Subversion Repositories Applications.projet

Rev

Rev 15 | Rev 59 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 15 Rev 35
Line 17... Line 17...
17
// |                                                                                                      |
17
// |                                                                                                      |
18
// | You should have received a copy of the GNU General Public                                            |
18
// | You should have received a copy of the GNU General Public                                            |
19
// | License along with this library; if not, write to the Free Software                                  |
19
// | License along with this library; if not, write to the Free Software                                  |
20
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
20
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
21
// +------------------------------------------------------------------------------------------------------+
21
// +------------------------------------------------------------------------------------------------------+
22
// CVS : $Id: projet.class.php,v 1.4 2005-09-28 16:29:39 ddelon Exp $
22
// CVS : $Id: projet.class.php,v 1.5 2005-10-14 08:50:37 alexandre_tb Exp $
23
/**
23
/**
24
* Application projet
24
* Application projet
25
*
25
*
26
* La classe projet
26
* La classe projet
27
*
27
*
Line 29... Line 29...
29
//Auteur original :
29
//Auteur original :
30
*@author        Alexandre Granier <alexandre@tela-botanica.org>
30
*@author        Alexandre Granier <alexandre@tela-botanica.org>
31
//Autres auteurs :
31
//Autres auteurs :
32
*@author        Aucun
32
*@author        Aucun
33
*@copyright     Tela-Botanica 2000-2004
33
*@copyright     Tela-Botanica 2000-2004
34
*@version       $Revision: 1.4 $
34
*@version       $Revision: 1.5 $
35
// +------------------------------------------------------------------------------------------------------+
35
// +------------------------------------------------------------------------------------------------------+
36
*/
36
*/
Line 37... Line 37...
37
 
37
 
Line 186... Line 186...
186
            $this->_type = $ligne->p_type ;
186
            $this->_type = $ligne->p_type ;
187
            // On récupère le nom du répertoire
187
            // On récupère le nom du répertoire
188
            $this->_nom_repertoire = $ligne->p_nom_repertoire ;
188
            $this->_nom_repertoire = $ligne->p_nom_repertoire ;
Line 189... Line 189...
189
            
189
            
-
 
190
            // on regarde si on a à faire au projet racine
190
            // on regarde si on a à faire au projet racine
191
            if (PROJET_UTILISE_HIERARCHIE) {
191
            $requete = 'select  ph_id_projet_pere, ph_id_projet_fils from projet_hierarchie where ph_id_projet_fils='.$this->_id_projet ;
192
	            $requete = 'select  ph_id_projet_pere, ph_id_projet_fils from projet_hierarchie where ph_id_projet_fils='.$this->_id_projet ;
192
            $resultat = $this->_db->query ($requete) ;
193
	            $resultat = $this->_db->query ($requete) ;
193
            if (DB::isError ($resultat)) {
194
	            if (DB::isError ($resultat)) {
194
                die ("Echec de la requete : $requete<br />".$resultat->getMessage()) ;
195
	                die ("Echec de la requete : $requete<br />".$resultat->getMessage()) ;
195
            }
196
	            }
196
            if (!$resultat->numRows()) {
197
	            if (!$resultat->numRows()) {
197
                $this->_est_racine = true ;
198
	                $this->_est_racine = true ;
198
            } else {
199
	            } else {
-
 
200
	                $this->_est_racine = false ;
199
                $this->_est_racine = false ;
201
	            }
200
            }
202
            }
201
        }
203
        }
Line 202... Line 204...
202
    } // end of member function projet
204
    } // end of member function projet
Line 498... Line 500...
498
        $requete .= ', p_titre="'.$tableau_de_valeur['projet_titre'].'", p_description="'.$tableau_de_valeur['projet_description'].'"'.
500
        $requete .= ', p_titre="'.$tableau_de_valeur['projet_titre'].'", p_description="'.$tableau_de_valeur['projet_description'].'"'.
499
                    ', p_espace_internet="'.$tableau_de_valeur['projet_espace_internet'].'", p_date_creation=NOW()'.
501
                    ', p_espace_internet="'.$tableau_de_valeur['projet_espace_internet'].'", p_date_creation=NOW()'.
500
                    ', p_wikini="'.$tableau_de_valeur['projet_wikini'].'", p_nom_repertoire="'.$nom_repertoire.'", p_resume="'.$tableau_de_valeur['projet_resume'].
502
                    ', p_wikini="'.$tableau_de_valeur['projet_wikini'].'", p_nom_repertoire="'.$nom_repertoire.'", p_resume="'.$tableau_de_valeur['projet_resume'].
501
                    '", p_type='.$tableau_de_valeur['projet_type'] ;
503
                    '", p_type='.$tableau_de_valeur['projet_type'] ;
502
        $resultat = $this->_db->query ($requete) ;
504
        $resultat = $this->_db->query ($requete) ;
-
 
505
        
503
        if (DB::isError($resultat)) {
506
        if (DB::isError($resultat)) {
504
            die ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ;
507
            die ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ;
505
        }
508
        }
506
        //insertion dans projet_hiérarchie
-
 
507
 
-
 
508
        $requete = 'insert into projet_hierarchie set ph_id_projet_pere='.$tableau_de_valeur['projet_asso'].
-
 
509
                    ', ph_id_projet_fils='.$id ;
-
 
510
        $resultat = $this->_db->query ($requete) ;
-
 
Line -... Line 509...
-
 
509
        
-
 
510
        // On affecte à l'objet projet son identifiant
-
 
511
        $this->_id_projet = $id ;
-
 
512
        
-
 
513
        //insertion dans projet_hiérarchie
-
 
514
		if (PROJET_UTILISE_HIERARCHIE) {
-
 
515
	        $requete = 'insert into projet_hierarchie set ph_id_projet_pere='.$tableau_de_valeur['projet_asso'].
-
 
516
	                    ', ph_id_projet_fils='.$id ;
-
 
517
	        $resultat = $this->_db->query ($requete) ;
511
        
518
		}
512
        return true ;
519
        return true ;
Line 513... Line 520...
513
    } // end of member function enregistrerSQL
520
    } // end of member function enregistrerSQL
514
 
521
 
Line 534... Line 541...
534
        $resultat = $this->_db->query ($requete) ;
541
        $resultat = $this->_db->query ($requete) ;
535
        if (DB::isError($resultat)) {
542
        if (DB::isError($resultat)) {
536
            die ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ;
543
            die ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ;
537
        }
544
        }
Line -... Line 545...
-
 
545
        
538
        
546
        if (PROJET_UTILISE_HIERARCHIE) {
539
        // suppression dans projet_hierarchie
547
	        // suppression dans projet_hierarchie
540
        
548
	        
541
        $requete = 'delete from projet_hierarchie where ph_id_projet_fils='.$this->_id_projet ;
549
	        $requete = 'delete from projet_hierarchie where ph_id_projet_fils='.$this->_id_projet ;
542
        $resultat = $this->_db->query ($requete) ;
550
	        $resultat = $this->_db->query ($requete) ;
543
        
551
	        
544
        //insertion dans projet_hiérarchie
552
	        //insertion dans projet_hiérarchie
545
 
553
	
546
        $requete = 'insert into projet_hierarchie set ph_id_projet_pere='.$tableau_de_valeur['projet_asso'].
554
	        $requete = 'insert into projet_hierarchie set ph_id_projet_pere='.$tableau_de_valeur['projet_asso'].
547
                    ', ph_id_projet_fils='.$this->_id_projet ;
555
	                    ', ph_id_projet_fils='.$this->_id_projet ;
-
 
556
	        $resultat = $this->_db->query ($requete) ;
548
        $resultat = $this->_db->query ($requete) ;
557
        }
549
        return true ;
558
        return true ;
Line 550... Line 559...
550
    } // end of member function enregistrerSQL
559
    } // end of member function enregistrerSQL
551
 
560
 
Line 587... Line 596...
587
        
596
        
588
        // Le projet lui-même
597
        // Le projet lui-même
589
        $requete = "delete from projet where p_id=".$this->_id_projet ;
598
        $requete = "delete from projet where p_id=".$this->_id_projet ;
Line -... Line 599...
-
 
599
        $resultat = $this->_db->query ($requete) ;
590
        $resultat = $this->_db->query ($requete) ;
600
        
591
        
601
        if (PROJET_UTILISE_HIERARCHIE) {
592
        $requete = "delete from projet_hierarchie where ph_id_projet_fils=".$this->_id_projet ;
602
	        $requete = "delete from projet_hierarchie where ph_id_projet_fils=".$this->_id_projet ;
593
        $resultat = $this->_db->query ($requete) ;
603
	        $resultat = $this->_db->query ($requete) ;
594
        
604
        }
595
        $requete = "delete from projet_statut_utilisateurs where psu_id_projet=".$this->_id_projet ;
605
        $requete = "delete from projet_statut_utilisateurs where psu_id_projet=".$this->_id_projet ;
596
        $resultat = $this->_db->query ($requete) ;
606
        $resultat = $this->_db->query ($requete) ;