Subversion Repositories Applications.papyrus

Rev

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

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