Subversion Repositories Applications.projet

Rev

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

Rev 204 Rev 208
Line 18... Line 18...
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
// +------------------------------------------------------------------------------------------------------+
Line 22... Line 22...
22
 
22
 
Line 23... Line 23...
23
// CVS : $Id: projetControleur.class.php,v 1.35 2007-04-19 09:31:35 alexandre_tb Exp $
23
// CVS : $Id: projetControleur.class.php,v 1.36 2007-04-19 15:34:35 neiluj Exp $
24
 
24
 
25
/**
25
/**
26
* Application projet
26
* Application projet
Line 31... Line 31...
31
//Auteur original :
31
//Auteur original :
32
*@author        Alexandre Granier <alexandre@tela-botanica.org>
32
*@author        Alexandre Granier <alexandre@tela-botanica.org>
33
//Autres auteurs :
33
//Autres auteurs :
34
*@author        Aucun
34
*@author        Aucun
35
*@copyright     Tela-Botanica 2000-2004
35
*@copyright     Tela-Botanica 2000-2004
36
*@version       $Revision: 1.35 $
36
*@version       $Revision: 1.36 $
37
// +------------------------------------------------------------------------------------------------------+
37
// +------------------------------------------------------------------------------------------------------+
38
*/
38
*/
Line 39... Line 39...
39
 
39
 
40
// +------------------------------------------------------------------------------------------------------+
40
// +------------------------------------------------------------------------------------------------------+
Line 46... Line 46...
46
    include_once 'client/projet/langues/pro_langue_'.$GLOBALS['lang'].'.inc.php' ;
46
    include_once 'client/projet/langues/pro_langue_'.$GLOBALS['lang'].'.inc.php' ;
47
} else {
47
} else {
48
    include_once 'client/projet/langues/pro_langue_'.PROJET_LANGUE_DEFAUT.'.inc.php' ;
48
    include_once 'client/projet/langues/pro_langue_'.PROJET_LANGUE_DEFAUT.'.inc.php' ;
49
}
49
}
Line 50... Line -...
50
 
-
 
51
include_once PROJET_CHEMIN_CLASSES.'participe.class.php' ;
-
 
52
include_once PROJET_CHEMIN_CLASSES.'HTML_listeProjet.class.php' ;
-
 
53
include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
-
 
54
include_once PROJET_CHEMIN_CLASSES.'HTML_formulaireProjet.class.php' ;
-
 
55
include_once PROJET_CHEMIN_CLASSES.'statut.class.php' ;
-
 
56
include_once PROJET_CHEMIN_CLASSES.'HTML_formulaireDocument.class.php' ;
-
 
57
include_once PROJET_CHEMIN_CLASSES.'HTML_formulaireMail.class.php' ;
-
 
58
include_once PROJET_CHEMIN_CLASSES.'HTML_formulaireListe.class.php' ;
-
 
59
include_once PROJET_CHEMIN_CLASSES.'commande_serveur.class.php' ;
-
 
Line 60... Line 50...
60
include_once PROJET_CHEMIN_CLASSES_LISTES.'ezmlm.php' ;
50
 
61
 
51
 
62
require_once GEN_CHEMIN_API.'html/HTML_TableFragmenteur.php' ;
52
require_once GEN_CHEMIN_API.'html/HTML_TableFragmenteur.php' ;
63
// +------------------------------------------------------------------------------------------------------+
53
// +------------------------------------------------------------------------------------------------------+
Line 121... Line 111...
121
define ('PROJET_DROIT_AUCUN', 16) ;
111
define ('PROJET_DROIT_AUCUN', 16) ;
122
define ('PROJET_DROIT_EN_ATTENTE', 32);
112
define ('PROJET_DROIT_EN_ATTENTE', 32);
123
/**
113
/**
124
 * class projetControleur
114
 * class projetControleur
125
 * Cette classe sert à lancer les diverses applications du module projet, en
115
 * Cette classe sert à lancer les diverses applications du module projet, en
126
 * fonction des paramêtre de l'URL GET ou POST. La méthode principale est run()
116
 * fonction des paramètre de l'URL GET ou POST. La méthode principale est run()
127
 */
117
 */
128
class projetControleur
118
class projetControleur
129
{
119
{
130
    /*** Attributes: ***/
120
    /*** Attributes: ***/
Line 388... Line 378...
388
            $this->_url = $urlObjet ;
378
            $this->_url = $urlObjet ;
389
        }
379
        }
390
    } // end of member function projetControleur
380
    } // end of member function projetControleur
Line 391... Line 381...
391
 
381
 
392
    /**
382
    /**
393
     * Renvoie la liste des projets auquel participe la personne logguée, avec son
383
     * Renvoie la liste des projets auquel participe la personne loguée, avec son
394
     * statut et un lien vers l'action pour gérer le projet.
384
     * statut et un lien vers l'action pour gérer le projet.
395
     *
385
     *
396
     * @return string
386
     * @return string
397
     * @access public
387
     * @access public
398
     */
388
     */
399
    function mesProjets( )
389
    function mesProjets( )
400
    {
390
    {
401
    	$res = '' ;
391
    	$res = '' ;
402
        include_once PROJET_CHEMIN_CLASSES.'statut_liste.class.php' ;
392
    	include_once PROJET_CHEMIN_CLASSES.'participe.class.php' ;
403
        include_once PROJET_CHEMIN_CLASSES.'inscription_liste.class.php' ;
393
        include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
Line 404... Line -...
404
        $participant = new participe ($this->_db) ;
-
 
405
 
-
 
406
        if (PROJET_UTILISE_TYPE && $this->_type != '') {
-
 
407
            $projetListe = projet::getProjetDuType($this->_type, $this->_db) ;
-
 
408
            if ($this->_presentation == 'arbre')array_push ($projetListe, projet::getProjetRacine($this->_db)) ;
-
 
409
        } else {
-
 
410
            // Un tableau de tous les projets dans $projetListe
-
 
411
            $projetListe = projet::getTousLesProjets($this->_db) ;
-
 
412
        }
-
 
413
        // Si la liste est vide, on renvoie un texte
-
 
414
        if (count($projetListe) == 0) {
-
 
415
        	// On inclue un fichier local
-
 
416
	        if (file_exists(PROJET_CHEMIN_APPLI.'langues/pro_langue_'.$GLOBALS['lang'].'.local.inc.php'))
-
 
417
	        	include_once PROJET_CHEMIN_APPLI.'langues/pro_langue_'.$GLOBALS['lang'].'.local.inc.php' ;
-
 
418
        	return $res .= PROJET_PAS_DE_PROJET;
-
 
419
        }
-
 
420
        // Si certain projet sont à exclure, on les exclu
-
 
421
        $projet_a_exclure = array() ;
-
 
422
        if (count($this->_projet_exclu)) {
-
 
423
        	arsort($this->_projet_exclu) ;
-
 
424
            foreach ($this->_projet_exclu as $valeur) {
-
 
425
            	for ($i = 0; $i < count($projetListe); $i++) {
-
 
426
            		if ($projetListe[$i]->getId() == $valeur)  array_push ($projet_a_exclure, $i);}
-
 
427
            }
-
 
428
        }
-
 
429
        foreach ($projet_a_exclure as $valeur) unset ($projetListe[$valeur]) ;
394
        $participant = new participe ($this->_db) ;
430
 
395
 
Line 431... Line 396...
431
        // Les entêtes des tableaux
396
      // Les entête des tableaux
432
        $tableau_label_statut_action = array (PROJET_GERER, PROJET_GERER, PROJET_GERER_FICHIER, PROJET_VOIR_FICHIER, "---") ;
397
        $tableau_label_statut_action = array (PROJET_GERER, PROJET_GERER, PROJET_GERER_FICHIER, PROJET_VOIR_FICHIER, "---") ;
Line 433... Line 398...
433
 
398
 
Line 434... Line 399...
434
        $auth = $this->_auth->getAuth() ;                       // Pour raccourcir le code
399
        $auth = $this->_auth->getAuth() ;                       // Pour raccourcir le code
435
        $id_u = $this->_auth->getAuthData(PROJET_CHAMPS_ID) ;   // --------------
-
 
Line 436... Line 400...
436
		
400
        $id_u = $this->_auth->getAuthData(PROJET_CHAMPS_ID) ;   // --------------
437
		return include_once PROJET_CHEMIN_APPLI.'presentation/'.$this->_presentation.'.php' ;
401
		
438
		
402
		return include_once PROJET_CHEMIN_APPLI.'presentation/'.$this->_presentation.'.php' ;
439
        
403
		
Line 450... Line 414...
450
    {
414
    {
451
        $res = '' ;
415
        $res = '' ;
452
        $auth = $this->_auth->getAuth() ;
416
        $auth = $this->_auth->getAuth() ;
453
        if (!$auth) return ;
417
        if (!$auth) return ;
454
        $res .= '<div class="menu_projet">'."\n";
418
        $res .= '<div class="menu_projet">'."\n";
-
 
419
        include_once PROJET_CHEMIN_CLASSES.'participe.class.php' ;
455
        $participant = new participe($this->_db) ;
420
        $participant = new participe($this->_db) ;
456
        if ($participant->isAdministrateur($this->_auth->getAuthData(PROJET_CHAMPS_ID))) {
421
        if ($participant->isAdministrateur($this->_auth->getAuthData(PROJET_CHAMPS_ID))) {
457
            $isAdm = 1; $isCoord = 1 ; $isContri = 1 ;
422
            $isAdm = 1; $isCoord = 1 ; $isContri = 1 ;
458
            $label_statut = PROJET_ADMINISTRATEUR;
423
            $label_statut = PROJET_ADMINISTRATEUR;
459
        } else {
424
        } else {
Line 493... Line 458...
493
        } else {
458
        } else {
494
            if ($this->_id_projet != '') $res .= '<h2>'.$label_statut.'</h2>'."\n" ;
459
            if ($this->_id_projet != '') $res .= '<h2>'.$label_statut.'</h2>'."\n" ;
495
        }
460
        }
Line 496... Line 461...
496
        
461
        
-
 
462
        if ($this->_id_projet != '') {
497
        if ($this->_id_projet != '') {
463
        	include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
498
        	$projet = new projet ($this->_db, $this->_id_projet) ;
464
        	$projet = new projet ($this->_db, $this->_id_projet) ;
499
			// Participant
465
			// Participant
500
			if (!$isEnAttente) {
466
			if (!$isEnAttente) {
501
				$res .= '<ul id ="projet_groupe_niv1"><li class="projet_niv1">'.PROJET_CONTRIBUTEUR ;
467
				$res .= '<ul id ="projet_groupe_niv1"><li class="projet_niv1">'.PROJET_CONTRIBUTEUR ;
Line 637... Line 603...
637
	    		return PROJET_TEXTE_NON_IDENTIFIE;
603
	    		return PROJET_TEXTE_NON_IDENTIFIE;
638
	    	}
604
	    	}
Line 639... Line 605...
639
	    	
605
	    	
640
	    	if (fileperms(PROJET_CHEMIN_FICHIER) & 0x0002) {
606
	    	if (fileperms(PROJET_CHEMIN_FICHIER) & 0x0002) {
-
 
607
	        $this->_url->addQueryString(PROJET_VARIABLE_ACTION, $action) ;
641
	        $this->_url->addQueryString(PROJET_VARIABLE_ACTION, $action) ;
608
	        include_once PROJET_CHEMIN_CLASSES.'HTML_formulaireProjet.class.php' ;
642
	        $formulaire_projet = new HTML_formulaireProjet('formulaire_projet', 'post',str_replace ("&amp;", "&", $this->_url->getURL())) ;
609
	        $formulaire_projet = new HTML_formulaireProjet('formulaire_projet', 'post',str_replace ("&amp;", "&", $this->_url->getURL())) ;
643
	        $tableau_type = '' ;
610
	        $tableau_type = '' ;
644
	        if (PROJET_UTILISE_TYPE) {
611
	        if (PROJET_UTILISE_TYPE) {
645
	            include_once PROJET_CHEMIN_CLASSES.'projet_type.class.php' ;
612
	            include_once PROJET_CHEMIN_CLASSES.'projet_type.class.php' ;
646
	            $tableau_type = projet_type::getTousLesTypes($this->_db) ;
613
	            $tableau_type = projet_type::getTousLesTypes($this->_db) ;
-
 
614
	        }
647
	        }
615
	        include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
648
	        $formulaire_projet->construitFormulaire(projet::getTousLesProjets($this->_db), $tableau_type) ;
616
	        $formulaire_projet->construitFormulaire(projet::getTousLesProjets($this->_db), $tableau_type) ;
649
	        if ($action == PROJET_MODIFIER_DESCRIPTION_V) {
617
	        if ($action == PROJET_MODIFIER_DESCRIPTION_V) {
650
	            $projet = new projet($this->_db, $this->_id_projet) ;
618
	            $projet = new projet($this->_db, $this->_id_projet) ;
651
	            $valeurs_par_defaut = array (   'projet_titre' => $projet->getTitre(),
619
	            $valeurs_par_defaut = array (   'projet_titre' => $projet->getTitre(),
Line 675... Line 643...
675
     * @access public
643
     * @access public
676
     */
644
     */
677
    function nouveauProjetValidation( )
645
    function nouveauProjetValidation( )
678
    {
646
    {
679
        $this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_NOUVEAU_V) ;
647
        $this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_NOUVEAU_V) ;
-
 
648
        include_once PROJET_CHEMIN_CLASSES.'HTML_formulaireProjet.class.php' ;
-
 
649
        include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
680
        $formulaire_projet = new HTML_formulaireProjet('formulaire_projet', 'post', str_replace ('&amp;', '&', $this->_url->getURL())) ;
650
        $formulaire_projet = new HTML_formulaireProjet('formulaire_projet', 'post', str_replace ('&amp;', '&', $this->_url->getURL())) ;
681
        $formulaire_projet->construitFormulaire(projet::getTousLesProjets($this->_db)) ;
651
        $formulaire_projet->construitFormulaire(projet::getTousLesProjets($this->_db)) ;
682
        if ($formulaire_projet->validate()) {
652
        if ($formulaire_projet->validate()) {
Line 683... Line 653...
683
 
653
 
Line 687... Line 657...
687
                return 'erreur' ;
657
                return 'erreur' ;
688
            }
658
            }
689
            // On inscrit le déposant du projet en tant que coordinateur
659
            // On inscrit le déposant du projet en tant que coordinateur
690
            if (PROJET_UTILISATEURS_COORD) {
660
            if (PROJET_UTILISATEURS_COORD) {
691
		        // Si le projet n'a pas de liste, on inscrit directement
661
		        // Si le projet n'a pas de liste, on inscrit directement
-
 
662
		        include_once PROJET_CHEMIN_CLASSES.'participe.class.php' ;
692
		        $participant = new participe($this->_db) ;
663
		        $participant = new participe($this->_db) ;
693
	            $participant->setStatut(1, $this->_auth->getAuthData (PROJET_CHAMPS_ID), $projet->getId()) ;
664
	            $participant->setStatut(1, $this->_auth->getAuthData (PROJET_CHAMPS_ID), $projet->getId()) ;
694
            }
665
            }
695
        } else {
666
        } else {
696
            return $formulaire_projet->toHTML() ;
667
            return $formulaire_projet->toHTML() ;
Line 704... Line 675...
704
     * @access public
675
     * @access public
705
     */
676
     */
706
    function modifierProjet( )
677
    function modifierProjet( )
707
    {
678
    {
708
        // création de l'objet projet courant
679
        // création de l'objet projet courant
-
 
680
        include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
709
        $projet = new projet ($this->_db, $this->_id_projet) ;
681
        $projet = new projet ($this->_db, $this->_id_projet) ;
710
        $this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_ACTION_MODIFIER_V) ;
682
        $this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_ACTION_MODIFIER_V) ;
-
 
683
        include_once PROJET_CHEMIN_CLASSES.'HTML_formulaireProjet.class.php' ;
711
        $formulaire_projet = new HTML_formulaireProjet('formulaire_projet', 'post', str_replace ('&amp;', '&', $this->_url->getURL())) ;
684
        $formulaire_projet = new HTML_formulaireProjet('formulaire_projet', 'post', str_replace ('&amp;', '&', $this->_url->getURL())) ;
712
        $formulaire_projet->construitFormulaire(projet::getTousLesProjets($this->_db)) ;
685
        $formulaire_projet->construitFormulaire(projet::getTousLesProjets($this->_db)) ;
713
        if ($formulaire_projet->validate()) {
686
        if ($formulaire_projet->validate()) {
714
            $projet->majSQL($formulaire_projet->getSubmitValues()) ;
687
            $projet->majSQL($formulaire_projet->getSubmitValues()) ;
715
        } else {
688
        } else {
716
            return $formulaire_projet->toHTML() ;
689
            return $formulaire_projet->toHTML() ;
717
        }
690
        }
718
        unset ($projet) ;
691
        unset ($projet) ;
719
    } // end of member function nouveauFichierValidation
692
    }
Line 720... Line 693...
720
 
693
 
721
    /**
694
    /**
722
     * Renvoie le formulaire d'upload d'un fichier.
695
     * Renvoie le formulaire d'upload d'un fichier.
723
     *
696
     *
Line 731... Line 704...
731
            unset ($_SESSION['formulaire_document']) ;
704
            unset ($_SESSION['formulaire_document']) ;
732
        }
705
        }
733
        $action_future = $action == PROJET_NOUVEAU_FICHIER ? PROJET_NOUVEAU_FICHIER_V : PROJET_ACTION_MODIFIER_V ;
706
        $action_future = $action == PROJET_NOUVEAU_FICHIER ? PROJET_NOUVEAU_FICHIER_V : PROJET_ACTION_MODIFIER_V ;
734
        $this->_url->addQueryString (PROJET_VARIABLE_ACTION, $action_future) ;
707
        $this->_url->addQueryString (PROJET_VARIABLE_ACTION, $action_future) ;
735
        if ($this->_id_repertoire != '') $this->_url->addQueryString (PROJET_VARIABLE_ID_REPERTOIRE, $this->_id_repertoire) ;
708
        if ($this->_id_repertoire != '') $this->_url->addQueryString (PROJET_VARIABLE_ID_REPERTOIRE, $this->_id_repertoire) ;
-
 
709
        include_once PROJET_CHEMIN_CLASSES.'HTML_formulaireDocument.class.php' ;
736
        $formulaire_document = new HTML_formulaireDocument('formulaire_document', 'post',preg_replace ("/&amp;/", "&", $this->_url->getURL())) ;
710
        $formulaire_document = new HTML_formulaireDocument('formulaire_document', 'post',preg_replace ("/&amp;/", "&", $this->_url->getURL())) ;
737
        $formulaire_document->construitFormulaire($action) ;
711
        $formulaire_document->construitFormulaire($action) ;
738
        if ($action == PROJET_ACTION_MODIFIER) {
712
        if ($action == PROJET_ACTION_MODIFIER) {
Line 739... Line 713...
739
 
713
 
Line 767... Line 741...
767
        $document = new document($this->_id_document, $this->_db, PROJET_CHEMIN_FICHIER) ;
741
        $document = new document($this->_id_document, $this->_db, PROJET_CHEMIN_FICHIER) ;
768
        // On traite le cas où l'on vient de déplacer un fichier
742
        // On traite le cas où l'on vient de déplacer un fichier
Line 769... Line 743...
769
 
743
 
770
        if (isset ($_POST['projet_repertoire'])) {
744
        if (isset ($_POST['projet_repertoire'])) {
771
            if (!$document -> deplace ($_POST['projet_repertoire'], $projet->getNomRepertoire())) {
745
            if (!$document -> deplace ($_POST['projet_repertoire'], $projet->getNomRepertoire())) {
772
                echo 'echec du déplacement' ;
746
                echo 'echec du Déplacement' ;
773
            }
747
            }
774
            return ;
748
            return ;
775
        }
749
        }
776
        include_once PROJET_CHEMIN_CLASSES.'HTML_formulaireCouperColler.class.php' ;
750
        include_once PROJET_CHEMIN_CLASSES.'HTML_formulaireCouperColler.class.php' ;
Line 788... Line 762...
788
    function suppressionFichier( )
762
    function suppressionFichier( )
789
    {
763
    {
790
        if ($this->_id_document == "") {
764
        if ($this->_id_document == "") {
791
            return $this->messageErreur(PROJETCONTROLEUR_PAS_DE_DOCUMENT_SELECTIONNE) ;
765
            return $this->messageErreur(PROJETCONTROLEUR_PAS_DE_DOCUMENT_SELECTIONNE) ;
792
        }
766
        }
-
 
767
        include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
793
        $projet = new projet ($this->_db, $this->_id_projet) ;
768
        $projet = new projet ($this->_db, $this->_id_projet) ;
794
        $document = new document($this->_id_document, $this->_db, PROJET_CHEMIN_FICHIER) ;
769
        $document = new document($this->_id_document, $this->_db, PROJET_CHEMIN_FICHIER) ;
795
        $document->suppression() ;
770
        $document->suppression() ;
796
        $document->suppressionSQL() ;
771
        $document->suppressionSQL() ;
-
 
772
        
-
 
773
        // On verifie s il reste des documents associes au projet et si non on met 
-
 
774
        // a jour projet.p_avoir_document
-
 
775
        if (count ($projet->getListesDocuments(PROJET_CHEMIN_FICHIER)) == 0) $projet->setAvoirDocument(false); 
797
        return ;
776
        return ;
Line 798... Line 777...
798
 
777
 
Line 799... Line 778...
799
    } // end of member function nouveauFichier
778
    } // end of member function nouveauFichier
Line 806... Line 785...
806
     */
785
     */
807
    function nouveauRepertoire( )
786
    function nouveauRepertoire( )
808
    {
787
    {
809
        $res = '<h1>'.PROJET_REP_CREER.'</h1>'."\n" ;
788
        $res = '<h1>'.PROJET_REP_CREER.'</h1>'."\n" ;
810
        $this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_NOUVEAU_REPERTOIRE_V) ;
789
        $this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_NOUVEAU_REPERTOIRE_V) ;
-
 
790
        include_once PROJET_CHEMIN_CLASSES.'HTML_formulaireDocument.class.php' ;
811
        $formulaire_repertoire = new HTML_formulaireDocument('formulaire_repertoire', 'post',preg_replace ("/&amp;/", "&", $this->_url->getURL())) ;
791
        $formulaire_repertoire = new HTML_formulaireDocument('formulaire_repertoire', 'post',preg_replace ("/&amp;/", "&", $this->_url->getURL())) ;
812
        $formulaire_repertoire->setType ('repertoire') ;
792
        $formulaire_repertoire->setType ('repertoire') ;
813
        $formulaire_repertoire->construitFormulaire() ;
793
        $formulaire_repertoire->construitFormulaire() ;
814
        $formulaire_repertoire->setDefaults (array ('document_visibilite'=> 'public')) ;
794
        $formulaire_repertoire->setDefaults (array ('document_visibilite'=> 'public')) ;
815
        return $res.$formulaire_repertoire->toHTML() ;
795
        return $res.$formulaire_repertoire->toHTML() ;
Line 816... Line 796...
816
 
796
 
Line 817... Line 797...
817
    } // end of member function nouveauFichier
797
    }
818
 
798
 
819
    /**
799
    /**
820
     * Valide le formulaire et appelle la fonction d'insertion.
800
     * Valide le formulaire et appelle la fonction d'insertion.
821
     *
801
     *
822
     * @return void
802
     * @return void
823
     * @access public
803
     * @access public
824
     */
804
     */
825
    function nouveauFichierValidation( )
805
    function nouveauFichierValidation( )
-
 
806
    {
826
    {
807
        // création de l'objet projet courant
827
        // création de l'objet projet courant
808
        include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
828
        $projet = new projet ($this->_db, $this->_id_projet) ;
809
        $projet = new projet ($this->_db, $this->_id_projet) ;
829
        if (isset($_SESSION['formulaire_document']) && $_SESSION['formulaire_document'] == 'valide') {
-
 
830
            include_once PROJET_CHEMIN_APPLI.'actions/documents.php' ;
810
        if (isset($_SESSION['formulaire_document']) && $_SESSION['formulaire_document'] == 'valide') {
831
            return $retour;
811
            return include_once PROJET_CHEMIN_APPLI.'actions/documents.php' ;
-
 
812
        }
832
        }
813
        $this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_NOUVEAU_FICHIER_V) ;
833
        $this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_NOUVEAU_FICHIER_V) ;
814
        include_once PROJET_CHEMIN_CLASSES.'HTML_formulaireDocument.class.php' ;
834
        $formulaire_document = new HTML_formulaireDocument('formulaire_document', 'post', preg_replace ("/&amp;/", "&", $this->_url->getURL())) ;
815
        $formulaire_document = new HTML_formulaireDocument('formulaire_document', 'post', preg_replace ("/&amp;/", "&", $this->_url->getURL())) ;
835
        $formulaire_document->construitFormulaire() ;
816
        $formulaire_document->construitFormulaire() ;
836
        if ($formulaire_document->validate()) {
817
        if ($formulaire_document->validate()) {
Line 850... Line 831...
850
                trigger_error('echec d\'upload !', E_USER_ERROR) ;
831
                trigger_error('echec d\'upload !', E_USER_ERROR) ;
851
            }
832
            }
Line 852... Line 833...
852
 
833
 
-
 
834
 
-
 
835
            $document->enregistrerSQL($formulaire_document->getSubmitValues(), $projet->getNomRepertoire().'/'.$chemin_upload) ;
-
 
836
            // On place a 1 la colonne p_avoir_document
853
 
837
            if (!$projet->avoirDocument()) $projet->setAvoirDocument(true);
854
            $document->enregistrerSQL($formulaire_document->getSubmitValues(), $projet->getNomRepertoire().'/'.$chemin_upload) ;
838
            
855
            // On ajoute une information de session
839
            // On ajoute une information de session
856
            $_SESSION['formulaire_document'] = 'valide';
840
            $_SESSION['formulaire_document'] = 'valide';
857
        } else {
841
        } else {
Line 867... Line 851...
867
     * @access public
851
     * @access public
868
     */
852
     */
869
    function modifierFichier( )
853
    function modifierFichier( )
870
    {
854
    {
871
        // création de l'objet projet courant
855
        // création de l'objet projet courant
-
 
856
        include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
872
        $projet = new projet ($this->_db, $this->_id_projet) ;
857
        $projet = new projet ($this->_db, $this->_id_projet) ;
873
        $this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_ACTION_MODIFIER_V) ;
858
        $this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_ACTION_MODIFIER_V) ;
-
 
859
        include_once PROJET_CHEMIN_CLASSES.'HTML_formulaireDocument.class.php' ;
874
        $formulaire_document = new HTML_formulaireDocument('formulaire_document', 'post',preg_replace ("/&amp;/", "&", $this->_url->getURL())) ;
860
        $formulaire_document = new HTML_formulaireDocument('formulaire_document', 'post',preg_replace ("/&amp;/", "&", $this->_url->getURL())) ;
875
        $formulaire_document->construitFormulaire(PROJET_ACTION_MODIFIER_V) ;
861
        $formulaire_document->construitFormulaire(PROJET_ACTION_MODIFIER_V) ;
876
        if ($formulaire_document->validate()) {
862
        if ($formulaire_document->validate()) {
877
            // Création d'un objet document vide
863
            // Création d'un objet document vide
878
            $document = new document ($this->_id_document, $this->_db) ;
864
            $document = new document ($this->_id_document, $this->_db) ;
Line 892... Line 878...
892
     * @access public
878
     * @access public
893
     */
879
     */
894
    function nouveauRepertoireValidation( )
880
    function nouveauRepertoireValidation( )
895
    {
881
    {
896
        // création de l'objet projet courant
882
        // création de l'objet projet courant
-
 
883
        include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
897
        $projet = new projet ($this->_db, $this->_id_projet) ;
884
        $projet = new projet ($this->_db, $this->_id_projet) ;
Line 898... Line 885...
898
 
885
 
-
 
886
        $this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_NOUVEAU_FICHIER_V) ;
899
        $this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_NOUVEAU_FICHIER_V) ;
887
        include_once PROJET_CHEMIN_CLASSES.'HTML_formulaireDocument.class.php' ;
900
        $formulaire_repertoire = new HTML_formulaireDocument('formulaire_repertoire', 'post',preg_replace ("/&amp;/", "&", $this->_url->getURL())) ;
888
        $formulaire_repertoire = new HTML_formulaireDocument('formulaire_repertoire', 'post',preg_replace ("/&amp;/", "&", $this->_url->getURL())) ;
901
        $formulaire_repertoire->setType ('repertoire') ;
889
        $formulaire_repertoire->setType ('repertoire') ;
902
        $formulaire_repertoire->construitFormulaire() ;
890
        $formulaire_repertoire->construitFormulaire() ;
903
        if ($formulaire_repertoire->validate()) {
891
        if ($formulaire_repertoire->validate()) {
Line 916... Line 904...
916
            if (!mkdir (PROJET_CHEMIN_FICHIER.$lien)) {
904
            if (!mkdir (PROJET_CHEMIN_FICHIER.$lien)) {
Line 917... Line 905...
917
 
905
 
918
                $document->suppressionSQL() ;
906
                $document->suppressionSQL() ;
919
                return $this->messageErreur(PROJETCONTROLEUR_ERREUR_CREATION_REPERTOIRE).'<br />'.PROJET_CHEMIN_FICHIER.$lien  ;
907
                return $this->messageErreur(PROJETCONTROLEUR_ERREUR_CREATION_REPERTOIRE).'<br />'.PROJET_CHEMIN_FICHIER.$lien  ;
-
 
908
            }
-
 
909
            // On place a 1 la colonne p_avoir_document
920
            }
910
            if (!$projet->avoirDocument()) $projet->setAvoirDocument(true);
921
        } else {
911
        } else {
922
            return $formulaire_repertoire->toHTML() ;
912
            return $formulaire_repertoire->toHTML() ;
923
        }
913
        }
Line 945... Line 935...
945
     */
935
     */
946
    function accueilProjet( )
936
    function accueilProjet( )
947
    {
937
    {
948
        $res = '' ;
938
        $res = '' ;
949
        // création de l'objet projet courant
939
        // création de l'objet projet courant
-
 
940
        include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
950
        $projet = new projet ($this->_db, $this->_id_projet) ;
941
        $projet = new projet ($this->_db, $this->_id_projet) ;
Line 951... Line 942...
951
 
942
 
952
        // récupération de la liste des documents associés
943
        // récupération de la liste des documents associés
Line 967... Line 958...
967
        $vue_liste_document->setCheminNavigation ($tableau_navigation) ;
958
        $vue_liste_document->setCheminNavigation ($tableau_navigation) ;
968
        // vérification des droits de l'utilisateur
959
        // vérification des droits de l'utilisateur
969
        $entete_liste = array (PROJET_FICHIERS_NOM, PROJET_FICHIERS_TAILLE, PROJET_FICHIERS_CREE_LE) ;
960
        $entete_liste = array (PROJET_FICHIERS_NOM, PROJET_FICHIERS_TAILLE, PROJET_FICHIERS_CREE_LE) ;
Line 970... Line 961...
970
 
961
 
-
 
962
        if ($this->_auth->getAuth()) {
971
        if ($this->_auth->getAuth()) {
963
            include_once PROJET_CHEMIN_CLASSES.'participe.class.php' ;
972
            $participant = new participe($this->_db) ;
964
            $participant = new participe($this->_db) ;
973
            $id_u = $this->_auth->getAuthData(PROJET_CHAMPS_ID) ;
965
            $id_u = $this->_auth->getAuthData(PROJET_CHAMPS_ID) ;
974
            $isCoord = $participant->isCoordinateur($id_u, $this->_id_projet, $this->_db) ;
966
            $isCoord = $participant->isCoordinateur($id_u, $this->_id_projet, $this->_db) ;
975
            if ($isCoord) $droits = PROJET_DROIT_COORDINATEUR ;
967
            if ($isCoord) $droits = PROJET_DROIT_COORDINATEUR ;
Line 1020... Line 1012...
1020
 
1012
 
1021
        $projet->getListesAssociees();
1013
        $projet->getListesAssociees();
Line 1022... Line 1014...
1022
        $sortie_liste = '' ;
1014
        $sortie_liste = '' ;
-
 
1015
 
1023
 
1016
        if ($projet->avoirListe()) {
Line 1024... Line 1017...
1024
        if ($projet->avoirListe()) {
1017
            include_once PROJET_CHEMIN_CLASSES_LISTES.'ezmlm.php' ;
1025
            foreach ($projet->_listes_associes as $info_liste) {
1018
            foreach ($projet->_listes_associes as $info_liste) {
Line 1156... Line 1149...
1156
     * @return void
1149
     * @return void
1157
     * @access public
1150
     * @access public
1158
     */
1151
     */
1159
    function suppressionProjet( )
1152
    function suppressionProjet( )
1160
    {
1153
    {
-
 
1154
        include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
1161
        $projet = new projet ($this->_db, $this->_id_projet) ;
1155
        $projet = new projet ($this->_db, $this->_id_projet) ;
1162
        $projet->setCheminRepertoire (PROJET_CHEMIN_FICHIER) ;
1156
        $projet->setCheminRepertoire (PROJET_CHEMIN_FICHIER) ;
1163
        $projet->getListesAssociees() ;
1157
        $projet->getListesAssociees() ;
1164
        if ($projet->avoirListe()) $projet->supprimerListe($projet->_listes_associes[0]) ;
1158
        if ($projet->avoirListe()) $projet->supprimerListe($projet->_listes_associes[0]) ;
1165
        $msg = $projet->suppressionSQL() ;
1159
        $msg = $projet->suppressionSQL() ;
1166
        unset ($this->_id_projet) ; unset($_GET['id_projet']);
1160
        unset ($this->_id_projet) ; unset($_GET['id_projet']);
1167
        return $msg ;
1161
        return $msg ;
1168
    } // end of member function suppressionProjet
1162
    }
Line 1169... Line 1163...
1169
 
1163
 
1170
    /**
1164
    /**
1171
     * Permet d'indiquer au controleur sur quel document on travaille.
1165
     * Permet d'indiquer au controleur sur quel document on travaille.
1172
     *
1166
     *
Line 1175... Line 1169...
1175
     * @access public
1169
     * @access public
1176
     */
1170
     */
1177
    function setIdDocument( $id_document )
1171
    function setIdDocument( $id_document )
1178
    {
1172
    {
1179
        $this->_id_document = $id_document ;
1173
        $this->_id_document = $id_document ;
1180
    } // end of member function setIdDocument
1174
    }
Line 1181... Line 1175...
1181
 
1175
 
1182
 
1176
 
1183
    /**
1177
    /**
Line 1194... Line 1188...
1194
    	if (isset($_SESSION['formulaire_mail'])) {
1188
    	if (isset($_SESSION['formulaire_mail'])) {
1195
            unset ($_SESSION['formulaire_mail']) ;
1189
            unset ($_SESSION['formulaire_mail']) ;
1196
        }
1190
        }
1197
        $res = '<h1>'.PROJET_ECRIRE_LISTE.'</h1>'."\n" ;
1191
        $res = '<h1>'.PROJET_ECRIRE_LISTE.'</h1>'."\n" ;
1198
        $this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ENVOYER_UN_MAIL_V) ;
1192
        $this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ENVOYER_UN_MAIL_V) ;
-
 
1193
        include_once PROJET_CHEMIN_CLASSES.'HTML_formulaireMail.class.php' ;
1199
        $formulaire_mail = new HTML_formulaireMail('formulaire_mail', 'post',preg_replace ("/&amp;/", "&", $this->_url->getURL())) ;
1194
        $formulaire_mail = new HTML_formulaireMail('formulaire_mail', 'post',preg_replace ("/&amp;/", "&", $this->_url->getURL())) ;
1200
        $formulaire_mail->construitFormulaire() ;
1195
        $formulaire_mail->construitFormulaire() ;
1201
        return $res.$formulaire_mail->toHTML() ;
1196
        return $res.$formulaire_mail->toHTML() ;
1202
    } // end of member function envoyerUnMailFormulaire
1197
    }
Line 1203... Line 1198...
1203
 
1198
 
1204
    /**
1199
    /**
1205
     * Envoie le mail
1200
     * Envoie le mail
1206
     *
1201
     *
Line 1209... Line 1204...
1209
     */
1204
     */
1210
    function envoyerUnMailValidation( )
1205
    function envoyerUnMailValidation( )
1211
    {
1206
    {
1212
        // Vérifications
1207
        // Vérifications
1213
        if (isset($_SESSION['formulaire_mail']) && $_SESSION['formulaire_mail'] == 'valide') {
1208
        if (isset($_SESSION['formulaire_mail']) && $_SESSION['formulaire_mail'] == 'valide') {
1214
            include_once PROJET_CHEMIN_APPLI.'actions/forums.php' ;
1209
            return include_once PROJET_CHEMIN_APPLI.'actions/forums.php' ;
1215
            return $retour;
-
 
1216
        }
1210
        }
Line 1217... Line 1211...
1217
        
1211
        
-
 
1212
        $this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_ENVOYER_UN_MAIL_V );
1218
        $this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_ENVOYER_UN_MAIL_V );
1213
        include_once PROJET_CHEMIN_CLASSES.'HTML_formulaireMail.class.php' ;
1219
        $formulaire_mail = new HTML_formulaireMail('formulaire_mail', 'post', preg_replace ("/&amp;/", "&", $this->_url->getURL())) ;
1214
        $formulaire_mail = new HTML_formulaireMail('formulaire_mail', 'post', preg_replace ("/&amp;/", "&", $this->_url->getURL())) ;
1220
        $formulaire_mail->construitFormulaire() ;
1215
        $formulaire_mail->construitFormulaire() ;
1221
        if ($formulaire_mail->validate()) {
1216
        if ($formulaire_mail->validate()) {
-
 
1217
            // création de l'objet projet courant
1222
            // création de l'objet projet courant
1218
            include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
1223
            $projet = new projet ($this->_db, $this->_id_projet) ;
1219
            $projet = new projet ($this->_db, $this->_id_projet) ;
1224
            $info_liste = $projet->getListesAssociees() ;
1220
            $info_liste = $projet->getListesAssociees() ;
1225
            $valeurs_mail = $formulaire_mail->getSubmitValues() ;
1221
            $valeurs_mail = $formulaire_mail->getSubmitValues() ;
1226
            // Pour envoyer le mail on utilise la classe Mail de PEAR
1222
            // Pour envoyer le mail on utilise la classe Mail de PEAR
Line 1255... Line 1251...
1255
     */
1251
     */
1256
    function formulaireListe( $action )
1252
    function formulaireListe( $action )
1257
    {
1253
    {
1258
        $res = '<h1>'.PROJET_CREATION_LISTE.'</h1>'."\n" ;
1254
        $res = '<h1>'.PROJET_CREATION_LISTE.'</h1>'."\n" ;
1259
        $this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_NOUVELLE_LISTE_V) ;
1255
        $this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_NOUVELLE_LISTE_V) ;
-
 
1256
        include_once PROJET_CHEMIN_CLASSES.'HTML_formulaireListe.class.php' ;
1260
        $formulaire_liste = new HTML_formulaireListe('formulaire_liste', 'post',preg_replace ("/&amp;/", "&", $this->_url->getURL())) ;
1257
        $formulaire_liste = new HTML_formulaireListe('formulaire_liste', 'post',preg_replace ("/&amp;/", "&", $this->_url->getURL())) ;
1261
        $formulaire_liste->construitFormulaire() ;
1258
        $formulaire_liste->construitFormulaire() ;
1262
        $formulaire_liste->setDefaults(array('domaine_liste' => PROJET_DOMAINE_LISTE)) ;
1259
        $formulaire_liste->setDefaults(array('domaine_liste' => PROJET_DOMAINE_LISTE)) ;
1263
        $formulaire_liste->updateElementAttr('domaine_liste', array('readonly' => 'readonly')) ;
1260
        $formulaire_liste->updateElementAttr('domaine_liste', array('readonly' => 'readonly')) ;
1264
        return $res.$formulaire_liste->toHTML() ;
1261
        return $res.$formulaire_liste->toHTML() ;
Line 1272... Line 1269...
1272
     */
1269
     */
1273
    function nouvelleListeValidation( )
1270
    function nouvelleListeValidation( )
1274
    {
1271
    {
1275
        // Vérifications
1272
        // Vérifications
1276
        $this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_ACTION_NOUVELLE_LISTE_V );
1273
        $this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_ACTION_NOUVELLE_LISTE_V );
-
 
1274
        include_once PROJET_CHEMIN_CLASSES.'HTML_formulaireListe.class.php' ;
1277
        $formulaire_liste = new HTML_formulaireListe('formulaire_liste', 'post', preg_replace ("/&amp;/", "&", $this->_url->getURL())) ;
1275
        $formulaire_liste = new HTML_formulaireListe('formulaire_liste', 'post', preg_replace ("/&amp;/", "&", $this->_url->getURL())) ;
1278
        $formulaire_liste->construitFormulaire() ;
1276
        $formulaire_liste->construitFormulaire() ;
1279
        if ($formulaire_liste->validate()) {
1277
        if ($formulaire_liste->validate()) {
1280
            // création de l'objet liste_discussion
1278
            // création de l'objet liste_discussion
1281
            $liste = new liste_discussion('', $this->_db) ;
1279
            $liste = new liste_discussion('', $this->_db) ;
Line 1285... Line 1283...
1285
                                                            $formulaire_liste->getSubmitValue('domaine_liste'), $this->_db)) {
1283
                                                            $formulaire_liste->getSubmitValue('domaine_liste'), $this->_db)) {
1286
                // On rajoute la liste dans la base
1284
                // On rajoute la liste dans la base
1287
                $liste->enregistrerSQL($formulaire_liste->getSubmitValues()) ;
1285
                $liste->enregistrerSQL($formulaire_liste->getSubmitValues()) ;
Line 1288... Line 1286...
1288
 
1286
 
-
 
1287
                // On la relie au projet
1289
                // On la relie au projet
1288
                include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
1290
                $projet = new projet ($this->_db, $this->_id_projet) ;
1289
                $projet = new projet ($this->_db, $this->_id_projet) ;
Line 1291... Line 1290...
1291
                $projet->ajouterListe($liste) ;
1290
                $projet->ajouterListe($liste) ;
1292
 
1291
 
Line 1317... Line 1316...
1317
     * @return void
1316
     * @return void
1318
     * @access public
1317
     * @access public
1319
     */
1318
     */
1320
    function supprimerListe( )
1319
    function supprimerListe( )
1321
    {
1320
    {
-
 
1321
        include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
1322
        $projet = new projet($this->_db, $this->_id_projet) ;
1322
        $projet = new projet($this->_db, $this->_id_projet) ;
1323
        $projet->getListesAssociees() ;
1323
        $projet->getListesAssociees() ;
Line 1324... Line -...
1324
 
-
 
1325
        // ajouter un commande de suppression
-
 
1326
 
-
 
1327
        $commande = new commande_serveur(PROJET_CHEMIN_APPLI.'script_cron/ezmlm.sh') ;
-
 
1328
        if (PEAR::isError($commande)) {
-
 
1329
            echo $commande->getMessage() ;
-
 
1330
        }
-
 
1331
 
-
 
1332
        // Suppression des listes synchronisés
-
 
1333
        $commande_supression_3 = 'rm -rf '.PROJET_CHEMIN_LISTES.$projet->_listes_associes[0]->getDomaine().
-
 
1334
                                '/'.$projet->_listes_associes[0]->getNom() ;
-
 
1335
        $commande->ajouterCommande($commande_supression_3) ;
-
 
1336
 
1324
 
1337
        $resultat_suppression = file_get_contents(PROJET_SERVEUR_VPOPMAIL.'/suppression_liste.php?domaine='.
1325
        $resultat_suppression = file_get_contents(PROJET_SERVEUR_VPOPMAIL.'/suppression_liste.php?domaine='.
1338
                                    $projet->_listes_associes[0]->getDomaine().'&liste='.$projet->_listes_associes[0]->getNom()) ;
1326
                                    $projet->_listes_associes[0]->getDomaine().'&liste='.$projet->_listes_associes[0]->getNom()) ;
1339
        $projet->supprimerListe($projet->_listes_associes[0]) ;
1327
        $projet->supprimerListe($projet->_listes_associes[0]) ;
1340
        return $resultat_suppression;
1328
        return $resultat_suppression;
Line 1373... Line 1361...
1373
     * @access public
1361
     * @access public
1374
     */
1362
     */
1375
    function voirParticipants( )
1363
    function voirParticipants( )
1376
    {
1364
    {
1377
        include_once PROJET_CHEMIN_CLASSES.'HTML_listeParticipants.class.php' ;
1365
        include_once PROJET_CHEMIN_CLASSES.'HTML_listeParticipants.class.php' ;
-
 
1366
        include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
1378
        $projet = new projet ($this->_db, $this->_id_projet) ;
1367
        $projet = new projet ($this->_db, $this->_id_projet) ;
1379
        $titre = '<h1>'.$projet->getTitre().'</h1>'."\n" ;
1368
        $titre = '<h1>'.$projet->getTitre().'</h1>'."\n" ;
1380
        $titre .= '<h2>'.PROJET_LISTE_PARTICIPANT.'</h2>'."\n" ;
1369
        $titre .= '<h2>'.PROJET_LISTE_PARTICIPANT.'</h2>'."\n" ;
-
 
1370
        include_once PROJET_CHEMIN_CLASSES.'participe.class.php' ;
1381
        $participants = new participe($this->_db) ;
1371
        $participants = new participe($this->_db) ;
Line 1382... Line 1372...
1382
 
1372
 
1383
        // On teste ici s'il y a une mise à jour de statut
1373
        // On teste ici s'il y a une mise à jour de statut
1384
        if (isset($_POST['statut'])) {
1374
        if (isset($_POST['statut'])) {
1385
            // $_GET['id_utilisateur'] et $_GET['statut'] proviennent du formulaire voir HTML_listeParticipants
1375
            // $_GET['id_utilisateur'] et $_GET['statut'] proviennent du formulaire voir HTML_listeParticipants
1386
            $participants->setStatut($_POST['statut'], $_GET['id_utilisateur'], $this->_id_projet) ;
1376
            $participants->setStatut($_POST['statut'], $_GET['id_utilisateur'], $this->_id_projet) ;
Line 1387... Line 1377...
1387
        }
1377
        }
1388
 
1378
 
1389
        // Ce qui suit doit être amélioré pour sortir la requête sur l'annuaire
1379
        // Ce qui suit doit être amàliorà pour sortir la requête sur l'annuaire
1390
        // On teste s'il y a un ajout d'utilisateur voir HTML_listeParticipants
1380
        // On teste s'il y a un ajout d'utilisateur voir HTML_listeParticipants
1391
        if (isset($_POST['mail_utilisateur'])) {
1381
        if (isset($_POST['mail_utilisateur'])) {
1392
            $requete = 'select '.PROJET_CHAMPS_ID.' from '.PROJET_ANNUAIRE.' where '.PROJET_CHAMPS_MAIL.'="'.$_POST['mail_utilisateur'].'"';
1382
            $requete = 'select '.PROJET_CHAMPS_ID.' from '.PROJET_ANNUAIRE.' where '.PROJET_CHAMPS_MAIL.'="'.$_POST['mail_utilisateur'].'"';
Line 1452... Line 1442...
1452
     * @access public
1442
     * @access public
1453
     */
1443
     */
1454
    function inscriptionProjet( )
1444
    function inscriptionProjet( )
1455
    {
1445
    {
1456
        include_once PROJET_CHEMIN_CLASSES.'HTML_formulaireInscriptionProjet.class.php' ;
1446
        include_once PROJET_CHEMIN_CLASSES.'HTML_formulaireInscriptionProjet.class.php' ;
1457
 
-
 
-
 
1447
		include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
1458
        $projet = new projet ($this->_db, $this->_id_projet) ;
1448
        $projet = new projet ($this->_db, $this->_id_projet) ;
Line 1459... Line 1449...
1459
 
1449
 
1460
        // Si le projet n'a pas de liste, on inscrit directement
1450
        // Si le projet n'a pas de liste, on inscrit directement
-
 
1451
        if (isset ($this->_id_projet)) {
1461
        if (isset ($this->_id_projet)) {
1452
            include_once PROJET_CHEMIN_CLASSES.'participe.class.php' ;
Line 1462... Line 1453...
1462
            $participant = new participe($this->_db) ;
1453
            $participant = new participe($this->_db) ;
1463
 
1454
 
1464
            if (!$projet->avoirListe()) {
1455
            if (!$projet->avoirListe()) {
Line 1521... Line 1512...
1521
            		$objet_mail->send($entetes['To'], $entetes, $tpl->get());
1512
            		$objet_mail->send($entetes['To'], $entetes, $tpl->get());
1522
            	}
1513
            	}
1523
            }
1514
            }
Line 1524... Line 1515...
1524
 
1515
 
1525
            if ($this->_presentation != 'arbre') {
1516
            if ($this->_presentation != 'arbre') {
1526
                include_once PROJET_CHEMIN_APPLI.'actions/resume.php' ;
-
 
1527
                return $retour ;
1517
                return include_once PROJET_CHEMIN_APPLI.'actions/resume.php' ;
1528
            } else {
1518
            } else {
1529
                $this->_action = PROJET_ACTION_VOIR_RESUME;
1519
                $this->_action = PROJET_ACTION_VOIR_RESUME;
1530
            }
1520
            }
1531
            return ;
1521
            return ;
Line 1539... Line 1529...
1539
        $HTML_formulaireInscriptionProjet->setDefaults(array('radio_inscription_liste' => 2)) ;
1529
        $HTML_formulaireInscriptionProjet->setDefaults(array('radio_inscription_liste' => 2)) ;
1540
        return $res.$HTML_formulaireInscriptionProjet->toHTML() ;
1530
        return $res.$HTML_formulaireInscriptionProjet->toHTML() ;
1541
    } // end of member function inscriptionProjet
1531
    } // end of member function inscriptionProjet
Line 1542... Line 1532...
1542
 
1532
 
1543
    /**
1533
    /**
1544
     * Inscrit l'utilisateur loggué à la liste dont le paraètre est en post.
1534
     * Inscrit l'utilisateur logué à la liste dont le paraître est en post.
1545
     *
1535
     *
1546
     * @return void
1536
     * @return void
1547
     * @access public
1537
     * @access public
1548
     */
1538
     */
1549
    function inscriptionListe( )
1539
    function inscriptionListe( )
-
 
1540
    {
1550
    {
1541
        include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
1551
        $projet = new projet ($this->_db, $this->_id_projet) ;
1542
        $projet = new projet ($this->_db, $this->_id_projet) ;
1552
        include_once PROJET_CHEMIN_CLASSES.'annuaire.class.php' ;
1543
        include_once PROJET_CHEMIN_CLASSES.'annuaire.class.php' ;
1553
        include_once PROJET_CHEMIN_CLASSES.'inscription_liste.class.php' ;
1544
        include_once PROJET_CHEMIN_CLASSES.'inscription_liste.class.php' ;
1554
        $projet->getListesAssociees() ;
1545
        $projet->getListesAssociees() ;
Line 1557... Line 1548...
1557
        $inscription_liste = new inscription_liste($this->_db) ;
1548
        $inscription_liste = new inscription_liste($this->_db) ;
1558
        $inscription_liste->inscrireUtilisateur( $utilisateur, $projet->_listes_associes[0], 2) ;  // 2 est la statut inscription normale
1549
        $inscription_liste->inscrireUtilisateur( $utilisateur, $projet->_listes_associes[0], 2) ;  // 2 est la statut inscription normale
1559
    } // end of member function inscriptionListe
1550
    } // end of member function inscriptionListe
Line 1560... Line 1551...
1560
 
1551
 
1561
    /**
1552
    /**
1562
     * Inscrit l'utilisateur loggué à la liste dont le paraètre est en post.
1553
     * Inscrit l'utilisateur logué à la liste dont le paraître est en post.
1563
     *
1554
     *
1564
     * @return void
1555
     * @return void
1565
     * @access public
1556
     * @access public
1566
     */
1557
     */
1567
    function desinscriptionListe( )
1558
    function desinscriptionListe( )
1568
    {
1559
    {
-
 
1560
        if (isset($_GET['inscription_liste']) || $this->_action = PROJET_ACTION_DESINSCRIPTION_LISTE) {
1569
        if (isset($_GET['inscription_liste']) || $this->_action = PROJET_ACTION_DESINSCRIPTION_LISTE) {
1561
            include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
1570
            $projet = new projet ($this->_db, $this->_id_projet) ;
1562
            $projet = new projet ($this->_db, $this->_id_projet) ;
1571
            include_once PROJET_CHEMIN_CLASSES.'annuaire.class.php' ;
1563
            include_once PROJET_CHEMIN_CLASSES.'annuaire.class.php' ;
1572
            include_once PROJET_CHEMIN_CLASSES.'inscription_liste.class.php' ;
1564
            include_once PROJET_CHEMIN_CLASSES.'inscription_liste.class.php' ;
1573
            $projet->getListesAssociees() ;
1565
            $projet->getListesAssociees() ;
Line 1590... Line 1582...
1590
        include_once PROJET_CHEMIN_CLASSES.'participe.class.php' ;
1582
        include_once PROJET_CHEMIN_CLASSES.'participe.class.php' ;
1591
        $participant = new participe($this->_db) ;
1583
        $participant = new participe($this->_db) ;
Line 1592... Line 1584...
1592
 
1584
 
1593
        // Le statut 4 désinscrit l'utilisateur, dans la méthode setStatut
1585
        // Le statut 4 désinscrit l'utilisateur, dans la méthode setStatut
-
 
1586
        $participant->setStatut(4, $this->_auth->getAuthData (PROJET_CHAMPS_ID), $this->_id_projet) ;
1594
        $participant->setStatut(4, $this->_auth->getAuthData (PROJET_CHAMPS_ID), $this->_id_projet) ;
1587
        include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
1595
        $projet = new projet ($this->_db, $this->_id_projet) ;
1588
        $projet = new projet ($this->_db, $this->_id_projet) ;
1596
        $projet->getListesAssociees() ;
1589
        $projet->getListesAssociees() ;
1597
        if ($projet->avoirListe()) {
1590
        if ($projet->avoirListe()) {
1598
            include_once PROJET_CHEMIN_CLASSES.'annuaire.class.php' ;
1591
            include_once PROJET_CHEMIN_CLASSES.'annuaire.class.php' ;
Line 1656... Line 1649...
1656
 
1649
 
Line 1657... Line 1650...
1657
	    $tableau_wikini = array() ;
1650
	    $tableau_wikini = array() ;
1658
 
1651
 
1659
	    while ($ligne = $resultat->fetchRow()) {
1652
	    while ($ligne = $resultat->fetchRow()) {
1660
	        $this->_url->addQueryString ('id_wikini', $ligne[0]) ;
1653
	        $this->_url->addQueryString ('id_wikini', $ligne[0]) ;
1661
	        array_push ($tableau_wikini, array ($ligne[1]."\n",    // Première colonne, le nom de l'application
1654
	        array_push ($tableau_wikini, array ($ligne[1]."\n",    // première colonne, le nom de l'application
1662
										        $ligne[2]."\n",    // Deuxieme colonne, la page par defaut
1655
										        $ligne[2]."\n",    // Deuxieme colonne, la page par defaut
1663
	        								  '<a href="'.$this->_url->getURL()."&amp;".PROJET_VARIABLE_ACTION."=".PROJET_ACTION_ASSOCIER_WIKI_V."".'">'.PROJET_CHOISIR_WIKINI.'</a>'."\n",
1656
	        								  '<a href="'.$this->_url->getURL()."&amp;".PROJET_VARIABLE_ACTION."=".PROJET_ACTION_ASSOCIER_WIKI_V."".'">'.PROJET_CHOISIR_WIKINI.'</a>'."\n",
1664
	                                            ));
1657
	                                            ));
Line 1692... Line 1685...
1692
	            	                                                            __FILE__, __LINE__, 'admin_wikini')   ;
1685
	            	                                                            __FILE__, __LINE__, 'admin_wikini')   ;
1693
	        	return ;
1686
	        	return ;
1694
	    	}
1687
	    	}
Line 1695... Line 1688...
1695
 
1688
 
-
 
1689
	    	$ligne = $resultat->fetchRow();
1696
	    	$ligne = $resultat->fetchRow();
1690
	    	include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
1697
			$projet = new projet($this->_db, $this->_id_projet) ;
1691
			$projet = new projet($this->_db, $this->_id_projet) ;
1698
        	$projet->majNomWikini($ligne[0]);
1692
        	$projet->majNomWikini($ligne[0]);
Line 1699... Line 1693...
1699
    	}
1693
    	}
Line 1710... Line 1704...
1710
    {
1704
    {
1711
        include_once PROJET_CHEMIN_CLASSES.'gestion_wikini.class.php' ;
1705
        include_once PROJET_CHEMIN_CLASSES.'gestion_wikini.class.php' ;
1712
        // On crée une nouvelle connexion avec les paramètres spécifiques aux wikinis
1706
        // On crée une nouvelle connexion avec les paramètres spécifiques aux wikinis
1713
        $connexion_bd = DB::connect('mysql://'.PROJET_UTILISATEUR_WIKINI.':'.PROJET_MDP_WIKINI.'@'.PROJET_HOTE_WIKINI.'/'.PROJET_DB_WIKINI) ;
1707
        $connexion_bd = DB::connect('mysql://'.PROJET_UTILISATEUR_WIKINI.':'.PROJET_MDP_WIKINI.'@'.PROJET_HOTE_WIKINI.'/'.PROJET_DB_WIKINI) ;
1714
        $gerantWiki = new gestion_wikini($connexion_bd) ;
1708
        $gerantWiki = new gestion_wikini($connexion_bd) ;
-
 
1709
        include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
1715
        $projet = new projet ($this->_db, $this->_id_projet) ;
1710
        $projet = new projet ($this->_db, $this->_id_projet) ;
1716
        $gerantWiki->suppression_tables(strtolower($projet->getWikini())) ;
1711
        $gerantWiki->suppression_tables(strtolower($projet->getWikini())) ;
1717
        $projet->majNomWikini('') ;
1712
        $projet->majNomWikini('') ;
1718
    } // end of member function supprimerWiki
1713
    } // end of member function supprimerWiki
Line 1797... Line 1792...
1797
    function messageErreur( $valeur )
1792
    function messageErreur( $valeur )
1798
    {
1793
    {
1799
        $messageErreur = array (
1794
        $messageErreur = array (
1800
                    PROJETCONTROLEUR_ACTION_INVALIDE => "Action non valide",
1795
                    PROJETCONTROLEUR_ACTION_INVALIDE => "Action non valide",
1801
                    PROJETCONTROLEUR_ERREUR_SUPPRESSION_REPERTOIRE => "Impossible de supprimer le répertoire",
1796
                    PROJETCONTROLEUR_ERREUR_SUPPRESSION_REPERTOIRE => "Impossible de supprimer le répertoire",
1802
                    PROJETCONTROLEUR_PAS_DE_DOCUMENT_SELECTIONNE => 'Pas de fichier sélectionné',
1797
                    PROJETCONTROLEUR_PAS_DE_DOCUMENT_SELECTIONNE => 'Pas de fichier sélectionn°',
1803
                    PROJETCONTROLEUR_ERREUR_CREATION_REPERTOIRE => 'Impossible de créer le répertoire'
1798
                    PROJETCONTROLEUR_ERREUR_CREATION_REPERTOIRE => 'Impossible de créer le répertoire'
1804
        ) ;
1799
        ) ;
1805
        return '<p class="erreur">'.$messageErreur[$valeur].'</p>' ;
1800
        return '<p class="erreur">'.$messageErreur[$valeur].'</p>' ;
1806
    } // end of member function messageErreur
1801
    } // end of member function messageErreur