| 448 | ddelon | 1 | <?php
 | 
        
           | 598 | ddelon | 2 | /*vim: set expandtab tabstop=4 shiftwidth=4: */
 | 
        
           | 448 | ddelon | 3 | // +------------------------------------------------------------------------------------------------------+
 | 
        
           |  |  | 4 | // | PHP version 4.1                                                                                      |
 | 
        
           |  |  | 5 | // +------------------------------------------------------------------------------------------------------+
 | 
        
           |  |  | 6 | // | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org)                                         |
 | 
        
           |  |  | 7 | // +------------------------------------------------------------------------------------------------------+
 | 
        
           |  |  | 8 | // | This library is free software; you can redistribute it and/or                                        |
 | 
        
           |  |  | 9 | // | modify it under the terms of the GNU General Public                                                  |
 | 
        
           |  |  | 10 | // | License as published by the Free Software Foundation; either                                         |
 | 
        
           |  |  | 11 | // | version 2.1 of the License, or (at your option) any later version.                                   |
 | 
        
           |  |  | 12 | // |                                                                                                      |
 | 
        
           |  |  | 13 | // | This library is distributed in the hope that it will be useful,                                      |
 | 
        
           |  |  | 14 | // | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
 | 
        
           |  |  | 15 | // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU                                    |
 | 
        
           |  |  | 16 | // | General Public License for more details.                                                             |
 | 
        
           |  |  | 17 | // |                                                                                                      |
 | 
        
           |  |  | 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                                  |
 | 
        
           |  |  | 20 | // | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
 | 
        
           |  |  | 21 | // +------------------------------------------------------------------------------------------------------+
 | 
        
           | 474 | alexandre_ | 22 |   | 
        
           | 1754 | alexandre_ | 23 | // CVS : $Id: projetControleur.class.php,v 1.38.2.3 2007-12-04 13:53:06 alexandre_tb Exp $
 | 
        
           | 474 | alexandre_ | 24 |   | 
        
           | 448 | ddelon | 25 | /**
 | 
        
           |  |  | 26 | * Application projet
 | 
        
           |  |  | 27 | *
 | 
        
           |  |  | 28 | * La classe controleur projet
 | 
        
           |  |  | 29 | *
 | 
        
           |  |  | 30 | *@package projet
 | 
        
           |  |  | 31 | //Auteur original :
 | 
        
           |  |  | 32 | *@author        Alexandre Granier <alexandre@tela-botanica.org>
 | 
        
           |  |  | 33 | //Autres auteurs :
 | 
        
           |  |  | 34 | *@author        Aucun
 | 
        
           |  |  | 35 | *@copyright     Tela-Botanica 2000-2004
 | 
        
           | 1754 | alexandre_ | 36 | *@version       $Revision: 1.38.2.3 $
 | 
        
           | 448 | ddelon | 37 | // +------------------------------------------------------------------------------------------------------+
 | 
        
           |  |  | 38 | */
 | 
        
           |  |  | 39 |   | 
        
           |  |  | 40 | // +------------------------------------------------------------------------------------------------------+
 | 
        
           |  |  | 41 | // |                                            ENTETE du PROGRAMME                                       |
 | 
        
           |  |  | 42 | // +------------------------------------------------------------------------------------------------------+
 | 
        
           |  |  | 43 |   | 
        
           |  |  | 44 | if (isset ($GLOBALS['lang'])) {
 | 
        
           |  |  | 45 |     /** le fichier de langue, par defaut PROJET_LANGUE_DEFAUT */
 | 
        
           |  |  | 46 |     include_once 'client/projet/langues/pro_langue_'.$GLOBALS['lang'].'.inc.php' ;
 | 
        
           |  |  | 47 | } else {
 | 
        
           |  |  | 48 |     include_once 'client/projet/langues/pro_langue_'.PROJET_LANGUE_DEFAUT.'.inc.php' ;
 | 
        
           |  |  | 49 | }
 | 
        
           |  |  | 50 |   | 
        
           | 1471 | alexandre_ | 51 | require_once GEN_CHEMIN_API.'sql/SQL_manipulation.fonct.php' ;
 | 
        
           | 487 | ddelon | 52 | require_once GEN_CHEMIN_API.'html/HTML_TableFragmenteur.php' ;
 | 
        
           | 448 | ddelon | 53 | // +------------------------------------------------------------------------------------------------------+
 | 
        
           |  |  | 54 | // |                                           LISTE des constantes                                       |
 | 
        
           |  |  | 55 | // +------------------------------------------------------------------------------------------------------+
 | 
        
           |  |  | 56 |   | 
        
           |  |  | 57 | define ("PROJET_ACTION_COUPER", 3) ;
 | 
        
           |  |  | 58 | define ("PROJET_ACTION_MODIFIER", 4) ;
 | 
        
           |  |  | 59 | define ("PROJET_SUPPRESSION_FICHIER", 5) ;
 | 
        
           |  |  | 60 | define ("PROJET_NOUVEAU", 6) ;
 | 
        
           |  |  | 61 | define ("PROJET_NOUVEAU_V", 7) ;
 | 
        
           |  |  | 62 | define ('PROJET_MODIFIER_DESCRIPTION', 19) ;
 | 
        
           |  |  | 63 | define ('PROJET_MODIFIER_DESCRIPTION_V', 20) ;
 | 
        
           |  |  | 64 | define ("PROJET_NOUVEAU_FICHIER", 8) ;
 | 
        
           |  |  | 65 | define ("PROJET_NOUVEAU_FICHIER_V", 9) ;
 | 
        
           |  |  | 66 | define ("PROJET_NOUVEAU_REPERTOIRE", 11) ;
 | 
        
           |  |  | 67 | define ("PROJET_NOUVEAU_REPERTOIRE_V", 12) ;
 | 
        
           |  |  | 68 | define ("PROJET_SUPPRESSION_PROJET", 10) ;
 | 
        
           |  |  | 69 | define ("PROJET_ENVOYER_UN_MAIL", 13) ;
 | 
        
           |  |  | 70 | define ("PROJET_ENVOYER_UN_MAIL_V", 14) ;
 | 
        
           |  |  | 71 | define ("PROJET_ACTION_MODIFIER_V", 15) ;
 | 
        
           |  |  | 72 | define ('PROJET_ACTION_NOUVELLE_LISTE', 16) ;
 | 
        
           |  |  | 73 | define ('PROJET_ACTION_NOUVELLE_LISTE_V', 17) ;
 | 
        
           |  |  | 74 | define ('PROJET_ACTION_S_INSCRIRE', 21) ;
 | 
        
           |  |  | 75 | define ('PROJET_ACTION_CREER_WIKI', 22) ;
 | 
        
           |  |  | 76 | define ('PROJET_ACTION_SUPPRIMER_WIKI', 23) ;
 | 
        
           |  |  | 77 | define ('PROJET_ACTION_CREER_WIKI_V', 24) ;
 | 
        
           |  |  | 78 | define ('PROJET_ACTION_SUPPRIMER_LISTE', 25) ;
 | 
        
           |  |  | 79 | define ('PROJET_ACTION_DESINSCRIPTION_PROJET', 26) ;
 | 
        
           |  |  | 80 | define ('PROJET_ACTION_INSCRIPTION_LISTE', 27) ;
 | 
        
           |  |  | 81 | define ('PROJET_ACTION_DESINSCRIPTION_LISTE', 28) ;
 | 
        
           |  |  | 82 | define ('PROJET_ACTION_REFERENCER_LISTE', 29) ;
 | 
        
           |  |  | 83 | define ('PROJET_ACTION_REFERENCER_LISTE_V', 30) ;
 | 
        
           |  |  | 84 | define ('PROJET_ACTION_COLLER', 32) ;
 | 
        
           | 487 | ddelon | 85 | define ('PROJET_ACTION_ASSOCIER_WIKI', 36) ;
 | 
        
           |  |  | 86 | define ('PROJET_ACTION_ASSOCIER_WIKI_V', 37) ;
 | 
        
           | 448 | ddelon | 87 |   | 
        
           |  |  | 88 | define ('PROJET_ACTION_VOIR_RESUME', 'resume') ;
 | 
        
           |  |  | 89 | define ('PROJET_ACTION_VOIR_DESCRIPTION', 'description') ;
 | 
        
           |  |  | 90 | define ('PROJET_ACTION_VOIR_DOCUMENT', 'documents') ;
 | 
        
           |  |  | 91 | define ('PROJET_ACTION_VOIR_FORUM', 'forums') ;
 | 
        
           |  |  | 92 | define ('PROJET_ACTION_VOIR_PARTICIPANT', 'participants') ;
 | 
        
           |  |  | 93 | define ('PROJET_ACTION_VOIR_WIKINI', 'wikini') ;
 | 
        
           |  |  | 94 | /**
 | 
        
           |  |  | 95 |  * Code erreur pour l'interface projetControleur qui trouveront leur message
 | 
        
           |  |  | 96 |  * correspondant via la fonction projetControleur::messageErreur()
 | 
        
           |  |  | 97 |  */
 | 
        
           |  |  | 98 | define ("PROJETCONTROLEUR_ACTION_INVALIDE", -1) ;
 | 
        
           |  |  | 99 | define ("PROJETCONTROLEUR_ERREUR_SUPPRESSION_REPERTOIRE", -2) ;
 | 
        
           |  |  | 100 | define ("PROJETCONTROLEUR_PAS_DE_DOCUMENT_SELECTIONNE", -3) ;
 | 
        
           |  |  | 101 | define ("PROJETCONTROLEUR_ERREUR_CREATION_REPERTOIRE", -4) ;
 | 
        
           |  |  | 102 |   | 
        
           |  |  | 103 | /**
 | 
        
           | 1471 | alexandre_ | 104 |  *  Constantes pour definir les droits
 | 
        
           | 448 | ddelon | 105 |  *
 | 
        
           |  |  | 106 |  */
 | 
        
           |  |  | 107 | define ('PROJET_DROIT_ADMINISTRATEUR', 1) ;
 | 
        
           |  |  | 108 | define ('PROJET_DROIT_COORDINATEUR', 2) ;
 | 
        
           |  |  | 109 | define ('PROJET_DROIT_PROPRIETAIRE', 4) ;
 | 
        
           |  |  | 110 | define ('PROJET_DROIT_CONTRIBUTEUR', 8) ;
 | 
        
           |  |  | 111 | define ('PROJET_DROIT_AUCUN', 16) ;
 | 
        
           | 888 | alexandre_ | 112 | define ('PROJET_DROIT_EN_ATTENTE', 32);
 | 
        
           | 448 | ddelon | 113 | /**
 | 
        
           |  |  | 114 |  * class projetControleur
 | 
        
           | 1471 | alexandre_ | 115 |  * Cette classe sert a lancer les diverses applications du module projet, en
 | 
        
           |  |  | 116 |  * fonction des parametre de l'URL GET ou POST. La methode principale est run()
 | 
        
           | 448 | ddelon | 117 |  */
 | 
        
           |  |  | 118 | class projetControleur
 | 
        
           |  |  | 119 | {
 | 
        
           |  |  | 120 |     /*** Attributes: ***/
 | 
        
           |  |  | 121 |   | 
        
           |  |  | 122 |     /**
 | 
        
           | 1471 | alexandre_ | 123 |      * Contient l'action du controleur, qui correspond a une action du module projet.
 | 
        
           | 448 | ddelon | 124 |      * @access private
 | 
        
           |  |  | 125 |      */
 | 
        
           |  |  | 126 |     var $_action;
 | 
        
           |  |  | 127 |     /**
 | 
        
           | 1471 | alexandre_ | 128 |      * Une connexion a une base de donnee DB.
 | 
        
           | 448 | ddelon | 129 |      * @access private
 | 
        
           |  |  | 130 |      */
 | 
        
           |  |  | 131 |     var $_db;
 | 
        
           |  |  | 132 |   | 
        
           |  |  | 133 |     /**
 | 
        
           |  |  | 134 |      * Un objet PEAR:Auth
 | 
        
           |  |  | 135 |      * @access private
 | 
        
           |  |  | 136 |      */
 | 
        
           |  |  | 137 |     var $_auth;
 | 
        
           | 598 | ddelon | 138 |   | 
        
           | 448 | ddelon | 139 |     /**
 | 
        
           | 598 | ddelon | 140 |      *
 | 
        
           | 448 | ddelon | 141 |      * @access private
 | 
        
           |  |  | 142 |      */
 | 
        
           |  |  | 143 |     var $_url;
 | 
        
           | 598 | ddelon | 144 |   | 
        
           | 448 | ddelon | 145 |     /**
 | 
        
           | 1471 | alexandre_ | 146 |      * L'identifiant du projet sur lequel on travaille. Dans l'action par defaut, cet
 | 
        
           | 448 | ddelon | 147 |      * attribut n'a pas de valeur.
 | 
        
           |  |  | 148 |      * @access private
 | 
        
           |  |  | 149 |      */
 | 
        
           |  |  | 150 |     var $_id_projet;
 | 
        
           |  |  | 151 |   | 
        
           |  |  | 152 |     /**
 | 
        
           | 1471 | alexandre_ | 153 |      * L'identifiant du repertoire que l'on est en train d'observer. Il sera passé en
 | 
        
           |  |  | 154 |      * parametre a la classe HTML_listeDocuments.
 | 
        
           | 448 | ddelon | 155 |      * @access private
 | 
        
           |  |  | 156 |      */
 | 
        
           |  |  | 157 |     var $_id_repertoire;
 | 
        
           |  |  | 158 |   | 
        
           |  |  | 159 |      /**
 | 
        
           |  |  | 160 |      * L'identifiant du fichier que l'on est en train de modifier / supprimer.
 | 
        
           |  |  | 161 |      * @access private
 | 
        
           |  |  | 162 |      */
 | 
        
           |  |  | 163 |     var $_id_document;
 | 
        
           |  |  | 164 |   | 
        
           |  |  | 165 |     /**
 | 
        
           | 1471 | alexandre_ | 166 |      * La presentation de la liste des projets, par defaut vide, signifie en liste.
 | 
        
           | 448 | ddelon | 167 |      * Valeurs possibles: arbre
 | 
        
           |  |  | 168 |      * @access private
 | 
        
           |  |  | 169 |      */
 | 
        
           |  |  | 170 |     var $_presentation;
 | 
        
           |  |  | 171 |   | 
        
           | 474 | alexandre_ | 172 |    /**
 | 
        
           | 1471 | alexandre_ | 173 |      * Le type du projets, par defaut 0, signifie en pas de type particumier.
 | 
        
           | 474 | alexandre_ | 174 |      * Valeurs possibles: 0, 1, 2, 3 ...
 | 
        
           |  |  | 175 |      * @access private
 | 
        
           |  |  | 176 |      */
 | 
        
           | 598 | ddelon | 177 |   | 
        
           | 570 | alexandre_ | 178 |      var $_type ;
 | 
        
           | 474 | alexandre_ | 179 |    /**
 | 
        
           | 1471 | alexandre_ | 180 |      * Le tableau des projets a ne pas afficher, ni dans l'arbre, ni dans les listes
 | 
        
           | 474 | alexandre_ | 181 |      * @access private
 | 
        
           |  |  | 182 |      */
 | 
        
           | 570 | alexandre_ | 183 |  	var $_projet_exclu = array();
 | 
        
           | 598 | ddelon | 184 |   | 
        
           | 570 | alexandre_ | 185 |  	/**
 | 
        
           |  |  | 186 |      * parametre indiquant le type d'inscription possible
 | 
        
           |  |  | 187 |      * @access private
 | 
        
           |  |  | 188 |      */
 | 
        
           |  |  | 189 |  	var $_prive = 0 ;
 | 
        
           | 598 | ddelon | 190 |   | 
        
           | 1326 | alexandre_ | 191 | 	/**
 | 
        
           |  |  | 192 |      * parametre pour gere l appel a un service en rapport avec ajax
 | 
        
           |  |  | 193 |      * @access private
 | 
        
           |  |  | 194 |      */
 | 
        
           |  |  | 195 | 	var $_service ;
 | 
        
           |  |  | 196 |   | 
        
           | 448 | ddelon | 197 |     /**
 | 
        
           | 1471 | alexandre_ | 198 |      * Methode principale de la classe. Elle permet d'appeler les methodes du modules
 | 
        
           | 448 | ddelon | 199 |      * projet en fonction de l'action.
 | 
        
           |  |  | 200 |      *
 | 
        
           |  |  | 201 |      * @return string
 | 
        
           |  |  | 202 |      * @access public
 | 
        
           |  |  | 203 |      */
 | 
        
           |  |  | 204 |   | 
        
           | 1326 | alexandre_ | 205 |   | 
        
           |  |  | 206 |   | 
        
           | 448 | ddelon | 207 |     function run( )
 | 
        
           |  |  | 208 |     {
 | 
        
           | 1326 | alexandre_ | 209 |         // On teste en premier la presence d un appel vers un service
 | 
        
           |  |  | 210 |         if ($this->_service != '') {
 | 
        
           |  |  | 211 |         	if (file_exists(PROJET_CHEMIN_APPLI.'services/'.$this->_service.'.php')) {
 | 
        
           | 1645 | alexandre_ | 212 |                 return include_once PROJET_CHEMIN_APPLI.'services/'.$this->_service.'.php' ;
 | 
        
           | 1326 | alexandre_ | 213 |             }
 | 
        
           |  |  | 214 |         }
 | 
        
           |  |  | 215 |   | 
        
           | 448 | ddelon | 216 |         if ($this->_action == '') {
 | 
        
           |  |  | 217 |             return $this->messageErreur(PROJETCONTROLEUR_ACTION_INVALIDE) ;
 | 
        
           |  |  | 218 |         }
 | 
        
           | 598 | ddelon | 219 |   | 
        
           | 1471 | alexandre_ | 220 |         // Si il n'y a pas d'action mais un projet, on transmet par defaut l'action PROJET_VOIR
 | 
        
           | 448 | ddelon | 221 |         if ($this->_id_projet != "" && $this->_action == PROJET_DEFAUT) {
 | 
        
           |  |  | 222 |             $this->_action = PROJET_ACTION_VOIR_RESUME ;
 | 
        
           |  |  | 223 |             $this->_url->addQueryString (PROJET_VARIABLE_ID_PROJET, $this->_id_projet) ;
 | 
        
           |  |  | 224 |         }
 | 
        
           |  |  | 225 |         if ($this->_id_document != "") {
 | 
        
           |  |  | 226 |             $this->_url->addQueryString (PROJET_VARIABLE_ID_DOCUMENT, $this->_id_document) ;
 | 
        
           |  |  | 227 |         }
 | 
        
           | 474 | alexandre_ | 228 |         if ($this->_id_repertoire != '') {
 | 
        
           |  |  | 229 |             $this->_url->addQueryString (PROJET_VARIABLE_ID_REPERTOIRE, $this->_id_repertoire) ;
 | 
        
           |  |  | 230 |         }
 | 
        
           | 448 | ddelon | 231 |         $retour = '' ;
 | 
        
           |  |  | 232 |         if (!defined('PROJET_MENU_AFFICHER_CONTENU_CORPS')) $retour = $this->menuGeneral() ;
 | 
        
           | 598 | ddelon | 233 |   | 
        
           | 448 | ddelon | 234 |         switch ($this->_action) {
 | 
        
           |  |  | 235 |             case PROJET_DEFAUT :
 | 
        
           |  |  | 236 |                 $retour .= $this->mesProjets() ;
 | 
        
           |  |  | 237 |             break ;
 | 
        
           |  |  | 238 |             case PROJET_VOIR :
 | 
        
           |  |  | 239 |                 $retour .= $this->accueilProjet();
 | 
        
           |  |  | 240 |             break ;
 | 
        
           |  |  | 241 |             case PROJET_NOUVEAU :
 | 
        
           |  |  | 242 |                 $retour .= $this->formulaireProjet(PROJET_NOUVEAU_V) ;
 | 
        
           |  |  | 243 |             break ;
 | 
        
           |  |  | 244 |             case PROJET_NOUVEAU_V :
 | 
        
           |  |  | 245 |                 $retour .= $this->nouveauProjetValidation().$this->mesProjets() ;
 | 
        
           |  |  | 246 |             break ;
 | 
        
           |  |  | 247 |             case PROJET_NOUVEAU_FICHIER :
 | 
        
           |  |  | 248 |                 $retour .= $this->formulaireFichier(PROJET_NOUVEAU_FICHIER) ;
 | 
        
           |  |  | 249 |             break ;
 | 
        
           |  |  | 250 |             case PROJET_ACTION_MODIFIER :
 | 
        
           |  |  | 251 |                 $retour .= $this->formulaireFichier (PROJET_ACTION_MODIFIER) ;
 | 
        
           |  |  | 252 |             break ;
 | 
        
           |  |  | 253 |             case PROJET_ACTION_MODIFIER_V :
 | 
        
           |  |  | 254 |                 $retour .= $this->modifierFichier () ;
 | 
        
           |  |  | 255 |                 $this->_action = PROJET_ACTION_VOIR_DOCUMENT ;
 | 
        
           |  |  | 256 |             break ;
 | 
        
           |  |  | 257 |             case PROJET_NOUVEAU_FICHIER_V :
 | 
        
           |  |  | 258 |                 $retour .= $this->nouveauFichierValidation() ;
 | 
        
           |  |  | 259 |                 $this->_action = PROJET_ACTION_VOIR_DOCUMENT ;
 | 
        
           |  |  | 260 |             break ;
 | 
        
           |  |  | 261 |             case PROJET_ACTION_COUPER :
 | 
        
           |  |  | 262 |                 $retour .= $this->fichierCouper() ;
 | 
        
           |  |  | 263 |                 $this->_action = PROJET_ACTION_VOIR_DOCUMENT ;
 | 
        
           |  |  | 264 |             break ;
 | 
        
           |  |  | 265 |             case PROJET_SUPPRESSION_PROJET :
 | 
        
           |  |  | 266 |                 $retour .= $this->suppressionProjet().$this->mesProjets() ;
 | 
        
           |  |  | 267 |             break ;
 | 
        
           |  |  | 268 |             case PROJET_NOUVEAU_REPERTOIRE :
 | 
        
           |  |  | 269 |                 $retour .= $this->nouveauRepertoire() ;
 | 
        
           |  |  | 270 |             break ;
 | 
        
           |  |  | 271 |             case PROJET_NOUVEAU_REPERTOIRE_V :
 | 
        
           | 474 | alexandre_ | 272 |                 $retour .= $this->nouveauRepertoireValidation() ;
 | 
        
           |  |  | 273 |                 $this->_action = PROJET_ACTION_VOIR_DOCUMENT ;
 | 
        
           | 448 | ddelon | 274 |             break ;
 | 
        
           |  |  | 275 |             case PROJET_SUPPRESSION_FICHIER :
 | 
        
           |  |  | 276 |                 $retour .=$this->suppressionFichier() ;
 | 
        
           |  |  | 277 |                 $this->_action = PROJET_ACTION_VOIR_DOCUMENT ;
 | 
        
           |  |  | 278 |             break ;
 | 
        
           |  |  | 279 |             case PROJET_ENVOYER_UN_MAIL :
 | 
        
           |  |  | 280 |                 $retour .= $this->envoyerUnMailFormulaire() ;
 | 
        
           |  |  | 281 |             break ;
 | 
        
           |  |  | 282 |             case PROJET_ENVOYER_UN_MAIL_V :
 | 
        
           |  |  | 283 |                 $retour .= $this->envoyerUnMailValidation() ;
 | 
        
           |  |  | 284 |                 $this->_action = PROJET_ACTION_VOIR_FORUM ;
 | 
        
           |  |  | 285 |             break ;
 | 
        
           |  |  | 286 |             case PROJET_ACTION_NOUVELLE_LISTE : $retour .= $this->formulaireListe(PROJET_ACTION_NOUVELLE_LISTE) ;
 | 
        
           |  |  | 287 |             break ;
 | 
        
           |  |  | 288 |             case PROJET_ACTION_NOUVELLE_LISTE_V : $retour .= $this->nouvelleListeValidation() ;
 | 
        
           |  |  | 289 |                 $this->_action = PROJET_ACTION_VOIR_FORUM ;
 | 
        
           |  |  | 290 |             break ;
 | 
        
           |  |  | 291 |             case PROJET_ACTION_SUPPRIMER_LISTE : $retour .= $this->supprimerListe() ;
 | 
        
           |  |  | 292 |                 $this->_action = PROJET_ACTION_VOIR_RESUME ;
 | 
        
           |  |  | 293 |             break ;
 | 
        
           |  |  | 294 |             case PROJET_MODIFIER_DESCRIPTION : $retour .= $this->formulaireProjet(PROJET_MODIFIER_DESCRIPTION_V) ;
 | 
        
           |  |  | 295 |             break ;
 | 
        
           |  |  | 296 |             case PROJET_MODIFIER_DESCRIPTION_V : $retour .= $this->modifierProjet() ;
 | 
        
           |  |  | 297 |                 $this->_action = PROJET_ACTION_VOIR_RESUME ;
 | 
        
           |  |  | 298 |             break ;
 | 
        
           |  |  | 299 |             case  PROJET_ACTION_S_INSCRIRE : $retour .= $this->inscriptionProjet() ;
 | 
        
           | 598 | ddelon | 300 |   | 
        
           | 448 | ddelon | 301 |             break ;
 | 
        
           |  |  | 302 |             case PROJET_ACTION_DESINSCRIPTION_PROJET : $retour .= $this->desinscriptionProjet() ;
 | 
        
           |  |  | 303 |             break ;
 | 
        
           |  |  | 304 |             case PROJET_ACTION_CREER_WIKI : $retour .= $this->formulaireWiki() ;
 | 
        
           |  |  | 305 |             break ;
 | 
        
           | 474 | alexandre_ | 306 |             case PROJET_ACTION_CREER_WIKI_V : $retour .= $this->creationWiki() ;
 | 
        
           |  |  | 307 |                 $this->_action = PROJET_ACTION_VOIR_RESUME ;
 | 
        
           | 448 | ddelon | 308 |             break ;
 | 
        
           | 487 | ddelon | 309 |             case PROJET_ACTION_ASSOCIER_WIKI : $retour .= $this->associerWiki() ;
 | 
        
           |  |  | 310 |             break ;
 | 
        
           |  |  | 311 |             case PROJET_ACTION_ASSOCIER_WIKI_V : $retour .= $this->associationWiki() ;
 | 
        
           | 635 | alexandre_ | 312 |             	$this->_action = PROJET_ACTION_VOIR_RESUME ;
 | 
        
           | 487 | ddelon | 313 |             break ;
 | 
        
           | 474 | alexandre_ | 314 |             case PROJET_ACTION_SUPPRIMER_WIKI : $retour .= $this->supprimerWiki();
 | 
        
           |  |  | 315 |                 $this->_action = PROJET_ACTION_VOIR_RESUME ;
 | 
        
           | 448 | ddelon | 316 |             break ;
 | 
        
           |  |  | 317 |             case PROJET_ACTION_INSCRIPTION_LISTE : $retour .= $this->inscriptionListe() ;
 | 
        
           | 616 | alexandre_ | 318 |                 $this->_action = PROJET_ACTION_VOIR_FORUM ;
 | 
        
           | 448 | ddelon | 319 |             break ;
 | 
        
           |  |  | 320 |             case PROJET_ACTION_DESINSCRIPTION_LISTE : $retour .= $this->desinscriptionListe() ;
 | 
        
           | 616 | alexandre_ | 321 |                 $this->_action = PROJET_ACTION_VOIR_FORUM ;
 | 
        
           | 448 | ddelon | 322 |             break ;
 | 
        
           |  |  | 323 |             case PROJET_ACTION_REFERENCER_LISTE : $retour .= $this->referencerListeExterne() ;
 | 
        
           |  |  | 324 |             break ;
 | 
        
           | 474 | alexandre_ | 325 |             case PROJET_ACTION_REFERENCER_LISTE_V : $retour .= $this->referencerListeExterneValidation() ;
 | 
        
           |  |  | 326 |                 $this->_action = PROJET_ACTION_VOIR_RESUME ;
 | 
        
           | 448 | ddelon | 327 |             break ;
 | 
        
           | 598 | ddelon | 328 |   | 
        
           | 448 | ddelon | 329 |         }
 | 
        
           |  |  | 330 |         if (!is_int($this->_action)) {
 | 
        
           |  |  | 331 |             if (file_exists(PROJET_CHEMIN_APPLI.'actions/'.$this->_action.'.php')) {
 | 
        
           |  |  | 332 |                 include_once PROJET_CHEMIN_APPLI.'actions/'.$this->_action.'.php' ;
 | 
        
           |  |  | 333 |             }
 | 
        
           |  |  | 334 |         }
 | 
        
           |  |  | 335 |         return $retour ;
 | 
        
           |  |  | 336 |     } // end of member function run
 | 
        
           |  |  | 337 |   | 
        
           |  |  | 338 |     /**
 | 
        
           |  |  | 339 |      * Permet de fixer la valeur de l'action pour l'objet projetControleur. Cette action
 | 
        
           | 1471 | alexandre_ | 340 |      * provient generalement de $_POST['action'] ou $_GET['action']
 | 
        
           | 448 | ddelon | 341 |      *
 | 
        
           |  |  | 342 |      * @param int action L'action à passer provient de l'URL.
 | 
        
           |  |  | 343 |      * @return void
 | 
        
           |  |  | 344 |      * @access public
 | 
        
           |  |  | 345 |      */
 | 
        
           |  |  | 346 |     function setAction( $action )
 | 
        
           |  |  | 347 |     {
 | 
        
           |  |  | 348 |         $this->_action = $action ;
 | 
        
           |  |  | 349 |     } // end of member function setAction
 | 
        
           |  |  | 350 |   | 
        
           | 1326 | alexandre_ | 351 | 	/**
 | 
        
           |  |  | 352 |      * Permet de fixer la valeur de du service pour l'objet projetControleur. Ce service
 | 
        
           |  |  | 353 |      * provient généralement de $_POST['service'] ou $_GET['service']
 | 
        
           |  |  | 354 |      *
 | 
        
           |  |  | 355 |      * @param int service Le service à appeler provient de l'URL.
 | 
        
           |  |  | 356 |      * @return void
 | 
        
           |  |  | 357 |      * @access public
 | 
        
           |  |  | 358 |      */
 | 
        
           |  |  | 359 |     function setService( $service )
 | 
        
           |  |  | 360 |     {
 | 
        
           |  |  | 361 |         $this->_service = $service ;
 | 
        
           |  |  | 362 |     } // end of member function setAction
 | 
        
           |  |  | 363 |   | 
        
           |  |  | 364 |   | 
        
           | 448 | ddelon | 365 |     /**
 | 
        
           | 598 | ddelon | 366 |      * Constructeur.
 | 
        
           | 448 | ddelon | 367 |      *
 | 
        
           |  |  | 368 |      * @return void
 | 
        
           |  |  | 369 |      * @access public
 | 
        
           |  |  | 370 |      */
 | 
        
           |  |  | 371 |     function projetControleur(&$dbObjet, &$authObjet, $urlObjet = "")
 | 
        
           |  |  | 372 |     {
 | 
        
           |  |  | 373 |         $this->_db = $dbObjet ;
 | 
        
           |  |  | 374 |         $this->_auth = $authObjet ;
 | 
        
           |  |  | 375 |         $this->_id_repertoire = 0 ;
 | 
        
           | 474 | alexandre_ | 376 |         $this->_type = '' ;
 | 
        
           | 448 | ddelon | 377 |         if (is_object ($urlObjet)) {
 | 
        
           |  |  | 378 |             $this->_url = $urlObjet ;
 | 
        
           |  |  | 379 |         }
 | 
        
           |  |  | 380 |     } // end of member function projetControleur
 | 
        
           | 598 | ddelon | 381 |   | 
        
           | 448 | ddelon | 382 |     /**
 | 
        
           | 1336 | neiluj | 383 |      * Renvoie la liste des projets auquel participe la personne loguée, avec son
 | 
        
           | 448 | ddelon | 384 |      * statut et un lien vers l'action pour gérer le projet.
 | 
        
           |  |  | 385 |      *
 | 
        
           |  |  | 386 |      * @return string
 | 
        
           |  |  | 387 |      * @access public
 | 
        
           |  |  | 388 |      */
 | 
        
           |  |  | 389 |     function mesProjets( )
 | 
        
           |  |  | 390 |     {
 | 
        
           | 534 | alexandre_ | 391 |     	$res = '' ;
 | 
        
           | 1336 | neiluj | 392 |     	include_once PROJET_CHEMIN_CLASSES.'participe.class.php' ;
 | 
        
           |  |  | 393 |         include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
 | 
        
           | 448 | ddelon | 394 |         $participant = new participe ($this->_db) ;
 | 
        
           | 598 | ddelon | 395 |   | 
        
           | 1471 | alexandre_ | 396 |       // Les entetes des tableaux
 | 
        
           | 448 | ddelon | 397 |         $tableau_label_statut_action = array (PROJET_GERER, PROJET_GERER, PROJET_GERER_FICHIER, PROJET_VOIR_FICHIER, "---") ;
 | 
        
           | 598 | ddelon | 398 |   | 
        
           | 448 | ddelon | 399 |         $auth = $this->_auth->getAuth() ;                       // Pour raccourcir le code
 | 
        
           |  |  | 400 |         $id_u = $this->_auth->getAuthData(PROJET_CHAMPS_ID) ;   // --------------
 | 
        
           | 616 | alexandre_ | 401 |   | 
        
           |  |  | 402 | 		return include_once PROJET_CHEMIN_APPLI.'presentation/'.$this->_presentation.'.php' ;
 | 
        
           |  |  | 403 |   | 
        
           | 1336 | neiluj | 404 |     }
 | 
        
           | 448 | ddelon | 405 |   | 
        
           |  |  | 406 |     /**
 | 
        
           | 1471 | alexandre_ | 407 |      * Renvoie le menu general de l'application projet. Avec differents liens selon le
 | 
        
           | 448 | ddelon | 408 |      * statut de l'utilisateur.
 | 
        
           |  |  | 409 |      *
 | 
        
           |  |  | 410 |      * @return string
 | 
        
           |  |  | 411 |      * @access public
 | 
        
           |  |  | 412 |      */
 | 
        
           |  |  | 413 |     function menuGeneral( )
 | 
        
           |  |  | 414 |     {
 | 
        
           |  |  | 415 |         $res = '' ;
 | 
        
           |  |  | 416 |         $auth = $this->_auth->getAuth() ;
 | 
        
           |  |  | 417 |         if (!$auth) return ;
 | 
        
           |  |  | 418 |         $res .= '<div class="menu_projet">'."\n";
 | 
        
           | 1336 | neiluj | 419 |         include_once PROJET_CHEMIN_CLASSES.'participe.class.php' ;
 | 
        
           | 448 | ddelon | 420 |         $participant = new participe($this->_db) ;
 | 
        
           | 683 | alexandre_ | 421 |         if ($participant->isAdministrateur($this->_auth->getAuthData(PROJET_CHAMPS_ID))) {
 | 
        
           |  |  | 422 |             $isAdm = 1; $isCoord = 1 ; $isContri = 1 ;
 | 
        
           | 448 | ddelon | 423 |             $label_statut = PROJET_ADMINISTRATEUR;
 | 
        
           |  |  | 424 |         } else {
 | 
        
           |  |  | 425 |             $isAdm = 0 ; $isCoord = 0 ; $isContri = 0 ;
 | 
        
           |  |  | 426 |         }
 | 
        
           |  |  | 427 |   | 
        
           | 1471 | alexandre_ | 428 |         // Les menus specifiques aux projets
 | 
        
           | 683 | alexandre_ | 429 |         if ($this->_id_projet != '') {
 | 
        
           | 448 | ddelon | 430 |             if (!$isCoord) {
 | 
        
           |  |  | 431 |                 $isCoord = $participant->isCoordinateur($this->_auth->getAuthData(PROJET_CHAMPS_ID), $this->_id_projet, $this->_db) ;
 | 
        
           |  |  | 432 |                 if ($isCoord) {
 | 
        
           |  |  | 433 |                     $label_statut = PROJET_CHEF ;
 | 
        
           |  |  | 434 |                     $isContri = true ;
 | 
        
           |  |  | 435 |                 }
 | 
        
           |  |  | 436 |             }
 | 
        
           | 607 | alexandre_ | 437 |             if (!$isContri && !$isAdm) {
 | 
        
           | 448 | ddelon | 438 |                 $isContri = $participant->isContributeur($this->_auth->getAuthData(PROJET_CHAMPS_ID), $this->_id_projet, $this->_db) ;
 | 
        
           |  |  | 439 |                 if ($isContri) {
 | 
        
           |  |  | 440 |                     $label_statut = PROJET_VOUS_PARTICIPEZ ;
 | 
        
           |  |  | 441 |                 } else {
 | 
        
           |  |  | 442 |                     $label_statut = PROJET_VOUS_N_ETES_PAS_INSCRIT ;
 | 
        
           |  |  | 443 |                 }
 | 
        
           |  |  | 444 |             }
 | 
        
           | 888 | alexandre_ | 445 |             if ($participant->isEnAttente($this->_auth->getAuthData(PROJET_CHAMPS_ID),$this->_id_projet,$this->_db)) {
 | 
        
           |  |  | 446 |             	$isEnAttente = true ;
 | 
        
           |  |  | 447 |             	$label_statut = PROJET_EN_ATTENTE ;
 | 
        
           |  |  | 448 |             } else {
 | 
        
           |  |  | 449 |             	$isEnAttente = false ;
 | 
        
           |  |  | 450 |             }
 | 
        
           | 448 | ddelon | 451 |         }
 | 
        
           |  |  | 452 |   | 
        
           |  |  | 453 |         if ($isContri || $isAdm) {
 | 
        
           |  |  | 454 |             $res .= '<h2>' ;
 | 
        
           |  |  | 455 |             if ($isAdm) $res .= PROJET_VOUS_ETES.' ' ;
 | 
        
           |  |  | 456 |             $res .= $label_statut.'</h2>'."\n" ;
 | 
        
           | 607 | alexandre_ | 457 |   | 
        
           | 448 | ddelon | 458 |         } else {
 | 
        
           |  |  | 459 |             if ($this->_id_projet != '') $res .= '<h2>'.$label_statut.'</h2>'."\n" ;
 | 
        
           |  |  | 460 |         }
 | 
        
           | 607 | alexandre_ | 461 |   | 
        
           | 448 | ddelon | 462 |         if ($this->_id_projet != '') {
 | 
        
           | 1336 | neiluj | 463 |         	include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
 | 
        
           | 607 | alexandre_ | 464 |         	$projet = new projet ($this->_db, $this->_id_projet) ;
 | 
        
           |  |  | 465 | 			// Participant
 | 
        
           | 888 | alexandre_ | 466 | 			if (!$isEnAttente) {
 | 
        
           |  |  | 467 | 				$res .= '<ul id ="projet_groupe_niv1"><li class="projet_niv1">'.PROJET_CONTRIBUTEUR ;
 | 
        
           |  |  | 468 | 				$res .= '<ul id="projet_groupe_niv2_con">' ;
 | 
        
           |  |  | 469 | 			}
 | 
        
           | 607 | alexandre_ | 470 | 	        if ($isCoord || $isContri) {
 | 
        
           |  |  | 471 | 	        	$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_DESINSCRIPTION_PROJET) ;
 | 
        
           | 710 | alexandre_ | 472 | 	        	$res .= '<li class="projet_niv2"><a href="'.$this->_url->getURL().'">'.PROJET_SE_DESINSCRIRE."</a></li>\n" ;
 | 
        
           | 607 | alexandre_ | 473 | 	        } else {
 | 
        
           |  |  | 474 | 	        	$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_S_INSCRIRE) ;
 | 
        
           | 888 | alexandre_ | 475 | 	        	if (!$isEnAttente) $res .= '<li class="projet_niv2"><a href="'.
 | 
        
           |  |  | 476 | 	        						$this->_url->getURL().'">'.PROJET_S_INSCRIRE_AU_PROJET."</a></li>\n" ;
 | 
        
           | 607 | alexandre_ | 477 | 	        }
 | 
        
           | 1471 | alexandre_ | 478 | 	        // L'action gerer les utilisateurs
 | 
        
           | 607 | alexandre_ | 479 | 	        if ($isCoord || $isAdm) {
 | 
        
           |  |  | 480 | 	            $this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_VOIR_PARTICIPANT) ;
 | 
        
           | 710 | alexandre_ | 481 | 	            $res .= '<li class="projet_niv2"><a href="'.$this->_url->getURL().'">'.PROJET_GESTION_UTILISATEUR."</a></li>\n" ;
 | 
        
           | 607 | alexandre_ | 482 | 	        }
 | 
        
           |  |  | 483 | 	        $res .= '</ul></li>' ;
 | 
        
           |  |  | 484 |   | 
        
           |  |  | 485 | 	        //document
 | 
        
           |  |  | 486 | 	        if ($isContri || $isCoord || $isAdm) {
 | 
        
           | 1471 | alexandre_ | 487 |   | 
        
           |  |  | 488 | 		        // On ajoute l id d un repertoire s il existe
 | 
        
           |  |  | 489 | 		        if (isset($this->_id_repertoire)) $this->_url->addQueryString ('id_repertoire', $this->_id_repertoire);
 | 
        
           | 710 | alexandre_ | 490 | 		        $res .= '<li class="projet_niv2">'.PROJET_DOCUMENT ;
 | 
        
           | 607 | alexandre_ | 491 | 		        // L'action "Mettre un fichier en ligne"
 | 
        
           |  |  | 492 | 		        $this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_NOUVEAU_FICHIER) ;
 | 
        
           | 710 | alexandre_ | 493 | 		        $res .= '<ul><li class="projet_niv2"><a href="'.$this->_url->getURL().'">'.PROJET_METTRE_FICHIER."</a></li>\n" ;
 | 
        
           | 607 | alexandre_ | 494 |   | 
        
           | 1471 | alexandre_ | 495 | 		        // L'action creer un repertoire
 | 
        
           | 607 | alexandre_ | 496 | 		        $this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_NOUVEAU_REPERTOIRE) ;
 | 
        
           | 710 | alexandre_ | 497 | 		        $res .= '<li class="projet_niv2"><a href="'.$this->_url->getURL().'">'.PROJET_CREER_REP."</a></li>\n" ;
 | 
        
           | 607 | alexandre_ | 498 | 				$res .= '</ul></li>' ;
 | 
        
           |  |  | 499 |   | 
        
           | 1471 | alexandre_ | 500 | 	        	$this->_url->removeQueryString('id_repertoire');
 | 
        
           | 607 | alexandre_ | 501 | 				// Forum
 | 
        
           | 710 | alexandre_ | 502 | 				$res .= '<li class="projet_niv1">'.PROJET_FORUM ;
 | 
        
           | 683 | alexandre_ | 503 | 				$res .= '<ul id="projet_groupe_niv2_for">' ;
 | 
        
           | 607 | alexandre_ | 504 | 				if ($projet->avoirListe()) {
 | 
        
           |  |  | 505 |   | 
        
           | 1471 | alexandre_ | 506 | 					// On verifie si l'utilisateur est inscrit ou non a la liste et on ajoute le lien
 | 
        
           | 607 | alexandre_ | 507 | 		            //$projet->getListesAssociees();
 | 
        
           |  |  | 508 |   | 
        
           |  |  | 509 | 		            include_once PROJET_CHEMIN_CLASSES.'inscription_liste.class.php';
 | 
        
           |  |  | 510 | 		            foreach ($projet->_listes_associes as $info_liste) {
 | 
        
           |  |  | 511 |   | 
        
           |  |  | 512 | 		                $inscription_liste = new inscription_liste($this->_db) ;
 | 
        
           |  |  | 513 | 		                if ($inscription_liste->getStatutInscrit($info_liste->getId(),  $this->_auth) == 0) {
 | 
        
           |  |  | 514 | 		                    $action_inscription = PROJET_ACTION_INSCRIPTION_LISTE ;
 | 
        
           |  |  | 515 | 		                    $label_inscription = PROJET_RECEVOIR_MESSAGES ;
 | 
        
           |  |  | 516 | 		                } else {
 | 
        
           |  |  | 517 | 		                    // L'action envoyer un mail
 | 
        
           |  |  | 518 | 		                    $this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ENVOYER_UN_MAIL) ;
 | 
        
           | 710 | alexandre_ | 519 | 		                    $res .= '<li class="projet_niv2"><a href="'.$this->_url->getURL().'">'.PROJET_ECRIRE_LISTE.'</a></li>'."\n" ;
 | 
        
           | 607 | alexandre_ | 520 | 		                    $action_inscription = PROJET_ACTION_DESINSCRIPTION_LISTE ;
 | 
        
           |  |  | 521 | 		                    $label_inscription = PROJET_NE_PAS_RECEVOIR_MESSAGES ;
 | 
        
           |  |  | 522 | 		                }
 | 
        
           |  |  | 523 | 		                $this->_url->addQueryString(PROJET_VARIABLE_ACTION, $action_inscription) ;
 | 
        
           | 710 | alexandre_ | 524 | 		                $res .= '<li class="projet_niv2"><a href="'.$this->_url->getURL().'">';
 | 
        
           | 607 | alexandre_ | 525 | 		                $res .= $label_inscription.'</a></li> ';
 | 
        
           |  |  | 526 | 		            }
 | 
        
           | 1135 | alexandre_ | 527 | 		            if ($isAdm || (PROJET_UTILISATEURS_COORD && $isCoord)) {
 | 
        
           | 607 | alexandre_ | 528 | 		                $this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_SUPPRIMER_LISTE) ;
 | 
        
           |  |  | 529 | 		                $texte_liste = PROJET_SUPPRIMER_LISTE ;
 | 
        
           |  |  | 530 | 		                $onclic = ' onclick="javascript:return confirm(\''.PROJET_SUPPRIMER_LISTE_CONFIRMATION.'\');"' ;
 | 
        
           | 710 | alexandre_ | 531 | 		                $res .= '<li class="projet_niv2"><a href="'.$this->_url->getURL().'"'.$onclic.'>'.$texte_liste.'</a></li>'."\n" ;
 | 
        
           | 607 | alexandre_ | 532 | 		            }
 | 
        
           | 683 | alexandre_ | 533 |   | 
        
           | 607 | alexandre_ | 534 | 				} else {
 | 
        
           | 664 | alexandre_ | 535 | 					if ($isAdm || $isCoord) {
 | 
        
           | 607 | alexandre_ | 536 | 			        	$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_NOUVELLE_LISTE) ;
 | 
        
           |  |  | 537 | 		                $texte_liste = PROJET_CREER_LISTE ;
 | 
        
           |  |  | 538 | 		                $onclic = '' ;
 | 
        
           | 710 | alexandre_ | 539 | 		                $res .= '<li class="projet_niv2"><a href="'.$this->_url->getURL().'"'.$onclic.'>'.$texte_liste.'</a></li>'."\n" ;
 | 
        
           | 607 | alexandre_ | 540 | 					}
 | 
        
           |  |  | 541 | 				}
 | 
        
           |  |  | 542 | 				if ($isAdm) {
 | 
        
           |  |  | 543 | 					$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_REFERENCER_LISTE) ;
 | 
        
           | 710 | alexandre_ | 544 | 			        $res .= '<li class="projet_niv2"><a href="'.$this->_url->getURL().'">'.PROJET_REFERENCER_LISTE.'</a></li>'."\n" ;
 | 
        
           | 683 | alexandre_ | 545 |   | 
        
           | 607 | alexandre_ | 546 | 				}
 | 
        
           | 683 | alexandre_ | 547 | 				$res .= '</ul></li>' ;
 | 
        
           | 607 | alexandre_ | 548 | 	        }
 | 
        
           |  |  | 549 | 			// Gestion projet
 | 
        
           |  |  | 550 | 			if ($isCoord || $isAdm) {
 | 
        
           | 710 | alexandre_ | 551 | 				$res .= '<li class="projet_niv1">'.PROJET_GESTION_PROJET ;
 | 
        
           | 683 | alexandre_ | 552 | 				$res .= '<ul id="projet_group_niv2_ges">' ;
 | 
        
           | 607 | alexandre_ | 553 | 				// L'action modifier les propriétés du projet
 | 
        
           |  |  | 554 | 	            $this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_MODIFIER_DESCRIPTION) ;
 | 
        
           | 710 | alexandre_ | 555 | 	            $res .= '<li class="projet_niv2"><a href="'.$this->_url->getURL().'">'.PROJET_MODIFIER_PROPRIETES."</a></li>\n" ;
 | 
        
           | 1177 | alexandre_ | 556 | 	            if ($isAdm || (PROJET_UTILISATEURS_COORD && $isCoord)) {
 | 
        
           | 607 | alexandre_ | 557 | 		            $this->_url->removeQueryString (PROJET_VARIABLE_ID_PROJET) ;
 | 
        
           |  |  | 558 | 		            $this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_NOUVEAU) ;
 | 
        
           | 710 | alexandre_ | 559 | 		            $res .= '<li class="projet_niv2"><a href="'.$this->_url->getURL().'">'.PROJET_NOUVEAU_PROJET.'</a></li>'."\n" ;
 | 
        
           | 607 | alexandre_ | 560 | 		            $this->_url->removeQueryString(PROJET_VARIABLE_ACTION) ;
 | 
        
           |  |  | 561 |   | 
        
           |  |  | 562 | 		                // L'action supprimer le projet
 | 
        
           | 448 | ddelon | 563 |                     $this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_SUPPRESSION_PROJET) ;
 | 
        
           |  |  | 564 |                     $this->_url->addQueryString(PROJET_VARIABLE_ID_PROJET, $this->_id_projet) ;
 | 
        
           | 710 | alexandre_ | 565 |                     $res .= '<li class="projet_niv2"><a href="'.$this->_url->getURL().'" onclick="javascript:return confirm(\''.PROJET_SUPPRIMER_PROJET_CONFIRMATION.'\');">'
 | 
        
           | 448 | ddelon | 566 |                                 .PROJET_SUPPRIMER_LE_PROJET."</a></li>\n" ;
 | 
        
           | 607 | alexandre_ | 567 | 		        }
 | 
        
           |  |  | 568 | 	            $res .= '</ul></li>' ;
 | 
        
           |  |  | 569 | 			}
 | 
        
           |  |  | 570 |   | 
        
           |  |  | 571 | 			// Wikini
 | 
        
           | 683 | alexandre_ | 572 | 			if ($isAdm || $isCoord) {
 | 
        
           | 710 | alexandre_ | 573 | 				$res .= '<li class="projet_niv1">'.PROJET_WIKINI ;
 | 
        
           | 607 | alexandre_ | 574 | 	           	$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_CREER_WIKI) ;
 | 
        
           | 710 | alexandre_ | 575 | 	           	$res .= '<ul><li class="projet_niv2"><a href="'.$this->_url->getURL()."\">".PROJET_CREER_WIKI."</a></li>\n" ;
 | 
        
           | 607 | alexandre_ | 576 | 				// L'action choisir un wikini
 | 
        
           |  |  | 577 | 	            $this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_ASSOCIER_WIKI) ;
 | 
        
           | 710 | alexandre_ | 578 | 	            $res .= '<li class="projet_niv2"><a href="'.$this->_url->getURL()."\">".PROJET_ASSOCIER_WIKI."</a></li>\n" ;
 | 
        
           | 607 | alexandre_ | 579 | 	            $res .= '</ul></li>' ;
 | 
        
           |  |  | 580 | 			}
 | 
        
           |  |  | 581 |         } else {
 | 
        
           |  |  | 582 |         	if ($isAdm) {
 | 
        
           | 710 | alexandre_ | 583 |         		$res .= '<li class="projet_niv1">'.PROJET_GESTION_PROJET ;
 | 
        
           | 607 | alexandre_ | 584 | 		 		$res .= '<ul>' ;
 | 
        
           |  |  | 585 |       			$this->_url->removeQueryString (PROJET_VARIABLE_ID_PROJET) ;
 | 
        
           |  |  | 586 | 		        $this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_NOUVEAU) ;
 | 
        
           | 710 | alexandre_ | 587 | 		        $res .= '<li class="projet_niv2"><a href="'.$this->_url->getURL().'">'.PROJET_NOUVEAU_PROJET.'</a></li>'."\n" ;
 | 
        
           | 607 | alexandre_ | 588 | 		        $this->_url->removeQueryString(PROJET_VARIABLE_ACTION) ;
 | 
        
           |  |  | 589 | 		        $res .= '</ul></li>' ;
 | 
        
           |  |  | 590 |         	}
 | 
        
           | 448 | ddelon | 591 |         }
 | 
        
           | 607 | alexandre_ | 592 |         $res .= '</ul>' ;
 | 
        
           | 448 | ddelon | 593 |         $res .= "</div>\n" ;
 | 
        
           | 616 | alexandre_ | 594 |         $this->_url->removeQueryString (PROJET_VARIABLE_ACTION) ;
 | 
        
           | 448 | ddelon | 595 |         return $res ;
 | 
        
           |  |  | 596 |     } // end of member function menuGeneral
 | 
        
           |  |  | 597 |   | 
        
           |  |  | 598 |     /**
 | 
        
           | 1471 | alexandre_ | 599 |      * Renvoie le formulaire de cretion d'un projet.
 | 
        
           | 448 | ddelon | 600 |      *
 | 
        
           |  |  | 601 |      * @return string
 | 
        
           |  |  | 602 |      * @access public
 | 
        
           |  |  | 603 |      */
 | 
        
           |  |  | 604 |     function formulaireProjet($action)
 | 
        
           |  |  | 605 |     {
 | 
        
           | 966 | alexandre_ | 606 | 	    	if (!$this->_auth->getAuth()) {
 | 
        
           |  |  | 607 | 	    		return PROJET_TEXTE_NON_IDENTIFIE;
 | 
        
           |  |  | 608 | 	    	}
 | 
        
           |  |  | 609 |   | 
        
           |  |  | 610 | 	    	if (fileperms(PROJET_CHEMIN_FICHIER) & 0x0002) {
 | 
        
           |  |  | 611 | 	        $this->_url->addQueryString(PROJET_VARIABLE_ACTION, $action) ;
 | 
        
           | 1336 | neiluj | 612 | 	        include_once PROJET_CHEMIN_CLASSES.'HTML_formulaireProjet.class.php' ;
 | 
        
           | 966 | alexandre_ | 613 | 	        $formulaire_projet = new HTML_formulaireProjet('formulaire_projet', 'post',str_replace ("&", "&", $this->_url->getURL())) ;
 | 
        
           |  |  | 614 | 	        $tableau_type = '' ;
 | 
        
           |  |  | 615 | 	        if (PROJET_UTILISE_TYPE) {
 | 
        
           |  |  | 616 | 	            include_once PROJET_CHEMIN_CLASSES.'projet_type.class.php' ;
 | 
        
           |  |  | 617 | 	            $tableau_type = projet_type::getTousLesTypes($this->_db) ;
 | 
        
           |  |  | 618 | 	        }
 | 
        
           | 1336 | neiluj | 619 | 	        include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
 | 
        
           | 966 | alexandre_ | 620 | 	        $formulaire_projet->construitFormulaire(projet::getTousLesProjets($this->_db), $tableau_type) ;
 | 
        
           |  |  | 621 | 	        if ($action == PROJET_MODIFIER_DESCRIPTION_V) {
 | 
        
           |  |  | 622 | 	            $projet = new projet($this->_db, $this->_id_projet) ;
 | 
        
           |  |  | 623 | 	            $valeurs_par_defaut = array (   'projet_titre' => $projet->getTitre(),
 | 
        
           |  |  | 624 | 	                                            'projet_description' => $projet->getDescription(),
 | 
        
           |  |  | 625 | 	                                            'projet_asso' => $projet->getIdPere(),
 | 
        
           |  |  | 626 | 	                                            'projet_wikini' => $projet->getWikini(),
 | 
        
           |  |  | 627 | 	                                            'projet_resume' => $projet->getResume(),
 | 
        
           |  |  | 628 | 	                                            'projet_espace_internet' => $projet->getEspaceInternet(),
 | 
        
           |  |  | 629 | 	                                            'projet_type'=> $projet->getType(),
 | 
        
           |  |  | 630 | 	                                            'projet_moderation' => $projet->isModere()
 | 
        
           |  |  | 631 | 	                                        ) ;
 | 
        
           |  |  | 632 | 	            $formulaire_projet->setDefaults($valeurs_par_defaut) ;
 | 
        
           |  |  | 633 | 	        } else {
 | 
        
           |  |  | 634 | 	        	$formulaire_projet->setDefaults (array ('projet_moderation'=> '0')) ;
 | 
        
           |  |  | 635 | 	        }
 | 
        
           |  |  | 636 | 	        $res = PROJET_PROPOSER_PROJET ;
 | 
        
           |  |  | 637 | 	        return $res . $formulaire_projet->toHTML() ;
 | 
        
           |  |  | 638 | 	    	} else {
 | 
        
           | 1471 | alexandre_ | 639 | 	    		return 'Veuillez régler les permissions en écriture sur '.PROJET_CHEMIN_FICHIER ;
 | 
        
           | 966 | alexandre_ | 640 | 	    	}
 | 
        
           | 448 | ddelon | 641 |     } // end of member function nouveauProjet
 | 
        
           |  |  | 642 |   | 
        
           |  |  | 643 |     /**
 | 
        
           |  |  | 644 |      * Valide le formulaire et appelle la fonction d'insertion.
 | 
        
           |  |  | 645 |      *
 | 
        
           |  |  | 646 |      * @return string
 | 
        
           |  |  | 647 |      * @access public
 | 
        
           |  |  | 648 |      */
 | 
        
           |  |  | 649 |     function nouveauProjetValidation( )
 | 
        
           |  |  | 650 |     {
 | 
        
           |  |  | 651 |         $this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_NOUVEAU_V) ;
 | 
        
           | 1336 | neiluj | 652 |         include_once PROJET_CHEMIN_CLASSES.'HTML_formulaireProjet.class.php' ;
 | 
        
           |  |  | 653 |         include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
 | 
        
           | 448 | ddelon | 654 |         $formulaire_projet = new HTML_formulaireProjet('formulaire_projet', 'post', str_replace ('&', '&', $this->_url->getURL())) ;
 | 
        
           |  |  | 655 |         $formulaire_projet->construitFormulaire(projet::getTousLesProjets($this->_db)) ;
 | 
        
           |  |  | 656 |         if ($formulaire_projet->validate()) {
 | 
        
           | 598 | ddelon | 657 |   | 
        
           | 448 | ddelon | 658 |             $projet = new projet ($this->_db) ;
 | 
        
           |  |  | 659 |             $projet->setCheminRepertoire (PROJET_CHEMIN_FICHIER) ;
 | 
        
           |  |  | 660 |             if (!$projet->enregistrerSQL($formulaire_projet->getSubmitValues())) {
 | 
        
           |  |  | 661 |                 return 'erreur' ;
 | 
        
           |  |  | 662 |             }
 | 
        
           | 534 | alexandre_ | 663 |             // On inscrit le déposant du projet en tant que coordinateur
 | 
        
           |  |  | 664 |             if (PROJET_UTILISATEURS_COORD) {
 | 
        
           |  |  | 665 | 		        // Si le projet n'a pas de liste, on inscrit directement
 | 
        
           | 1336 | neiluj | 666 | 		        include_once PROJET_CHEMIN_CLASSES.'participe.class.php' ;
 | 
        
           | 534 | alexandre_ | 667 | 		        $participant = new participe($this->_db) ;
 | 
        
           |  |  | 668 | 	            $participant->setStatut(1, $this->_auth->getAuthData (PROJET_CHAMPS_ID), $projet->getId()) ;
 | 
        
           |  |  | 669 |             }
 | 
        
           | 448 | ddelon | 670 |         } else {
 | 
        
           |  |  | 671 |             return $formulaire_projet->toHTML() ;
 | 
        
           |  |  | 672 |         }
 | 
        
           | 1471 | alexandre_ | 673 |     }
 | 
        
           | 448 | ddelon | 674 |   | 
        
           |  |  | 675 |     /**
 | 
        
           |  |  | 676 |      * Valide le formulaire et appelle la fonction de mise à jour.
 | 
        
           |  |  | 677 |      *
 | 
        
           |  |  | 678 |      * @return void
 | 
        
           |  |  | 679 |      * @access public
 | 
        
           |  |  | 680 |      */
 | 
        
           |  |  | 681 |     function modifierProjet( )
 | 
        
           |  |  | 682 |     {
 | 
        
           |  |  | 683 |         // création de l'objet projet courant
 | 
        
           | 1336 | neiluj | 684 |         include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
 | 
        
           | 448 | ddelon | 685 |         $projet = new projet ($this->_db, $this->_id_projet) ;
 | 
        
           |  |  | 686 |         $this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_ACTION_MODIFIER_V) ;
 | 
        
           | 1336 | neiluj | 687 |         include_once PROJET_CHEMIN_CLASSES.'HTML_formulaireProjet.class.php' ;
 | 
        
           | 448 | ddelon | 688 |         $formulaire_projet = new HTML_formulaireProjet('formulaire_projet', 'post', str_replace ('&', '&', $this->_url->getURL())) ;
 | 
        
           |  |  | 689 |         $formulaire_projet->construitFormulaire(projet::getTousLesProjets($this->_db)) ;
 | 
        
           |  |  | 690 |         if ($formulaire_projet->validate()) {
 | 
        
           |  |  | 691 |             $projet->majSQL($formulaire_projet->getSubmitValues()) ;
 | 
        
           |  |  | 692 |         } else {
 | 
        
           |  |  | 693 |             return $formulaire_projet->toHTML() ;
 | 
        
           |  |  | 694 |         }
 | 
        
           |  |  | 695 |         unset ($projet) ;
 | 
        
           | 1336 | neiluj | 696 |     }
 | 
        
           | 448 | ddelon | 697 |   | 
        
           |  |  | 698 |     /**
 | 
        
           |  |  | 699 |      * Renvoie le formulaire d'upload d'un fichier.
 | 
        
           |  |  | 700 |      *
 | 
        
           |  |  | 701 |      * @return void
 | 
        
           |  |  | 702 |      * @access public
 | 
        
           |  |  | 703 |      */
 | 
        
           |  |  | 704 |     function formulaireFichier($action)
 | 
        
           |  |  | 705 |     {
 | 
        
           |  |  | 706 |         $res = '<h1>'.PROJET_FICHIER_MISE_EN_LIGNE.'</h1>'."\n" ;
 | 
        
           |  |  | 707 |         if (isset($_SESSION['formulaire_document'])) {
 | 
        
           |  |  | 708 |             unset ($_SESSION['formulaire_document']) ;
 | 
        
           |  |  | 709 |         }
 | 
        
           |  |  | 710 |         $action_future = $action == PROJET_NOUVEAU_FICHIER ? PROJET_NOUVEAU_FICHIER_V : PROJET_ACTION_MODIFIER_V ;
 | 
        
           |  |  | 711 |         $this->_url->addQueryString (PROJET_VARIABLE_ACTION, $action_future) ;
 | 
        
           |  |  | 712 |         if ($this->_id_repertoire != '') $this->_url->addQueryString (PROJET_VARIABLE_ID_REPERTOIRE, $this->_id_repertoire) ;
 | 
        
           | 1336 | neiluj | 713 |         include_once PROJET_CHEMIN_CLASSES.'HTML_formulaireDocument.class.php' ;
 | 
        
           | 448 | ddelon | 714 |         $formulaire_document = new HTML_formulaireDocument('formulaire_document', 'post',preg_replace ("/&/", "&", $this->_url->getURL())) ;
 | 
        
           |  |  | 715 |         $formulaire_document->construitFormulaire($action) ;
 | 
        
           |  |  | 716 |         if ($action == PROJET_ACTION_MODIFIER) {
 | 
        
           | 1471 | alexandre_ | 717 | 			include_once PROJET_CHEMIN_CLASSES.'document.class.php' ;
 | 
        
           | 448 | ddelon | 718 |             $document = new document($this->_id_document, $this->_db, PROJET_CHEMIN_FICHIER, PROJET_CHEMIN_ICONES) ;
 | 
        
           | 1471 | alexandre_ | 719 |             // On affecte dans un tableau les valeurs de chaque champs du formulaire avec le nom de chaque element de formulaire
 | 
        
           | 448 | ddelon | 720 |             // voir HTML_formulaireDocument
 | 
        
           |  |  | 721 |             $valeurs_par_defaut = array ('document_nom' => $document->getNomLong(),
 | 
        
           |  |  | 722 |                                          'document_description' => $document->getDescription(),
 | 
        
           |  |  | 723 |                                          'document_visibilite' => $document->getVisibilite()) ;
 | 
        
           | 598 | ddelon | 724 |   | 
        
           | 1471 | alexandre_ | 725 |             // On rajoute un champs cache avec l'identifiant du document
 | 
        
           | 448 | ddelon | 726 |             $formulaire_document->addElement ('hidden', 'id_document', $this->_id_document) ;
 | 
        
           |  |  | 727 |             $formulaire_document->setDefaults($valeurs_par_defaut) ;
 | 
        
           |  |  | 728 |         } else {
 | 
        
           |  |  | 729 |             $formulaire_document->setDefaults (array ('document_visibilite'=> 'public')) ;
 | 
        
           |  |  | 730 |         }
 | 
        
           |  |  | 731 |         return $res.$formulaire_document->toHTML() ;
 | 
        
           |  |  | 732 |   | 
        
           |  |  | 733 |     } // end of member function nouveauFichier
 | 
        
           | 598 | ddelon | 734 |   | 
        
           | 448 | ddelon | 735 |     /**
 | 
        
           | 1471 | alexandre_ | 736 |     *   Presente un formulaire pour deplacer un fichier
 | 
        
           | 448 | ddelon | 737 |     *
 | 
        
           |  |  | 738 |     *
 | 
        
           |  |  | 739 |     */
 | 
        
           |  |  | 740 |     function fichierCouper() {
 | 
        
           |  |  | 741 |         include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
 | 
        
           |  |  | 742 |         $projet = new projet ($this->_db, $this->_id_projet) ;
 | 
        
           | 598 | ddelon | 743 |   | 
        
           | 448 | ddelon | 744 |         $res = '<h1>'.PROJET_PROJET.' : '.$projet->getTitre().'</h1>' ;
 | 
        
           | 1471 | alexandre_ | 745 |         include_once PROJET_CHEMIN_CLASSES.'document.class.php' ;
 | 
        
           | 448 | ddelon | 746 |         $document = new document($this->_id_document, $this->_db, PROJET_CHEMIN_FICHIER) ;
 | 
        
           | 1471 | alexandre_ | 747 |         // On traite le cas ou l'on vient de deplacer un fichier
 | 
        
           | 598 | ddelon | 748 |   | 
        
           | 448 | ddelon | 749 |         if (isset ($_POST['projet_repertoire'])) {
 | 
        
           |  |  | 750 |             if (!$document -> deplace ($_POST['projet_repertoire'], $projet->getNomRepertoire())) {
 | 
        
           | 1471 | alexandre_ | 751 |                 return 'echec du déplacement' ;
 | 
        
           | 448 | ddelon | 752 |             }
 | 
        
           |  |  | 753 |             return ;
 | 
        
           |  |  | 754 |         }
 | 
        
           |  |  | 755 |         include_once PROJET_CHEMIN_CLASSES.'HTML_formulaireCouperColler.class.php' ;
 | 
        
           |  |  | 756 |         $this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_COUPER) ;
 | 
        
           |  |  | 757 |         $HTML_formulaireCouperColler = new HTML_formulaireCouperColler('formulaire_couper_coller', 'post', str_replace('&', '&', $this->_url->getURL())) ;
 | 
        
           |  |  | 758 |         $HTML_formulaireCouperColler -> construitFormulaire($projet->getListeRepertoireHierarchisee()) ;
 | 
        
           | 1471 | alexandre_ | 759 |         $tab = $projet->getListeRepertoireHierarchisee();
 | 
        
           |  |  | 760 |         //$res .=  '<pre>'.print_r ($tab, true).'</pre>';
 | 
        
           |  |  | 761 |         return $res .$HTML_formulaireCouperColler->toHTML('<img src="'.PROJET_CHEMIN_ICONES.$document->getCheminIcone().'" /> '.$document->getNomLong());
 | 
        
           | 448 | ddelon | 762 |     }
 | 
        
           |  |  | 763 |     /**
 | 
        
           |  |  | 764 |      * Supprime un fichier.
 | 
        
           |  |  | 765 |      *
 | 
        
           |  |  | 766 |      * @return void
 | 
        
           |  |  | 767 |      * @access public
 | 
        
           |  |  | 768 |      */
 | 
        
           |  |  | 769 |     function suppressionFichier( )
 | 
        
           |  |  | 770 |     {
 | 
        
           |  |  | 771 |         if ($this->_id_document == "") {
 | 
        
           |  |  | 772 |             return $this->messageErreur(PROJETCONTROLEUR_PAS_DE_DOCUMENT_SELECTIONNE) ;
 | 
        
           |  |  | 773 |         }
 | 
        
           | 1336 | neiluj | 774 |         include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
 | 
        
           | 448 | ddelon | 775 |         $projet = new projet ($this->_db, $this->_id_projet) ;
 | 
        
           |  |  | 776 |         $document = new document($this->_id_document, $this->_db, PROJET_CHEMIN_FICHIER) ;
 | 
        
           |  |  | 777 |         $document->suppression() ;
 | 
        
           |  |  | 778 |         $document->suppressionSQL() ;
 | 
        
           | 1336 | neiluj | 779 |   | 
        
           |  |  | 780 |         // On verifie s il reste des documents associes au projet et si non on met
 | 
        
           |  |  | 781 |         // a jour projet.p_avoir_document
 | 
        
           |  |  | 782 |         if (count ($projet->getListesDocuments(PROJET_CHEMIN_FICHIER)) == 0) $projet->setAvoirDocument(false);
 | 
        
           | 448 | ddelon | 783 |         return ;
 | 
        
           |  |  | 784 |   | 
        
           |  |  | 785 |     } // end of member function nouveauFichier
 | 
        
           |  |  | 786 |   | 
        
           |  |  | 787 |     /**
 | 
        
           | 1471 | alexandre_ | 788 |      * Renvoie le formulaire de creation d'un repertoire.
 | 
        
           | 448 | ddelon | 789 |      *
 | 
        
           |  |  | 790 |      * @return void
 | 
        
           |  |  | 791 |      * @access public
 | 
        
           |  |  | 792 |      */
 | 
        
           |  |  | 793 |     function nouveauRepertoire( )
 | 
        
           |  |  | 794 |     {
 | 
        
           |  |  | 795 |         $res = '<h1>'.PROJET_REP_CREER.'</h1>'."\n" ;
 | 
        
           |  |  | 796 |         $this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_NOUVEAU_REPERTOIRE_V) ;
 | 
        
           | 1336 | neiluj | 797 |         include_once PROJET_CHEMIN_CLASSES.'HTML_formulaireDocument.class.php' ;
 | 
        
           | 448 | ddelon | 798 |         $formulaire_repertoire = new HTML_formulaireDocument('formulaire_repertoire', 'post',preg_replace ("/&/", "&", $this->_url->getURL())) ;
 | 
        
           |  |  | 799 |         $formulaire_repertoire->setType ('repertoire') ;
 | 
        
           |  |  | 800 |         $formulaire_repertoire->construitFormulaire() ;
 | 
        
           |  |  | 801 |         $formulaire_repertoire->setDefaults (array ('document_visibilite'=> 'public')) ;
 | 
        
           |  |  | 802 |         return $res.$formulaire_repertoire->toHTML() ;
 | 
        
           |  |  | 803 |   | 
        
           | 1336 | neiluj | 804 |     }
 | 
        
           | 448 | ddelon | 805 |   | 
        
           |  |  | 806 |     /**
 | 
        
           |  |  | 807 |      * Valide le formulaire et appelle la fonction d'insertion.
 | 
        
           |  |  | 808 |      *
 | 
        
           |  |  | 809 |      * @return void
 | 
        
           |  |  | 810 |      * @access public
 | 
        
           |  |  | 811 |      */
 | 
        
           |  |  | 812 |     function nouveauFichierValidation( )
 | 
        
           |  |  | 813 |     {
 | 
        
           | 1471 | alexandre_ | 814 |         // creation de l'objet projet courant
 | 
        
           | 1336 | neiluj | 815 |         include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
 | 
        
           | 448 | ddelon | 816 |         $projet = new projet ($this->_db, $this->_id_projet) ;
 | 
        
           |  |  | 817 |         if (isset($_SESSION['formulaire_document']) && $_SESSION['formulaire_document'] == 'valide') {
 | 
        
           | 1336 | neiluj | 818 |             return include_once PROJET_CHEMIN_APPLI.'actions/documents.php' ;
 | 
        
           | 448 | ddelon | 819 |         }
 | 
        
           |  |  | 820 |         $this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_NOUVEAU_FICHIER_V) ;
 | 
        
           | 1336 | neiluj | 821 |         include_once PROJET_CHEMIN_CLASSES.'HTML_formulaireDocument.class.php' ;
 | 
        
           | 448 | ddelon | 822 |         $formulaire_document = new HTML_formulaireDocument('formulaire_document', 'post', preg_replace ("/&/", "&", $this->_url->getURL())) ;
 | 
        
           |  |  | 823 |         $formulaire_document->construitFormulaire() ;
 | 
        
           |  |  | 824 |         if ($formulaire_document->validate()) {
 | 
        
           | 1471 | alexandre_ | 825 |             // Creation d'un objet document vide
 | 
        
           | 448 | ddelon | 826 |             $document = new document ("", $this->_db) ;
 | 
        
           | 1471 | alexandre_ | 827 |             // avant d'appeler la methode enregistrerSQL, il faut indiquer l'identifiant du projet et l'identifiant du proprietaire
 | 
        
           | 448 | ddelon | 828 |             $document->setIdProjet ($this->_id_projet) ;
 | 
        
           |  |  | 829 |             $document->setIdProprietaire ($this->_auth->getAuthData (PROJET_CHAMPS_ID)) ;
 | 
        
           | 598 | ddelon | 830 |   | 
        
           | 1471 | alexandre_ | 831 |             // On passe aussi le numero de repertoire s'il existe
 | 
        
           | 448 | ddelon | 832 |             if ($this->_id_repertoire != '') $document->setIdRepertoire($this->_id_repertoire) ;
 | 
        
           | 1471 | alexandre_ | 833 |             if ($this->_id_repertoire == 0) $document->setIdRepertoire(0) ;
 | 
        
           |  |  | 834 | 			//$GLOBALS['log'] .= '<br>this->_id_repertoire: '.$this->_id_repertoire.'<br>';
 | 
        
           | 448 | ddelon | 835 |             $chemin_upload = $document->calculeCheminUploaded($projet->getNomRepertoire()) ;
 | 
        
           | 1471 | alexandre_ | 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') ;
 | 
        
           |  |  | 839 | 			$nouveau_nom = $document->genereNouveauNom($projet->getNomRepertoire(), $_FILES['fichier']['name'], $id_document);
 | 
        
           |  |  | 840 |   | 
        
           |  |  | 841 |             if (!$document->upload (PROJET_CHEMIN_FICHIER.$chemin_upload.'/'.$nouveau_nom)) {
 | 
        
           |  |  | 842 |                 return 'Echec de l\'upload<br />'.
 | 
        
           |  |  | 843 |                 		'Fichier source : '. $_FILES['fichier']['name'];
 | 
        
           |  |  | 844 |                 		'Fichier destination : '.PROJET_CHEMIN_FICHIER.$projet->getNomRepertoire().'/'.$chemin_upload.'/'.$nouveau_nom ;
 | 
        
           | 448 | ddelon | 845 |             }
 | 
        
           | 598 | ddelon | 846 |   | 
        
           |  |  | 847 |   | 
        
           | 1471 | alexandre_ | 848 |             //$document->enregistrerSQL($formulaire_document->getSubmitValues(), $projet->getNomRepertoire().'/'.$chemin_upload) ;
 | 
        
           |  |  | 849 |             $retour = $document->enregistrerSQL($formulaire_document->getSubmitValues(), $nouveau_nom);
 | 
        
           | 1336 | neiluj | 850 |             // On place a 1 la colonne p_avoir_document
 | 
        
           |  |  | 851 |             if (!$projet->avoirDocument()) $projet->setAvoirDocument(true);
 | 
        
           |  |  | 852 |   | 
        
           | 448 | ddelon | 853 |             // On ajoute une information de session
 | 
        
           |  |  | 854 |             $_SESSION['formulaire_document'] = 'valide';
 | 
        
           |  |  | 855 |         } else {
 | 
        
           |  |  | 856 |             return $formulaire_document->toHTML() ;
 | 
        
           |  |  | 857 |         }
 | 
        
           | 1471 | alexandre_ | 858 |         return $retour;
 | 
        
           | 448 | ddelon | 859 |         unset ($projet) ;
 | 
        
           |  |  | 860 |     } // end of member function nouveauFichierValidation
 | 
        
           |  |  | 861 |   | 
        
           |  |  | 862 |     /**
 | 
        
           |  |  | 863 |      * Valide le formulaire et appelle la fonction d'insertion.
 | 
        
           |  |  | 864 |      *
 | 
        
           |  |  | 865 |      * @return void
 | 
        
           |  |  | 866 |      * @access public
 | 
        
           |  |  | 867 |      */
 | 
        
           |  |  | 868 |     function modifierFichier( )
 | 
        
           |  |  | 869 |     {
 | 
        
           | 1471 | alexandre_ | 870 |         // creation de l'objet projet courant
 | 
        
           | 1336 | neiluj | 871 |         include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
 | 
        
           | 448 | ddelon | 872 |         $projet = new projet ($this->_db, $this->_id_projet) ;
 | 
        
           |  |  | 873 |         $this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_ACTION_MODIFIER_V) ;
 | 
        
           | 1336 | neiluj | 874 |         include_once PROJET_CHEMIN_CLASSES.'HTML_formulaireDocument.class.php' ;
 | 
        
           | 448 | ddelon | 875 |         $formulaire_document = new HTML_formulaireDocument('formulaire_document', 'post',preg_replace ("/&/", "&", $this->_url->getURL())) ;
 | 
        
           |  |  | 876 |         $formulaire_document->construitFormulaire(PROJET_ACTION_MODIFIER_V) ;
 | 
        
           |  |  | 877 |         if ($formulaire_document->validate()) {
 | 
        
           | 1471 | alexandre_ | 878 |             // Creation d'un objet document vide
 | 
        
           | 448 | ddelon | 879 |             $document = new document ($this->_id_document, $this->_db) ;
 | 
        
           | 1471 | alexandre_ | 880 |             // On passe aussi le numero de répertoire s'il existe
 | 
        
           | 448 | ddelon | 881 |             if ($this->_id_repertoire != '') $document->setIdRepertoire($this->_id_repertoire) ;
 | 
        
           |  |  | 882 |             $document->majSQL($formulaire_document->getSubmitValues()) ;
 | 
        
           |  |  | 883 |         } else {
 | 
        
           |  |  | 884 |             return $formulaire_document->toHTML() ;
 | 
        
           |  |  | 885 |         }
 | 
        
           |  |  | 886 |         unset ($projet) ;
 | 
        
           |  |  | 887 |     } // end of member function nouveauFichierValidation
 | 
        
           |  |  | 888 |   | 
        
           |  |  | 889 |     /**
 | 
        
           |  |  | 890 |      * Valide le formulaire et appelle la fonction d'insertion.
 | 
        
           |  |  | 891 |      *
 | 
        
           |  |  | 892 |      * @return void
 | 
        
           |  |  | 893 |      * @access public
 | 
        
           |  |  | 894 |      */
 | 
        
           |  |  | 895 |     function nouveauRepertoireValidation( )
 | 
        
           |  |  | 896 |     {
 | 
        
           | 1471 | alexandre_ | 897 |         // creation de l'objet projet courant
 | 
        
           | 1336 | neiluj | 898 |         include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
 | 
        
           | 448 | ddelon | 899 |         $projet = new projet ($this->_db, $this->_id_projet) ;
 | 
        
           | 598 | ddelon | 900 |   | 
        
           | 448 | ddelon | 901 |         $this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_NOUVEAU_FICHIER_V) ;
 | 
        
           | 1336 | neiluj | 902 |         include_once PROJET_CHEMIN_CLASSES.'HTML_formulaireDocument.class.php' ;
 | 
        
           | 448 | ddelon | 903 |         $formulaire_repertoire = new HTML_formulaireDocument('formulaire_repertoire', 'post',preg_replace ("/&/", "&", $this->_url->getURL())) ;
 | 
        
           |  |  | 904 |         $formulaire_repertoire->setType ('repertoire') ;
 | 
        
           |  |  | 905 |         $formulaire_repertoire->construitFormulaire() ;
 | 
        
           |  |  | 906 |         if ($formulaire_repertoire->validate()) {
 | 
        
           | 1471 | alexandre_ | 907 |             // Creation d'un objet
 | 
        
           | 448 | ddelon | 908 |             $document = new document ("", $this->_db) ;
 | 
        
           | 1471 | alexandre_ | 909 |             // avant d'appeler la methode enregistrerSQL, il faut indiquer l'identifiant du projet et l'identifiant du proprietaire
 | 
        
           | 448 | ddelon | 910 |             $document->setIdProjet ($this->_id_projet) ;
 | 
        
           |  |  | 911 |             $document->setIdProprietaire ($this->_auth->getAuthData (PROJET_CHAMPS_ID)) ;
 | 
        
           | 598 | ddelon | 912 |   | 
        
           | 1471 | alexandre_ | 913 |             // On passe aussi le numero de repertoire s'il existe
 | 
        
           | 448 | ddelon | 914 |             if ($this->_id_repertoire != '') $document->setIdRepertoire($this->_id_repertoire) ;
 | 
        
           | 1471 | alexandre_ | 915 | 			if ($this->_id_repertoire == 0) $document->setIdRepertoire(0) ;
 | 
        
           |  |  | 916 |             $chemin_upload = $document->calculeCheminUploaded($projet->getNomRepertoire()) ;
 | 
        
           |  |  | 917 |             $nom_repertoire = $document->enregistrerSQL($formulaire_repertoire->getSubmitValues(), $projet->getNomRepertoire()) ;
 | 
        
           | 598 | ddelon | 918 |   | 
        
           | 1471 | alexandre_ | 919 |             // La creation du repertoire sur le disque, chemin / nom_repertoire_projet / id_repertoire
 | 
        
           | 1708 | alexandre_ | 920 |             $GLOBALS['log'] = '<br />chemin_upload:'.$chemin_upload.'<br />';
 | 
        
           | 1471 | alexandre_ | 921 |             $GLOBALS['log'] .= '<br />mkdir('.PROJET_CHEMIN_FICHIER.$chemin_upload.$nom_repertoire.')<br />';
 | 
        
           |  |  | 922 |             if (!mkdir (PROJET_CHEMIN_FICHIER.$chemin_upload.'/'.$nom_repertoire)) {
 | 
        
           | 598 | ddelon | 923 |   | 
        
           | 448 | ddelon | 924 |                 $document->suppressionSQL() ;
 | 
        
           | 1471 | alexandre_ | 925 |                 return $this->messageErreur(PROJETCONTROLEUR_ERREUR_CREATION_REPERTOIRE).'<br />'.
 | 
        
           |  |  | 926 |                 						PROJET_CHEMIN_FICHIER.$chemin_upload.'/'.$nom_repertoire;
 | 
        
           | 448 | ddelon | 927 |             }
 | 
        
           | 1336 | neiluj | 928 |             // On place a 1 la colonne p_avoir_document
 | 
        
           |  |  | 929 |             if (!$projet->avoirDocument()) $projet->setAvoirDocument(true);
 | 
        
           | 448 | ddelon | 930 |         } else {
 | 
        
           |  |  | 931 |             return $formulaire_repertoire->toHTML() ;
 | 
        
           |  |  | 932 |         }
 | 
        
           | 1471 | alexandre_ | 933 |     }
 | 
        
           | 448 | ddelon | 934 |   | 
        
           |  |  | 935 |   | 
        
           |  |  | 936 |     /**
 | 
        
           | 1471 | alexandre_ | 937 |      * Permet de specifier au controleur sur quel projet l'on travaille.
 | 
        
           | 448 | ddelon | 938 |      *
 | 
        
           |  |  | 939 |      * @param int id_projet L'identifiant du projet.
 | 
        
           |  |  | 940 |      * @return void
 | 
        
           |  |  | 941 |      * @access public
 | 
        
           |  |  | 942 |      */
 | 
        
           |  |  | 943 |     function setIdProjet( $id_projet )
 | 
        
           |  |  | 944 |     {
 | 
        
           |  |  | 945 |         $this->_id_projet = $id_projet ;
 | 
        
           | 598 | ddelon | 946 |   | 
        
           | 448 | ddelon | 947 |     } // end of member function setIdProjet
 | 
        
           |  |  | 948 |   | 
        
           |  |  | 949 |     /**
 | 
        
           |  |  | 950 |      * Renvoie la page d'accueil d'un projet.
 | 
        
           |  |  | 951 |      *
 | 
        
           |  |  | 952 |      * @return string
 | 
        
           |  |  | 953 |      * @access public
 | 
        
           |  |  | 954 |      */
 | 
        
           |  |  | 955 |     function accueilProjet( )
 | 
        
           |  |  | 956 |     {
 | 
        
           |  |  | 957 |         $res = '' ;
 | 
        
           | 1471 | alexandre_ | 958 |         // creation de l'objet projet courant
 | 
        
           | 1336 | neiluj | 959 |         include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
 | 
        
           | 448 | ddelon | 960 |         $projet = new projet ($this->_db, $this->_id_projet) ;
 | 
        
           | 598 | ddelon | 961 |   | 
        
           | 1471 | alexandre_ | 962 |         // recuperation de la liste des documents associés
 | 
        
           | 448 | ddelon | 963 |         $liste_documents = $projet->getListesDocuments(PROJET_CHEMIN_FICHIER, PROJET_CHEMIN_ICONES) ;
 | 
        
           | 598 | ddelon | 964 |   | 
        
           | 448 | ddelon | 965 |         // création de la vue liste de document, on nettoie l'url
 | 
        
           |  |  | 966 |         $this->_url->removeQueryString(PROJET_VARIABLE_ACTION) ;
 | 
        
           |  |  | 967 |         include_once PROJET_CHEMIN_CLASSES.'HTML_listeDocuments.class.php' ;
 | 
        
           |  |  | 968 |         $vue_liste_document = new HTML_listeDocuments($this->_url, false, $this->_id_repertoire) ;
 | 
        
           | 598 | ddelon | 969 |   | 
        
           | 1471 | alexandre_ | 970 |         // reglage de parametres de la vue
 | 
        
           | 448 | ddelon | 971 |         $vue_liste_document->setAction (array ("couper" => PROJET_ACTION_COUPER, "modifier" => PROJET_ACTION_MODIFIER, "supprimer" => PROJET_SUPPRESSION_FICHIER)) ;
 | 
        
           |  |  | 972 |         $vue_liste_document->setCheminIcones(PROJET_CHEMIN_ICONES) ;
 | 
        
           | 598 | ddelon | 973 |   | 
        
           |  |  | 974 |   | 
        
           | 448 | ddelon | 975 |         $tableau_navigation = document::getCheminIdRepertoire($this->_id_repertoire, $this->_db) ;
 | 
        
           | 598 | ddelon | 976 |   | 
        
           | 448 | ddelon | 977 |         $vue_liste_document->setCheminNavigation ($tableau_navigation) ;
 | 
        
           | 1471 | alexandre_ | 978 |         // verification des droits de l'utilisateur
 | 
        
           | 448 | ddelon | 979 |         $entete_liste = array (PROJET_FICHIERS_NOM, PROJET_FICHIERS_TAILLE, PROJET_FICHIERS_CREE_LE) ;
 | 
        
           | 598 | ddelon | 980 |   | 
        
           | 448 | ddelon | 981 |         if ($this->_auth->getAuth()) {
 | 
        
           | 1336 | neiluj | 982 |             include_once PROJET_CHEMIN_CLASSES.'participe.class.php' ;
 | 
        
           | 448 | ddelon | 983 |             $participant = new participe($this->_db) ;
 | 
        
           |  |  | 984 |             $id_u = $this->_auth->getAuthData(PROJET_CHAMPS_ID) ;
 | 
        
           |  |  | 985 |             $isCoord = $participant->isCoordinateur($id_u, $this->_id_projet, $this->_db) ;
 | 
        
           |  |  | 986 |             if ($isCoord) $droits = PROJET_DROIT_COORDINATEUR ;
 | 
        
           |  |  | 987 |             $isAdm = participe::isAdministrateur($this->_auth->getAuthData(PROJET_CHAMPS_ID), $this->_db) ;
 | 
        
           |  |  | 988 |             if ($isAdm) $droits = PROJET_DROIT_ADMINISTRATEUR ;
 | 
        
           |  |  | 989 |             if ($isAdm) $isCoord = true ;
 | 
        
           | 598 | ddelon | 990 |   | 
        
           | 448 | ddelon | 991 |             $statut = participe::getStatutSurProjetCourant ($this->_auth->getAuthData(PROJET_CHAMPS_ID), $this->_id_projet, $this->_db) ;
 | 
        
           |  |  | 992 |             // si participant, on ajoute le champs visibilite
 | 
        
           | 598 | ddelon | 993 |   | 
        
           | 448 | ddelon | 994 |             if ($statut !='' || $isAdm) {
 | 
        
           |  |  | 995 |                 array_push ($entete_liste, PROJET_FICHIERS_VISIBILITE) ;
 | 
        
           |  |  | 996 |             }
 | 
        
           |  |  | 997 |             // si chef de projet ou si propriétaire d'au moins 1 document
 | 
        
           |  |  | 998 |             $proprietaire_un_document = false ;
 | 
        
           | 598 | ddelon | 999 |   | 
        
           | 448 | ddelon | 1000 |             foreach ($liste_documents as $document) {
 | 
        
           |  |  | 1001 |                 if ($this->_auth->getAuthData(PROJET_CHAMPS_ID) == $document) {
 | 
        
           |  |  | 1002 |                     $proprietaire_un_document = true ;
 | 
        
           |  |  | 1003 |                     $droits = PROJET_DROIT_PROPRIETAIRE ;
 | 
        
           |  |  | 1004 |                 }
 | 
        
           |  |  | 1005 |             }
 | 
        
           |  |  | 1006 |             if ($statut > 0 || $proprietaire_un_document) {
 | 
        
           |  |  | 1007 |                 array_push ($entete_liste, PROJET_ACTION) ;
 | 
        
           |  |  | 1008 |             }
 | 
        
           |  |  | 1009 |         } else {
 | 
        
           |  |  | 1010 |             $droits = PROJET_DROIT_AUCUN ;
 | 
        
           |  |  | 1011 |         }
 | 
        
           |  |  | 1012 |         if (!isset($droits)) $droits = PROJET_DROIT_AUCUN ;
 | 
        
           | 598 | ddelon | 1013 |   | 
        
           | 448 | ddelon | 1014 |         $vue_liste_document->construitEntete($entete_liste) ;
 | 
        
           |  |  | 1015 |         $vue_liste_document->construitListe ($liste_documents, $droits) ;
 | 
        
           | 598 | ddelon | 1016 |   | 
        
           | 448 | ddelon | 1017 |         $wiki_res = '' ;
 | 
        
           |  |  | 1018 |         // Les wikinis associés au projet
 | 
        
           |  |  | 1019 |         if ($projet->getWikini()) {
 | 
        
           |  |  | 1020 |             $wiki_res .= '<div><a href="'.PROJET_URL_WIKINI.'wakka.php?wiki=PagePrincipale&wikini='.$projet->getWikini().'">'.PROJET_URL_WIKINI.'</a>' ;
 | 
        
           |  |  | 1021 |             if ($this->_auth->getAuth() && $isCoord) {
 | 
        
           |  |  | 1022 |                 $this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_SUPPRIMER_WIKI) ;
 | 
        
           |  |  | 1023 |                 $wiki_res .= ' <a href="'.$this->_url->getURL().'" onclick="javascript:return confirm(\''.PROJET_WIKINI_SUPPRIMER.' ?\')">'.PROJET_WIKINI_SUPPRIMER.'</a>' ;
 | 
        
           |  |  | 1024 |             }
 | 
        
           |  |  | 1025 |             $wiki_res .= '</div>' ;
 | 
        
           |  |  | 1026 |         } else {
 | 
        
           |  |  | 1027 |             $wiki_res .= '<div>'.PROJET_WIKINI_PAS.'</div>'."\n" ;
 | 
        
           |  |  | 1028 |         }
 | 
        
           |  |  | 1029 |         // On charge les listes de discussion du projet
 | 
        
           |  |  | 1030 |         // Pour le moment seul ezmlm est supportée
 | 
        
           | 598 | ddelon | 1031 |   | 
        
           | 448 | ddelon | 1032 |         $projet->getListesAssociees();
 | 
        
           |  |  | 1033 |         $sortie_liste = '' ;
 | 
        
           | 598 | ddelon | 1034 |   | 
        
           | 448 | ddelon | 1035 |         if ($projet->avoirListe()) {
 | 
        
           | 1336 | neiluj | 1036 |             include_once PROJET_CHEMIN_CLASSES_LISTES.'ezmlm.php' ;
 | 
        
           | 448 | ddelon | 1037 |             foreach ($projet->_listes_associes as $info_liste) {
 | 
        
           | 598 | ddelon | 1038 |   | 
        
           | 448 | ddelon | 1039 |                 $liste = new ezmlm_php() ;
 | 
        
           |  |  | 1040 |                 // Paramétrage de la liste
 | 
        
           | 598 | ddelon | 1041 |   | 
        
           | 448 | ddelon | 1042 |                 $liste->listdir = PROJET_CHEMIN_LISTES.$info_liste->getDomaine().'/'.$info_liste->getNom();
 | 
        
           |  |  | 1043 |                 $liste->listname = $info_liste->getNom() ;
 | 
        
           |  |  | 1044 |                 $liste->listdomain = $info_liste->getDomaine();
 | 
        
           | 598 | ddelon | 1045 |   | 
        
           | 448 | ddelon | 1046 |                 if (isset ($GLOBALS['action']) && $GLOBALS['action'] != '') {
 | 
        
           |  |  | 1047 |                     $liste->set_action($GLOBALS['action']) ;
 | 
        
           |  |  | 1048 |                     $liste->set_actionargs($GLOBALS['actionargs']) ;
 | 
        
           |  |  | 1049 |                 } else {
 | 
        
           |  |  | 1050 |                     $liste->set_action('list_info') ;
 | 
        
           |  |  | 1051 |                 }
 | 
        
           |  |  | 1052 |                 $liste->sendheaders	= false;
 | 
        
           |  |  | 1053 |                 $liste->sendbody        = false;
 | 
        
           |  |  | 1054 |                 $liste->sendfooters    = false;
 | 
        
           |  |  | 1055 |                 $liste->forcehref = $this->_url->getURL() ;
 | 
        
           | 598 | ddelon | 1056 |   | 
        
           | 448 | ddelon | 1057 |                 ob_start() ;
 | 
        
           |  |  | 1058 |                 print '<span class="heading">Liste <strong>' . $info_liste->getAdresseEnvoi() ;
 | 
        
           |  |  | 1059 |                 print "</strong></span><br />\n";
 | 
        
           |  |  | 1060 |                 if ($this->_auth->getAuth()) {
 | 
        
           |  |  | 1061 |                     include_once PROJET_CHEMIN_CLASSES.'inscription_liste.class.php';
 | 
        
           |  |  | 1062 |                     $inscription_liste = new inscription_liste($this->_db) ;
 | 
        
           | 474 | alexandre_ | 1063 |                     if ($inscription_liste->getStatutInscrit( $info_liste->getId(),  $this->_auth) == '') {
 | 
        
           | 448 | ddelon | 1064 |                         $action_inscription = PROJET_ACTION_INSCRIPTION_LISTE ;
 | 
        
           |  |  | 1065 |                         $label_inscription = PROJET_S_INSCRIRE ;
 | 
        
           |  |  | 1066 |                     } else {
 | 
        
           |  |  | 1067 |                         $action_inscription = PROJET_ACTION_DESINSCRIPTION_LISTE ;
 | 
        
           |  |  | 1068 |                         $label_inscription = PROJET_SE_DESINSCRIRE ;
 | 
        
           |  |  | 1069 |                     }
 | 
        
           |  |  | 1070 |                     $this->_url->addQueryString(PROJET_VARIABLE_ACTION, $action_inscription) ;
 | 
        
           |  |  | 1071 |                     print '<a href="'.$this->_url->getURL().'">';
 | 
        
           |  |  | 1072 |                     print $label_inscription.'</a><br /> ';
 | 
        
           |  |  | 1073 |                 }
 | 
        
           |  |  | 1074 |                 print "\n<hr noshade><br />\n";
 | 
        
           |  |  | 1075 |                 $this->_url->removeQueryString(PROJET_VARIABLE_ACTION) ;
 | 
        
           |  |  | 1076 |                 switch ($liste->action) {
 | 
        
           |  |  | 1077 |                     case "show_msg":
 | 
        
           |  |  | 1078 |                         if (count($liste->actionargs) < 2) {
 | 
        
           |  |  | 1079 |                             $liste->error(EZMLM_INVALID_SYNTAX,TRUE);
 | 
        
           |  |  | 1080 |                         }
 | 
        
           |  |  | 1081 |                         $show_msg = new ezmlm_msgdisplay();
 | 
        
           |  |  | 1082 |                         $show_msg->listdir = $liste->listdir ;
 | 
        
           |  |  | 1083 |                         $show_msg->forcehref = $this->_url->getURL();
 | 
        
           |  |  | 1084 |                         // actionargs[0] contient le nom du répertoire et actionargs[1] le nom du fichier
 | 
        
           |  |  | 1085 |                         // On appelle la fonction qui affiche un fichier
 | 
        
           |  |  | 1086 |                         $show_msg->display($liste->actionargs[0] . "/" . $liste->actionargs[1]);
 | 
        
           |  |  | 1087 |                         break;
 | 
        
           | 598 | ddelon | 1088 |   | 
        
           | 448 | ddelon | 1089 |                     case "list_info":
 | 
        
           |  |  | 1090 |                         $info = new ezmlm_listinfo();
 | 
        
           |  |  | 1091 |                         if (!$info) return 'Les fichiers de la liste ne sont pas visible sur le serveur' ;
 | 
        
           |  |  | 1092 |                         $info->forcehref = $this->_url->getURL();
 | 
        
           |  |  | 1093 |                         $info->listdir = $liste->listdir ;
 | 
        
           |  |  | 1094 |                         $info->listname = $info_liste->getNom();
 | 
        
           |  |  | 1095 |                         $info->listdomain = $info_liste->getDomaine() ;
 | 
        
           | 598 | ddelon | 1096 |   | 
        
           | 448 | ddelon | 1097 |                         if (!$info->display()) {
 | 
        
           |  |  | 1098 |                             echo 'Pas de message dans cette liste' ;
 | 
        
           |  |  | 1099 |                         }
 | 
        
           |  |  | 1100 |                         break;
 | 
        
           |  |  | 1101 |                     case "show_threads":
 | 
        
           |  |  | 1102 |                         $threads = new ezmlm_threads();
 | 
        
           |  |  | 1103 |                         $threads->forcehref = $this->_url->getURL() ;
 | 
        
           |  |  | 1104 |                         $threads->listdir = $liste->listdir ;
 | 
        
           |  |  | 1105 |                         $threads->listname = $info_liste->getNom() ;
 | 
        
           |  |  | 1106 |                         $threads->listdomain = $info_liste->getDomaine() ;
 | 
        
           |  |  | 1107 |                         $threads->tempdir = PROJET_CHEMIN_APPLI.'/tmp' ;
 | 
        
           |  |  | 1108 |                         $threads->load($liste->actionargs[0]);
 | 
        
           |  |  | 1109 |                         break;
 | 
        
           |  |  | 1110 |                     case "show_author_msgs" :
 | 
        
           |  |  | 1111 |                         $author = new ezmlm_author();
 | 
        
           |  |  | 1112 |                         $author->listdir = $liste->listdir ;
 | 
        
           |  |  | 1113 |                         $author->listname = $info_liste->getNom() ;
 | 
        
           |  |  | 1114 |                         $author->listdomain = $info_liste->getDomaine() ;
 | 
        
           |  |  | 1115 |                         $author->forcehref = $this->_url->getURL() ;
 | 
        
           |  |  | 1116 |                         $author->display($liste->actionargs[0]);
 | 
        
           |  |  | 1117 |                     break ;
 | 
        
           |  |  | 1118 |                 }
 | 
        
           |  |  | 1119 |                 $sortie_liste = ob_get_contents() ;
 | 
        
           |  |  | 1120 |                 ob_end_clean() ;
 | 
        
           |  |  | 1121 |             }
 | 
        
           |  |  | 1122 |         } else {
 | 
        
           |  |  | 1123 |             $sortie_liste = '<div>'.PROJET_PAS_DE_LISTE.'</div>'."\n" ;
 | 
        
           |  |  | 1124 |         }
 | 
        
           | 598 | ddelon | 1125 |   | 
        
           | 448 | ddelon | 1126 |         $res .= "<h1>".$projet->getTitre()."</h1>" ;
 | 
        
           |  |  | 1127 |         $res .= '<div>'.$projet->getDescription().'</div>'."\n" ;
 | 
        
           |  |  | 1128 |         $res .= '<h2>'.PROJET_WIKI_ASSOCIE.'</h2>' ;
 | 
        
           |  |  | 1129 |         $res .= $wiki_res ;
 | 
        
           |  |  | 1130 |         $res .= '<h2>'.PROJET_FICHIERS_ASSOCIES.'</h2>'."\n" ;
 | 
        
           |  |  | 1131 |         $res .= $vue_liste_document->toHTML() ;
 | 
        
           |  |  | 1132 |         $res .= '<h2>'.PROJET_LISTES_ASSOCIEES.'</h2>'."\n" ;
 | 
        
           |  |  | 1133 |         $res .= $sortie_liste ;
 | 
        
           | 598 | ddelon | 1134 |   | 
        
           | 448 | ddelon | 1135 |         include_once PROJET_CHEMIN_CLASSES.'liste_externe.class.php' ;
 | 
        
           |  |  | 1136 |         $listes_ext = new liste_externe ($this->_db) ;
 | 
        
           |  |  | 1137 |         $tableau_liste = $listes_ext->getListesAssociees($this->_id_projet) ;
 | 
        
           | 598 | ddelon | 1138 |   | 
        
           | 448 | ddelon | 1139 |         if (count ($tableau_liste) != 0) {
 | 
        
           |  |  | 1140 |             $res .= '<h2>'.PROJET_LISTES_EXTERNES_ASSOCIEES.'</h2>'."\n" ;
 | 
        
           |  |  | 1141 |             for ($i = 0; $i < count ($tableau_liste); $i++) {
 | 
        
           |  |  | 1142 |                 $info_liste = $listes_ext->getInfoListe($tableau_liste[$i]) ;
 | 
        
           |  |  | 1143 |                 $res .= '<h2>'.$info_liste->AGO_A_NOMGRPLG.'</h2>'."\n" ;
 | 
        
           |  |  | 1144 |                 $res .= '<p>'.$info_liste->AGO_A_RESUMLG.'</p>'."\n" ;
 | 
        
           |  |  | 1145 |                 $res .= '<p><a href="'.$info_liste->AGO_A_URLGRP.'">'.$info_liste->AGO_A_URLGRP.'</a></p>'."\n" ;
 | 
        
           |  |  | 1146 |                 $res .= '<br />'."\n" ;
 | 
        
           |  |  | 1147 |             }
 | 
        
           |  |  | 1148 |         }
 | 
        
           |  |  | 1149 |         return $res ;
 | 
        
           |  |  | 1150 |     } // end of member function accueilProjet
 | 
        
           |  |  | 1151 |   | 
        
           |  |  | 1152 |     /**
 | 
        
           | 1471 | alexandre_ | 1153 |      * Permet de specifier quel repertoire, dans la vue de document afficher. Il sera
 | 
        
           |  |  | 1154 |      * passe en parametre a la classe HTML_listeDocuments.
 | 
        
           | 448 | ddelon | 1155 |      *
 | 
        
           | 1471 | alexandre_ | 1156 |      * @param int id_repertoire L'identifiant du repertoire a afficher.
 | 
        
           | 448 | ddelon | 1157 |      * @return void
 | 
        
           |  |  | 1158 |      * @access public
 | 
        
           |  |  | 1159 |      */
 | 
        
           |  |  | 1160 |     function setIdRepertoire( $id_repertoire )
 | 
        
           |  |  | 1161 |     {
 | 
        
           |  |  | 1162 |         $this->_id_repertoire = $id_repertoire ;
 | 
        
           | 1471 | alexandre_ | 1163 |     }
 | 
        
           | 448 | ddelon | 1164 |   | 
        
           |  |  | 1165 |     /**
 | 
        
           |  |  | 1166 |      * Supprime un projet et tout ce qui va avec.
 | 
        
           |  |  | 1167 |      *
 | 
        
           |  |  | 1168 |      * @return void
 | 
        
           |  |  | 1169 |      * @access public
 | 
        
           |  |  | 1170 |      */
 | 
        
           |  |  | 1171 |     function suppressionProjet( )
 | 
        
           |  |  | 1172 |     {
 | 
        
           | 1336 | neiluj | 1173 |         include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
 | 
        
           | 448 | ddelon | 1174 |         $projet = new projet ($this->_db, $this->_id_projet) ;
 | 
        
           |  |  | 1175 |         $projet->setCheminRepertoire (PROJET_CHEMIN_FICHIER) ;
 | 
        
           |  |  | 1176 |         $projet->getListesAssociees() ;
 | 
        
           |  |  | 1177 |         if ($projet->avoirListe()) $projet->supprimerListe($projet->_listes_associes[0]) ;
 | 
        
           |  |  | 1178 |         $msg = $projet->suppressionSQL() ;
 | 
        
           |  |  | 1179 |         unset ($this->_id_projet) ; unset($_GET['id_projet']);
 | 
        
           |  |  | 1180 |         return $msg ;
 | 
        
           | 1336 | neiluj | 1181 |     }
 | 
        
           | 448 | ddelon | 1182 |   | 
        
           |  |  | 1183 |     /**
 | 
        
           |  |  | 1184 |      * Permet d'indiquer au controleur sur quel document on travaille.
 | 
        
           |  |  | 1185 |      *
 | 
        
           | 598 | ddelon | 1186 |      * @param int id_document
 | 
        
           | 448 | ddelon | 1187 |      * @return void
 | 
        
           |  |  | 1188 |      * @access public
 | 
        
           |  |  | 1189 |      */
 | 
        
           |  |  | 1190 |     function setIdDocument( $id_document )
 | 
        
           |  |  | 1191 |     {
 | 
        
           |  |  | 1192 |         $this->_id_document = $id_document ;
 | 
        
           | 1336 | neiluj | 1193 |     }
 | 
        
           | 448 | ddelon | 1194 |   | 
        
           |  |  | 1195 |   | 
        
           |  |  | 1196 |     /**
 | 
        
           |  |  | 1197 |      * Renvoie le formulaire d'envoie de mail
 | 
        
           |  |  | 1198 |      *
 | 
        
           |  |  | 1199 |      * @return void
 | 
        
           |  |  | 1200 |      * @access public
 | 
        
           |  |  | 1201 |      */
 | 
        
           |  |  | 1202 |     function envoyerUnMailFormulaire( )
 | 
        
           |  |  | 1203 |     {
 | 
        
           | 622 | alexandre_ | 1204 |     	if (!$this->_auth->getAuth()) {
 | 
        
           |  |  | 1205 |     		return PROJET_LISTE_PROJET;
 | 
        
           |  |  | 1206 |     	}
 | 
        
           | 702 | alexandre_ | 1207 |     	if (isset($_SESSION['formulaire_mail'])) {
 | 
        
           |  |  | 1208 |             unset ($_SESSION['formulaire_mail']) ;
 | 
        
           |  |  | 1209 |         }
 | 
        
           | 448 | ddelon | 1210 |         $res = '<h1>'.PROJET_ECRIRE_LISTE.'</h1>'."\n" ;
 | 
        
           |  |  | 1211 |         $this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ENVOYER_UN_MAIL_V) ;
 | 
        
           | 1336 | neiluj | 1212 |         include_once PROJET_CHEMIN_CLASSES.'HTML_formulaireMail.class.php' ;
 | 
        
           | 448 | ddelon | 1213 |         $formulaire_mail = new HTML_formulaireMail('formulaire_mail', 'post',preg_replace ("/&/", "&", $this->_url->getURL())) ;
 | 
        
           |  |  | 1214 |         $formulaire_mail->construitFormulaire() ;
 | 
        
           |  |  | 1215 |         return $res.$formulaire_mail->toHTML() ;
 | 
        
           | 1336 | neiluj | 1216 |     }
 | 
        
           | 448 | ddelon | 1217 |   | 
        
           |  |  | 1218 |     /**
 | 
        
           |  |  | 1219 |      * Envoie le mail
 | 
        
           |  |  | 1220 |      *
 | 
        
           |  |  | 1221 |      * @return void
 | 
        
           |  |  | 1222 |      * @access public
 | 
        
           |  |  | 1223 |      */
 | 
        
           |  |  | 1224 |     function envoyerUnMailValidation( )
 | 
        
           |  |  | 1225 |     {
 | 
        
           | 1471 | alexandre_ | 1226 |         // Verifications
 | 
        
           | 702 | alexandre_ | 1227 |         if (isset($_SESSION['formulaire_mail']) && $_SESSION['formulaire_mail'] == 'valide') {
 | 
        
           | 1336 | neiluj | 1228 |             return include_once PROJET_CHEMIN_APPLI.'actions/forums.php' ;
 | 
        
           | 702 | alexandre_ | 1229 |         }
 | 
        
           | 888 | alexandre_ | 1230 |   | 
        
           | 448 | ddelon | 1231 |         $this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_ENVOYER_UN_MAIL_V );
 | 
        
           | 1336 | neiluj | 1232 |         include_once PROJET_CHEMIN_CLASSES.'HTML_formulaireMail.class.php' ;
 | 
        
           | 448 | ddelon | 1233 |         $formulaire_mail = new HTML_formulaireMail('formulaire_mail', 'post', preg_replace ("/&/", "&", $this->_url->getURL())) ;
 | 
        
           |  |  | 1234 |         $formulaire_mail->construitFormulaire() ;
 | 
        
           |  |  | 1235 |         if ($formulaire_mail->validate()) {
 | 
        
           | 1471 | alexandre_ | 1236 |             // creation de l'objet projet courant
 | 
        
           | 1336 | neiluj | 1237 |             include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
 | 
        
           | 448 | ddelon | 1238 |             $projet = new projet ($this->_db, $this->_id_projet) ;
 | 
        
           |  |  | 1239 |             $info_liste = $projet->getListesAssociees() ;
 | 
        
           |  |  | 1240 |             $valeurs_mail = $formulaire_mail->getSubmitValues() ;
 | 
        
           |  |  | 1241 |             // Pour envoyer le mail on utilise la classe Mail de PEAR
 | 
        
           |  |  | 1242 |             // on a besoin du mail de l'inscrit
 | 
        
           |  |  | 1243 |   | 
        
           |  |  | 1244 |             $entetes['From'] = $this->_auth->getUserName();
 | 
        
           |  |  | 1245 |             $entetes['To'] = $projet->_listes_associes[0]->getAdresseEnvoi() ;
 | 
        
           |  |  | 1246 |             $entetes['Subject'] = $valeurs_mail['mail_titre'] ;
 | 
        
           | 607 | alexandre_ | 1247 |             $entetes['Date'] = date ('D, M j G:i:s \C\E\S\T Y') ;
 | 
        
           | 448 | ddelon | 1248 |             $entetes['Message-ID'] = md5(time()).'@'.$projet->_listes_associes[0]->getNom().'.'.$projet->_listes_associes[0]->getDomaine() ;
 | 
        
           |  |  | 1249 |             $entetes['reply-to'] = $projet->_listes_associes[0]->getAdresseEnvoi() ;
 | 
        
           |  |  | 1250 |             $entetes['Content-Type'] = 'text/plain' ;
 | 
        
           | 1471 | alexandre_ | 1251 |             // Traitement de la reference s'il s'agit d'une reponse
 | 
        
           | 448 | ddelon | 1252 |             if (isset ($_POST['messageid'])) {
 | 
        
           |  |  | 1253 |                 $entetes['In-Reply-To'] = $_POST['messageid'] ;
 | 
        
           |  |  | 1254 |             }
 | 
        
           |  |  | 1255 |             $objet_mail =& Mail::factory('smtp');
 | 
        
           |  |  | 1256 |             $objet_mail->send($entetes['To'], $entetes, $valeurs_mail['mail_corps']);
 | 
        
           | 702 | alexandre_ | 1257 |             $_SESSION['formulaire_mail'] = 'valide';
 | 
        
           | 448 | ddelon | 1258 |             return  ;
 | 
        
           |  |  | 1259 |         } else {
 | 
        
           |  |  | 1260 |             return $formulaire_mail->toHTML() ;
 | 
        
           |  |  | 1261 |         }
 | 
        
           |  |  | 1262 |     } // end of member function envoyerUnMailValidation
 | 
        
           |  |  | 1263 |   | 
        
           |  |  | 1264 |    /**
 | 
        
           |  |  | 1265 |      * Renvoie le formulaire de création d'une liste.
 | 
        
           |  |  | 1266 |      *
 | 
        
           |  |  | 1267 |      * @param int action Indique le type d'action,  PROJET_ACTION_NOUVELLE_LISTE
 | 
        
           |  |  | 1268 |      * @return string
 | 
        
           |  |  | 1269 |      * @access public
 | 
        
           |  |  | 1270 |      */
 | 
        
           |  |  | 1271 |     function formulaireListe( $action )
 | 
        
           |  |  | 1272 |     {
 | 
        
           |  |  | 1273 |         $res = '<h1>'.PROJET_CREATION_LISTE.'</h1>'."\n" ;
 | 
        
           |  |  | 1274 |         $this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_NOUVELLE_LISTE_V) ;
 | 
        
           | 1336 | neiluj | 1275 |         include_once PROJET_CHEMIN_CLASSES.'HTML_formulaireListe.class.php' ;
 | 
        
           | 448 | ddelon | 1276 |         $formulaire_liste = new HTML_formulaireListe('formulaire_liste', 'post',preg_replace ("/&/", "&", $this->_url->getURL())) ;
 | 
        
           |  |  | 1277 |         $formulaire_liste->construitFormulaire() ;
 | 
        
           |  |  | 1278 |         $formulaire_liste->setDefaults(array('domaine_liste' => PROJET_DOMAINE_LISTE)) ;
 | 
        
           |  |  | 1279 |         $formulaire_liste->updateElementAttr('domaine_liste', array('readonly' => 'readonly')) ;
 | 
        
           |  |  | 1280 |         return $res.$formulaire_liste->toHTML() ;
 | 
        
           | 1471 | alexandre_ | 1281 |     }
 | 
        
           | 448 | ddelon | 1282 |   | 
        
           |  |  | 1283 |     /**
 | 
        
           |  |  | 1284 |      * Transmet au serveur la demande de création d'une nouvelle liste.
 | 
        
           |  |  | 1285 |      *
 | 
        
           |  |  | 1286 |      * @return void
 | 
        
           |  |  | 1287 |      * @access public
 | 
        
           |  |  | 1288 |      */
 | 
        
           |  |  | 1289 |     function nouvelleListeValidation( )
 | 
        
           |  |  | 1290 |     {
 | 
        
           | 1471 | alexandre_ | 1291 |         // Verifications
 | 
        
           | 448 | ddelon | 1292 |         $this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_ACTION_NOUVELLE_LISTE_V );
 | 
        
           | 1336 | neiluj | 1293 |         include_once PROJET_CHEMIN_CLASSES.'HTML_formulaireListe.class.php' ;
 | 
        
           | 448 | ddelon | 1294 |         $formulaire_liste = new HTML_formulaireListe('formulaire_liste', 'post', preg_replace ("/&/", "&", $this->_url->getURL())) ;
 | 
        
           |  |  | 1295 |         $formulaire_liste->construitFormulaire() ;
 | 
        
           |  |  | 1296 |         if ($formulaire_liste->validate()) {
 | 
        
           | 1471 | alexandre_ | 1297 |             // creation de l'objet liste_discussion
 | 
        
           |  |  | 1298 |             include_once PROJET_CHEMIN_CLASSES.'liste_discussion.class.php';
 | 
        
           | 448 | ddelon | 1299 |             $liste = new liste_discussion('', $this->_db) ;
 | 
        
           | 598 | ddelon | 1300 |   | 
        
           | 448 | ddelon | 1301 |             // On vérifie que le nom de la liste soit unique
 | 
        
           |  |  | 1302 |             if (liste_discussion::verifieDoubleListe($formulaire_liste->getSubmitValue('nom_liste').'@'.
 | 
        
           |  |  | 1303 |                                                             $formulaire_liste->getSubmitValue('domaine_liste'), $this->_db)) {
 | 
        
           | 598 | ddelon | 1304 |                 // On rajoute la liste dans la base
 | 
        
           | 448 | ddelon | 1305 |                 $liste->enregistrerSQL($formulaire_liste->getSubmitValues()) ;
 | 
        
           | 598 | ddelon | 1306 |   | 
        
           | 448 | ddelon | 1307 |                 // On la relie au projet
 | 
        
           | 1336 | neiluj | 1308 |                 include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
 | 
        
           | 448 | ddelon | 1309 |                 $projet = new projet ($this->_db, $this->_id_projet) ;
 | 
        
           |  |  | 1310 |                 $projet->ajouterListe($liste) ;
 | 
        
           | 598 | ddelon | 1311 |   | 
        
           | 1471 | alexandre_ | 1312 |                 // Creation de la liste
 | 
        
           | 507 | alexandre_ | 1313 |                 $resultat_creation = file_get_contents (PROJET_SERVEUR_VPOPMAIL.'/creation_liste.php?domaine='.
 | 
        
           | 448 | ddelon | 1314 |                                     $liste->getDomaine().'&liste='.$liste->getNom().'¶metres=aBiud') ;
 | 
        
           | 598 | ddelon | 1315 |   | 
        
           | 1471 | alexandre_ | 1316 |                 // Ajout du moderateur
 | 
        
           | 507 | alexandre_ | 1317 |                 $resultat_ajout_moderateur = file_get_contents (PROJET_SERVEUR_VPOPMAIL.'/ajout_moderateur.php?domaine='.
 | 
        
           | 448 | ddelon | 1318 |                                     $liste->getDomaine().'&liste='.$liste->getNom().'&mail='.$this->_auth->getUserName()) ;
 | 
        
           | 1471 | alexandre_ | 1319 |                 // Ajout du moderateur en tant qu'utilisateur
 | 
        
           | 507 | alexandre_ | 1320 |                 $resultat_ajout_utilisateur = file_get_contents (PROJET_SERVEUR_VPOPMAIL.'/ajout_abonne.php?domaine='.
 | 
        
           | 448 | ddelon | 1321 |                                     $liste->getDomaine().'&liste='.$liste->getNom().'&mail='.$this->_auth->getUserName()) ;
 | 
        
           |  |  | 1322 |   | 
        
           |  |  | 1323 |             } else {
 | 
        
           |  |  | 1324 |                 return PROJET_MESSAGE_LISTE_DOUBLE.$formulaire_liste->toHTML() ;
 | 
        
           |  |  | 1325 |             }
 | 
        
           |  |  | 1326 |             return $resultat_creation.$resultat_ajout_moderateur.$resultat_ajout_utilisateur;
 | 
        
           | 598 | ddelon | 1327 |   | 
        
           | 448 | ddelon | 1328 |         } else {
 | 
        
           |  |  | 1329 |             return $formulaire_liste->toHTML() ;
 | 
        
           |  |  | 1330 |         }
 | 
        
           |  |  | 1331 |     } // end of member function nouvelleListeValidation
 | 
        
           | 598 | ddelon | 1332 |   | 
        
           | 448 | ddelon | 1333 |     /**
 | 
        
           |  |  | 1334 |      * Supprime la liste de discussion associée au projet
 | 
        
           |  |  | 1335 |      *
 | 
        
           |  |  | 1336 |      * @return void
 | 
        
           |  |  | 1337 |      * @access public
 | 
        
           |  |  | 1338 |      */
 | 
        
           |  |  | 1339 |     function supprimerListe( )
 | 
        
           |  |  | 1340 |     {
 | 
        
           | 1336 | neiluj | 1341 |         include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
 | 
        
           | 448 | ddelon | 1342 |         $projet = new projet($this->_db, $this->_id_projet) ;
 | 
        
           |  |  | 1343 |         $projet->getListesAssociees() ;
 | 
        
           | 598 | ddelon | 1344 |   | 
        
           | 507 | alexandre_ | 1345 |         $resultat_suppression = file_get_contents(PROJET_SERVEUR_VPOPMAIL.'/suppression_liste.php?domaine='.
 | 
        
           | 448 | ddelon | 1346 |                                     $projet->_listes_associes[0]->getDomaine().'&liste='.$projet->_listes_associes[0]->getNom()) ;
 | 
        
           |  |  | 1347 |         $projet->supprimerListe($projet->_listes_associes[0]) ;
 | 
        
           |  |  | 1348 |         return $resultat_suppression;
 | 
        
           |  |  | 1349 |     } // end of member function supprimerListe
 | 
        
           |  |  | 1350 |   | 
        
           |  |  | 1351 |   | 
        
           |  |  | 1352 |     /**
 | 
        
           |  |  | 1353 |      *
 | 
        
           | 598 | ddelon | 1354 |      *
 | 
        
           | 448 | ddelon | 1355 |      * @param string presentation Pour affecter une présentation au projet
 | 
        
           |  |  | 1356 |      * @return void
 | 
        
           |  |  | 1357 |      * @access public
 | 
        
           |  |  | 1358 |      */
 | 
        
           |  |  | 1359 |     function setPresentation( $presentation )
 | 
        
           |  |  | 1360 |     {
 | 
        
           |  |  | 1361 |         $this->_presentation = $presentation ;
 | 
        
           |  |  | 1362 |     } // end of member function setPresentation
 | 
        
           |  |  | 1363 |   | 
        
           | 474 | alexandre_ | 1364 |     /**
 | 
        
           |  |  | 1365 |      *
 | 
        
           | 598 | ddelon | 1366 |      *
 | 
        
           | 474 | alexandre_ | 1367 |      * @param string type Pour affecter un type au projet
 | 
        
           |  |  | 1368 |      * @return void
 | 
        
           |  |  | 1369 |      * @access public
 | 
        
           |  |  | 1370 |      */
 | 
        
           |  |  | 1371 |     function setType( $type)
 | 
        
           |  |  | 1372 |     {
 | 
        
           |  |  | 1373 |         $this->_type = $type ;
 | 
        
           |  |  | 1374 |     } // end of member function setPresentation
 | 
        
           | 448 | ddelon | 1375 |   | 
        
           | 474 | alexandre_ | 1376 |   | 
        
           | 448 | ddelon | 1377 |     /**
 | 
        
           | 556 | ddelon | 1378 |      * Fonction affichant les participants à un projet
 | 
        
           | 448 | ddelon | 1379 |      *
 | 
        
           |  |  | 1380 |      * @return string
 | 
        
           |  |  | 1381 |      * @access public
 | 
        
           |  |  | 1382 |      */
 | 
        
           |  |  | 1383 |     function voirParticipants( )
 | 
        
           |  |  | 1384 |     {
 | 
        
           |  |  | 1385 |         include_once PROJET_CHEMIN_CLASSES.'HTML_listeParticipants.class.php' ;
 | 
        
           | 1336 | neiluj | 1386 |         include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
 | 
        
           | 448 | ddelon | 1387 |         $projet = new projet ($this->_db, $this->_id_projet) ;
 | 
        
           |  |  | 1388 |         $titre = '<h1>'.$projet->getTitre().'</h1>'."\n" ;
 | 
        
           |  |  | 1389 |         $titre .= '<h2>'.PROJET_LISTE_PARTICIPANT.'</h2>'."\n" ;
 | 
        
           | 1336 | neiluj | 1390 |         include_once PROJET_CHEMIN_CLASSES.'participe.class.php' ;
 | 
        
           | 448 | ddelon | 1391 |         $participants = new participe($this->_db) ;
 | 
        
           | 598 | ddelon | 1392 |   | 
        
           | 448 | ddelon | 1393 |         // On teste ici s'il y a une mise à jour de statut
 | 
        
           |  |  | 1394 |         if (isset($_POST['statut'])) {
 | 
        
           |  |  | 1395 |             // $_GET['id_utilisateur'] et $_GET['statut'] proviennent du formulaire voir HTML_listeParticipants
 | 
        
           |  |  | 1396 |             $participants->setStatut($_POST['statut'], $_GET['id_utilisateur'], $this->_id_projet) ;
 | 
        
           |  |  | 1397 |         }
 | 
        
           | 598 | ddelon | 1398 |   | 
        
           | 1336 | neiluj | 1399 |         // Ce qui suit doit être amàliorà pour sortir la requête sur l'annuaire
 | 
        
           | 448 | ddelon | 1400 |         // On teste s'il y a un ajout d'utilisateur voir HTML_listeParticipants
 | 
        
           |  |  | 1401 |         if (isset($_POST['mail_utilisateur'])) {
 | 
        
           |  |  | 1402 |             $requete = 'select '.PROJET_CHAMPS_ID.' from '.PROJET_ANNUAIRE.' where '.PROJET_CHAMPS_MAIL.'="'.$_POST['mail_utilisateur'].'"';
 | 
        
           |  |  | 1403 |             $resultat = $this->_db->query ($requete) ;
 | 
        
           |  |  | 1404 |             if (DB::isError ($resultat)) {
 | 
        
           |  |  | 1405 |                 die ('Echec de la requete : '.$requete.'<br />'.$resultat->getMessage()) ;
 | 
        
           |  |  | 1406 |             }
 | 
        
           |  |  | 1407 |             if (!$resultat->numRows()) {
 | 
        
           |  |  | 1408 |                 $msg = PROJET_MAIL_ABSENT;
 | 
        
           |  |  | 1409 |             } else {
 | 
        
           |  |  | 1410 |                 $ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC) ;
 | 
        
           |  |  | 1411 |                 $participants->setStatut(3, $ligne[PROJET_CHAMPS_ID], $this->_id_projet) ;
 | 
        
           |  |  | 1412 |             }
 | 
        
           |  |  | 1413 |         }
 | 
        
           | 598 | ddelon | 1414 |   | 
        
           | 448 | ddelon | 1415 |         if ($this->_auth->getAuth()) {
 | 
        
           |  |  | 1416 |             $statut = participe::getStatutSurProjetCourant($this->_auth->getAuthData(PROJET_CHAMPS_ID),  $this->_id_projet, $this->_db) ;
 | 
        
           |  |  | 1417 |             if ($statut == 2) $droits = PROJET_DROIT_CONTRIBUTEUR ;
 | 
        
           |  |  | 1418 |             if ($statut == 1) $droits = PROJET_DROIT_COORDINATEUR ;
 | 
        
           |  |  | 1419 |             if (participe::isAdministrateur($this->_auth->getAuthData(PROJET_CHAMPS_ID), $this->_db)) $droits = PROJET_DROIT_ADMINISTRATEUR  ;
 | 
        
           |  |  | 1420 |             $HTML_listeParticipants = new HTML_listeParticipants(true) ;
 | 
        
           |  |  | 1421 |             if ($statut < 2) $HTML_listeParticipants->setModeModification() ;
 | 
        
           |  |  | 1422 |             // Mise en place de l'url
 | 
        
           |  |  | 1423 |             $this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_ACTION_VOIR_PARTICIPANT) ;
 | 
        
           |  |  | 1424 |             $HTML_listeParticipants->setURL($this->_url) ;
 | 
        
           |  |  | 1425 |             // Construction de l'entete
 | 
        
           |  |  | 1426 |             $entete = array (PROJET_NOM, PROJET_PRENOM) ;
 | 
        
           | 598 | ddelon | 1427 |   | 
        
           | 448 | ddelon | 1428 |             if ($this->_auth->getAuth()) {
 | 
        
           |  |  | 1429 |                 array_push ($entete, PROJET_MAIL) ;
 | 
        
           |  |  | 1430 |             } else {
 | 
        
           |  |  | 1431 |                $droits = PROJET_DROIT_AUCUN ;
 | 
        
           |  |  | 1432 |             }
 | 
        
           |  |  | 1433 |             $info_utilisateur = $participants->getInscrits($this->_id_projet, $droits) ;
 | 
        
           |  |  | 1434 |             array_push ($entete, PROJET_DATE_INSCRIPTION) ;
 | 
        
           |  |  | 1435 |             $HTML_listeParticipants->construitEntete($entete) ;
 | 
        
           | 598 | ddelon | 1436 |   | 
        
           | 448 | ddelon | 1437 |             $HTML_listeParticipants->construitListe($info_utilisateur, statut::getTousLesStatuts(PROJET_STATUT_SAUF_ADM_COORD, $this->_db)) ;
 | 
        
           | 598 | ddelon | 1438 |   | 
        
           | 448 | ddelon | 1439 |             $res = $HTML_listeParticipants->toHTML() ;
 | 
        
           | 598 | ddelon | 1440 |   | 
        
           | 448 | ddelon | 1441 |             if ($statut < 2) {
 | 
        
           |  |  | 1442 |                 $res .= PROJET_NOUVEAU_UTILISATEUR_LAIUS ;
 | 
        
           |  |  | 1443 |                 $res .= '<form action="'.$this->_url->getURL().'" method="post">'."\n" ;
 | 
        
           |  |  | 1444 |                 if (isset ($msg) && $msg != '') {
 | 
        
           |  |  | 1445 |                     $res .= '<div>'.$msg.'</div>' ;
 | 
        
           |  |  | 1446 |                 }
 | 
        
           |  |  | 1447 |                 $res .= '<input type="text" name="mail_utilisateur" size="32" />' ;
 | 
        
           |  |  | 1448 |                 $res .= '<input type="submit" value="'.PROJET_NOUVEAU_UTILISATEUR.'" />'."\n" ;
 | 
        
           |  |  | 1449 |                 $res .= '</form>'."\n" ;
 | 
        
           |  |  | 1450 |             }
 | 
        
           |  |  | 1451 |         } else {
 | 
        
           |  |  | 1452 |             $res .= '<p>'.PROJET_TEXTE_NON_IDENTIFIE.'</p>'."\n" ;
 | 
        
           |  |  | 1453 |         }
 | 
        
           |  |  | 1454 |         return $titre.$res ;
 | 
        
           | 598 | ddelon | 1455 |   | 
        
           | 448 | ddelon | 1456 |     } // end of member function voirParticipants
 | 
        
           |  |  | 1457 |   | 
        
           |  |  | 1458 |     /**
 | 
        
           | 1471 | alexandre_ | 1459 |      * Inscrit un utilisateur a un projet avec le statut observateur
 | 
        
           | 448 | ddelon | 1460 |      *
 | 
        
           |  |  | 1461 |      * @return void
 | 
        
           |  |  | 1462 |      * @access public
 | 
        
           |  |  | 1463 |      */
 | 
        
           |  |  | 1464 |     function inscriptionProjet( )
 | 
        
           |  |  | 1465 |     {
 | 
        
           |  |  | 1466 |         include_once PROJET_CHEMIN_CLASSES.'HTML_formulaireInscriptionProjet.class.php' ;
 | 
        
           | 1336 | neiluj | 1467 | 		include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
 | 
        
           | 448 | ddelon | 1468 |         $projet = new projet ($this->_db, $this->_id_projet) ;
 | 
        
           | 598 | ddelon | 1469 |   | 
        
           | 448 | ddelon | 1470 |         // Si le projet n'a pas de liste, on inscrit directement
 | 
        
           |  |  | 1471 |         if (isset ($this->_id_projet)) {
 | 
        
           | 1336 | neiluj | 1472 |             include_once PROJET_CHEMIN_CLASSES.'participe.class.php' ;
 | 
        
           | 448 | ddelon | 1473 |             $participant = new participe($this->_db) ;
 | 
        
           | 598 | ddelon | 1474 |   | 
        
           | 448 | ddelon | 1475 |             if (!$projet->avoirListe()) {
 | 
        
           | 888 | alexandre_ | 1476 |             	if ($projet->isModere()) {
 | 
        
           |  |  | 1477 |                 	$participant->setStatut(3, $this->_auth->getAuthData (PROJET_CHAMPS_ID), $this->_id_projet) ;
 | 
        
           |  |  | 1478 |             	} else {
 | 
        
           |  |  | 1479 |             		$participant->setStatut(2, $this->_auth->getAuthData (PROJET_CHAMPS_ID), $this->_id_projet) ;
 | 
        
           |  |  | 1480 |             	}
 | 
        
           | 448 | ddelon | 1481 |                 return $this->mesProjets() ;
 | 
        
           |  |  | 1482 |             }
 | 
        
           |  |  | 1483 |         }
 | 
        
           |  |  | 1484 |         if (isset($_POST['valider_inscription_projet'])) {
 | 
        
           |  |  | 1485 |             if (isset($_POST['radio_inscription_liste'])) {
 | 
        
           | 888 | alexandre_ | 1486 |             	include_once PROJET_CHEMIN_CLASSES.'annuaire.class.php' ;
 | 
        
           |  |  | 1487 |             	$utilisateur = new annuaire($this->_db, array('identifiant' => PROJET_CHAMPS_ID,
 | 
        
           |  |  | 1488 | 								'mail' => PROJET_CHAMPS_MAIL, 'table' => PROJET_ANNUAIRE,
 | 
        
           |  |  | 1489 | 								'nom'=> PROJET_CHAMPS_NOM, 'prenom' => PROJET_CHAMPS_PRENOM)) ;
 | 
        
           |  |  | 1490 | 	            $utilisateur->setId($this->_auth->getAuthData(PROJET_CHAMPS_ID)) ;
 | 
        
           |  |  | 1491 |   | 
        
           |  |  | 1492 |             	if (!$projet->isModere()) {
 | 
        
           |  |  | 1493 | 	                $participant->setStatut(2, $this->_auth->getAuthData (PROJET_CHAMPS_ID), $this->_id_projet) ;
 | 
        
           |  |  | 1494 |   | 
        
           |  |  | 1495 | 	                include_once PROJET_CHEMIN_CLASSES.'inscription_liste.class.php' ;
 | 
        
           |  |  | 1496 | 	                $projet->getListesAssociees() ;
 | 
        
           |  |  | 1497 | 	                $inscription_liste = new inscription_liste($this->_db) ;
 | 
        
           |  |  | 1498 | 	                $inscription_liste->inscrireUtilisateur( $utilisateur,
 | 
        
           | 448 | ddelon | 1499 |                                                         $projet->_listes_associes[0],
 | 
        
           |  |  | 1500 |                                                         $_POST['radio_inscription_liste']) ;
 | 
        
           | 888 | alexandre_ | 1501 |             	} else {
 | 
        
           |  |  | 1502 |             		$participant->setStatut(3, $this->_auth->getAuthData (PROJET_CHAMPS_ID), $this->_id_projet) ;
 | 
        
           |  |  | 1503 |             		$tableau_coordinateur = $participant->getCoordinateurs($this->_id_projet) ;
 | 
        
           | 1471 | alexandre_ | 1504 |   | 
        
           | 888 | alexandre_ | 1505 |             		$entetes['From'] = $this->_auth->getUserName();
 | 
        
           |  |  | 1506 | 		            $entetes['To'] = '';
 | 
        
           |  |  | 1507 | 		            $entetes['Subject'] = PROJET_DEMANDE_INSCRIPTION ;
 | 
        
           |  |  | 1508 | 		            $entetes['Date'] = date ('D, M j G:i:s \C\E\S\T Y') ;
 | 
        
           |  |  | 1509 | 		            $entetes['Message-ID'] = md5(time()) ;
 | 
        
           |  |  | 1510 | 		            $entetes['reply-to'] = '' ;
 | 
        
           |  |  | 1511 | 		            $entetes['Content-Type'] = 'text/plain' ;
 | 
        
           |  |  | 1512 |   | 
        
           |  |  | 1513 | 		            $objet_mail =& Mail::factory('smtp');
 | 
        
           |  |  | 1514 | 		            require_once PROJET_CHEMIN_BIBLIOTHEQUE_API.'pear/HTML/Template/IT.php';
 | 
        
           |  |  | 1515 | 				    $tpl = new HTML_Template_IT() ;
 | 
        
           |  |  | 1516 | 				    // Le gabarit du mail est dans un template
 | 
        
           |  |  | 1517 | 				    // template 1
 | 
        
           |  |  | 1518 | 				    $requete = 'select pt_template from projet_template where pt_id_template=1'.
 | 
        
           |  |  | 1519 | 				    			' and pt_i18n like "%'.PROJET_LANGUE_DEFAUT.'"' ;
 | 
        
           |  |  | 1520 |   | 
        
           |  |  | 1521 | 				    if (!$tpl -> setTemplate($this->_db->getOne ($requete))) {
 | 
        
           |  |  | 1522 | 				    	echo 'erreur' ;
 | 
        
           |  |  | 1523 | 				    }
 | 
        
           |  |  | 1524 | 					$tpl->setVariable('nom', $utilisateur->getInfo( 'nom')) ;
 | 
        
           |  |  | 1525 | 					$tpl->setVariable('prenom', $utilisateur->getInfo( 'prenom')) ;
 | 
        
           |  |  | 1526 | 					$tpl->setVariable('nom_projet', $projet->getTitre()) ;
 | 
        
           |  |  | 1527 | 					$tpl->setVariable('lien', str_replace ('&', '&', $this->_url->getURL())) ;
 | 
        
           | 1754 | alexandre_ | 1528 |   | 
        
           | 888 | alexandre_ | 1529 |             		foreach ($tableau_coordinateur as $coordinateur) {
 | 
        
           | 1754 | alexandre_ | 1530 |             			$entetes['To'] .= $coordinateur[3].',';	// Le champs 3 est le mail
 | 
        
           | 888 | alexandre_ | 1531 |             		}
 | 
        
           | 1754 | alexandre_ | 1532 |             		// On enleve la virgule finale
 | 
        
           |  |  | 1533 |             		$entetes['To'] = substr ($entetes['To'], 0, count ($entetes['To']) - 1);
 | 
        
           |  |  | 1534 |   | 
        
           |  |  | 1535 |             		// on envoie le mail
 | 
        
           |  |  | 1536 |             		$objet_mail->send($entetes['To'], $entetes, html_entity_decode ($tpl->get()));
 | 
        
           | 888 | alexandre_ | 1537 |             	}
 | 
        
           | 448 | ddelon | 1538 |             }
 | 
        
           | 598 | ddelon | 1539 |   | 
        
           | 448 | ddelon | 1540 |             if ($this->_presentation != 'arbre') {
 | 
        
           | 1716 | alexandre_ | 1541 |                 if ($projet->isModere()) return '<h1>'.$projet->getTitre().'</h1>'.
 | 
        
           | 1471 | alexandre_ | 1542 |                 		str_replace ('nom_du_projet', $projet->getTitre(), PROJET_LAIUS_INSCRIPTION_MODERE);
 | 
        
           | 1716 | alexandre_ | 1543 |                 		else $this->_action = PROJET_ACTION_VOIR_RESUME;
 | 
        
           | 448 | ddelon | 1544 |             } else {
 | 
        
           |  |  | 1545 |                 $this->_action = PROJET_ACTION_VOIR_RESUME;
 | 
        
           |  |  | 1546 |             }
 | 
        
           | 1471 | alexandre_ | 1547 |             return PROJET_LAIUS_INSCRIPTION_MODERE;
 | 
        
           | 448 | ddelon | 1548 |         }
 | 
        
           |  |  | 1549 |         $res = '<h1>'.PROJET_INSCRIPTION_PROJET.' : '.$projet->getTitre().'</h1>'."\n" ;
 | 
        
           |  |  | 1550 |         if ($projet->avoirListe()) $res .= '<h2>'.PROJET_MESSAGE_LISTE.'</h2>'."\n" ;
 | 
        
           |  |  | 1551 |         //$participant = new participe($this->_db) ;
 | 
        
           |  |  | 1552 |         $this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_S_INSCRIRE) ;
 | 
        
           |  |  | 1553 |         $HTML_formulaireInscriptionProjet = new HTML_formulaireInscriptionProjet('inscription_projet', 'post', str_replace ('&', '&', $this->_url->getURL())) ;
 | 
        
           |  |  | 1554 |         $HTML_formulaireInscriptionProjet->construitFormulaire($projet) ;
 | 
        
           |  |  | 1555 |         $HTML_formulaireInscriptionProjet->setDefaults(array('radio_inscription_liste' => 2)) ;
 | 
        
           |  |  | 1556 |         return $res.$HTML_formulaireInscriptionProjet->toHTML() ;
 | 
        
           |  |  | 1557 |     } // end of member function inscriptionProjet
 | 
        
           |  |  | 1558 |   | 
        
           |  |  | 1559 |     /**
 | 
        
           | 1471 | alexandre_ | 1560 |      * Inscrit l'utilisateur loggue a la liste dont le parametre est en post.
 | 
        
           | 448 | ddelon | 1561 |      *
 | 
        
           |  |  | 1562 |      * @return void
 | 
        
           |  |  | 1563 |      * @access public
 | 
        
           |  |  | 1564 |      */
 | 
        
           |  |  | 1565 |     function inscriptionListe( )
 | 
        
           |  |  | 1566 |     {
 | 
        
           | 1336 | neiluj | 1567 |         include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
 | 
        
           | 448 | ddelon | 1568 |         $projet = new projet ($this->_db, $this->_id_projet) ;
 | 
        
           |  |  | 1569 |         include_once PROJET_CHEMIN_CLASSES.'annuaire.class.php' ;
 | 
        
           |  |  | 1570 |         include_once PROJET_CHEMIN_CLASSES.'inscription_liste.class.php' ;
 | 
        
           |  |  | 1571 |         $projet->getListesAssociees() ;
 | 
        
           |  |  | 1572 |         $utilisateur = new annuaire($this->_db, array('identifiant' => PROJET_CHAMPS_ID, 'mail' => PROJET_CHAMPS_MAIL, 'table' => PROJET_ANNUAIRE)) ;
 | 
        
           |  |  | 1573 |         $utilisateur->setId($this->_auth->getAuthData(PROJET_CHAMPS_ID)) ;
 | 
        
           |  |  | 1574 |         $inscription_liste = new inscription_liste($this->_db) ;
 | 
        
           |  |  | 1575 |         $inscription_liste->inscrireUtilisateur( $utilisateur, $projet->_listes_associes[0], 2) ;  // 2 est la statut inscription normale
 | 
        
           |  |  | 1576 |     } // end of member function inscriptionListe
 | 
        
           |  |  | 1577 |   | 
        
           |  |  | 1578 |     /**
 | 
        
           | 1336 | neiluj | 1579 |      * Inscrit l'utilisateur logué à la liste dont le paraître est en post.
 | 
        
           | 448 | ddelon | 1580 |      *
 | 
        
           |  |  | 1581 |      * @return void
 | 
        
           |  |  | 1582 |      * @access public
 | 
        
           |  |  | 1583 |      */
 | 
        
           |  |  | 1584 |     function desinscriptionListe( )
 | 
        
           |  |  | 1585 |     {
 | 
        
           |  |  | 1586 |         if (isset($_GET['inscription_liste']) || $this->_action = PROJET_ACTION_DESINSCRIPTION_LISTE) {
 | 
        
           | 1336 | neiluj | 1587 |             include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
 | 
        
           | 448 | ddelon | 1588 |             $projet = new projet ($this->_db, $this->_id_projet) ;
 | 
        
           |  |  | 1589 |             include_once PROJET_CHEMIN_CLASSES.'annuaire.class.php' ;
 | 
        
           |  |  | 1590 |             include_once PROJET_CHEMIN_CLASSES.'inscription_liste.class.php' ;
 | 
        
           |  |  | 1591 |             $projet->getListesAssociees() ;
 | 
        
           | 516 | alexandre_ | 1592 |             $utilisateur = new annuaire($this->_db, array('identifiant' => PROJET_CHAMPS_ID,
 | 
        
           |  |  | 1593 |             								 'mail' => PROJET_CHAMPS_MAIL,
 | 
        
           |  |  | 1594 |             								 'table' => PROJET_ANNUAIRE)) ;
 | 
        
           | 448 | ddelon | 1595 |             $utilisateur->setId($this->_auth->getAuthData(PROJET_CHAMPS_ID)) ;
 | 
        
           |  |  | 1596 |             $inscription_liste = new inscription_liste($this->_db) ;
 | 
        
           |  |  | 1597 |             $inscription_liste->desinscrireUtilisateur( $utilisateur, $projet->_listes_associes[0], $_GET['inscription_liste']) ;
 | 
        
           |  |  | 1598 |         }
 | 
        
           |  |  | 1599 |     } // end of member function inscriptionListe
 | 
        
           |  |  | 1600 |     /**
 | 
        
           |  |  | 1601 |      * desinscrit un utilisateur à un projet
 | 
        
           |  |  | 1602 |      *
 | 
        
           |  |  | 1603 |      * @return void
 | 
        
           |  |  | 1604 |      * @access public
 | 
        
           |  |  | 1605 |      */
 | 
        
           |  |  | 1606 |     function desinscriptionProjet( )
 | 
        
           |  |  | 1607 |     {
 | 
        
           |  |  | 1608 |         include_once PROJET_CHEMIN_CLASSES.'participe.class.php' ;
 | 
        
           |  |  | 1609 |         $participant = new participe($this->_db) ;
 | 
        
           | 598 | ddelon | 1610 |   | 
        
           | 448 | ddelon | 1611 |         // Le statut 4 désinscrit l'utilisateur, dans la méthode setStatut
 | 
        
           |  |  | 1612 |         $participant->setStatut(4, $this->_auth->getAuthData (PROJET_CHAMPS_ID), $this->_id_projet) ;
 | 
        
           | 1336 | neiluj | 1613 |         include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
 | 
        
           | 448 | ddelon | 1614 |         $projet = new projet ($this->_db, $this->_id_projet) ;
 | 
        
           |  |  | 1615 |         $projet->getListesAssociees() ;
 | 
        
           |  |  | 1616 |         if ($projet->avoirListe()) {
 | 
        
           |  |  | 1617 |             include_once PROJET_CHEMIN_CLASSES.'annuaire.class.php' ;
 | 
        
           |  |  | 1618 |             $annuaire = new annuaire($this->_db, array('identifiant' => PROJET_CHAMPS_ID, 'mail' => PROJET_CHAMPS_MAIL, 'table' => PROJET_ANNUAIRE)) ;
 | 
        
           |  |  | 1619 |             $annuaire->setId($this->_auth->getAuthData(PROJET_CHAMPS_ID)) ;
 | 
        
           |  |  | 1620 |             include_once PROJET_CHEMIN_CLASSES.'inscription_liste.class.php' ;
 | 
        
           |  |  | 1621 |             $desinscription= new inscription_liste($this->_db) ;
 | 
        
           |  |  | 1622 |             $desinscription->desinscrireUtilisateur($annuaire, $projet->_listes_associes[0]) ;
 | 
        
           |  |  | 1623 |         }
 | 
        
           |  |  | 1624 |         if ($this->_presentation != 'arbre') {
 | 
        
           | 888 | alexandre_ | 1625 |             include_once PROJET_CHEMIN_APPLI.'actions/resume.php' ;
 | 
        
           |  |  | 1626 |             return $retour ;
 | 
        
           | 448 | ddelon | 1627 |         } else {
 | 
        
           |  |  | 1628 |             $this->_action = PROJET_ACTION_VOIR_RESUME;
 | 
        
           |  |  | 1629 |         }
 | 
        
           |  |  | 1630 |     } // end of member function inscriptionProjet
 | 
        
           |  |  | 1631 |   | 
        
           |  |  | 1632 |     /**
 | 
        
           |  |  | 1633 |      * Renvoie le formulaire de création d'un wiki
 | 
        
           |  |  | 1634 |      *
 | 
        
           |  |  | 1635 |      * @return void
 | 
        
           |  |  | 1636 |      * @access public
 | 
        
           |  |  | 1637 |      */
 | 
        
           |  |  | 1638 |     function formulaireWiki( )
 | 
        
           |  |  | 1639 |     {
 | 
        
           | 598 | ddelon | 1640 |   | 
        
           |  |  | 1641 | 		require_once 'client/integrateur_wikini/bibliotheque/iw_admin_wikini.fonct.php';
 | 
        
           |  |  | 1642 |   | 
        
           | 599 | ddelon | 1643 |   | 
        
           | 600 | ddelon | 1644 |   		$url = &$GLOBALS['_GEN_commun']['url'] ;
 | 
        
           | 599 | ddelon | 1645 | 		$url->addQueryString ('act', PROJET_ACTION_CREER_WIKI) ;
 | 
        
           | 635 | alexandre_ | 1646 | 		$url->addQueryString (PROJET_VARIABLE_ID_PROJET, $this->_id_projet) ;
 | 
        
           | 598 | ddelon | 1647 | 		$res =admin_afficherContenuCorps();
 | 
        
           | 635 | alexandre_ | 1648 | 		$res .= '<br /><a href="'.$this->_url->getURL().'">'.PROJET_RETOUR_RESUME.'</a>';
 | 
        
           | 598 | ddelon | 1649 |     	return $res;
 | 
        
           |  |  | 1650 |   | 
        
           | 448 | ddelon | 1651 |     } // end of member function formulaireWiki
 | 
        
           |  |  | 1652 |   | 
        
           | 487 | ddelon | 1653 |   | 
        
           |  |  | 1654 | 	function associerWiki( )
 | 
        
           |  |  | 1655 |     {
 | 
        
           |  |  | 1656 |         $res = '<h1>'.PROJET_ASSOCIER_WIKI.'</h1>'."\n" ;
 | 
        
           | 598 | ddelon | 1657 |   | 
        
           |  |  | 1658 | 	 	$db = &$GLOBALS['_GEN_commun']['pear_db'] ;
 | 
        
           | 487 | ddelon | 1659 |     	$res='';
 | 
        
           | 598 | ddelon | 1660 |   | 
        
           | 487 | ddelon | 1661 |          // Comportement par défaut
 | 
        
           | 598 | ddelon | 1662 | 	    // requete sur la table gen_wikini pour affichage de la liste des Wikini
 | 
        
           | 487 | ddelon | 1663 | 	    $requete = "select  gewi_id_wikini, gewi_code_alpha_wikini, gewi_page from gen_wikini" ;
 | 
        
           | 598 | ddelon | 1664 |   | 
        
           | 487 | ddelon | 1665 | 	    $resultat = $db->query ($requete) ;
 | 
        
           |  |  | 1666 | 	    if (DB::isError ($resultat)) {
 | 
        
           |  |  | 1667 | 	        $GLOBALS['_GEN_commun']['debogage_erreur']->gererErreur(E_USER_WARNING, "Echec de la requete : $requete<br />".$resultat->getMessage(),
 | 
        
           |  |  | 1668 | 	                                                                        __FILE__, __LINE__, 'admin_wikini')   ;
 | 
        
           |  |  | 1669 | 	        return ;
 | 
        
           |  |  | 1670 | 	    }
 | 
        
           | 598 | ddelon | 1671 |   | 
        
           |  |  | 1672 |   | 
        
           | 487 | ddelon | 1673 | 	    $liste = new HTML_TableFragmenteur () ;
 | 
        
           | 545 | ddelon | 1674 | 	    $liste->construireEntete(array (PROJET_NOM_WIKINI,PROJET_PAGE_WIKINI, PROJET_SELECTIONNER_WIKINI)) ;
 | 
        
           | 598 | ddelon | 1675 |   | 
        
           | 487 | ddelon | 1676 | 	    $tableau_wikini = array() ;
 | 
        
           | 598 | ddelon | 1677 |   | 
        
           | 487 | ddelon | 1678 | 	    while ($ligne = $resultat->fetchRow()) {
 | 
        
           |  |  | 1679 | 	        $this->_url->addQueryString ('id_wikini', $ligne[0]) ;
 | 
        
           | 1336 | neiluj | 1680 | 	        array_push ($tableau_wikini, array ($ligne[1]."\n",    // première colonne, le nom de l'application
 | 
        
           | 487 | ddelon | 1681 | 										        $ligne[2]."\n",    // Deuxieme colonne, la page par defaut
 | 
        
           | 545 | ddelon | 1682 | 	        								  '<a href="'.$this->_url->getURL()."&".PROJET_VARIABLE_ACTION."=".PROJET_ACTION_ASSOCIER_WIKI_V."".'">'.PROJET_CHOISIR_WIKINI.'</a>'."\n",
 | 
        
           | 487 | ddelon | 1683 | 	                                            ));
 | 
        
           |  |  | 1684 | 	    }
 | 
        
           |  |  | 1685 | 	    $liste->construireListe($tableau_wikini) ;
 | 
        
           |  |  | 1686 | 	    $res .= $liste->toHTML();
 | 
        
           | 616 | alexandre_ | 1687 | 	    $this->_url->removeQueryString(PROJET_VARIABLE_ACTION) ;
 | 
        
           | 487 | ddelon | 1688 | 	    return $res ;
 | 
        
           | 598 | ddelon | 1689 |   | 
        
           |  |  | 1690 |   | 
        
           |  |  | 1691 |   | 
        
           | 487 | ddelon | 1692 |     } // end of member function formulaireWiki
 | 
        
           |  |  | 1693 |   | 
        
           | 448 | ddelon | 1694 |   | 
        
           | 545 | ddelon | 1695 |     /**
 | 
        
           |  |  | 1696 |      * Associe un wiki au projet courant
 | 
        
           |  |  | 1697 |      *
 | 
        
           |  |  | 1698 |      * @return void
 | 
        
           |  |  | 1699 |      * @access public
 | 
        
           |  |  | 1700 |      */
 | 
        
           | 448 | ddelon | 1701 |   | 
        
           | 545 | ddelon | 1702 | 	function associationWiki( )  {
 | 
        
           | 598 | ddelon | 1703 |   | 
        
           |  |  | 1704 |   | 
        
           | 545 | ddelon | 1705 |     	if (isset($_GET['id_wikini'])) {
 | 
        
           |  |  | 1706 |     		$db = &$GLOBALS['_GEN_commun']['pear_db'] ;
 | 
        
           |  |  | 1707 | 		    $requete = "select gewi_code_alpha_wikini from gen_wikini where gewi_id_wikini = ".$_GET['id_wikini'] ;
 | 
        
           |  |  | 1708 | 	    	$resultat = $db->query ($requete) ;
 | 
        
           |  |  | 1709 | 	    	if (DB::isError ($resultat)) {
 | 
        
           |  |  | 1710 | 	        	$GLOBALS['_GEN_commun']['debogage_erreur']->gererErreur(E_USER_WARNING, "Echec de la requete : $requete<br />".$resultat->getMessage(),
 | 
        
           |  |  | 1711 | 	            	                                                            __FILE__, __LINE__, 'admin_wikini')   ;
 | 
        
           |  |  | 1712 | 	        	return ;
 | 
        
           |  |  | 1713 | 	    	}
 | 
        
           | 598 | ddelon | 1714 |   | 
        
           | 545 | ddelon | 1715 | 	    	$ligne = $resultat->fetchRow();
 | 
        
           | 1336 | neiluj | 1716 | 	    	include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
 | 
        
           | 545 | ddelon | 1717 | 			$projet = new projet($this->_db, $this->_id_projet) ;
 | 
        
           |  |  | 1718 |         	$projet->majNomWikini($ligne[0]);
 | 
        
           |  |  | 1719 |     	}
 | 
        
           | 598 | ddelon | 1720 |   | 
        
           | 545 | ddelon | 1721 | 	}
 | 
        
           |  |  | 1722 |   | 
        
           | 448 | ddelon | 1723 |     /**
 | 
        
           |  |  | 1724 |      * Supprime le wiki du projet courant
 | 
        
           |  |  | 1725 |      *
 | 
        
           |  |  | 1726 |      * @return void
 | 
        
           |  |  | 1727 |      * @access public
 | 
        
           |  |  | 1728 |      */
 | 
        
           |  |  | 1729 |     function supprimerWiki( )
 | 
        
           |  |  | 1730 |     {
 | 
        
           |  |  | 1731 |         include_once PROJET_CHEMIN_CLASSES.'gestion_wikini.class.php' ;
 | 
        
           |  |  | 1732 |         // On crée une nouvelle connexion avec les paramètres spécifiques aux wikinis
 | 
        
           |  |  | 1733 |         $connexion_bd = DB::connect('mysql://'.PROJET_UTILISATEUR_WIKINI.':'.PROJET_MDP_WIKINI.'@'.PROJET_HOTE_WIKINI.'/'.PROJET_DB_WIKINI) ;
 | 
        
           |  |  | 1734 |         $gerantWiki = new gestion_wikini($connexion_bd) ;
 | 
        
           | 1336 | neiluj | 1735 |         include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
 | 
        
           | 448 | ddelon | 1736 |         $projet = new projet ($this->_db, $this->_id_projet) ;
 | 
        
           |  |  | 1737 |         $gerantWiki->suppression_tables(strtolower($projet->getWikini())) ;
 | 
        
           |  |  | 1738 |         $projet->majNomWikini('') ;
 | 
        
           |  |  | 1739 |     } // end of member function supprimerWiki
 | 
        
           |  |  | 1740 |   | 
        
           |  |  | 1741 |     /**
 | 
        
           |  |  | 1742 |      * Permet de lier une ou plusieurs listes de la table agora à un projet.
 | 
        
           |  |  | 1743 |      *
 | 
        
           |  |  | 1744 |      * @return string
 | 
        
           |  |  | 1745 |      * @access public
 | 
        
           |  |  | 1746 |      */
 | 
        
           |  |  | 1747 |     function referencerListeExterne( )
 | 
        
           |  |  | 1748 |     {
 | 
        
           | 1191 | alexandre_ | 1749 |         $requete = 'show tables like \'agora\'' ;
 | 
        
           |  |  | 1750 |         $resultat = $this->_db->query ($requete);
 | 
        
           |  |  | 1751 |         if ($resultat->numRows() == 0) {
 | 
        
           |  |  | 1752 |         	return 'Cette fonctionnalité n\'est pas active' ;
 | 
        
           |  |  | 1753 |         }
 | 
        
           | 448 | ddelon | 1754 |         $res = '<h1>'.PROJET_REFERENCER_LISTE.'</h1>' ;
 | 
        
           |  |  | 1755 |         include_once PROJET_CHEMIN_CLASSES.'liste_externe.class.php' ;
 | 
        
           |  |  | 1756 |         $liste_externe = new liste_externe($this->_db) ;
 | 
        
           |  |  | 1757 |         include_once PROJET_CHEMIN_CLASSES.'HTML_formulaireListeExterne.class.php' ;
 | 
        
           |  |  | 1758 |         $this->_url->addQueryString(PROJET_VARIABLE_ID_PROJET, $this->_id_projet) ;
 | 
        
           |  |  | 1759 |         $this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_REFERENCER_LISTE_V) ;
 | 
        
           |  |  | 1760 |         $HTML_formulaireListeExterne = new HTML_formulaireListeExterne('formulaire_liste_externe', 'post', str_replace('&', '&', $this->_url->getURL())) ;
 | 
        
           |  |  | 1761 |         $HTML_formulaireListeExterne->construitFormulaire($liste_externe->getListeNom()) ;
 | 
        
           |  |  | 1762 |         $liste_assoc = $liste_externe->getListesAssociees($this->_id_projet) ;
 | 
        
           |  |  | 1763 |         $default = array() ;
 | 
        
           |  |  | 1764 |         foreach ($liste_assoc as $val) $default['liste_'.$val] = 1 ;
 | 
        
           |  |  | 1765 |   | 
        
           |  |  | 1766 |         $HTML_formulaireListeExterne->setDefaults($default) ;
 | 
        
           |  |  | 1767 |         return $res.$HTML_formulaireListeExterne->toHTML() ;
 | 
        
           |  |  | 1768 |     } // end of member function referencerListeExterne
 | 
        
           |  |  | 1769 |   | 
        
           |  |  | 1770 |     /**
 | 
        
           |  |  | 1771 |      * Réalise les mises à jours dans la table projet_lien_liste_externe
 | 
        
           |  |  | 1772 |      *
 | 
        
           |  |  | 1773 |      * @return void
 | 
        
           |  |  | 1774 |      * @access public
 | 
        
           |  |  | 1775 |      */
 | 
        
           |  |  | 1776 |     function referencerListeExterneValidation( )
 | 
        
           |  |  | 1777 |     {
 | 
        
           |  |  | 1778 |         include_once PROJET_CHEMIN_CLASSES.'liste_externe.class.php' ;
 | 
        
           |  |  | 1779 |         $liste_externe = new liste_externe($this->_db) ;
 | 
        
           |  |  | 1780 |         include_once PROJET_CHEMIN_CLASSES.'HTML_formulaireListeExterne.class.php' ;
 | 
        
           |  |  | 1781 |         $HTML_formulaireListeExterne = new HTML_formulaireListeExterne('formulaire_liste_externe', 'post', str_replace('&', '&', $this->_url->getURL())) ;
 | 
        
           |  |  | 1782 |         $HTML_formulaireListeExterne->construitFormulaire($liste_externe->getListeNom()) ;
 | 
        
           | 598 | ddelon | 1783 |   | 
        
           | 448 | ddelon | 1784 |         $liste_externe->enregistrerSQL($HTML_formulaireListeExterne->getSubmitValues(), $this->_id_projet) ;
 | 
        
           |  |  | 1785 |     } // end of member function referencerListeExterneValidation
 | 
        
           |  |  | 1786 |   | 
        
           | 474 | alexandre_ | 1787 |     /**
 | 
        
           |  |  | 1788 |      * permet d'exclure un projet de l'affichage
 | 
        
           |  |  | 1789 |      *
 | 
        
           |  |  | 1790 |      * @return void
 | 
        
           |  |  | 1791 |      * @access public
 | 
        
           |  |  | 1792 |      */
 | 
        
           |  |  | 1793 |     function exclure($id_projet)
 | 
        
           |  |  | 1794 |     {
 | 
        
           |  |  | 1795 |        array_push ($this->_projet_exclu, $id_projet) ;
 | 
        
           |  |  | 1796 |     } // end of member function exclure
 | 
        
           | 448 | ddelon | 1797 |   | 
        
           | 570 | alexandre_ | 1798 |     /**
 | 
        
           |  |  | 1799 |      * permet d'exclure un projet de l'affichage
 | 
        
           |  |  | 1800 |      *
 | 
        
           |  |  | 1801 |      * @return void
 | 
        
           |  |  | 1802 |      * @access public
 | 
        
           |  |  | 1803 |      */
 | 
        
           |  |  | 1804 |     function setPrive()
 | 
        
           |  |  | 1805 |     {
 | 
        
           |  |  | 1806 |        $this->_prive = 1 ;
 | 
        
           |  |  | 1807 |     } // end of member function exclure
 | 
        
           | 448 | ddelon | 1808 |   | 
        
           | 474 | alexandre_ | 1809 |   | 
        
           | 570 | alexandre_ | 1810 |   | 
        
           | 448 | ddelon | 1811 |     /**
 | 
        
           |  |  | 1812 |      * Renvoie un message d'erreur, en fonction du code de l'erreur.
 | 
        
           |  |  | 1813 |      *
 | 
        
           |  |  | 1814 |      * @param int valeur Le code du message d'erreur.
 | 
        
           |  |  | 1815 |      * @return string
 | 
        
           |  |  | 1816 |      * @access public
 | 
        
           |  |  | 1817 |      */
 | 
        
           |  |  | 1818 |     function messageErreur( $valeur )
 | 
        
           |  |  | 1819 |     {
 | 
        
           |  |  | 1820 |         $messageErreur = array (
 | 
        
           |  |  | 1821 |                     PROJETCONTROLEUR_ACTION_INVALIDE => "Action non valide",
 | 
        
           | 1471 | alexandre_ | 1822 |                     PROJETCONTROLEUR_ERREUR_SUPPRESSION_REPERTOIRE => "Impossible de supprimer le répertoire",
 | 
        
           |  |  | 1823 |                     PROJETCONTROLEUR_PAS_DE_DOCUMENT_SELECTIONNE => 'Pas de fichier sélectionné',
 | 
        
           |  |  | 1824 |                     PROJETCONTROLEUR_ERREUR_CREATION_REPERTOIRE => 'Impossible de créer le répertoire'
 | 
        
           | 448 | ddelon | 1825 |         ) ;
 | 
        
           |  |  | 1826 |         return '<p class="erreur">'.$messageErreur[$valeur].'</p>' ;
 | 
        
           |  |  | 1827 |     } // end of member function messageErreur
 | 
        
           |  |  | 1828 |   | 
        
           |  |  | 1829 |   | 
        
           |  |  | 1830 |   | 
        
           |  |  | 1831 |   | 
        
           |  |  | 1832 | } // end of projetControleur
 | 
        
           |  |  | 1833 | ?>
 |