Subversion Repositories Applications.projet

Rev

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

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