Subversion Repositories Applications.projet

Rev

Rev 31 | Rev 40 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

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