Subversion Repositories Applications.projet

Rev

Rev 15 | Rev 22 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

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