Subversion Repositories Applications.projet

Rev

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

Rev 208 Rev 249
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.36 2007-04-19 15:34:35 neiluj Exp $
23
// CVS : $Id: projetControleur.class.php,v 1.37 2007-06-25 12:15:06 alexandre_tb 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.36 $
36
*@version       $Revision: 1.37 $
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
 
-
 
-
 
50
 
51
 
51
require_once GEN_CHEMIN_API.'sql/SQL_manipulation.fonct.php' ;
52
require_once GEN_CHEMIN_API.'html/HTML_TableFragmenteur.php' ;
52
require_once GEN_CHEMIN_API.'html/HTML_TableFragmenteur.php' ;
53
// +------------------------------------------------------------------------------------------------------+
53
// +------------------------------------------------------------------------------------------------------+
54
// |                                           LISTE des constantes                                       |
54
// |                                           LISTE des constantes                                       |
Line 99... Line 99...
99
define ("PROJETCONTROLEUR_ERREUR_SUPPRESSION_REPERTOIRE", -2) ;
99
define ("PROJETCONTROLEUR_ERREUR_SUPPRESSION_REPERTOIRE", -2) ;
100
define ("PROJETCONTROLEUR_PAS_DE_DOCUMENT_SELECTIONNE", -3) ;
100
define ("PROJETCONTROLEUR_PAS_DE_DOCUMENT_SELECTIONNE", -3) ;
101
define ("PROJETCONTROLEUR_ERREUR_CREATION_REPERTOIRE", -4) ;
101
define ("PROJETCONTROLEUR_ERREUR_CREATION_REPERTOIRE", -4) ;
Line 102... Line 102...
102
 
102
 
103
/**
103
/**
104
 *  Constantes pour définir les droits
104
 *  Constantes pour definir les droits
105
 *
105
 *
106
 */
106
 */
107
define ('PROJET_DROIT_ADMINISTRATEUR', 1) ;
107
define ('PROJET_DROIT_ADMINISTRATEUR', 1) ;
108
define ('PROJET_DROIT_COORDINATEUR', 2) ;
108
define ('PROJET_DROIT_COORDINATEUR', 2) ;
109
define ('PROJET_DROIT_PROPRIETAIRE', 4) ;
109
define ('PROJET_DROIT_PROPRIETAIRE', 4) ;
110
define ('PROJET_DROIT_CONTRIBUTEUR', 8) ;
110
define ('PROJET_DROIT_CONTRIBUTEUR', 8) ;
111
define ('PROJET_DROIT_AUCUN', 16) ;
111
define ('PROJET_DROIT_AUCUN', 16) ;
112
define ('PROJET_DROIT_EN_ATTENTE', 32);
112
define ('PROJET_DROIT_EN_ATTENTE', 32);
113
/**
113
/**
114
 * class projetControleur
114
 * class projetControleur
115
 * Cette classe sert à lancer les diverses applications du module projet, en
115
 * Cette classe sert a lancer les diverses applications du module projet, en
116
 * fonction des paramètre de l'URL GET ou POST. La méthode principale est run()
116
 * fonction des parametre de l'URL GET ou POST. La methode principale est run()
117
 */
117
 */
118
class projetControleur
118
class projetControleur
119
{
119
{
Line 120... Line 120...
120
    /*** Attributes: ***/
120
    /*** Attributes: ***/
121
 
121
 
122
    /**
122
    /**
123
     * Contient l'action du controleur, qui correspond à une action du module projet.
123
     * Contient l'action du controleur, qui correspond a une action du module projet.
124
     * @access private
124
     * @access private
125
     */
125
     */
126
    var $_action;
126
    var $_action;
127
    /**
127
    /**
128
     * Une connexion à une base de donnée DB.
128
     * Une connexion a une base de donnee DB.
129
     * @access private
129
     * @access private
Line 130... Line 130...
130
     */
130
     */
Line 141... Line 141...
141
     * @access private
141
     * @access private
142
     */
142
     */
143
    var $_url;
143
    var $_url;
Line 144... Line 144...
144
 
144
 
145
    /**
145
    /**
146
     * L'identifiant du projet sur lequel on travaille. Dans l'action par défaut, cet
146
     * L'identifiant du projet sur lequel on travaille. Dans l'action par defaut, cet
147
     * attribut n'a pas de valeur.
147
     * attribut n'a pas de valeur.
148
     * @access private
148
     * @access private
149
     */
149
     */
Line 150... Line 150...
150
    var $_id_projet;
150
    var $_id_projet;
151
 
151
 
152
    /**
152
    /**
153
     * L'identifiant du répertoire que l'on est en train d'observer. Il sera passé en
153
     * L'identifiant du repertoire que l'on est en train d'observer. Il sera passé en
154
     * paramètre à la classe HTML_listeDocuments.
154
     * parametre a la classe HTML_listeDocuments.
155
     * @access private
155
     * @access private
Line 156... Line 156...
156
     */
156
     */
Line 161... Line 161...
161
     * @access private
161
     * @access private
162
     */
162
     */
163
    var $_id_document;
163
    var $_id_document;
Line 164... Line 164...
164
 
164
 
165
    /**
165
    /**
166
     * La présentation de la liste des projets, par défaut vide, signifie en liste.
166
     * La presentation de la liste des projets, par defaut vide, signifie en liste.
167
     * Valeurs possibles: arbre
167
     * Valeurs possibles: arbre
168
     * @access private
168
     * @access private
169
     */
169
     */
Line 170... Line 170...
170
    var $_presentation;
170
    var $_presentation;
171
 
171
 
172
   /**
172
   /**
173
     * Le type du projets, par défaut 0, signifie en pas de type particumier.
173
     * Le type du projets, par defaut 0, signifie en pas de type particumier.
174
     * Valeurs possibles: 0, 1, 2, 3 ...
174
     * Valeurs possibles: 0, 1, 2, 3 ...
Line 175... Line 175...
175
     * @access private
175
     * @access private
176
     */
176
     */
177
 
177
 
178
     var $_type ;
178
     var $_type ;
179
   /**
179
   /**
180
     * Le tableau des projets à ne pas afficher, ni dans l'arbre, ni dans les listes
180
     * Le tableau des projets a ne pas afficher, ni dans l'arbre, ni dans les listes
Line 181... Line 181...
181
     * @access private
181
     * @access private
Line 193... Line 193...
193
     * @access private
193
     * @access private
194
     */
194
     */
195
	var $_service ;
195
	var $_service ;
Line 196... Line 196...
196
	
196
	
197
    /**
197
    /**
198
     * Méthode principale de la classe. Elle permet d'appeler les méthodes du modules
198
     * Methode principale de la classe. Elle permet d'appeler les methodes du modules
199
     * projet en fonction de l'action.
199
     * projet en fonction de l'action.
200
     *
200
     *
201
     * @return string
201
     * @return string
202
     * @access public
202
     * @access public
Line 215... Line 215...
215
        
215
        
216
        if ($this->_action == '') {
216
        if ($this->_action == '') {
217
            return $this->messageErreur(PROJETCONTROLEUR_ACTION_INVALIDE) ;
217
            return $this->messageErreur(PROJETCONTROLEUR_ACTION_INVALIDE) ;
Line 218... Line 218...
218
        }
218
        }
219
 
219
 
220
        // Si il n'y a pas d'action mais un projet, on transmet par défaut l'action PROJET_VOIR
220
        // Si il n'y a pas d'action mais un projet, on transmet par defaut l'action PROJET_VOIR
221
        if ($this->_id_projet != "" && $this->_action == PROJET_DEFAUT) {
221
        if ($this->_id_projet != "" && $this->_action == PROJET_DEFAUT) {
222
            $this->_action = PROJET_ACTION_VOIR_RESUME ;
222
            $this->_action = PROJET_ACTION_VOIR_RESUME ;
223
            $this->_url->addQueryString (PROJET_VARIABLE_ID_PROJET, $this->_id_projet) ;
223
            $this->_url->addQueryString (PROJET_VARIABLE_ID_PROJET, $this->_id_projet) ;
Line 335... Line 335...
335
        return $retour ;
335
        return $retour ;
336
    } // end of member function run
336
    } // end of member function run
Line 337... Line 337...
337
 
337
 
338
    /**
338
    /**
339
     * Permet de fixer la valeur de l'action pour l'objet projetControleur. Cette action
339
     * Permet de fixer la valeur de l'action pour l'objet projetControleur. Cette action
340
     * provient généralement de $_POST['action'] ou $_GET['action']
340
     * provient generalement de $_POST['action'] ou $_GET['action']
341
     *
341
     *
342
     * @param int action L'action à passer provient de l'URL.
342
     * @param int action L'action à passer provient de l'URL.
343
     * @return void
343
     * @return void
344
     * @access public
344
     * @access public
Line 391... Line 391...
391
    	$res = '' ;
391
    	$res = '' ;
392
    	include_once PROJET_CHEMIN_CLASSES.'participe.class.php' ;
392
    	include_once PROJET_CHEMIN_CLASSES.'participe.class.php' ;
393
        include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
393
        include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
394
        $participant = new participe ($this->_db) ;
394
        $participant = new participe ($this->_db) ;
Line 395... Line 395...
395
 
395
 
396
      // Les entête des tableaux
396
      // Les entetes des tableaux
Line 397... Line 397...
397
        $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, "---") ;
398
 
398
 
Line 399... Line 399...
399
        $auth = $this->_auth->getAuth() ;                       // Pour raccourcir le code
399
        $auth = $this->_auth->getAuth() ;                       // Pour raccourcir le code
Line 400... Line 400...
400
        $id_u = $this->_auth->getAuthData(PROJET_CHAMPS_ID) ;   // --------------
400
        $id_u = $this->_auth->getAuthData(PROJET_CHAMPS_ID) ;   // --------------
Line 401... Line 401...
401
		
401
		
402
		return include_once PROJET_CHEMIN_APPLI.'presentation/'.$this->_presentation.'.php' ;
402
		return include_once PROJET_CHEMIN_APPLI.'presentation/'.$this->_presentation.'.php' ;
403
		
403
		
404
    }
404
    }
405
 
405
 
406
    /**
406
    /**
407
     * Renvoie le menu général de l'application projet. Avec différents liens selon le
407
     * Renvoie le menu general de l'application projet. Avec differents liens selon le
Line 423... Line 423...
423
            $label_statut = PROJET_ADMINISTRATEUR;
423
            $label_statut = PROJET_ADMINISTRATEUR;
424
        } else {
424
        } else {
425
            $isAdm = 0 ; $isCoord = 0 ; $isContri = 0 ;
425
            $isAdm = 0 ; $isCoord = 0 ; $isContri = 0 ;
426
        }
426
        }
Line 427... Line 427...
427
 
427
 
428
        // Les menus spécifiques aux projets
428
        // Les menus specifiques aux projets
429
        if ($this->_id_projet != '') {
429
        if ($this->_id_projet != '') {
430
            if (!$isCoord) {
430
            if (!$isCoord) {
431
                $isCoord = $participant->isCoordinateur($this->_auth->getAuthData(PROJET_CHAMPS_ID), $this->_id_projet, $this->_db) ;
431
                $isCoord = $participant->isCoordinateur($this->_auth->getAuthData(PROJET_CHAMPS_ID), $this->_id_projet, $this->_db) ;
432
                if ($isCoord) {
432
                if ($isCoord) {
Line 473... Line 473...
473
	        } else {
473
	        } else {
474
	        	$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_S_INSCRIRE) ;
474
	        	$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_S_INSCRIRE) ;
475
	        	if (!$isEnAttente) $res .= '<li class="projet_niv2"><a href="'.
475
	        	if (!$isEnAttente) $res .= '<li class="projet_niv2"><a href="'.
476
	        						$this->_url->getURL().'">'.PROJET_S_INSCRIRE_AU_PROJET."</a></li>\n" ;
476
	        						$this->_url->getURL().'">'.PROJET_S_INSCRIRE_AU_PROJET."</a></li>\n" ;
477
	        }
477
	        }
478
	        // L'action gérer les utilisateurs
478
	        // L'action gerer les utilisateurs
479
	        if ($isCoord || $isAdm) {
479
	        if ($isCoord || $isAdm) {
480
	            $this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_VOIR_PARTICIPANT) ;
480
	            $this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_VOIR_PARTICIPANT) ;
481
	            $res .= '<li class="projet_niv2"><a href="'.$this->_url->getURL().'">'.PROJET_GESTION_UTILISATEUR."</a></li>\n" ;
481
	            $res .= '<li class="projet_niv2"><a href="'.$this->_url->getURL().'">'.PROJET_GESTION_UTILISATEUR."</a></li>\n" ;
482
	        }
482
	        }
483
	        $res .= '</ul></li>' ;
483
	        $res .= '</ul></li>' ;
Line 484... Line 484...
484
	        
484
	        
485
	        //document
485
	        //document
-
 
486
	        if ($isContri || $isCoord || $isAdm) {
-
 
487
		        
-
 
488
		        // On ajoute l id d un repertoire s il existe
486
	        if ($isContri || $isCoord || $isAdm) {
489
		        if (isset($this->_id_repertoire)) $this->_url->addQueryString ('id_repertoire', $this->_id_repertoire);
487
		        $res .= '<li class="projet_niv2">'.PROJET_DOCUMENT ;
490
		        $res .= '<li class="projet_niv2">'.PROJET_DOCUMENT ;
488
		        // L'action "Mettre un fichier en ligne"
491
		        // L'action "Mettre un fichier en ligne"
489
		        $this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_NOUVEAU_FICHIER) ;
492
		        $this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_NOUVEAU_FICHIER) ;
Line 490... Line 493...
490
		        $res .= '<ul><li class="projet_niv2"><a href="'.$this->_url->getURL().'">'.PROJET_METTRE_FICHIER."</a></li>\n" ;
493
		        $res .= '<ul><li class="projet_niv2"><a href="'.$this->_url->getURL().'">'.PROJET_METTRE_FICHIER."</a></li>\n" ;
491
		
494
		
492
		        // L'action créer un répertoire
495
		        // L'action creer un repertoire
493
		        $this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_NOUVEAU_REPERTOIRE) ;
496
		        $this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_NOUVEAU_REPERTOIRE) ;
Line -... Line 497...
-
 
497
		        $res .= '<li class="projet_niv2"><a href="'.$this->_url->getURL().'">'.PROJET_CREER_REP."</a></li>\n" ;
494
		        $res .= '<li class="projet_niv2"><a href="'.$this->_url->getURL().'">'.PROJET_CREER_REP."</a></li>\n" ;
498
				$res .= '</ul></li>' ;
495
				$res .= '</ul></li>' ;
499
	        
496
	        
500
	        	$this->_url->removeQueryString('id_repertoire');
497
				// Forum 
501
				// Forum 
Line 498... Line 502...
498
				$res .= '<li class="projet_niv1">'.PROJET_FORUM ;
502
				$res .= '<li class="projet_niv1">'.PROJET_FORUM ;
499
				$res .= '<ul id="projet_groupe_niv2_for">' ;
503
				$res .= '<ul id="projet_groupe_niv2_for">' ;
Line 500... Line 504...
500
				if ($projet->avoirListe()) {
504
				if ($projet->avoirListe()) {
501
					
505
					
Line 590... Line 594...
590
        $this->_url->removeQueryString (PROJET_VARIABLE_ACTION) ;
594
        $this->_url->removeQueryString (PROJET_VARIABLE_ACTION) ;
591
        return $res ;
595
        return $res ;
592
    } // end of member function menuGeneral
596
    } // end of member function menuGeneral
Line 593... Line 597...
593
 
597
 
594
    /**
598
    /**
595
     * Renvoie le formulaire de création d'un projet.
599
     * Renvoie le formulaire de cretion d'un projet.
596
     *
600
     *
597
     * @return string
601
     * @return string
598
     * @access public
602
     * @access public
599
     */
603
     */
Line 630... Line 634...
630
	        	$formulaire_projet->setDefaults (array ('projet_moderation'=> '0')) ;	
634
	        	$formulaire_projet->setDefaults (array ('projet_moderation'=> '0')) ;	
631
	        }
635
	        }
632
	        $res = PROJET_PROPOSER_PROJET ;
636
	        $res = PROJET_PROPOSER_PROJET ;
633
	        return $res . $formulaire_projet->toHTML() ;
637
	        return $res . $formulaire_projet->toHTML() ;
634
	    	} else {
638
	    	} else {
635
	    		return 'Veuillez régler les permissions en écriture sur '.PROJET_CHEMIN_FICHIER ;
639
	    		return 'Veuillez r&eacute;gler les permissions en &eacute;criture sur '.PROJET_CHEMIN_FICHIER ;
636
	    	}
640
	    	}
637
    } // end of member function nouveauProjet
641
    } // end of member function nouveauProjet
Line 638... Line 642...
638
 
642
 
639
    /**
643
    /**
Line 664... Line 668...
664
	            $participant->setStatut(1, $this->_auth->getAuthData (PROJET_CHAMPS_ID), $projet->getId()) ;
668
	            $participant->setStatut(1, $this->_auth->getAuthData (PROJET_CHAMPS_ID), $projet->getId()) ;
665
            }
669
            }
666
        } else {
670
        } else {
667
            return $formulaire_projet->toHTML() ;
671
            return $formulaire_projet->toHTML() ;
668
        }
672
        }
669
    } // end of member function nouveauProjetValidation
673
    }
Line 670... Line 674...
670
 
674
 
671
    /**
675
    /**
672
     * Valide le formulaire et appelle la fonction de mise à jour.
676
     * Valide le formulaire et appelle la fonction de mise à jour.
673
     *
677
     *
Line 708... Line 712...
708
        if ($this->_id_repertoire != '') $this->_url->addQueryString (PROJET_VARIABLE_ID_REPERTOIRE, $this->_id_repertoire) ;
712
        if ($this->_id_repertoire != '') $this->_url->addQueryString (PROJET_VARIABLE_ID_REPERTOIRE, $this->_id_repertoire) ;
709
        include_once PROJET_CHEMIN_CLASSES.'HTML_formulaireDocument.class.php' ;
713
        include_once PROJET_CHEMIN_CLASSES.'HTML_formulaireDocument.class.php' ;
710
        $formulaire_document = new HTML_formulaireDocument('formulaire_document', 'post',preg_replace ("/&amp;/", "&", $this->_url->getURL())) ;
714
        $formulaire_document = new HTML_formulaireDocument('formulaire_document', 'post',preg_replace ("/&amp;/", "&", $this->_url->getURL())) ;
711
        $formulaire_document->construitFormulaire($action) ;
715
        $formulaire_document->construitFormulaire($action) ;
712
        if ($action == PROJET_ACTION_MODIFIER) {
716
        if ($action == PROJET_ACTION_MODIFIER) {
713
 
-
 
-
 
717
			include_once PROJET_CHEMIN_CLASSES.'document.class.php' ;
714
            $document = new document($this->_id_document, $this->_db, PROJET_CHEMIN_FICHIER, PROJET_CHEMIN_ICONES) ;
718
            $document = new document($this->_id_document, $this->_db, PROJET_CHEMIN_FICHIER, PROJET_CHEMIN_ICONES) ;
715
            // On affecte dans un tableau les valeurs de chaque champs du formulaire avec le nom de chaque élément de formulaire
719
            // On affecte dans un tableau les valeurs de chaque champs du formulaire avec le nom de chaque element de formulaire
716
            // voir HTML_formulaireDocument
720
            // voir HTML_formulaireDocument
717
            $valeurs_par_defaut = array ('document_nom' => $document->getNomLong(),
721
            $valeurs_par_defaut = array ('document_nom' => $document->getNomLong(),
718
                                         'document_description' => $document->getDescription(),
722
                                         'document_description' => $document->getDescription(),
719
                                         'document_visibilite' => $document->getVisibilite()) ;
723
                                         'document_visibilite' => $document->getVisibilite()) ;
Line 720... Line 724...
720
 
724
 
721
            // On rajoute un champs caché avec l'identifiant du document
725
            // On rajoute un champs cache avec l'identifiant du document
722
            $formulaire_document->addElement ('hidden', 'id_document', $this->_id_document) ;
726
            $formulaire_document->addElement ('hidden', 'id_document', $this->_id_document) ;
723
            $formulaire_document->setDefaults($valeurs_par_defaut) ;
727
            $formulaire_document->setDefaults($valeurs_par_defaut) ;
724
        } else {
728
        } else {
725
            $formulaire_document->setDefaults (array ('document_visibilite'=> 'public')) ;
729
            $formulaire_document->setDefaults (array ('document_visibilite'=> 'public')) ;
726
        }
730
        }
Line 727... Line 731...
727
        return $res.$formulaire_document->toHTML() ;
731
        return $res.$formulaire_document->toHTML() ;
Line 728... Line 732...
728
 
732
 
729
    } // end of member function nouveauFichier
733
    } // end of member function nouveauFichier
730
 
734
 
731
    /**
735
    /**
732
    *   Présente un formulaire pour déplacer un fichier
736
    *   Presente un formulaire pour deplacer un fichier
733
    *
737
    *
734
    *
738
    *
735
    */
739
    */
Line 736... Line 740...
736
    function fichierCouper() {
740
    function fichierCouper() {
-
 
741
        include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
737
        include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
742
        $projet = new projet ($this->_db, $this->_id_projet) ;
738
        $projet = new projet ($this->_db, $this->_id_projet) ;
743
 
Line 739... Line 744...
739
 
744
        $res = '<h1>'.PROJET_PROJET.' : '.$projet->getTitre().'</h1>' ;
740
        $res = '<h1>'.PROJET_PROJET.' : '.$projet->getTitre().'</h1>' ;
745
        include_once PROJET_CHEMIN_CLASSES.'document.class.php' ;
741
        $document = new document($this->_id_document, $this->_db, PROJET_CHEMIN_FICHIER) ;
746
        $document = new document($this->_id_document, $this->_db, PROJET_CHEMIN_FICHIER) ;
742
        // On traite le cas où l'on vient de déplacer un fichier
747
        // On traite le cas ou l'on vient de deplacer un fichier
743
 
748
 
744
        if (isset ($_POST['projet_repertoire'])) {
749
        if (isset ($_POST['projet_repertoire'])) {
745
            if (!$document -> deplace ($_POST['projet_repertoire'], $projet->getNomRepertoire())) {
750
            if (!$document -> deplace ($_POST['projet_repertoire'], $projet->getNomRepertoire())) {
746
                echo 'echec du Déplacement' ;
751
                return 'echec du d&eacute;placement' ;
747
            }
752
            }
748
            return ;
753
            return ;
-
 
754
        }
-
 
755
        include_once PROJET_CHEMIN_CLASSES.'HTML_formulaireCouperColler.class.php' ;
749
        }
756
        $this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_COUPER) ;
750
        include_once PROJET_CHEMIN_CLASSES.'HTML_formulaireCouperColler.class.php' ;
757
        $HTML_formulaireCouperColler = new HTML_formulaireCouperColler('formulaire_couper_coller', 'post', str_replace('&amp;', '&', $this->_url->getURL())) ;
751
        $this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_COUPER) ;
758
        $HTML_formulaireCouperColler -> construitFormulaire($projet->getListeRepertoireHierarchisee()) ;
752
        $HTML_formulaireCouperColler = new HTML_formulaireCouperColler('formulaire_couper_coller', 'post', str_replace('&amp;', '&', $this->_url->getURL())) ;
759
        $tab = $projet->getListeRepertoireHierarchisee();
753
        $HTML_formulaireCouperColler -> construitFormulaire($projet->getListeRepertoireHierarchisee()) ;
760
        //$res .=  '<pre>'.print_r ($tab, true).'</pre>';
754
        return $res.$HTML_formulaireCouperColler->toHTML('<img src="'.PROJET_CHEMIN_ICONES.$document->getCheminIcone().'" /> '.$document->getNomLong());
761
        return $res .$HTML_formulaireCouperColler->toHTML('<img src="'.PROJET_CHEMIN_ICONES.$document->getCheminIcone().'" /> '.$document->getNomLong());
Line 776... Line 783...
776
        return ;
783
        return ;
Line 777... Line 784...
777
 
784
 
Line 778... Line 785...
778
    } // end of member function nouveauFichier
785
    } // end of member function nouveauFichier
779
 
786
 
780
    /**
787
    /**
781
     * Renvoie le formulaire de création d'un répertoire.
788
     * Renvoie le formulaire de creation d'un repertoire.
782
     *
789
     *
783
     * @return void
790
     * @return void
784
     * @access public
791
     * @access public
Line 802... Line 809...
802
     * @return void
809
     * @return void
803
     * @access public
810
     * @access public
804
     */
811
     */
805
    function nouveauFichierValidation( )
812
    function nouveauFichierValidation( )
806
    {
813
    {
807
        // création de l'objet projet courant
814
        // creation de l'objet projet courant
808
        include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
815
        include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
809
        $projet = new projet ($this->_db, $this->_id_projet) ;
816
        $projet = new projet ($this->_db, $this->_id_projet) ;
810
        if (isset($_SESSION['formulaire_document']) && $_SESSION['formulaire_document'] == 'valide') {
817
        if (isset($_SESSION['formulaire_document']) && $_SESSION['formulaire_document'] == 'valide') {
811
            return include_once PROJET_CHEMIN_APPLI.'actions/documents.php' ;
818
            return include_once PROJET_CHEMIN_APPLI.'actions/documents.php' ;
812
        }
819
        }
813
        $this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_NOUVEAU_FICHIER_V) ;
820
        $this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_NOUVEAU_FICHIER_V) ;
814
        include_once PROJET_CHEMIN_CLASSES.'HTML_formulaireDocument.class.php' ;
821
        include_once PROJET_CHEMIN_CLASSES.'HTML_formulaireDocument.class.php' ;
815
        $formulaire_document = new HTML_formulaireDocument('formulaire_document', 'post', preg_replace ("/&amp;/", "&", $this->_url->getURL())) ;
822
        $formulaire_document = new HTML_formulaireDocument('formulaire_document', 'post', preg_replace ("/&amp;/", "&", $this->_url->getURL())) ;
816
        $formulaire_document->construitFormulaire() ;
823
        $formulaire_document->construitFormulaire() ;
817
        if ($formulaire_document->validate()) {
824
        if ($formulaire_document->validate()) {
818
            // Création d'un objet document vide
825
            // Creation d'un objet document vide
819
            $document = new document ("", $this->_db) ;
826
            $document = new document ("", $this->_db) ;
820
            // avant d'appeler la méthode enregistrerSQL, il faut indiquer l'identifiant du projet et l'identifiant du propriétaire
827
            // avant d'appeler la methode enregistrerSQL, il faut indiquer l'identifiant du projet et l'identifiant du proprietaire
821
            $document->setIdProjet ($this->_id_projet) ;
828
            $document->setIdProjet ($this->_id_projet) ;
822
            $document->setIdProprietaire ($this->_auth->getAuthData (PROJET_CHAMPS_ID)) ;
829
            $document->setIdProprietaire ($this->_auth->getAuthData (PROJET_CHAMPS_ID)) ;
Line 823... Line 830...
823
 
830
 
824
            // On passe aussi le numéro de répertoire s'il existe
831
            // On passe aussi le numero de repertoire s'il existe
825
            if ($this->_id_repertoire != '') $document->setIdRepertoire($this->_id_repertoire) ;
-
 
-
 
832
            if ($this->_id_repertoire != '') $document->setIdRepertoire($this->_id_repertoire) ;
-
 
833
            if ($this->_id_repertoire == 0) $document->setIdRepertoire(0) ;
826
 
834
			//$GLOBALS['log'] .= '<br>this->_id_repertoire: '.$this->_id_repertoire.'<br>';
-
 
835
            $chemin_upload = $document->calculeCheminUploaded($projet->getNomRepertoire()) ;
-
 
836
			//$GLOBALS['log'] .= '<br>chemin_upload: '.$chemin_upload.'<br>';
-
 
837
			//$GLOBALS['log'] .= 'projet->getRepertoire() : '.$projet->getNomRepertoire().'<br>';
-
 
838
			$id_document = SQL_obtenirNouveauId($this->_db, 'projet_documents', 'pd_id') ;
827
            $chemin_upload = $document->calculeCheminUploaded($projet->getNomRepertoire()) ;
839
			$nouveau_nom = $document->genereNouveauNom($projet->getNomRepertoire(), $_FILES['fichier']['name'], $id_document);
828
 
840
			
829
            if (!$document->upload (PROJET_CHEMIN_FICHIER.$projet->getNomRepertoire().'/'.$chemin_upload)) {
841
            if (!$document->upload (PROJET_CHEMIN_FICHIER.$chemin_upload.'/'.$nouveau_nom)) {
830
                echo 'Echec de l\'upload' ;
842
                return 'Echec de l\'upload<br />'.
-
 
843
                		'Fichier source : '. $_FILES['fichier']['name'];
831
                trigger_error('echec d\'upload !', E_USER_ERROR) ;
844
                		'Fichier destination : '.PROJET_CHEMIN_FICHIER.$projet->getNomRepertoire().'/'.$chemin_upload.'/'.$nouveau_nom ;
Line 832... Line 845...
832
            }
845
            }
-
 
846
 
833
 
847
 
834
 
848
            //$document->enregistrerSQL($formulaire_document->getSubmitValues(), $projet->getNomRepertoire().'/'.$chemin_upload) ;
Line 835... Line 849...
835
            $document->enregistrerSQL($formulaire_document->getSubmitValues(), $projet->getNomRepertoire().'/'.$chemin_upload) ;
849
            $retour = $document->enregistrerSQL($formulaire_document->getSubmitValues(), $nouveau_nom);
836
            // On place a 1 la colonne p_avoir_document
850
            // On place a 1 la colonne p_avoir_document
837
            if (!$projet->avoirDocument()) $projet->setAvoirDocument(true);
851
            if (!$projet->avoirDocument()) $projet->setAvoirDocument(true);
838
            
852
            
839
            // On ajoute une information de session
853
            // On ajoute une information de session
-
 
854
            $_SESSION['formulaire_document'] = 'valide';
840
            $_SESSION['formulaire_document'] = 'valide';
855
        } else {
841
        } else {
856
            return $formulaire_document->toHTML() ;
Line 842... Line 857...
842
            return $formulaire_document->toHTML() ;
857
        }
843
        }
858
        return $retour;
Line 850... Line 865...
850
     * @return void
865
     * @return void
851
     * @access public
866
     * @access public
852
     */
867
     */
853
    function modifierFichier( )
868
    function modifierFichier( )
854
    {
869
    {
855
        // création de l'objet projet courant
870
        // creation de l'objet projet courant
856
        include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
871
        include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
857
        $projet = new projet ($this->_db, $this->_id_projet) ;
872
        $projet = new projet ($this->_db, $this->_id_projet) ;
858
        $this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_ACTION_MODIFIER_V) ;
873
        $this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_ACTION_MODIFIER_V) ;
859
        include_once PROJET_CHEMIN_CLASSES.'HTML_formulaireDocument.class.php' ;
874
        include_once PROJET_CHEMIN_CLASSES.'HTML_formulaireDocument.class.php' ;
860
        $formulaire_document = new HTML_formulaireDocument('formulaire_document', 'post',preg_replace ("/&amp;/", "&", $this->_url->getURL())) ;
875
        $formulaire_document = new HTML_formulaireDocument('formulaire_document', 'post',preg_replace ("/&amp;/", "&", $this->_url->getURL())) ;
861
        $formulaire_document->construitFormulaire(PROJET_ACTION_MODIFIER_V) ;
876
        $formulaire_document->construitFormulaire(PROJET_ACTION_MODIFIER_V) ;
862
        if ($formulaire_document->validate()) {
877
        if ($formulaire_document->validate()) {
863
            // Création d'un objet document vide
878
            // Creation d'un objet document vide
864
            $document = new document ($this->_id_document, $this->_db) ;
879
            $document = new document ($this->_id_document, $this->_db) ;
865
            // On passe aussi le numéro de répertoire s'il existe
880
            // On passe aussi le numero de répertoire s'il existe
866
            if ($this->_id_repertoire != '') $document->setIdRepertoire($this->_id_repertoire) ;
881
            if ($this->_id_repertoire != '') $document->setIdRepertoire($this->_id_repertoire) ;
867
            $document->majSQL($formulaire_document->getSubmitValues()) ;
882
            $document->majSQL($formulaire_document->getSubmitValues()) ;
868
        } else {
883
        } else {
869
            return $formulaire_document->toHTML() ;
884
            return $formulaire_document->toHTML() ;
870
        }
885
        }
Line 877... Line 892...
877
     * @return void
892
     * @return void
878
     * @access public
893
     * @access public
879
     */
894
     */
880
    function nouveauRepertoireValidation( )
895
    function nouveauRepertoireValidation( )
881
    {
896
    {
882
        // création de l'objet projet courant
897
        // creation de l'objet projet courant
883
        include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
898
        include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
884
        $projet = new projet ($this->_db, $this->_id_projet) ;
899
        $projet = new projet ($this->_db, $this->_id_projet) ;
Line 885... Line 900...
885
 
900
 
886
        $this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_NOUVEAU_FICHIER_V) ;
901
        $this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_NOUVEAU_FICHIER_V) ;
887
        include_once PROJET_CHEMIN_CLASSES.'HTML_formulaireDocument.class.php' ;
902
        include_once PROJET_CHEMIN_CLASSES.'HTML_formulaireDocument.class.php' ;
888
        $formulaire_repertoire = new HTML_formulaireDocument('formulaire_repertoire', 'post',preg_replace ("/&amp;/", "&", $this->_url->getURL())) ;
903
        $formulaire_repertoire = new HTML_formulaireDocument('formulaire_repertoire', 'post',preg_replace ("/&amp;/", "&", $this->_url->getURL())) ;
889
        $formulaire_repertoire->setType ('repertoire') ;
904
        $formulaire_repertoire->setType ('repertoire') ;
890
        $formulaire_repertoire->construitFormulaire() ;
905
        $formulaire_repertoire->construitFormulaire() ;
891
        if ($formulaire_repertoire->validate()) {
906
        if ($formulaire_repertoire->validate()) {
892
            // Création d'un objet
907
            // Creation d'un objet
893
            $document = new document ("", $this->_db) ;
908
            $document = new document ("", $this->_db) ;
894
            // avant d'appeler la méthode enregistrerSQL, il faut indiquer l'identifiant du projet et l'identifiant du propriétaire
909
            // avant d'appeler la methode enregistrerSQL, il faut indiquer l'identifiant du projet et l'identifiant du proprietaire
895
            $document->setIdProjet ($this->_id_projet) ;
910
            $document->setIdProjet ($this->_id_projet) ;
Line 896... Line 911...
896
            $document->setIdProprietaire ($this->_auth->getAuthData (PROJET_CHAMPS_ID)) ;
911
            $document->setIdProprietaire ($this->_auth->getAuthData (PROJET_CHAMPS_ID)) ;
897
 
912
 
-
 
913
            // On passe aussi le numero de repertoire s'il existe
-
 
914
            if ($this->_id_repertoire != '') $document->setIdRepertoire($this->_id_repertoire) ;
-
 
915
			if ($this->_id_repertoire == 0) $document->setIdRepertoire(0) ;
Line 898... Line 916...
898
            // On passe aussi le numéro de répertoire s'il existe
916
            $chemin_upload = $document->calculeCheminUploaded($projet->getNomRepertoire()) ;
899
            if ($this->_id_repertoire != '') $document->setIdRepertoire($this->_id_repertoire) ;
-
 
-
 
917
            $nom_repertoire = $document->enregistrerSQL($formulaire_repertoire->getSubmitValues(), $projet->getNomRepertoire()) ;
900
 
918
 
901
            $lien = $document->enregistrerSQL($formulaire_repertoire->getSubmitValues(), $projet->getNomRepertoire()) ;
919
            // La creation du repertoire sur le disque, chemin / nom_repertoire_projet / id_repertoire
Line 902... Line 920...
902
 
920
            $GLOBALS['log'] .= '<br />chemin_upload:'.$chemin_upload.'<br />';
903
            // La création du répertoire sur le disque, chemin / nom_repertoire_projet / id_repertoire
921
            $GLOBALS['log'] .= '<br />mkdir('.PROJET_CHEMIN_FICHIER.$chemin_upload.$nom_repertoire.')<br />';
-
 
922
            if (!mkdir (PROJET_CHEMIN_FICHIER.$chemin_upload.'/'.$nom_repertoire)) {
904
            if (!mkdir (PROJET_CHEMIN_FICHIER.$lien)) {
923
 
905
 
924
                $document->suppressionSQL() ;
906
                $document->suppressionSQL() ;
925
                return $this->messageErreur(PROJETCONTROLEUR_ERREUR_CREATION_REPERTOIRE).'<br />'.
907
                return $this->messageErreur(PROJETCONTROLEUR_ERREUR_CREATION_REPERTOIRE).'<br />'.PROJET_CHEMIN_FICHIER.$lien  ;
926
                						PROJET_CHEMIN_FICHIER.$chemin_upload.'/'.$nom_repertoire;
908
            }
927
            }
909
            // On place a 1 la colonne p_avoir_document
928
            // On place a 1 la colonne p_avoir_document
910
            if (!$projet->avoirDocument()) $projet->setAvoirDocument(true);
929
            if (!$projet->avoirDocument()) $projet->setAvoirDocument(true);
Line 911... Line 930...
911
        } else {
930
        } else {
912
            return $formulaire_repertoire->toHTML() ;
931
            return $formulaire_repertoire->toHTML() ;
913
        }
932
        }
914
    } // end of member function nouveauFichierValidation
933
    }
915
 
934
 
916
 
935
 
917
    /**
936
    /**
Line 934... Line 953...
934
     * @access public
953
     * @access public
935
     */
954
     */
936
    function accueilProjet( )
955
    function accueilProjet( )
937
    {
956
    {
938
        $res = '' ;
957
        $res = '' ;
939
        // création de l'objet projet courant
958
        // creation de l'objet projet courant
940
        include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
959
        include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
941
        $projet = new projet ($this->_db, $this->_id_projet) ;
960
        $projet = new projet ($this->_db, $this->_id_projet) ;
Line 942... Line 961...
942
 
961
 
943
        // récupération de la liste des documents associés
962
        // recuperation de la liste des documents associés
Line 944... Line 963...
944
        $liste_documents = $projet->getListesDocuments(PROJET_CHEMIN_FICHIER, PROJET_CHEMIN_ICONES) ;
963
        $liste_documents = $projet->getListesDocuments(PROJET_CHEMIN_FICHIER, PROJET_CHEMIN_ICONES) ;
945
 
964
 
946
        // création de la vue liste de document, on nettoie l'url
965
        // création de la vue liste de document, on nettoie l'url
947
        $this->_url->removeQueryString(PROJET_VARIABLE_ACTION) ;
966
        $this->_url->removeQueryString(PROJET_VARIABLE_ACTION) ;
Line 948... Line 967...
948
        include_once PROJET_CHEMIN_CLASSES.'HTML_listeDocuments.class.php' ;
967
        include_once PROJET_CHEMIN_CLASSES.'HTML_listeDocuments.class.php' ;
949
        $vue_liste_document = new HTML_listeDocuments($this->_url, false, $this->_id_repertoire) ;
968
        $vue_liste_document = new HTML_listeDocuments($this->_url, false, $this->_id_repertoire) ;
950
 
969
 
Line 951... Line 970...
951
        // réglage de paramètres de la vue
970
        // reglage de parametres de la vue
Line 952... Line 971...
952
        $vue_liste_document->setAction (array ("couper" => PROJET_ACTION_COUPER, "modifier" => PROJET_ACTION_MODIFIER, "supprimer" => PROJET_SUPPRESSION_FICHIER)) ;
971
        $vue_liste_document->setAction (array ("couper" => PROJET_ACTION_COUPER, "modifier" => PROJET_ACTION_MODIFIER, "supprimer" => PROJET_SUPPRESSION_FICHIER)) ;
953
        $vue_liste_document->setCheminIcones(PROJET_CHEMIN_ICONES) ;
972
        $vue_liste_document->setCheminIcones(PROJET_CHEMIN_ICONES) ;
954
 
973
 
Line 955... Line 974...
955
 
974
 
956
        $tableau_navigation = document::getCheminIdRepertoire($this->_id_repertoire, $this->_db) ;
975
        $tableau_navigation = document::getCheminIdRepertoire($this->_id_repertoire, $this->_db) ;
957
 
976
 
Line 1129... Line 1148...
1129
        }
1148
        }
1130
        return $res ;
1149
        return $res ;
1131
    } // end of member function accueilProjet
1150
    } // end of member function accueilProjet
Line 1132... Line 1151...
1132
 
1151
 
1133
    /**
1152
    /**
1134
     * Permet de spécifier quel répertoire, dans la vue de document afficher. Il sera
1153
     * Permet de specifier quel repertoire, dans la vue de document afficher. Il sera
1135
     * passé en paramètre à la classe HTML_listeDocuments.
1154
     * passe en parametre a la classe HTML_listeDocuments.
1136
     *
1155
     *
1137
     * @param int id_repertoire L'identifiant du répertoire à afficher.
1156
     * @param int id_repertoire L'identifiant du repertoire a afficher.
1138
     * @return void
1157
     * @return void
1139
     * @access public
1158
     * @access public
1140
     */
1159
     */
1141
    function setIdRepertoire( $id_repertoire )
1160
    function setIdRepertoire( $id_repertoire )
1142
    {
1161
    {
1143
        $this->_id_repertoire = $id_repertoire ;
1162
        $this->_id_repertoire = $id_repertoire ;
Line 1144... Line 1163...
1144
    } // end of member function setIdRepertoire
1163
    }
1145
 
1164
 
1146
    /**
1165
    /**
1147
     * Supprime un projet et tout ce qui va avec.
1166
     * Supprime un projet et tout ce qui va avec.
Line 1202... Line 1221...
1202
     * @return void
1221
     * @return void
1203
     * @access public
1222
     * @access public
1204
     */
1223
     */
1205
    function envoyerUnMailValidation( )
1224
    function envoyerUnMailValidation( )
1206
    {
1225
    {
1207
        // Vérifications
1226
        // Verifications
1208
        if (isset($_SESSION['formulaire_mail']) && $_SESSION['formulaire_mail'] == 'valide') {
1227
        if (isset($_SESSION['formulaire_mail']) && $_SESSION['formulaire_mail'] == 'valide') {
1209
            return include_once PROJET_CHEMIN_APPLI.'actions/forums.php' ;
1228
            return include_once PROJET_CHEMIN_APPLI.'actions/forums.php' ;
1210
        }
1229
        }
Line 1211... Line 1230...
1211
        
1230
        
1212
        $this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_ENVOYER_UN_MAIL_V );
1231
        $this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_ENVOYER_UN_MAIL_V );
1213
        include_once PROJET_CHEMIN_CLASSES.'HTML_formulaireMail.class.php' ;
1232
        include_once PROJET_CHEMIN_CLASSES.'HTML_formulaireMail.class.php' ;
1214
        $formulaire_mail = new HTML_formulaireMail('formulaire_mail', 'post', preg_replace ("/&amp;/", "&", $this->_url->getURL())) ;
1233
        $formulaire_mail = new HTML_formulaireMail('formulaire_mail', 'post', preg_replace ("/&amp;/", "&", $this->_url->getURL())) ;
1215
        $formulaire_mail->construitFormulaire() ;
1234
        $formulaire_mail->construitFormulaire() ;
1216
        if ($formulaire_mail->validate()) {
1235
        if ($formulaire_mail->validate()) {
1217
            // création de l'objet projet courant
1236
            // creation de l'objet projet courant
1218
            include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
1237
            include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
1219
            $projet = new projet ($this->_db, $this->_id_projet) ;
1238
            $projet = new projet ($this->_db, $this->_id_projet) ;
1220
            $info_liste = $projet->getListesAssociees() ;
1239
            $info_liste = $projet->getListesAssociees() ;
1221
            $valeurs_mail = $formulaire_mail->getSubmitValues() ;
1240
            $valeurs_mail = $formulaire_mail->getSubmitValues() ;
Line 1227... Line 1246...
1227
            $entetes['Subject'] = $valeurs_mail['mail_titre'] ;
1246
            $entetes['Subject'] = $valeurs_mail['mail_titre'] ;
1228
            $entetes['Date'] = date ('D, M j G:i:s \C\E\S\T Y') ;
1247
            $entetes['Date'] = date ('D, M j G:i:s \C\E\S\T Y') ;
1229
            $entetes['Message-ID'] = md5(time()).'@'.$projet->_listes_associes[0]->getNom().'.'.$projet->_listes_associes[0]->getDomaine() ;
1248
            $entetes['Message-ID'] = md5(time()).'@'.$projet->_listes_associes[0]->getNom().'.'.$projet->_listes_associes[0]->getDomaine() ;
1230
            $entetes['reply-to'] = $projet->_listes_associes[0]->getAdresseEnvoi() ;
1249
            $entetes['reply-to'] = $projet->_listes_associes[0]->getAdresseEnvoi() ;
1231
            $entetes['Content-Type'] = 'text/plain' ;
1250
            $entetes['Content-Type'] = 'text/plain' ;
1232
            // Traitement de la reference s'il s'agit d'une réponse
1251
            // Traitement de la reference s'il s'agit d'une reponse
1233
            if (isset ($_POST['messageid'])) {
1252
            if (isset ($_POST['messageid'])) {
1234
                $entetes['In-Reply-To'] = $_POST['messageid'] ;
1253
                $entetes['In-Reply-To'] = $_POST['messageid'] ;
1235
            }
1254
            }
1236
            $objet_mail =& Mail::factory('smtp');
1255
            $objet_mail =& Mail::factory('smtp');
1237
            $objet_mail->send($entetes['To'], $entetes, $valeurs_mail['mail_corps']);
1256
            $objet_mail->send($entetes['To'], $entetes, $valeurs_mail['mail_corps']);
Line 1257... Line 1276...
1257
        $formulaire_liste = new HTML_formulaireListe('formulaire_liste', 'post',preg_replace ("/&amp;/", "&", $this->_url->getURL())) ;
1276
        $formulaire_liste = new HTML_formulaireListe('formulaire_liste', 'post',preg_replace ("/&amp;/", "&", $this->_url->getURL())) ;
1258
        $formulaire_liste->construitFormulaire() ;
1277
        $formulaire_liste->construitFormulaire() ;
1259
        $formulaire_liste->setDefaults(array('domaine_liste' => PROJET_DOMAINE_LISTE)) ;
1278
        $formulaire_liste->setDefaults(array('domaine_liste' => PROJET_DOMAINE_LISTE)) ;
1260
        $formulaire_liste->updateElementAttr('domaine_liste', array('readonly' => 'readonly')) ;
1279
        $formulaire_liste->updateElementAttr('domaine_liste', array('readonly' => 'readonly')) ;
1261
        return $res.$formulaire_liste->toHTML() ;
1280
        return $res.$formulaire_liste->toHTML() ;
1262
    } // end of member function formulaireListe
1281
    } 
Line 1263... Line 1282...
1263
 
1282
 
1264
    /**
1283
    /**
1265
     * Transmet au serveur la demande de création d'une nouvelle liste.
1284
     * Transmet au serveur la demande de création d'une nouvelle liste.
1266
     *
1285
     *
1267
     * @return void
1286
     * @return void
1268
     * @access public
1287
     * @access public
1269
     */
1288
     */
1270
    function nouvelleListeValidation( )
1289
    function nouvelleListeValidation( )
1271
    {
1290
    {
1272
        // Vérifications
1291
        // Verifications
1273
        $this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_ACTION_NOUVELLE_LISTE_V );
1292
        $this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_ACTION_NOUVELLE_LISTE_V );
1274
        include_once PROJET_CHEMIN_CLASSES.'HTML_formulaireListe.class.php' ;
1293
        include_once PROJET_CHEMIN_CLASSES.'HTML_formulaireListe.class.php' ;
1275
        $formulaire_liste = new HTML_formulaireListe('formulaire_liste', 'post', preg_replace ("/&amp;/", "&", $this->_url->getURL())) ;
1294
        $formulaire_liste = new HTML_formulaireListe('formulaire_liste', 'post', preg_replace ("/&amp;/", "&", $this->_url->getURL())) ;
1276
        $formulaire_liste->construitFormulaire() ;
1295
        $formulaire_liste->construitFormulaire() ;
1277
        if ($formulaire_liste->validate()) {
1296
        if ($formulaire_liste->validate()) {
-
 
1297
            // creation de l'objet liste_discussion
1278
            // création de l'objet liste_discussion
1298
            include_once PROJET_CHEMIN_CLASSES.'liste_discussion.class.php';
Line 1279... Line 1299...
1279
            $liste = new liste_discussion('', $this->_db) ;
1299
            $liste = new liste_discussion('', $this->_db) ;
1280
 
1300
 
1281
            // On vérifie que le nom de la liste soit unique
1301
            // On vérifie que le nom de la liste soit unique
Line 1287... Line 1307...
1287
                // On la relie au projet
1307
                // On la relie au projet
1288
                include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
1308
                include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
1289
                $projet = new projet ($this->_db, $this->_id_projet) ;
1309
                $projet = new projet ($this->_db, $this->_id_projet) ;
1290
                $projet->ajouterListe($liste) ;
1310
                $projet->ajouterListe($liste) ;
Line 1291... Line 1311...
1291
 
1311
 
1292
                // Création de la liste
1312
                // Creation de la liste
1293
                $resultat_creation = file_get_contents (PROJET_SERVEUR_VPOPMAIL.'/creation_liste.php?domaine='.
1313
                $resultat_creation = file_get_contents (PROJET_SERVEUR_VPOPMAIL.'/creation_liste.php?domaine='.
Line 1294... Line 1314...
1294
                                    $liste->getDomaine().'&liste='.$liste->getNom().'&parametres=aBiud') ;
1314
                                    $liste->getDomaine().'&liste='.$liste->getNom().'&parametres=aBiud') ;
1295
 
1315
 
1296
                // Ajout du modérateur
1316
                // Ajout du moderateur
1297
                $resultat_ajout_moderateur = file_get_contents (PROJET_SERVEUR_VPOPMAIL.'/ajout_moderateur.php?domaine='.
1317
                $resultat_ajout_moderateur = file_get_contents (PROJET_SERVEUR_VPOPMAIL.'/ajout_moderateur.php?domaine='.
1298
                                    $liste->getDomaine().'&liste='.$liste->getNom().'&mail='.$this->_auth->getUserName()) ;
1318
                                    $liste->getDomaine().'&liste='.$liste->getNom().'&mail='.$this->_auth->getUserName()) ;
1299
                // Ajout du modérateur en tant qu'utilisateur
1319
                // Ajout du moderateur en tant qu'utilisateur
Line 1300... Line 1320...
1300
                $resultat_ajout_utilisateur = file_get_contents (PROJET_SERVEUR_VPOPMAIL.'/ajout_abonne.php?domaine='.
1320
                $resultat_ajout_utilisateur = file_get_contents (PROJET_SERVEUR_VPOPMAIL.'/ajout_abonne.php?domaine='.
1301
                                    $liste->getDomaine().'&liste='.$liste->getNom().'&mail='.$this->_auth->getUserName()) ;
1321
                                    $liste->getDomaine().'&liste='.$liste->getNom().'&mail='.$this->_auth->getUserName()) ;
Line 1434... Line 1454...
1434
        return $titre.$res ;
1454
        return $titre.$res ;
Line 1435... Line 1455...
1435
 
1455
 
Line 1436... Line 1456...
1436
    } // end of member function voirParticipants
1456
    } // end of member function voirParticipants
1437
 
1457
 
1438
    /**
1458
    /**
1439
     * Inscrit un utilisateur à un projet avec le statut observateur
1459
     * Inscrit un utilisateur a un projet avec le statut observateur
1440
     *
1460
     *
1441
     * @return void
1461
     * @return void
1442
     * @access public
1462
     * @access public
Line 1479... Line 1499...
1479
                                                        $projet->_listes_associes[0],
1499
                                                        $projet->_listes_associes[0],
1480
                                                        $_POST['radio_inscription_liste']) ;
1500
                                                        $_POST['radio_inscription_liste']) ;
1481
            	} else {
1501
            	} else {
1482
            		$participant->setStatut(3, $this->_auth->getAuthData (PROJET_CHAMPS_ID), $this->_id_projet) ;
1502
            		$participant->setStatut(3, $this->_auth->getAuthData (PROJET_CHAMPS_ID), $this->_id_projet) ;
1483
            		$tableau_coordinateur = $participant->getCoordinateurs($this->_id_projet) ;
1503
            		$tableau_coordinateur = $participant->getCoordinateurs($this->_id_projet) ;
1484
            		#include_once PROJET_CHEMIN_API.'pear/Mail.php';
-
 
-
 
1504
            		
1485
            		$entetes['From'] = $this->_auth->getUserName();
1505
            		$entetes['From'] = $this->_auth->getUserName();
1486
		            $entetes['To'] = '';
1506
		            $entetes['To'] = '';
1487
		            $entetes['Subject'] = PROJET_DEMANDE_INSCRIPTION ;
1507
		            $entetes['Subject'] = PROJET_DEMANDE_INSCRIPTION ;
1488
		            $entetes['Date'] = date ('D, M j G:i:s \C\E\S\T Y') ;
1508
		            $entetes['Date'] = date ('D, M j G:i:s \C\E\S\T Y') ;
1489
		            $entetes['Message-ID'] = md5(time()) ;
1509
		            $entetes['Message-ID'] = md5(time()) ;
Line 1512... Line 1532...
1512
            		$objet_mail->send($entetes['To'], $entetes, $tpl->get());
1532
            		$objet_mail->send($entetes['To'], $entetes, $tpl->get());
1513
            	}
1533
            	}
1514
            }
1534
            }
Line 1515... Line 1535...
1515
 
1535
 
1516
            if ($this->_presentation != 'arbre') {
1536
            if ($this->_presentation != 'arbre') {
-
 
1537
                return '<h1>'.$projet->getTitre().'</h1>'.
1517
                return include_once PROJET_CHEMIN_APPLI.'actions/resume.php' ;
1538
                		str_replace ('nom_du_projet', $projet->getTitre(), PROJET_LAIUS_INSCRIPTION_MODERE);
1518
            } else {
1539
            } else {
1519
                $this->_action = PROJET_ACTION_VOIR_RESUME;
1540
                $this->_action = PROJET_ACTION_VOIR_RESUME;
1520
            }
1541
            }
1521
            return ;
1542
            return PROJET_LAIUS_INSCRIPTION_MODERE;
1522
        }
1543
        }
1523
        $res = '<h1>'.PROJET_INSCRIPTION_PROJET.' : '.$projet->getTitre().'</h1>'."\n" ;
1544
        $res = '<h1>'.PROJET_INSCRIPTION_PROJET.' : '.$projet->getTitre().'</h1>'."\n" ;
1524
        if ($projet->avoirListe()) $res .= '<h2>'.PROJET_MESSAGE_LISTE.'</h2>'."\n" ;
1545
        if ($projet->avoirListe()) $res .= '<h2>'.PROJET_MESSAGE_LISTE.'</h2>'."\n" ;
1525
        //$participant = new participe($this->_db) ;
1546
        //$participant = new participe($this->_db) ;
Line 1529... Line 1550...
1529
        $HTML_formulaireInscriptionProjet->setDefaults(array('radio_inscription_liste' => 2)) ;
1550
        $HTML_formulaireInscriptionProjet->setDefaults(array('radio_inscription_liste' => 2)) ;
1530
        return $res.$HTML_formulaireInscriptionProjet->toHTML() ;
1551
        return $res.$HTML_formulaireInscriptionProjet->toHTML() ;
1531
    } // end of member function inscriptionProjet
1552
    } // end of member function inscriptionProjet
Line 1532... Line 1553...
1532
 
1553
 
1533
    /**
1554
    /**
1534
     * Inscrit l'utilisateur logué à la liste dont le paraître est en post.
1555
     * Inscrit l'utilisateur loggue a la liste dont le parametre est en post.
1535
     *
1556
     *
1536
     * @return void
1557
     * @return void
1537
     * @access public
1558
     * @access public
1538
     */
1559
     */
Line 1791... Line 1812...
1791
     */
1812
     */
1792
    function messageErreur( $valeur )
1813
    function messageErreur( $valeur )
1793
    {
1814
    {
1794
        $messageErreur = array (
1815
        $messageErreur = array (
1795
                    PROJETCONTROLEUR_ACTION_INVALIDE => "Action non valide",
1816
                    PROJETCONTROLEUR_ACTION_INVALIDE => "Action non valide",
1796
                    PROJETCONTROLEUR_ERREUR_SUPPRESSION_REPERTOIRE => "Impossible de supprimer le répertoire",
1817
                    PROJETCONTROLEUR_ERREUR_SUPPRESSION_REPERTOIRE => "Impossible de supprimer le r&eacute;pertoire",
1797
                    PROJETCONTROLEUR_PAS_DE_DOCUMENT_SELECTIONNE => 'Pas de fichier sélectionn°',
1818
                    PROJETCONTROLEUR_PAS_DE_DOCUMENT_SELECTIONNE => 'Pas de fichier s&eacute;lectionn&eacute;',
1798
                    PROJETCONTROLEUR_ERREUR_CREATION_REPERTOIRE => 'Impossible de créer le répertoire'
1819
                    PROJETCONTROLEUR_ERREUR_CREATION_REPERTOIRE => 'Impossible de cr&eacute;er le r&eacute;pertoire'
1799
        ) ;
1820
        ) ;
1800
        return '<p class="erreur">'.$messageErreur[$valeur].'</p>' ;
1821
        return '<p class="erreur">'.$messageErreur[$valeur].'</p>' ;
1801
    } // end of member function messageErreur
1822
    } // end of member function messageErreur