Subversion Repositories Applications.projet

Rev

Rev 54 | Rev 60 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 54 Rev 59
Line 1... Line 1...
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
// +------------------------------------------------------------------------------------------------------+
Line 18... Line 18...
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
// +------------------------------------------------------------------------------------------------------+
Line 22... Line 22...
22
 
22
 
Line 23... Line 23...
23
// CVS : $Id: projetControleur.class.php,v 1.16 2005-10-25 13:48:27 alexandre_tb Exp $
23
// CVS : $Id: projetControleur.class.php,v 1.17 2005-11-14 10:14:30 ddelon Exp $
24
 
24
 
25
/**
25
/**
26
* Application projet
26
* Application projet
Line 31... Line 31...
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.16 $
36
*@version       $Revision: 1.17 $
37
// +------------------------------------------------------------------------------------------------------+
37
// +------------------------------------------------------------------------------------------------------+
38
*/
38
*/
Line 39... Line 39...
39
 
39
 
40
// +------------------------------------------------------------------------------------------------------+
40
// +------------------------------------------------------------------------------------------------------+
Line 142... Line 142...
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
     */
Line 181... Line 181...
181
   /**
181
   /**
182
     * Le type du projets, par défaut 0, signifie en pas de type particumier.
182
     * Le type du projets, par défaut 0, signifie en pas de type particumier.
183
     * Valeurs possibles: 0, 1, 2, 3 ...
183
     * Valeurs possibles: 0, 1, 2, 3 ...
184
     * @access private
184
     * @access private
185
     */
185
     */
186
     
186
 
187
     var $_type ;
187
     var $_type ;
188
   /**
188
   /**
189
     * Le tableau des projets à ne pas afficher, ni dans l'arbre, ni dans les listes
189
     * Le tableau des projets à ne pas afficher, ni dans l'arbre, ni dans les listes
190
     * @access private
190
     * @access private
191
     */
191
     */
192
 	var $_projet_exclu = array();
192
 	var $_projet_exclu = array();
193
 	
193
 
194
 	/**
194
 	/**
195
     * parametre indiquant le type d'inscription possible
195
     * parametre indiquant le type d'inscription possible
196
     * @access private
196
     * @access private
197
     */
197
     */
198
 	var $_prive = 0 ;
198
 	var $_prive = 0 ;
199
 	
199
 
200
    /**
200
    /**
201
     * Méthode principale de la classe. Elle permet d'appeler les méthodes du modules
201
     * Méthode principale de la classe. Elle permet d'appeler les méthodes du modules
202
     * projet en fonction de l'action.
202
     * projet en fonction de l'action.
203
     *
203
     *
204
     * @return string
204
     * @return string
Line 208... Line 208...
208
    function run( )
208
    function run( )
209
    {
209
    {
210
        if ($this->_action == '') {
210
        if ($this->_action == '') {
211
            return $this->messageErreur(PROJETCONTROLEUR_ACTION_INVALIDE) ;
211
            return $this->messageErreur(PROJETCONTROLEUR_ACTION_INVALIDE) ;
212
        }
212
        }
213
        
213
 
214
        // Si il n'y a pas d'action mais un projet, on transmet par défaut l'action PROJET_VOIR
214
        // Si il n'y a pas d'action mais un projet, on transmet par défaut l'action PROJET_VOIR
215
        if ($this->_id_projet != "" && $this->_action == PROJET_DEFAUT) {
215
        if ($this->_id_projet != "" && $this->_action == PROJET_DEFAUT) {
216
            $this->_action = PROJET_ACTION_VOIR_RESUME ;
216
            $this->_action = PROJET_ACTION_VOIR_RESUME ;
217
            $this->_url->addQueryString (PROJET_VARIABLE_ID_PROJET, $this->_id_projet) ;
217
            $this->_url->addQueryString (PROJET_VARIABLE_ID_PROJET, $this->_id_projet) ;
218
        }
218
        }
Line 222... Line 222...
222
        if ($this->_id_repertoire != '') {
222
        if ($this->_id_repertoire != '') {
223
            $this->_url->addQueryString (PROJET_VARIABLE_ID_REPERTOIRE, $this->_id_repertoire) ;
223
            $this->_url->addQueryString (PROJET_VARIABLE_ID_REPERTOIRE, $this->_id_repertoire) ;
224
        }
224
        }
225
        $retour = '' ;
225
        $retour = '' ;
226
        if (!defined('PROJET_MENU_AFFICHER_CONTENU_CORPS')) $retour = $this->menuGeneral() ;
226
        if (!defined('PROJET_MENU_AFFICHER_CONTENU_CORPS')) $retour = $this->menuGeneral() ;
227
        
227
 
228
        switch ($this->_action) {
228
        switch ($this->_action) {
229
            case PROJET_DEFAUT :
229
            case PROJET_DEFAUT :
230
                $retour .= $this->mesProjets() ;
230
                $retour .= $this->mesProjets() ;
231
            break ;
231
            break ;
232
            case PROJET_VOIR :
232
            case PROJET_VOIR :
Line 289... Line 289...
289
            break ;
289
            break ;
290
            case PROJET_MODIFIER_DESCRIPTION_V : $retour .= $this->modifierProjet() ;
290
            case PROJET_MODIFIER_DESCRIPTION_V : $retour .= $this->modifierProjet() ;
291
                $this->_action = PROJET_ACTION_VOIR_RESUME ;
291
                $this->_action = PROJET_ACTION_VOIR_RESUME ;
292
            break ;
292
            break ;
293
            case  PROJET_ACTION_S_INSCRIRE : $retour .= $this->inscriptionProjet() ;
293
            case  PROJET_ACTION_S_INSCRIRE : $retour .= $this->inscriptionProjet() ;
294
                
294
 
295
            break ;
295
            break ;
296
            case PROJET_ACTION_DESINSCRIPTION_PROJET : $retour .= $this->desinscriptionProjet() ;
296
            case PROJET_ACTION_DESINSCRIPTION_PROJET : $retour .= $this->desinscriptionProjet() ;
297
            break ;
297
            break ;
298
            case PROJET_ACTION_CREER_WIKI : $retour .= $this->formulaireWiki() ;
298
            case PROJET_ACTION_CREER_WIKI : $retour .= $this->formulaireWiki() ;
299
            break ;
299
            break ;
Line 316... Line 316...
316
            case PROJET_ACTION_REFERENCER_LISTE : $retour .= $this->referencerListeExterne() ;
316
            case PROJET_ACTION_REFERENCER_LISTE : $retour .= $this->referencerListeExterne() ;
317
            break ;
317
            break ;
318
            case PROJET_ACTION_REFERENCER_LISTE_V : $retour .= $this->referencerListeExterneValidation() ;
318
            case PROJET_ACTION_REFERENCER_LISTE_V : $retour .= $this->referencerListeExterneValidation() ;
319
                $this->_action = PROJET_ACTION_VOIR_RESUME ;
319
                $this->_action = PROJET_ACTION_VOIR_RESUME ;
320
            break ;
320
            break ;
321
            
321
 
322
        }
322
        }
323
        if (!is_int($this->_action)) {
323
        if (!is_int($this->_action)) {
324
            if (file_exists(PROJET_CHEMIN_APPLI.'actions/'.$this->_action.'.php')) {
324
            if (file_exists(PROJET_CHEMIN_APPLI.'actions/'.$this->_action.'.php')) {
325
                include_once PROJET_CHEMIN_APPLI.'actions/'.$this->_action.'.php' ;
325
                include_once PROJET_CHEMIN_APPLI.'actions/'.$this->_action.'.php' ;
326
            }
326
            }
Line 340... Line 340...
340
    {
340
    {
341
        $this->_action = $action ;
341
        $this->_action = $action ;
342
    } // end of member function setAction
342
    } // end of member function setAction
Line 343... Line 343...
343
 
343
 
344
    /**
344
    /**
345
     * Constructeur. 
345
     * Constructeur.
346
     *
346
     *
347
     * @return void
347
     * @return void
348
     * @access public
348
     * @access public
349
     */
349
     */
Line 355... Line 355...
355
        $this->_type = '' ;
355
        $this->_type = '' ;
356
        if (is_object ($urlObjet)) {
356
        if (is_object ($urlObjet)) {
357
            $this->_url = $urlObjet ;
357
            $this->_url = $urlObjet ;
358
        }
358
        }
359
    } // end of member function projetControleur
359
    } // end of member function projetControleur
360
    
360
 
361
    /**
361
    /**
362
     * Renvoie la liste des projets auquel participe la personne logguée, avec son
362
     * Renvoie la liste des projets auquel participe la personne logguée, avec son
363
     * statut et un lien vers l'action pour gérer le projet.
363
     * statut et un lien vers l'action pour gérer le projet.
364
     *
364
     *
365
     * @return string
365
     * @return string
Line 369... Line 369...
369
    {
369
    {
370
    	$res = '' ;
370
    	$res = '' ;
371
        include_once PROJET_CHEMIN_CLASSES.'statut_liste.class.php' ;
371
        include_once PROJET_CHEMIN_CLASSES.'statut_liste.class.php' ;
372
        include_once PROJET_CHEMIN_CLASSES.'inscription_liste.class.php' ;
372
        include_once PROJET_CHEMIN_CLASSES.'inscription_liste.class.php' ;
373
        $participant = new participe ($this->_db) ;
373
        $participant = new participe ($this->_db) ;
374
        
374
 
375
        if (PROJET_UTILISE_TYPE && $this->_type != '') {
375
        if (PROJET_UTILISE_TYPE && $this->_type != '') {
376
            $projetListe = projet::getProjetDuType($this->_type, $this->_db) ;
376
            $projetListe = projet::getProjetDuType($this->_type, $this->_db) ;
377
            if ($this->_presentation == 'arbre')array_push ($projetListe, projet::getProjetRacine($this->_db)) ;
377
            if ($this->_presentation == 'arbre')array_push ($projetListe, projet::getProjetRacine($this->_db)) ;
378
        } else {
378
        } else {
379
            // Un tableau de tous les projets dans $projetListe
379
            // Un tableau de tous les projets dans $projetListe
Line 382... Line 382...
382
        // Si la liste est vide, on renvoie un texte
382
        // Si la liste est vide, on renvoie un texte
383
        if (count($projetListe) == 0) {
383
        if (count($projetListe) == 0) {
384
        	// On inclue un fichier local
384
        	// On inclue un fichier local
385
	        if (file_exists(PROJET_CHEMIN_APPLI.'langues/pro_langues_fr.local.inc.php'))
385
	        if (file_exists(PROJET_CHEMIN_APPLI.'langues/pro_langues_fr.local.inc.php'))
386
	        	include_once PROJET_CHEMIN_APPLI.'langues/pro_langues_fr.local.inc.php' ;
386
	        	include_once PROJET_CHEMIN_APPLI.'langues/pro_langues_fr.local.inc.php' ;
387
        	return $res .= PROJET_PAS_DE_LISTE;	
387
        	return $res .= PROJET_PAS_DE_LISTE;
388
        } 
388
        }
389
        // Si certain projet sont à exclure, on les exclu
389
        // Si certain projet sont à exclure, on les exclu
390
        $projet_a_exclure = array() ;
390
        $projet_a_exclure = array() ;
391
        if (count($this->_projet_exclu)) {
391
        if (count($this->_projet_exclu)) {
392
        	arsort($this->_projet_exclu) ;
392
        	arsort($this->_projet_exclu) ;
393
            foreach ($this->_projet_exclu as $valeur) {
393
            foreach ($this->_projet_exclu as $valeur) {
394
            	for ($i = 0; $i < count($projetListe); $i++) {
394
            	for ($i = 0; $i < count($projetListe); $i++) {
395
            		if ($projetListe[$i]->getId() == $valeur)  array_push ($projet_a_exclure, $i);}
395
            		if ($projetListe[$i]->getId() == $valeur)  array_push ($projet_a_exclure, $i);}
396
            }
396
            }
397
        }
397
        }
398
        foreach ($projet_a_exclure as $valeur) unset ($projetListe[$valeur]) ;
398
        foreach ($projet_a_exclure as $valeur) unset ($projetListe[$valeur]) ;
399
        
399
 
400
        // Les entêtes des tableaux
400
        // Les entêtes des tableaux
401
        $tableau_label_statut_action = array (PROJET_GERER, PROJET_GERER, PROJET_GERER_FICHIER, PROJET_VOIR_FICHIER, "---") ;
401
        $tableau_label_statut_action = array (PROJET_GERER, PROJET_GERER, PROJET_GERER_FICHIER, PROJET_VOIR_FICHIER, "---") ;
402
        
402
 
403
        $auth = $this->_auth->getAuth() ;                       // Pour raccourcir le code
403
        $auth = $this->_auth->getAuth() ;                       // Pour raccourcir le code
404
        $id_u = $this->_auth->getAuthData(PROJET_CHAMPS_ID) ;   // --------------
404
        $id_u = $this->_auth->getAuthData(PROJET_CHAMPS_ID) ;   // --------------
405
        
405
 
406
        
406
 
407
        // Si la présentation est par arbre
407
        // Si la présentation est par arbre
408
        // TODO : Organiser différemment les présentations
408
        // TODO : Organiser différemment les présentations
409
        // En utilisant des templates
409
        // En utilisant des templates
410
        if ($this->_presentation == 'arbre') {
410
        if ($this->_presentation == 'arbre') {
411
            $titre = '<h1>Arbre des Projets</h1>'."\n" ;
411
            $titre = '<h1>Arbre des Projets</h1>'."\n" ;
412
            include_once PROJET_CHEMIN_API_ARBRE.'arbre.class.php' ;
412
            include_once PROJET_CHEMIN_API_ARBRE.'arbre.class.php' ;
413
            // initialisation de variables
413
            // initialisation de variables
414
            $intensite_feuille = '' ; $longueur_branche = '' ;
414
            $intensite_feuille = '' ; $longueur_branche = '' ;
415
            $arbre = new arbre() ;
415
            $arbre = new arbre() ;
416
            // recherche du projet principal
416
            // recherche du projet principal
417
            
417
 
418
            $cime='';
418
            $cime='';
419
            
419
 
420
            foreach ($projetListe as $projet) {
420
            foreach ($projetListe as $projet) {
421
                $this->_url->addQueryString (PROJET_VARIABLE_ID_PROJET, $projet->getId()) ;
421
                $this->_url->addQueryString (PROJET_VARIABLE_ID_PROJET, $projet->getId()) ;
422
                $this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_VOIR_PARTICIPANT) ;
422
                $this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_VOIR_PARTICIPANT) ;
423
                $lien_feuille = $this->_url->getURL() ;
423
                $lien_feuille = $this->_url->getURL() ;
424
                $this->_url->removeQueryString(PROJET_VARIABLE_ACTION) ;
424
                $this->_url->removeQueryString(PROJET_VARIABLE_ACTION) ;
425
                
425
 
426
                if ($projet->isRacine()) {
426
                if ($projet->isRacine()) {
427
                    $cime = $arbre->cime($projet->getTitre(), $this->_url->getURL(), $projet->getNombreInscrits(), $lien_feuille, '') ;
427
                    $cime = $arbre->cime($projet->getTitre(), $this->_url->getURL(), $projet->getNombreInscrits(), $lien_feuille, '') ;
428
                } else {
428
                } else {
429
                    
429
 
430
                    $arbre->addBranche($projet->getTitre(), $this->_url->getURL(), $projet->getNombreInscrits(), 
430
                    $arbre->addBranche($projet->getTitre(), $this->_url->getURL(), $projet->getNombreInscrits(),
431
                                        $lien_feuille, $lien_feuille, $intensite_feuille, $longueur_branche) ;
431
                                        $lien_feuille, $lien_feuille, $intensite_feuille, $longueur_branche) ;
432
                }
432
                }
433
            }
433
            }
434
            return $titre.'<table>'.$cime.$arbre->affBranche().$arbre->affRacine().'</table>';
434
            return $titre.'<table>'.$cime.$arbre->affBranche().$arbre->affRacine().'</table>';
435
        }
435
        }
436
        
436
 
437
        // Présentation par liste
437
        // Présentation par liste
438
        
438
 
439
        $titre = '<h1>'.PROJET_LISTE.'</h1>'."\n" ;
439
        $titre = '<h1>'.PROJET_LISTE.'</h1>'."\n" ;
440
        
440
 
441
        // On inclue un fichier local
441
        // On inclue un fichier local
442
        if (file_exists(PROJET_CHEMIN_APPLI.'langues/pro_langues_fr.local.inc.php'))
442
        if (file_exists(PROJET_CHEMIN_APPLI.'langues/pro_langues_fr.local.inc.php'))
443
        	include_once PROJET_CHEMIN_APPLI.'langues/pro_langues_fr.local.inc.php' ;
443
        	include_once PROJET_CHEMIN_APPLI.'langues/pro_langues_fr.local.inc.php' ;
444
        // On vérifie si l'utilisateur participe à des projets
444
        // On vérifie si l'utilisateur participe à des projets
445
        if ($auth) {
445
        if ($auth) {
446
            
446
 
447
            $utilisateur_liste = new inscription_liste($this->_db) ;
447
            $utilisateur_liste = new inscription_liste($this->_db) ;
448
            // On teste ici s'il y a une mise à jour de statut
448
            // On teste ici s'il y a une mise à jour de statut
449
            if (isset($_POST['statut'])) {
449
            if (isset($_POST['statut'])) {
450
                // $_POST['statut'] et $_GET['identifiant_projet'] proviennent du formulaire voir HTML_listeProjet
450
                // $_POST['statut'] et $_GET['identifiant_projet'] proviennent du formulaire voir HTML_listeProjet
451
                include_once PROJET_CHEMIN_CLASSES.'annuaire.class.php' ;
451
                include_once PROJET_CHEMIN_CLASSES.'annuaire.class.php' ;
Line 454... Line 454...
454
                $projet = new projet ($this->_db, $_GET['identifiant_projet']) ;
454
                $projet = new projet ($this->_db, $_GET['identifiant_projet']) ;
455
                $projet->getListesAssociees() ;
455
                $projet->getListesAssociees() ;
456
                $utilisateur_liste->modifierTypeInscription($projet->_listes_associes[0],$annuaire, $_POST['statut']) ;
456
                $utilisateur_liste->modifierTypeInscription($projet->_listes_associes[0],$annuaire, $_POST['statut']) ;
457
            }
457
            }
458
            if (count($participant->getIdProjetsStatuts($id_u))) {
458
            if (count($participant->getIdProjetsStatuts($id_u))) {
459
                
459
 
460
                $HTML_projetListe = new HTML_listeProjet(true) ;
460
                $HTML_projetListe = new HTML_listeProjet(true) ;
461
                $entete_liste = array($auth ? PROJET_VOUS_PARTICIPEZ : PROJET_LISTE) ;
461
                $entete_liste = array($auth ? PROJET_VOUS_PARTICIPEZ : PROJET_LISTE) ;
462
                if ($auth) array_push ($entete_liste, PROJET_SE_DESINSCRIRE, PROJET_LISTE_DE_DISCUSSION) ;
462
                if ($auth) array_push ($entete_liste, PROJET_SE_DESINSCRIRE, PROJET_LISTE_DE_DISCUSSION) ;
463
                
463
 
464
                
464
 
465
                $tableau_resultat = array () ;
465
                $tableau_resultat = array () ;
466
               
466
 
467
                $HTML_projetListe->construitEntete ($entete_liste) ;
467
                $HTML_projetListe->construitEntete ($entete_liste) ;
Line 468... Line 468...
468
 
468
 
469
                // On construit $tableau_resultat avec une ligne par projet contenant un tableau (titre, statut_nom, id_statut, id_projet)
469
                // On construit $tableau_resultat avec une ligne par projet contenant un tableau (titre, statut_nom, id_statut, id_projet)
470
                $statut_liste = new statut_liste($this->_db) ;
470
                $statut_liste = new statut_liste($this->_db) ;
Line 481... Line 481...
481
                            $projet->getListesAssociees() ;
481
                            $projet->getListesAssociees() ;
482
                            $statut = $utilisateur_liste->getStatutInscrit($projet->_listes_associes[0]->getId(), $this->_auth) ;
482
                            $statut = $utilisateur_liste->getStatutInscrit($projet->_listes_associes[0]->getId(), $this->_auth) ;
483
                            //if ($statut == '') $statut = 0 ;
483
                            //if ($statut == '') $statut = 0 ;
484
                        }
484
                        }
485
                    }
485
                    }
486
                    
486
 
487
                    $this->_url->addQueryString (PROJET_VARIABLE_ID_PROJET, $projet->getId()) ;
487
                    $this->_url->addQueryString (PROJET_VARIABLE_ID_PROJET, $projet->getId()) ;
488
                    $ligne_tableau = array ($projet->getId(), $projet->getResume(),
488
                    $ligne_tableau = array ($projet->getId(), $projet->getResume(),
489
								'<a href="'.$this->_url->getURL().'">'.$projet->getTitre().'</a>'
489
								'<a href="'.$this->_url->getURL().'">'.$projet->getTitre().'</a>'
490
								) ;
490
								) ;
491
                    if ($auth) {
491
                    if ($auth) {
Line 501... Line 501...
501
                        $this->_url->removeQueryString (PROJET_VARIABLE_ACTION) ;
501
                        $this->_url->removeQueryString (PROJET_VARIABLE_ACTION) ;
502
                    }
502
                    }
503
                    $statut = '' ;
503
                    $statut = '' ;
504
                }
504
                }
505
                $HTML_projetListe->construitListe ($tableau_resultat, $tableau_statut) ;
505
                $HTML_projetListe->construitListe ($tableau_resultat, $tableau_statut) ;
506
                
506
 
507
        
507
 
508
                if ($HTML_projetListe->getRowCount() > 1) {
508
                if ($HTML_projetListe->getRowCount() > 1) {
509
                	$res .= '<p>'.PROJET_PARTICIPER.'</p>';
509
                	$res .= '<p>'.PROJET_PARTICIPER.'</p>';
510
                	$res .= $HTML_projetListe->toHTML() ;
510
                	$res .= $HTML_projetListe->toHTML() ;
511
                }
511
                }
512
            } else {
512
            } else {
Line 535... Line 535...
535
	        if (PROJET_UTILISE_TYPE && $this->_type != '') {
535
	        if (PROJET_UTILISE_TYPE && $this->_type != '') {
536
	        	for ($i = 0; $i < count($projetNonParticipantListe); $i++) {
536
	        	for ($i = 0; $i < count($projetNonParticipantListe); $i++) {
537
	        		if ($projetNonParticipantListe[$i]->getType() != $this->_type) array_push ($projet_a_exclure, $i) ;
537
	        		if ($projetNonParticipantListe[$i]->getType() != $this->_type) array_push ($projet_a_exclure, $i) ;
538
	        	}
538
	        	}
539
           	}
539
           	}
540
           	
540
 
541
	        foreach ($projet_a_exclure as $valeur) {
541
	        foreach ($projet_a_exclure as $valeur) {
542
	        	unset ($projetNonParticipantListe[$valeur]) ;
542
	        	unset ($projetNonParticipantListe[$valeur]) ;
543
	        }
543
	        }
544
	        	
544
 
545
            $HTML_projetNonParticipantListe = new HTML_listeProjet(true) ;
545
            $HTML_projetNonParticipantListe = new HTML_listeProjet(true) ;
546
            $entete_liste = array (PROJET_LISTE) ;
546
            $entete_liste = array (PROJET_LISTE) ;
547
            array_push ($entete_liste, PROJET_S_INSCRIRE) ;
547
            array_push ($entete_liste, PROJET_S_INSCRIRE) ;
Line 548... Line 548...
548
 
548
 
549
            $HTML_projetNonParticipantListe->construitEntete($entete_liste) ;
549
            $HTML_projetNonParticipantListe->construitEntete($entete_liste) ;
550
            
550
 
551
            $liste_projet = array() ;
551
            $liste_projet = array() ;
552
            // La liste
552
            // La liste
553
            
553
 
554
            foreach ($projetNonParticipantListe as $projet) {
554
            foreach ($projetNonParticipantListe as $projet) {
555
                $this->_url->addQueryString(PROJET_VARIABLE_ID_PROJET, $projet->getId()) ;
555
                $this->_url->addQueryString(PROJET_VARIABLE_ID_PROJET, $projet->getId()) ;
556
                $ligne_projet = array ($projet->getResume(),
556
                $ligne_projet = array ($projet->getResume(),
557
                                    '<a href="'.$this->_url->getURL().'">'.$projet->getTitre().'</a>'      // le nom du projet
557
                                    '<a href="'.$this->_url->getURL().'">'.$projet->getTitre().'</a>'      // le nom du projet
558
                                        ) ;
558
                                        ) ;
559
                $this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_ACTION_S_INSCRIRE) ;
559
                $this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_ACTION_S_INSCRIRE) ;
560
                array_push ($ligne_projet, '<a href="'.$this->_url->getURL().'">'.PROJET_S_INSCRIRE.'</a>') ;
560
                array_push ($ligne_projet, '<a href="'.$this->_url->getURL().'">'.PROJET_S_INSCRIRE.'</a>') ;
561
                
561
 
562
                $this->_url->removeQueryString(PROJET_VARIABLE_ACTION);
562
                $this->_url->removeQueryString(PROJET_VARIABLE_ACTION);
563
                array_push ($liste_projet, $ligne_projet) ;
563
                array_push ($liste_projet, $ligne_projet) ;
564
            }
564
            }
565
            $this->_url->removeQueryString(PROJET_VARIABLE_ACTION) ;
565
            $this->_url->removeQueryString(PROJET_VARIABLE_ACTION) ;
Line 568... Line 568...
568
        } else {
568
        } else {
569
            $projetNonParticipantListe = & $projetListe ;
569
            $projetNonParticipantListe = & $projetListe ;
570
            $HTML_projetNonParticipantListe = new HTML_listeProjet(true) ;
570
            $HTML_projetNonParticipantListe = new HTML_listeProjet(true) ;
571
            $entete_liste = array (PROJET_LISTE) ;
571
            $entete_liste = array (PROJET_LISTE) ;
572
            $HTML_projetNonParticipantListe->construitEntete($entete_liste) ;
572
            $HTML_projetNonParticipantListe->construitEntete($entete_liste) ;
573
            
573
 
574
            $liste_projet = array() ;
574
            $liste_projet = array() ;
575
            // La liste
575
            // La liste
576
            foreach ($projetNonParticipantListe as $projet) {
576
            foreach ($projetNonParticipantListe as $projet) {
577
                $this->_url->addQueryString(PROJET_VARIABLE_ID_PROJET, $projet->getId()) ;
577
                $this->_url->addQueryString(PROJET_VARIABLE_ID_PROJET, $projet->getId()) ;
578
                $ligne_projet = array ( $projet->getResume(),
578
                $ligne_projet = array ( $projet->getResume(),
579
                                    '<a href="'.$this->_url->getURL().'">'.$projet->getTitre().'</a>',  // le nom du projet
579
                                    '<a href="'.$this->_url->getURL().'">'.$projet->getTitre().'</a>',  // le nom du projet
580
                                    ) ;
580
                                    ) ;
581
                
581
 
582
                $this->_url->removeQueryString(PROJET_VARIABLE_ACTION);
582
                $this->_url->removeQueryString(PROJET_VARIABLE_ACTION);
583
                array_push ($liste_projet, $ligne_projet) ;
583
                array_push ($liste_projet, $ligne_projet) ;
584
            }
584
            }
585
            $this->_url->removeQueryString(PROJET_VARIABLE_ACTION) ;
585
            $this->_url->removeQueryString(PROJET_VARIABLE_ACTION) ;
586
            $HTML_projetNonParticipantListe->construitListe($liste_projet) ;
586
            $HTML_projetNonParticipantListe->construitListe($liste_projet) ;
Line 665... Line 665...
665
                }
665
                }
666
                if ($isCoord) {
666
                if ($isCoord) {
667
                    // L'action modifier les propriétés du projet
667
                    // L'action modifier les propriétés du projet
668
                    $this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_MODIFIER_DESCRIPTION) ;
668
                    $this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_MODIFIER_DESCRIPTION) ;
669
                    $res .= "<li><a href=\"".$this->_url->getURL()."\">".PROJET_MODIFIER_PROPRIETES."</a></li>\n" ;
669
                    $res .= "<li><a href=\"".$this->_url->getURL()."\">".PROJET_MODIFIER_PROPRIETES."</a></li>\n" ;
670
                    
670
 
671
                    if ($projet->avoirListe()) {
671
                    if ($projet->avoirListe()) {
672
                        $this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_SUPPRIMER_LISTE) ;
672
                        $this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_SUPPRIMER_LISTE) ;
673
                        $texte_liste = PROJET_SUPPRIMER_LISTE ;
673
                        $texte_liste = PROJET_SUPPRIMER_LISTE ;
674
                        $onclic = ' onclick="javascript:return confirm(\''.PROJET_SUPPRIMER_LISTE_CONFIRMATION.'\');"' ;
674
                        $onclic = ' onclick="javascript:return confirm(\''.PROJET_SUPPRIMER_LISTE_CONFIRMATION.'\');"' ;
675
                    } else {
675
                    } else {
Line 679... Line 679...
679
                        $onclic = '' ;
679
                        $onclic = '' ;
680
                    }
680
                    }
681
                    $res .= '<li><a href="'.$this->_url->getURL().'"'.$onclic.'>'.$texte_liste.'</a></li>'."\n" ;
681
                    $res .= '<li><a href="'.$this->_url->getURL().'"'.$onclic.'>'.$texte_liste.'</a></li>'."\n" ;
682
                    $this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_REFERENCER_LISTE) ;
682
                    $this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_REFERENCER_LISTE) ;
683
                    $res .= '<li><a href="'.$this->_url->getURL().'">'.PROJET_REFERENCER_LISTE.'</a></li>'."\n" ;
683
                    $res .= '<li><a href="'.$this->_url->getURL().'">'.PROJET_REFERENCER_LISTE.'</a></li>'."\n" ;
684
                    
684
 
685
                    // L'action gérer les utilisateurs
685
                    // L'action gérer les utilisateurs
686
                    $this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_VOIR_PARTICIPANT) ;
686
                    $this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_VOIR_PARTICIPANT) ;
687
                    $res .= "<li><a href=\"".$this->_url->getURL()."\">".PROJET_GESTION_UTILISATEUR."</a></li>\n" ;
687
                    $res .= "<li><a href=\"".$this->_url->getURL()."\">".PROJET_GESTION_UTILISATEUR."</a></li>\n" ;
688
                    
688
 
689
                    // L'action créer un wikini
689
                    // L'action Gerer les wikis
-
 
690
                    /*
-
 
691
                     * client/integrateur_wikini/admin_wikini.php
-
 
692
                     */
-
 
693
 
-
 
694
                   	$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_CREER_WIKI) ;
-
 
695
                   	$res .= "<li><a href=\"".$this->_url->getURL()."\">".PROJET_CREER_WIKI."</a></li>\n" ;
-
 
696
 
-
 
697
                    /*
690
                    if (!$projet->getWikini()) {
698
                    if (!$projet->getWikini()) {
691
                        $this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_CREER_WIKI) ;
699
                        $this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_CREER_WIKI) ;
692
                        $res .= "<li><a href=\"".$this->_url->getURL()."\">".PROJET_CREER_WIKI."</a></li>\n" ;
700
                        $res .= "<li><a href=\"".$this->_url->getURL()."\">".PROJET_CREER_WIKI."</a></li>\n" ;
693
                    } else {
701
                    } else {
694
                        $this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_SUPPRIMER_WIKI) ;
702
                        $this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_SUPPRIMER_WIKI) ;
695
                        $res .= '<li><a href="'.$this->_url->getURL().'" onclick="javascript:return confirm(\''.PROJET_WIKINI_SUPPRIMER.' ?\')">'.PROJET_WIKINI_SUPPRIMER."</a></li>\n" ;
703
                        $res .= '<li><a href="'.$this->_url->getURL().'" onclick="javascript:return confirm(\''.PROJET_WIKINI_SUPPRIMER.' ?\')">'.PROJET_WIKINI_SUPPRIMER."</a></li>\n" ;
696
                    }
704
                    }
-
 
705
                    */
697
                    
706
 
698
                    // L'action choisir un wikini
707
                    // L'action choisir un wikini
699
                    $this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_ASSOCIER_WIKI) ;
708
                    $this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_ASSOCIER_WIKI) ;
700
                    $res .= "<li><a href=\"".$this->_url->getURL()."\">".PROJET_ASSOCIER_WIKI."</a></li>\n" ;
709
                    $res .= "<li><a href=\"".$this->_url->getURL()."\">".PROJET_ASSOCIER_WIKI."</a></li>\n" ;
701
                    
710
 
702
                }
711
                }
703
                // L'action se désinscrire du projet
712
                // L'action se désinscrire du projet
704
                $this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_DESINSCRIPTION_PROJET) ;
713
                $this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_DESINSCRIPTION_PROJET) ;
705
                $res .= "<li><a href=\"".$this->_url->getURL()."\">".PROJET_SE_DESINSCRIRE."</a></li>\n" ;
714
                $res .= "<li><a href=\"".$this->_url->getURL()."\">".PROJET_SE_DESINSCRIRE."</a></li>\n" ;
706
                
715
 
707
                // L'action "Mettre un fichier en ligne"
716
                // L'action "Mettre un fichier en ligne"
708
                $this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_NOUVEAU_FICHIER) ;
717
                $this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_NOUVEAU_FICHIER) ;
709
                $res .= "<li><a href=\"".$this->_url->getURL()."\">".PROJET_METTRE_FICHIER."</a></li>\n" ;
718
                $res .= "<li><a href=\"".$this->_url->getURL()."\">".PROJET_METTRE_FICHIER."</a></li>\n" ;
Line 710... Line 719...
710
 
719
 
711
                // L'action créer un répertoire
720
                // L'action créer un répertoire
712
                $this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_NOUVEAU_REPERTOIRE) ;
721
                $this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_NOUVEAU_REPERTOIRE) ;
713
                $res .= "<li><a href=\"".$this->_url->getURL()."\">".PROJET_CREER_REP."</a></li>\n" ;
722
                $res .= "<li><a href=\"".$this->_url->getURL()."\">".PROJET_CREER_REP."</a></li>\n" ;
714
                
723
 
715
                if ($projet->avoirListe()) {
724
                if ($projet->avoirListe()) {
716
                    
725
 
717
                    // On vérifie si l'utilisateur est inscrit ou non à la liste et on ajoute le lien
726
                    // On vérifie si l'utilisateur est inscrit ou non à la liste et on ajoute le lien
718
                    //$projet->getListesAssociees();
727
                    //$projet->getListesAssociees();
719
                    
728
 
720
                    include_once PROJET_CHEMIN_CLASSES.'inscription_liste.class.php';
729
                    include_once PROJET_CHEMIN_CLASSES.'inscription_liste.class.php';
721
                    foreach ($projet->_listes_associes as $info_liste) {
730
                    foreach ($projet->_listes_associes as $info_liste) {
722
                        
731
 
723
                        $inscription_liste = new inscription_liste($this->_db) ;
732
                        $inscription_liste = new inscription_liste($this->_db) ;
724
                        if ($inscription_liste->getStatutInscrit($info_liste->getId(),  $this->_auth) == 0) {
733
                        if ($inscription_liste->getStatutInscrit($info_liste->getId(),  $this->_auth) == 0) {
725
                            $action_inscription = PROJET_ACTION_INSCRIPTION_LISTE ;
734
                            $action_inscription = PROJET_ACTION_INSCRIPTION_LISTE ;
726
                            $label_inscription = PROJET_RECEVOIR_MESSAGES ;
735
                            $label_inscription = PROJET_RECEVOIR_MESSAGES ;
Line 734... Line 743...
734
                        $this->_url->addQueryString(PROJET_VARIABLE_ACTION, $action_inscription) ;
743
                        $this->_url->addQueryString(PROJET_VARIABLE_ACTION, $action_inscription) ;
735
                        $res .= '<li><a href="'.$this->_url->getURL().'">';
744
                        $res .= '<li><a href="'.$this->_url->getURL().'">';
736
                        $res .= $label_inscription.'</a></li> ';
745
                        $res .= $label_inscription.'</a></li> ';
737
                    }
746
                    }
738
                }
747
                }
739
                
748
 
740
            $res .= '</ul>' ;
749
            $res .= '</ul>' ;
741
            } else if ($auth && !$this->_prive){
750
            } else if ($auth && !$this->_prive){
742
                // L'action s'inscrire du projet
751
                // L'action s'inscrire du projet
743
                $this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_S_INSCRIRE) ;
752
                $this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_S_INSCRIRE) ;
744
                $res .= "<li><a href=\"".$this->_url->getURL()."\">".PROJET_S_INSCRIRE_AU_PROJET."</a></li>\n" ;
753
                $res .= "<li><a href=\"".$this->_url->getURL()."\">".PROJET_S_INSCRIRE_AU_PROJET."</a></li>\n" ;
745
            }
754
            }
746
        }
755
        }
747
        
756
 
748
        $res .= "</div>\n" ;
757
        $res .= "</div>\n" ;
749
        return $res ;
758
        return $res ;
750
    } // end of member function menuGeneral
759
    } // end of member function menuGeneral
Line 751... Line 760...
751
 
760
 
Line 793... Line 802...
793
    {
802
    {
794
        $this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_NOUVEAU_V) ;
803
        $this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_NOUVEAU_V) ;
795
        $formulaire_projet = new HTML_formulaireProjet('formulaire_projet', 'post', str_replace ('&amp;', '&', $this->_url->getURL())) ;
804
        $formulaire_projet = new HTML_formulaireProjet('formulaire_projet', 'post', str_replace ('&amp;', '&', $this->_url->getURL())) ;
796
        $formulaire_projet->construitFormulaire(projet::getTousLesProjets($this->_db)) ;
805
        $formulaire_projet->construitFormulaire(projet::getTousLesProjets($this->_db)) ;
797
        if ($formulaire_projet->validate()) {
806
        if ($formulaire_projet->validate()) {
798
            
807
 
799
            $projet = new projet ($this->_db) ;
808
            $projet = new projet ($this->_db) ;
800
            $projet->setCheminRepertoire (PROJET_CHEMIN_FICHIER) ;
809
            $projet->setCheminRepertoire (PROJET_CHEMIN_FICHIER) ;
801
            if (!$projet->enregistrerSQL($formulaire_projet->getSubmitValues())) {
810
            if (!$projet->enregistrerSQL($formulaire_projet->getSubmitValues())) {
802
                return 'erreur' ;
811
                return 'erreur' ;
803
            }
812
            }
Line 849... Line 858...
849
        $this->_url->addQueryString (PROJET_VARIABLE_ACTION, $action_future) ;
858
        $this->_url->addQueryString (PROJET_VARIABLE_ACTION, $action_future) ;
850
        if ($this->_id_repertoire != '') $this->_url->addQueryString (PROJET_VARIABLE_ID_REPERTOIRE, $this->_id_repertoire) ;
859
        if ($this->_id_repertoire != '') $this->_url->addQueryString (PROJET_VARIABLE_ID_REPERTOIRE, $this->_id_repertoire) ;
851
        $formulaire_document = new HTML_formulaireDocument('formulaire_document', 'post',preg_replace ("/&amp;/", "&", $this->_url->getURL())) ;
860
        $formulaire_document = new HTML_formulaireDocument('formulaire_document', 'post',preg_replace ("/&amp;/", "&", $this->_url->getURL())) ;
852
        $formulaire_document->construitFormulaire($action) ;
861
        $formulaire_document->construitFormulaire($action) ;
853
        if ($action == PROJET_ACTION_MODIFIER) {
862
        if ($action == PROJET_ACTION_MODIFIER) {
854
            
863
 
855
            $document = new document($this->_id_document, $this->_db, PROJET_CHEMIN_FICHIER, PROJET_CHEMIN_ICONES) ;
864
            $document = new document($this->_id_document, $this->_db, PROJET_CHEMIN_FICHIER, PROJET_CHEMIN_ICONES) ;
856
            // On affecte dans un tableau les valeurs de chaque champs du formulaire avec le nom de chaque élément de formulaire
865
            // On affecte dans un tableau les valeurs de chaque champs du formulaire avec le nom de chaque élément de formulaire
857
            // voir HTML_formulaireDocument
866
            // voir HTML_formulaireDocument
858
            $valeurs_par_defaut = array ('document_nom' => $document->getNomLong(),
867
            $valeurs_par_defaut = array ('document_nom' => $document->getNomLong(),
859
                                         'document_description' => $document->getDescription(),
868
                                         'document_description' => $document->getDescription(),
860
                                         'document_visibilite' => $document->getVisibilite()) ;
869
                                         'document_visibilite' => $document->getVisibilite()) ;
861
            
870
 
862
            // On rajoute un champs caché avec l'identifiant du document 
871
            // On rajoute un champs caché avec l'identifiant du document
863
            $formulaire_document->addElement ('hidden', 'id_document', $this->_id_document) ;
872
            $formulaire_document->addElement ('hidden', 'id_document', $this->_id_document) ;
864
            $formulaire_document->setDefaults($valeurs_par_defaut) ;
873
            $formulaire_document->setDefaults($valeurs_par_defaut) ;
865
        } else {
874
        } else {
866
            $formulaire_document->setDefaults (array ('document_visibilite'=> 'public')) ;
875
            $formulaire_document->setDefaults (array ('document_visibilite'=> 'public')) ;
867
        }
876
        }
868
        return $res.$formulaire_document->toHTML() ;
877
        return $res.$formulaire_document->toHTML() ;
Line 869... Line 878...
869
 
878
 
870
    } // end of member function nouveauFichier
879
    } // end of member function nouveauFichier
871
    
880
 
872
    /**
881
    /**
873
    *   Présente un formulaire pour déplacer un fichier
882
    *   Présente un formulaire pour déplacer un fichier
874
    *
883
    *
875
    *
884
    *
876
    */
885
    */
877
    function fichierCouper() {
886
    function fichierCouper() {
878
        include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
887
        include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
879
        $projet = new projet ($this->_db, $this->_id_projet) ;
888
        $projet = new projet ($this->_db, $this->_id_projet) ;
880
        
889
 
881
        $res = '<h1>'.PROJET_PROJET.' : '.$projet->getTitre().'</h1>' ;
890
        $res = '<h1>'.PROJET_PROJET.' : '.$projet->getTitre().'</h1>' ;
882
        $document = new document($this->_id_document, $this->_db, PROJET_CHEMIN_FICHIER) ;
891
        $document = new document($this->_id_document, $this->_db, PROJET_CHEMIN_FICHIER) ;
883
        // On traite le cas où l'on vient de déplacer un fichier
892
        // On traite le cas où l'on vient de déplacer un fichier
884
        
893
 
885
        if (isset ($_POST['projet_repertoire'])) {
894
        if (isset ($_POST['projet_repertoire'])) {
886
            if (!$document -> deplace ($_POST['projet_repertoire'], $projet->getNomRepertoire())) {
895
            if (!$document -> deplace ($_POST['projet_repertoire'], $projet->getNomRepertoire())) {
887
                echo 'echec du déplacement' ;
896
                echo 'echec du déplacement' ;
888
            }
897
            }
Line 952... Line 961...
952
            // Création d'un objet document vide
961
            // Création d'un objet document vide
953
            $document = new document ("", $this->_db) ;
962
            $document = new document ("", $this->_db) ;
954
            // avant d'appeler la méthode enregistrerSQL, il faut indiquer l'identifiant du projet et l'identifiant du propriétaire
963
            // avant d'appeler la méthode enregistrerSQL, il faut indiquer l'identifiant du projet et l'identifiant du propriétaire
955
            $document->setIdProjet ($this->_id_projet) ;
964
            $document->setIdProjet ($this->_id_projet) ;
956
            $document->setIdProprietaire ($this->_auth->getAuthData (PROJET_CHAMPS_ID)) ;
965
            $document->setIdProprietaire ($this->_auth->getAuthData (PROJET_CHAMPS_ID)) ;
957
            
966
 
958
            // On passe aussi le numéro de répertoire s'il existe
967
            // On passe aussi le numéro de répertoire s'il existe
959
            if ($this->_id_repertoire != '') $document->setIdRepertoire($this->_id_repertoire) ;
968
            if ($this->_id_repertoire != '') $document->setIdRepertoire($this->_id_repertoire) ;
960
            
969
 
961
            $chemin_upload = $document->calculeCheminUploaded($projet->getNomRepertoire()) ;
970
            $chemin_upload = $document->calculeCheminUploaded($projet->getNomRepertoire()) ;
962
            
971
 
963
            if (!$document->upload (PROJET_CHEMIN_FICHIER.$projet->getNomRepertoire().'/'.$chemin_upload)) {
972
            if (!$document->upload (PROJET_CHEMIN_FICHIER.$projet->getNomRepertoire().'/'.$chemin_upload)) {
964
                echo 'Echec de l\'upload' ;
973
                echo 'Echec de l\'upload' ;
965
                trigger_error('echec d\'upload !', E_USER_ERROR) ;
974
                trigger_error('echec d\'upload !', E_USER_ERROR) ;
966
            }
975
            }
967
             
976
 
968
            
977
 
969
            $document->enregistrerSQL($formulaire_document->getSubmitValues(), $projet->getNomRepertoire().'/'.$chemin_upload) ;
978
            $document->enregistrerSQL($formulaire_document->getSubmitValues(), $projet->getNomRepertoire().'/'.$chemin_upload) ;
970
            // On ajoute une information de session
979
            // On ajoute une information de session
971
            $_SESSION['formulaire_document'] = 'valide';
980
            $_SESSION['formulaire_document'] = 'valide';
972
        } else {
981
        } else {
973
            return $formulaire_document->toHTML() ;
982
            return $formulaire_document->toHTML() ;
Line 1008... Line 1017...
1008
     */
1017
     */
1009
    function nouveauRepertoireValidation( )
1018
    function nouveauRepertoireValidation( )
1010
    {
1019
    {
1011
        // création de l'objet projet courant
1020
        // création de l'objet projet courant
1012
        $projet = new projet ($this->_db, $this->_id_projet) ;
1021
        $projet = new projet ($this->_db, $this->_id_projet) ;
1013
        
1022
 
1014
        $this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_NOUVEAU_FICHIER_V) ;
1023
        $this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_NOUVEAU_FICHIER_V) ;
1015
        $formulaire_repertoire = new HTML_formulaireDocument('formulaire_repertoire', 'post',preg_replace ("/&amp;/", "&", $this->_url->getURL())) ;
1024
        $formulaire_repertoire = new HTML_formulaireDocument('formulaire_repertoire', 'post',preg_replace ("/&amp;/", "&", $this->_url->getURL())) ;
1016
        $formulaire_repertoire->setType ('repertoire') ;
1025
        $formulaire_repertoire->setType ('repertoire') ;
1017
        $formulaire_repertoire->construitFormulaire() ;
1026
        $formulaire_repertoire->construitFormulaire() ;
1018
        if ($formulaire_repertoire->validate()) {
1027
        if ($formulaire_repertoire->validate()) {
1019
            // Création d'un objet 
1028
            // Création d'un objet
1020
            $document = new document ("", $this->_db) ;
1029
            $document = new document ("", $this->_db) ;
1021
            // avant d'appeler la méthode enregistrerSQL, il faut indiquer l'identifiant du projet et l'identifiant du propriétaire
1030
            // avant d'appeler la méthode enregistrerSQL, il faut indiquer l'identifiant du projet et l'identifiant du propriétaire
1022
            $document->setIdProjet ($this->_id_projet) ;
1031
            $document->setIdProjet ($this->_id_projet) ;
1023
            $document->setIdProprietaire ($this->_auth->getAuthData (PROJET_CHAMPS_ID)) ;
1032
            $document->setIdProprietaire ($this->_auth->getAuthData (PROJET_CHAMPS_ID)) ;
1024
            
1033
 
1025
            // On passe aussi le numéro de répertoire s'il existe
1034
            // On passe aussi le numéro de répertoire s'il existe
1026
            if ($this->_id_repertoire != '') $document->setIdRepertoire($this->_id_repertoire) ;
1035
            if ($this->_id_repertoire != '') $document->setIdRepertoire($this->_id_repertoire) ;
1027
            
1036
 
1028
            $lien = $document->enregistrerSQL($formulaire_repertoire->getSubmitValues(), $projet->getNomRepertoire()) ;
1037
            $lien = $document->enregistrerSQL($formulaire_repertoire->getSubmitValues(), $projet->getNomRepertoire()) ;
1029
            
1038
 
1030
            // La création du répertoire sur le disque, chemin / nom_repertoire_projet / id_repertoire
1039
            // La création du répertoire sur le disque, chemin / nom_repertoire_projet / id_repertoire
1031
            if (!mkdir (PROJET_CHEMIN_FICHIER.$lien)) {
1040
            if (!mkdir (PROJET_CHEMIN_FICHIER.$lien)) {
1032
                
1041
 
1033
                $document->suppressionSQL() ;
1042
                $document->suppressionSQL() ;
1034
                return $this->messageErreur(PROJETCONTROLEUR_ERREUR_CREATION_REPERTOIRE).'<br />'.PROJET_CHEMIN_FICHIER.$lien  ;
1043
                return $this->messageErreur(PROJETCONTROLEUR_ERREUR_CREATION_REPERTOIRE).'<br />'.PROJET_CHEMIN_FICHIER.$lien  ;
1035
            }
1044
            }
1036
        } else {
1045
        } else {
1037
            return $formulaire_repertoire->toHTML() ;
1046
            return $formulaire_repertoire->toHTML() ;
Line 1047... Line 1056...
1047
     * @access public
1056
     * @access public
1048
     */
1057
     */
1049
    function setIdProjet( $id_projet )
1058
    function setIdProjet( $id_projet )
1050
    {
1059
    {
1051
        $this->_id_projet = $id_projet ;
1060
        $this->_id_projet = $id_projet ;
1052
        
1061
 
1053
    } // end of member function setIdProjet
1062
    } // end of member function setIdProjet
Line 1054... Line 1063...
1054
 
1063
 
1055
    /**
1064
    /**
1056
     * Renvoie la page d'accueil d'un projet.
1065
     * Renvoie la page d'accueil d'un projet.
Line 1061... Line 1070...
1061
    function accueilProjet( )
1070
    function accueilProjet( )
1062
    {
1071
    {
1063
        $res = '' ;
1072
        $res = '' ;
1064
        // création de l'objet projet courant
1073
        // création de l'objet projet courant
1065
        $projet = new projet ($this->_db, $this->_id_projet) ;
1074
        $projet = new projet ($this->_db, $this->_id_projet) ;
1066
        
1075
 
1067
        // récupération de la liste des documents associés
1076
        // récupération de la liste des documents associés
1068
        $liste_documents = $projet->getListesDocuments(PROJET_CHEMIN_FICHIER, PROJET_CHEMIN_ICONES) ;
1077
        $liste_documents = $projet->getListesDocuments(PROJET_CHEMIN_FICHIER, PROJET_CHEMIN_ICONES) ;
1069
        
1078
 
1070
        // création de la vue liste de document, on nettoie l'url
1079
        // création de la vue liste de document, on nettoie l'url
1071
        $this->_url->removeQueryString(PROJET_VARIABLE_ACTION) ;
1080
        $this->_url->removeQueryString(PROJET_VARIABLE_ACTION) ;
1072
        include_once PROJET_CHEMIN_CLASSES.'HTML_listeDocuments.class.php' ;
1081
        include_once PROJET_CHEMIN_CLASSES.'HTML_listeDocuments.class.php' ;
1073
        $vue_liste_document = new HTML_listeDocuments($this->_url, false, $this->_id_repertoire) ;
1082
        $vue_liste_document = new HTML_listeDocuments($this->_url, false, $this->_id_repertoire) ;
1074
        
1083
 
1075
        // réglage de paramètres de la vue
1084
        // réglage de paramètres de la vue
1076
        $vue_liste_document->setAction (array ("couper" => PROJET_ACTION_COUPER, "modifier" => PROJET_ACTION_MODIFIER, "supprimer" => PROJET_SUPPRESSION_FICHIER)) ;
1085
        $vue_liste_document->setAction (array ("couper" => PROJET_ACTION_COUPER, "modifier" => PROJET_ACTION_MODIFIER, "supprimer" => PROJET_SUPPRESSION_FICHIER)) ;
1077
        $vue_liste_document->setCheminIcones(PROJET_CHEMIN_ICONES) ;
1086
        $vue_liste_document->setCheminIcones(PROJET_CHEMIN_ICONES) ;
1078
        
1087
 
1079
        
1088
 
1080
        $tableau_navigation = document::getCheminIdRepertoire($this->_id_repertoire, $this->_db) ;
1089
        $tableau_navigation = document::getCheminIdRepertoire($this->_id_repertoire, $this->_db) ;
1081
        
1090
 
1082
        $vue_liste_document->setCheminNavigation ($tableau_navigation) ;
1091
        $vue_liste_document->setCheminNavigation ($tableau_navigation) ;
1083
        // vérification des droits de l'utilisateur
1092
        // vérification des droits de l'utilisateur
1084
        $entete_liste = array (PROJET_FICHIERS_NOM, PROJET_FICHIERS_TAILLE, PROJET_FICHIERS_CREE_LE) ;
1093
        $entete_liste = array (PROJET_FICHIERS_NOM, PROJET_FICHIERS_TAILLE, PROJET_FICHIERS_CREE_LE) ;
1085
        
1094
 
1086
        if ($this->_auth->getAuth()) {
1095
        if ($this->_auth->getAuth()) {
1087
            $participant = new participe($this->_db) ;
1096
            $participant = new participe($this->_db) ;
1088
            $id_u = $this->_auth->getAuthData(PROJET_CHAMPS_ID) ;
1097
            $id_u = $this->_auth->getAuthData(PROJET_CHAMPS_ID) ;
1089
            $isCoord = $participant->isCoordinateur($id_u, $this->_id_projet, $this->_db) ;
1098
            $isCoord = $participant->isCoordinateur($id_u, $this->_id_projet, $this->_db) ;
1090
            if ($isCoord) $droits = PROJET_DROIT_COORDINATEUR ;
1099
            if ($isCoord) $droits = PROJET_DROIT_COORDINATEUR ;
1091
            $isAdm = participe::isAdministrateur($this->_auth->getAuthData(PROJET_CHAMPS_ID), $this->_db) ;
1100
            $isAdm = participe::isAdministrateur($this->_auth->getAuthData(PROJET_CHAMPS_ID), $this->_db) ;
1092
            if ($isAdm) $droits = PROJET_DROIT_ADMINISTRATEUR ;
1101
            if ($isAdm) $droits = PROJET_DROIT_ADMINISTRATEUR ;
1093
            if ($isAdm) $isCoord = true ;
1102
            if ($isAdm) $isCoord = true ;
1094
            
1103
 
1095
            $statut = participe::getStatutSurProjetCourant ($this->_auth->getAuthData(PROJET_CHAMPS_ID), $this->_id_projet, $this->_db) ;
1104
            $statut = participe::getStatutSurProjetCourant ($this->_auth->getAuthData(PROJET_CHAMPS_ID), $this->_id_projet, $this->_db) ;
1096
            // si participant, on ajoute le champs visibilite
1105
            // si participant, on ajoute le champs visibilite
1097
            
1106
 
1098
            if ($statut !='' || $isAdm) {
1107
            if ($statut !='' || $isAdm) {
1099
                array_push ($entete_liste, PROJET_FICHIERS_VISIBILITE) ;
1108
                array_push ($entete_liste, PROJET_FICHIERS_VISIBILITE) ;
1100
            }
1109
            }
1101
            // si chef de projet ou si propriétaire d'au moins 1 document
1110
            // si chef de projet ou si propriétaire d'au moins 1 document
1102
            $proprietaire_un_document = false ;
1111
            $proprietaire_un_document = false ;
1103
    
1112
 
1104
            foreach ($liste_documents as $document) {
1113
            foreach ($liste_documents as $document) {
1105
                if ($this->_auth->getAuthData(PROJET_CHAMPS_ID) == $document) {
1114
                if ($this->_auth->getAuthData(PROJET_CHAMPS_ID) == $document) {
1106
                    $proprietaire_un_document = true ;
1115
                    $proprietaire_un_document = true ;
1107
                    $droits = PROJET_DROIT_PROPRIETAIRE ;
1116
                    $droits = PROJET_DROIT_PROPRIETAIRE ;
1108
                }
1117
                }
Line 1112... Line 1121...
1112
            }
1121
            }
1113
        } else {
1122
        } else {
1114
            $droits = PROJET_DROIT_AUCUN ;
1123
            $droits = PROJET_DROIT_AUCUN ;
1115
        }
1124
        }
1116
        if (!isset($droits)) $droits = PROJET_DROIT_AUCUN ;
1125
        if (!isset($droits)) $droits = PROJET_DROIT_AUCUN ;
1117
        
1126
 
1118
        $vue_liste_document->construitEntete($entete_liste) ;
1127
        $vue_liste_document->construitEntete($entete_liste) ;
1119
        $vue_liste_document->construitListe ($liste_documents, $droits) ;
1128
        $vue_liste_document->construitListe ($liste_documents, $droits) ;
1120
        
1129
 
1121
        $wiki_res = '' ;
1130
        $wiki_res = '' ;
1122
        // Les wikinis associés au projet
1131
        // Les wikinis associés au projet
1123
        if ($projet->getWikini()) {
1132
        if ($projet->getWikini()) {
1124
            $wiki_res .= '<div><a href="'.PROJET_URL_WIKINI.'wakka.php?wiki=PagePrincipale&wikini='.$projet->getWikini().'">'.PROJET_URL_WIKINI.'</a>' ;
1133
            $wiki_res .= '<div><a href="'.PROJET_URL_WIKINI.'wakka.php?wiki=PagePrincipale&wikini='.$projet->getWikini().'">'.PROJET_URL_WIKINI.'</a>' ;
1125
            if ($this->_auth->getAuth() && $isCoord) {
1134
            if ($this->_auth->getAuth() && $isCoord) {
Line 1130... Line 1139...
1130
        } else {
1139
        } else {
1131
            $wiki_res .= '<div>'.PROJET_WIKINI_PAS.'</div>'."\n" ;
1140
            $wiki_res .= '<div>'.PROJET_WIKINI_PAS.'</div>'."\n" ;
1132
        }
1141
        }
1133
        // On charge les listes de discussion du projet
1142
        // On charge les listes de discussion du projet
1134
        // Pour le moment seul ezmlm est supportée
1143
        // Pour le moment seul ezmlm est supportée
1135
        
1144
 
1136
        $projet->getListesAssociees();
1145
        $projet->getListesAssociees();
1137
        $sortie_liste = '' ;
1146
        $sortie_liste = '' ;
1138
        
1147
 
1139
        if ($projet->avoirListe()) {
1148
        if ($projet->avoirListe()) {
1140
            foreach ($projet->_listes_associes as $info_liste) {
1149
            foreach ($projet->_listes_associes as $info_liste) {
1141
            
1150
 
1142
                $liste = new ezmlm_php() ;
1151
                $liste = new ezmlm_php() ;
1143
                // Paramétrage de la liste
1152
                // Paramétrage de la liste
1144
                
1153
 
1145
                $liste->listdir = PROJET_CHEMIN_LISTES.$info_liste->getDomaine().'/'.$info_liste->getNom();
1154
                $liste->listdir = PROJET_CHEMIN_LISTES.$info_liste->getDomaine().'/'.$info_liste->getNom();
1146
                $liste->listname = $info_liste->getNom() ;
1155
                $liste->listname = $info_liste->getNom() ;
1147
                $liste->listdomain = $info_liste->getDomaine();
1156
                $liste->listdomain = $info_liste->getDomaine();
1148
            
1157
 
1149
                if (isset ($GLOBALS['action']) && $GLOBALS['action'] != '') {
1158
                if (isset ($GLOBALS['action']) && $GLOBALS['action'] != '') {
1150
                    $liste->set_action($GLOBALS['action']) ;
1159
                    $liste->set_action($GLOBALS['action']) ;
1151
                    $liste->set_actionargs($GLOBALS['actionargs']) ;
1160
                    $liste->set_actionargs($GLOBALS['actionargs']) ;
1152
                } else {
1161
                } else {
1153
                    $liste->set_action('list_info') ;
1162
                    $liste->set_action('list_info') ;
1154
                }
1163
                }
1155
                $liste->sendheaders	= false;
1164
                $liste->sendheaders	= false;
1156
                $liste->sendbody        = false;
1165
                $liste->sendbody        = false;
1157
                $liste->sendfooters    = false;
1166
                $liste->sendfooters    = false;
1158
                $liste->forcehref = $this->_url->getURL() ;
1167
                $liste->forcehref = $this->_url->getURL() ;
1159
                
1168
 
1160
                ob_start() ;
1169
                ob_start() ;
1161
                print '<span class="heading">Liste <strong>' . $info_liste->getAdresseEnvoi() ;
1170
                print '<span class="heading">Liste <strong>' . $info_liste->getAdresseEnvoi() ;
1162
                print "</strong></span><br />\n";
1171
                print "</strong></span><br />\n";
1163
                if ($this->_auth->getAuth()) {
1172
                if ($this->_auth->getAuth()) {
1164
                    include_once PROJET_CHEMIN_CLASSES.'inscription_liste.class.php';
1173
                    include_once PROJET_CHEMIN_CLASSES.'inscription_liste.class.php';
Line 1186... Line 1195...
1186
                        $show_msg->forcehref = $this->_url->getURL();
1195
                        $show_msg->forcehref = $this->_url->getURL();
1187
                        // actionargs[0] contient le nom du répertoire et actionargs[1] le nom du fichier
1196
                        // actionargs[0] contient le nom du répertoire et actionargs[1] le nom du fichier
1188
                        // On appelle la fonction qui affiche un fichier
1197
                        // On appelle la fonction qui affiche un fichier
1189
                        $show_msg->display($liste->actionargs[0] . "/" . $liste->actionargs[1]);
1198
                        $show_msg->display($liste->actionargs[0] . "/" . $liste->actionargs[1]);
1190
                        break;
1199
                        break;
1191
                        
1200
 
1192
                    case "list_info":
1201
                    case "list_info":
1193
                        $info = new ezmlm_listinfo();
1202
                        $info = new ezmlm_listinfo();
1194
                        if (!$info) return 'Les fichiers de la liste ne sont pas visible sur le serveur' ;
1203
                        if (!$info) return 'Les fichiers de la liste ne sont pas visible sur le serveur' ;
1195
                        $info->forcehref = $this->_url->getURL();
1204
                        $info->forcehref = $this->_url->getURL();
1196
                        $info->listdir = $liste->listdir ;
1205
                        $info->listdir = $liste->listdir ;
1197
                        $info->listname = $info_liste->getNom();
1206
                        $info->listname = $info_liste->getNom();
1198
                        $info->listdomain = $info_liste->getDomaine() ;
1207
                        $info->listdomain = $info_liste->getDomaine() ;
1199
                        
1208
 
1200
                        if (!$info->display()) {
1209
                        if (!$info->display()) {
1201
                            echo 'Pas de message dans cette liste' ;
1210
                            echo 'Pas de message dans cette liste' ;
1202
                        }
1211
                        }
1203
                        break;
1212
                        break;
1204
                    case "show_threads":
1213
                    case "show_threads":
Line 1223... Line 1232...
1223
                ob_end_clean() ;
1232
                ob_end_clean() ;
1224
            }
1233
            }
1225
        } else {
1234
        } else {
1226
            $sortie_liste = '<div>'.PROJET_PAS_DE_LISTE.'</div>'."\n" ;
1235
            $sortie_liste = '<div>'.PROJET_PAS_DE_LISTE.'</div>'."\n" ;
1227
        }
1236
        }
1228
        
1237
 
1229
        $res .= "<h1>".$projet->getTitre()."</h1>" ;
1238
        $res .= "<h1>".$projet->getTitre()."</h1>" ;
1230
        $res .= '<div>'.$projet->getDescription().'</div>'."\n" ;
1239
        $res .= '<div>'.$projet->getDescription().'</div>'."\n" ;
1231
        $res .= '<h2>'.PROJET_WIKI_ASSOCIE.'</h2>' ;
1240
        $res .= '<h2>'.PROJET_WIKI_ASSOCIE.'</h2>' ;
1232
        $res .= $wiki_res ;
1241
        $res .= $wiki_res ;
1233
        $res .= '<h2>'.PROJET_FICHIERS_ASSOCIES.'</h2>'."\n" ;
1242
        $res .= '<h2>'.PROJET_FICHIERS_ASSOCIES.'</h2>'."\n" ;
1234
        $res .= $vue_liste_document->toHTML() ;
1243
        $res .= $vue_liste_document->toHTML() ;
1235
        $res .= '<h2>'.PROJET_LISTES_ASSOCIEES.'</h2>'."\n" ;
1244
        $res .= '<h2>'.PROJET_LISTES_ASSOCIEES.'</h2>'."\n" ;
1236
        $res .= $sortie_liste ;
1245
        $res .= $sortie_liste ;
1237
        
1246
 
1238
        include_once PROJET_CHEMIN_CLASSES.'liste_externe.class.php' ;
1247
        include_once PROJET_CHEMIN_CLASSES.'liste_externe.class.php' ;
1239
        $listes_ext = new liste_externe ($this->_db) ;
1248
        $listes_ext = new liste_externe ($this->_db) ;
1240
        $tableau_liste = $listes_ext->getListesAssociees($this->_id_projet) ;
1249
        $tableau_liste = $listes_ext->getListesAssociees($this->_id_projet) ;
1241
        
1250
 
1242
        if (count ($tableau_liste) != 0) {
1251
        if (count ($tableau_liste) != 0) {
1243
            $res .= '<h2>'.PROJET_LISTES_EXTERNES_ASSOCIEES.'</h2>'."\n" ;
1252
            $res .= '<h2>'.PROJET_LISTES_EXTERNES_ASSOCIEES.'</h2>'."\n" ;
1244
            for ($i = 0; $i < count ($tableau_liste); $i++) {
1253
            for ($i = 0; $i < count ($tableau_liste); $i++) {
1245
                $info_liste = $listes_ext->getInfoListe($tableau_liste[$i]) ;
1254
                $info_liste = $listes_ext->getInfoListe($tableau_liste[$i]) ;
1246
                $res .= '<h2>'.$info_liste->AGO_A_NOMGRPLG.'</h2>'."\n" ;
1255
                $res .= '<h2>'.$info_liste->AGO_A_NOMGRPLG.'</h2>'."\n" ;
Line 1283... Line 1292...
1283
    } // end of member function suppressionProjet
1292
    } // end of member function suppressionProjet
Line 1284... Line 1293...
1284
 
1293
 
1285
    /**
1294
    /**
1286
     * Permet d'indiquer au controleur sur quel document on travaille.
1295
     * Permet d'indiquer au controleur sur quel document on travaille.
1287
     *
1296
     *
1288
     * @param int id_document 
1297
     * @param int id_document
1289
     * @return void
1298
     * @return void
1290
     * @access public
1299
     * @access public
1291
     */
1300
     */
1292
    function setIdDocument( $id_document )
1301
    function setIdDocument( $id_document )
Line 1378... Line 1387...
1378
        // Vérifications
1387
        // Vérifications
1379
        $this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_ACTION_NOUVELLE_LISTE_V );
1388
        $this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_ACTION_NOUVELLE_LISTE_V );
1380
        $formulaire_liste = new HTML_formulaireListe('formulaire_liste', 'post', preg_replace ("/&amp;/", "&", $this->_url->getURL())) ;
1389
        $formulaire_liste = new HTML_formulaireListe('formulaire_liste', 'post', preg_replace ("/&amp;/", "&", $this->_url->getURL())) ;
1381
        $formulaire_liste->construitFormulaire() ;
1390
        $formulaire_liste->construitFormulaire() ;
1382
        if ($formulaire_liste->validate()) {
1391
        if ($formulaire_liste->validate()) {
1383
            // création de l'objet liste_discussion 
1392
            // création de l'objet liste_discussion
1384
            $liste = new liste_discussion('', $this->_db) ;
1393
            $liste = new liste_discussion('', $this->_db) ;
1385
            
1394
 
1386
            // On vérifie que le nom de la liste soit unique
1395
            // On vérifie que le nom de la liste soit unique
1387
            if (liste_discussion::verifieDoubleListe($formulaire_liste->getSubmitValue('nom_liste').'@'.
1396
            if (liste_discussion::verifieDoubleListe($formulaire_liste->getSubmitValue('nom_liste').'@'.
1388
                                                            $formulaire_liste->getSubmitValue('domaine_liste'), $this->_db)) {
1397
                                                            $formulaire_liste->getSubmitValue('domaine_liste'), $this->_db)) {
1389
                // On rajoute la liste dans la base       
1398
                // On rajoute la liste dans la base
1390
                $liste->enregistrerSQL($formulaire_liste->getSubmitValues()) ;
1399
                $liste->enregistrerSQL($formulaire_liste->getSubmitValues()) ;
1391
                
1400
 
1392
                // On la relie au projet
1401
                // On la relie au projet
1393
                $projet = new projet ($this->_db, $this->_id_projet) ;
1402
                $projet = new projet ($this->_db, $this->_id_projet) ;
1394
                $projet->ajouterListe($liste) ;
1403
                $projet->ajouterListe($liste) ;
1395
                
1404
 
1396
                // Création de la liste
1405
                // Création de la liste
1397
                $resultat_creation = file_get_contents (PROJET_SERVEUR_VPOPMAIL.'/creation_liste.php?domaine='.
1406
                $resultat_creation = file_get_contents (PROJET_SERVEUR_VPOPMAIL.'/creation_liste.php?domaine='.
1398
                                    $liste->getDomaine().'&liste='.$liste->getNom().'&parametres=aBiud') ;
1407
                                    $liste->getDomaine().'&liste='.$liste->getNom().'&parametres=aBiud') ;
1399
                                    
1408
 
1400
                // Ajout du modérateur
1409
                // Ajout du modérateur
1401
                $resultat_ajout_moderateur = file_get_contents (PROJET_SERVEUR_VPOPMAIL.'/ajout_moderateur.php?domaine='.
1410
                $resultat_ajout_moderateur = file_get_contents (PROJET_SERVEUR_VPOPMAIL.'/ajout_moderateur.php?domaine='.
1402
                                    $liste->getDomaine().'&liste='.$liste->getNom().'&mail='.$this->_auth->getUserName()) ;
1411
                                    $liste->getDomaine().'&liste='.$liste->getNom().'&mail='.$this->_auth->getUserName()) ;
1403
                // Ajout du modérateur en tant qu'utilisateur
1412
                // Ajout du modérateur en tant qu'utilisateur
1404
                $resultat_ajout_utilisateur = file_get_contents (PROJET_SERVEUR_VPOPMAIL.'/ajout_abonne.php?domaine='.
1413
                $resultat_ajout_utilisateur = file_get_contents (PROJET_SERVEUR_VPOPMAIL.'/ajout_abonne.php?domaine='.
Line 1406... Line 1415...
1406
 
1415
 
1407
            } else {
1416
            } else {
1408
                return PROJET_MESSAGE_LISTE_DOUBLE.$formulaire_liste->toHTML() ;
1417
                return PROJET_MESSAGE_LISTE_DOUBLE.$formulaire_liste->toHTML() ;
1409
            }
1418
            }
1410
            return $resultat_creation.$resultat_ajout_moderateur.$resultat_ajout_utilisateur;
1419
            return $resultat_creation.$resultat_ajout_moderateur.$resultat_ajout_utilisateur;
1411
            
1420
 
1412
        } else {
1421
        } else {
1413
            return $formulaire_liste->toHTML() ;
1422
            return $formulaire_liste->toHTML() ;
1414
        }
1423
        }
1415
    } // end of member function nouvelleListeValidation
1424
    } // end of member function nouvelleListeValidation
1416
    
1425
 
1417
    /**
1426
    /**
1418
     * Supprime la liste de discussion associée au projet
1427
     * Supprime la liste de discussion associée au projet
1419
     *
1428
     *
1420
     * @return void
1429
     * @return void
1421
     * @access public
1430
     * @access public
1422
     */
1431
     */
1423
    function supprimerListe( )
1432
    function supprimerListe( )
1424
    {
1433
    {
1425
        $projet = new projet($this->_db, $this->_id_projet) ;
1434
        $projet = new projet($this->_db, $this->_id_projet) ;
1426
        $projet->getListesAssociees() ;
1435
        $projet->getListesAssociees() ;
1427
        
1436
 
1428
        // ajouter un commande de suppression
1437
        // ajouter un commande de suppression
1429
        
1438
 
1430
        $commande = new commande_serveur(PROJET_CHEMIN_APPLI.'script_cron/ezmlm.sh') ;
1439
        $commande = new commande_serveur(PROJET_CHEMIN_APPLI.'script_cron/ezmlm.sh') ;
1431
        if (PEAR::isError($commande)) {
1440
        if (PEAR::isError($commande)) {
1432
            echo $commande->getMessage() ;
1441
            echo $commande->getMessage() ;
1433
        }
1442
        }
1434
        
1443
 
1435
        // Suppression des listes synchronisés
1444
        // Suppression des listes synchronisés
1436
        $commande_supression_3 = 'rm -rf '.PROJET_CHEMIN_LISTES.$projet->_listes_associes[0]->getDomaine().
1445
        $commande_supression_3 = 'rm -rf '.PROJET_CHEMIN_LISTES.$projet->_listes_associes[0]->getDomaine().
1437
                                '/'.$projet->_listes_associes[0]->getNom() ;
1446
                                '/'.$projet->_listes_associes[0]->getNom() ;
1438
        $commande->ajouterCommande($commande_supression_3) ;
1447
        $commande->ajouterCommande($commande_supression_3) ;
1439
        
1448
 
1440
        $resultat_suppression = file_get_contents(PROJET_SERVEUR_VPOPMAIL.'/suppression_liste.php?domaine='.
1449
        $resultat_suppression = file_get_contents(PROJET_SERVEUR_VPOPMAIL.'/suppression_liste.php?domaine='.
1441
                                    $projet->_listes_associes[0]->getDomaine().'&liste='.$projet->_listes_associes[0]->getNom()) ;
1450
                                    $projet->_listes_associes[0]->getDomaine().'&liste='.$projet->_listes_associes[0]->getNom()) ;
1442
        $projet->supprimerListe($projet->_listes_associes[0]) ;
1451
        $projet->supprimerListe($projet->_listes_associes[0]) ;
1443
        return $resultat_suppression;
1452
        return $resultat_suppression;
Line 1444... Line 1453...
1444
    } // end of member function supprimerListe
1453
    } // end of member function supprimerListe
1445
 
1454
 
1446
 
1455
 
1447
    /**
1456
    /**
1448
     * 
1457
     *
1449
     *
1458
     *
1450
     * @param string presentation Pour affecter une présentation au projet
1459
     * @param string presentation Pour affecter une présentation au projet
Line 1455... Line 1464...
1455
    {
1464
    {
1456
        $this->_presentation = $presentation ;
1465
        $this->_presentation = $presentation ;
1457
    } // end of member function setPresentation
1466
    } // end of member function setPresentation
Line 1458... Line 1467...
1458
 
1467
 
1459
    /**
1468
    /**
1460
     * 
1469
     *
1461
     *
1470
     *
1462
     * @param string type Pour affecter un type au projet
1471
     * @param string type Pour affecter un type au projet
1463
     * @return void
1472
     * @return void
1464
     * @access public
1473
     * @access public
Line 1480... Line 1489...
1480
        include_once PROJET_CHEMIN_CLASSES.'HTML_listeParticipants.class.php' ;
1489
        include_once PROJET_CHEMIN_CLASSES.'HTML_listeParticipants.class.php' ;
1481
        $projet = new projet ($this->_db, $this->_id_projet) ;
1490
        $projet = new projet ($this->_db, $this->_id_projet) ;
1482
        $titre = '<h1>'.$projet->getTitre().'</h1>'."\n" ;
1491
        $titre = '<h1>'.$projet->getTitre().'</h1>'."\n" ;
1483
        $titre .= '<h2>'.PROJET_LISTE_PARTICIPANT.'</h2>'."\n" ;
1492
        $titre .= '<h2>'.PROJET_LISTE_PARTICIPANT.'</h2>'."\n" ;
1484
        $participants = new participe($this->_db) ;
1493
        $participants = new participe($this->_db) ;
1485
        
1494
 
1486
        // On teste ici s'il y a une mise à jour de statut
1495
        // On teste ici s'il y a une mise à jour de statut
1487
        if (isset($_POST['statut'])) {
1496
        if (isset($_POST['statut'])) {
1488
            // $_GET['id_utilisateur'] et $_GET['statut'] proviennent du formulaire voir HTML_listeParticipants
1497
            // $_GET['id_utilisateur'] et $_GET['statut'] proviennent du formulaire voir HTML_listeParticipants
1489
            $participants->setStatut($_POST['statut'], $_GET['id_utilisateur'], $this->_id_projet) ;
1498
            $participants->setStatut($_POST['statut'], $_GET['id_utilisateur'], $this->_id_projet) ;
1490
        }
1499
        }
1491
        
1500
 
1492
        // Ce qui suit doit être amélioré pour sortir la requête sur l'annuaire
1501
        // Ce qui suit doit être amélioré pour sortir la requête sur l'annuaire
1493
        // On teste s'il y a un ajout d'utilisateur voir HTML_listeParticipants
1502
        // On teste s'il y a un ajout d'utilisateur voir HTML_listeParticipants
1494
        if (isset($_POST['mail_utilisateur'])) {
1503
        if (isset($_POST['mail_utilisateur'])) {
1495
            $requete = 'select '.PROJET_CHAMPS_ID.' from '.PROJET_ANNUAIRE.' where '.PROJET_CHAMPS_MAIL.'="'.$_POST['mail_utilisateur'].'"';
1504
            $requete = 'select '.PROJET_CHAMPS_ID.' from '.PROJET_ANNUAIRE.' where '.PROJET_CHAMPS_MAIL.'="'.$_POST['mail_utilisateur'].'"';
1496
            $resultat = $this->_db->query ($requete) ;
1505
            $resultat = $this->_db->query ($requete) ;
Line 1502... Line 1511...
1502
            } else {
1511
            } else {
1503
                $ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC) ;
1512
                $ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC) ;
1504
                $participants->setStatut(3, $ligne[PROJET_CHAMPS_ID], $this->_id_projet) ;
1513
                $participants->setStatut(3, $ligne[PROJET_CHAMPS_ID], $this->_id_projet) ;
1505
            }
1514
            }
1506
        }
1515
        }
1507
        
1516
 
1508
        if ($this->_auth->getAuth()) {
1517
        if ($this->_auth->getAuth()) {
1509
            $statut = participe::getStatutSurProjetCourant($this->_auth->getAuthData(PROJET_CHAMPS_ID),  $this->_id_projet, $this->_db) ;
1518
            $statut = participe::getStatutSurProjetCourant($this->_auth->getAuthData(PROJET_CHAMPS_ID),  $this->_id_projet, $this->_db) ;
1510
            if ($statut == 2) $droits = PROJET_DROIT_CONTRIBUTEUR ;
1519
            if ($statut == 2) $droits = PROJET_DROIT_CONTRIBUTEUR ;
1511
            if ($statut == 1) $droits = PROJET_DROIT_COORDINATEUR ;
1520
            if ($statut == 1) $droits = PROJET_DROIT_COORDINATEUR ;
1512
            if (participe::isAdministrateur($this->_auth->getAuthData(PROJET_CHAMPS_ID), $this->_db)) $droits = PROJET_DROIT_ADMINISTRATEUR  ;
1521
            if (participe::isAdministrateur($this->_auth->getAuthData(PROJET_CHAMPS_ID), $this->_db)) $droits = PROJET_DROIT_ADMINISTRATEUR  ;
Line 1515... Line 1524...
1515
            // Mise en place de l'url
1524
            // Mise en place de l'url
1516
            $this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_ACTION_VOIR_PARTICIPANT) ;
1525
            $this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_ACTION_VOIR_PARTICIPANT) ;
1517
            $HTML_listeParticipants->setURL($this->_url) ;
1526
            $HTML_listeParticipants->setURL($this->_url) ;
1518
            // Construction de l'entete
1527
            // Construction de l'entete
1519
            $entete = array (PROJET_NOM, PROJET_PRENOM) ;
1528
            $entete = array (PROJET_NOM, PROJET_PRENOM) ;
1520
            
1529
 
1521
            if ($this->_auth->getAuth()) {
1530
            if ($this->_auth->getAuth()) {
1522
                array_push ($entete, PROJET_MAIL) ;
1531
                array_push ($entete, PROJET_MAIL) ;
1523
            } else {
1532
            } else {
1524
               $droits = PROJET_DROIT_AUCUN ;
1533
               $droits = PROJET_DROIT_AUCUN ;
1525
            }
1534
            }
1526
            $info_utilisateur = $participants->getInscrits($this->_id_projet, $droits) ;
1535
            $info_utilisateur = $participants->getInscrits($this->_id_projet, $droits) ;
1527
            array_push ($entete, PROJET_DATE_INSCRIPTION) ;
1536
            array_push ($entete, PROJET_DATE_INSCRIPTION) ;
1528
            $HTML_listeParticipants->construitEntete($entete) ;
1537
            $HTML_listeParticipants->construitEntete($entete) ;
1529
            
1538
 
1530
            $HTML_listeParticipants->construitListe($info_utilisateur, statut::getTousLesStatuts(PROJET_STATUT_SAUF_ADM_COORD, $this->_db)) ;
1539
            $HTML_listeParticipants->construitListe($info_utilisateur, statut::getTousLesStatuts(PROJET_STATUT_SAUF_ADM_COORD, $this->_db)) ;
1531
            
1540
 
1532
            $res = $HTML_listeParticipants->toHTML() ;
1541
            $res = $HTML_listeParticipants->toHTML() ;
1533
            
1542
 
1534
            if ($statut < 2) {
1543
            if ($statut < 2) {
1535
                $res .= PROJET_NOUVEAU_UTILISATEUR_LAIUS ;
1544
                $res .= PROJET_NOUVEAU_UTILISATEUR_LAIUS ;
1536
                $res .= '<form action="'.$this->_url->getURL().'" method="post">'."\n" ;
1545
                $res .= '<form action="'.$this->_url->getURL().'" method="post">'."\n" ;
1537
                if (isset ($msg) && $msg != '') {
1546
                if (isset ($msg) && $msg != '') {
1538
                    $res .= '<div>'.$msg.'</div>' ;
1547
                    $res .= '<div>'.$msg.'</div>' ;
Line 1543... Line 1552...
1543
            }
1552
            }
1544
        } else {
1553
        } else {
1545
            $res .= '<p>'.PROJET_TEXTE_NON_IDENTIFIE.'</p>'."\n" ;
1554
            $res .= '<p>'.PROJET_TEXTE_NON_IDENTIFIE.'</p>'."\n" ;
1546
        }
1555
        }
1547
        return $titre.$res ;
1556
        return $titre.$res ;
1548
        
1557
 
1549
    } // end of member function voirParticipants
1558
    } // end of member function voirParticipants
Line 1550... Line 1559...
1550
 
1559
 
1551
    /**
1560
    /**
1552
     * Inscrit un utilisateur à un projet avec le statut observateur
1561
     * Inscrit un utilisateur à un projet avec le statut observateur
Line 1555... Line 1564...
1555
     * @access public
1564
     * @access public
1556
     */
1565
     */
1557
    function inscriptionProjet( )
1566
    function inscriptionProjet( )
1558
    {
1567
    {
1559
        include_once PROJET_CHEMIN_CLASSES.'HTML_formulaireInscriptionProjet.class.php' ;
1568
        include_once PROJET_CHEMIN_CLASSES.'HTML_formulaireInscriptionProjet.class.php' ;
1560
        
1569
 
1561
        $projet = new projet ($this->_db, $this->_id_projet) ;
1570
        $projet = new projet ($this->_db, $this->_id_projet) ;
1562
        
1571
 
1563
        // Si le projet n'a pas de liste, on inscrit directement
1572
        // Si le projet n'a pas de liste, on inscrit directement
1564
        if (isset ($this->_id_projet)) {
1573
        if (isset ($this->_id_projet)) {
1565
            $participant = new participe($this->_db) ;
1574
            $participant = new participe($this->_db) ;
1566
            
1575
 
1567
            if (!$projet->avoirListe()) {
1576
            if (!$projet->avoirListe()) {
1568
                $participant->setStatut(2, $this->_auth->getAuthData (PROJET_CHAMPS_ID), $this->_id_projet) ;
1577
                $participant->setStatut(2, $this->_auth->getAuthData (PROJET_CHAMPS_ID), $this->_id_projet) ;
1569
                return $this->mesProjets() ;
1578
                return $this->mesProjets() ;
1570
            }
1579
            }
1571
        }
1580
        }
Line 1580... Line 1589...
1580
                $inscription_liste = new inscription_liste($this->_db) ;
1589
                $inscription_liste = new inscription_liste($this->_db) ;
1581
                $inscription_liste->inscrireUtilisateur( $utilisateur,
1590
                $inscription_liste->inscrireUtilisateur( $utilisateur,
1582
                                                        $projet->_listes_associes[0],
1591
                                                        $projet->_listes_associes[0],
1583
                                                        $_POST['radio_inscription_liste']) ;
1592
                                                        $_POST['radio_inscription_liste']) ;
1584
            }
1593
            }
1585
            
1594
 
1586
            if ($this->_presentation != 'arbre') {
1595
            if ($this->_presentation != 'arbre') {
1587
                return $this->mesProjets() ;
1596
                return $this->mesProjets() ;
1588
            } else {
1597
            } else {
1589
                $this->_action = PROJET_ACTION_VOIR_RESUME;
1598
                $this->_action = PROJET_ACTION_VOIR_RESUME;
1590
            }
1599
            }
Line 1647... Line 1656...
1647
     */
1656
     */
1648
    function desinscriptionProjet( )
1657
    function desinscriptionProjet( )
1649
    {
1658
    {
1650
        include_once PROJET_CHEMIN_CLASSES.'participe.class.php' ;
1659
        include_once PROJET_CHEMIN_CLASSES.'participe.class.php' ;
1651
        $participant = new participe($this->_db) ;
1660
        $participant = new participe($this->_db) ;
1652
        
1661
 
1653
        // Le statut 4 désinscrit l'utilisateur, dans la méthode setStatut
1662
        // Le statut 4 désinscrit l'utilisateur, dans la méthode setStatut
1654
        $participant->setStatut(4, $this->_auth->getAuthData (PROJET_CHAMPS_ID), $this->_id_projet) ;
1663
        $participant->setStatut(4, $this->_auth->getAuthData (PROJET_CHAMPS_ID), $this->_id_projet) ;
1655
        $projet = new projet ($this->_db, $this->_id_projet) ;
1664
        $projet = new projet ($this->_db, $this->_id_projet) ;
1656
        $projet->getListesAssociees() ;
1665
        $projet->getListesAssociees() ;
1657
        if ($projet->avoirListe()) {
1666
        if ($projet->avoirListe()) {
Line 1675... Line 1684...
1675
     * @return void
1684
     * @return void
1676
     * @access public
1685
     * @access public
1677
     */
1686
     */
1678
    function formulaireWiki( )
1687
    function formulaireWiki( )
1679
    {
1688
    {
1680
        $res = '<h1>'.PROJET_CREER_WIKI.'</h1>'."\n" ;
-
 
-
 
1689
 
1681
        include_once PROJET_CHEMIN_CLASSES.'HTML_formulaireCreationWikini.class.php' ;
1690
		require_once 'client/integrateur_wikini/bibliotheque/iw_admin_wikini.fonct.php';
-
 
1691
 
1682
        $this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_CREER_WIKI_V) ;
1692
		$this->_url->addQueryString ('act', PROJET_ACTION_CREER_WIKI) ;
1683
        $HTML_formulaireCreationWikini = new HTML_formulaireCreationWikini('formulaire_wikini', 'post', str_replace('&amp;', '&', $this->_url->getURL())) ;
-
 
1684
        $HTML_formulaireCreationWikini->construitFormulaire() ;
1693
		$res =admin_afficherContenuCorps();
1685
        return $res.$HTML_formulaireCreationWikini->toHTML() ;
1694
    	return $res;
-
 
1695
 
1686
    } // end of member function formulaireWiki
1696
    } // end of member function formulaireWiki
Line 1687... Line 1697...
1687
 
1697
 
1688
 
1698
 
1689
	function associerWiki( )
1699
	function associerWiki( )
1690
    {
1700
    {
1691
        $res = '<h1>'.PROJET_ASSOCIER_WIKI.'</h1>'."\n" ;
1701
        $res = '<h1>'.PROJET_ASSOCIER_WIKI.'</h1>'."\n" ;
1692
        
1702
 
1693
	 	$db = &$GLOBALS['_GEN_commun']['pear_db'] ;   
1703
	 	$db = &$GLOBALS['_GEN_commun']['pear_db'] ;
1694
    	$res='';
1704
    	$res='';
1695
    	
1705
 
1696
         // Comportement par défaut
1706
         // Comportement par défaut
1697
	    // requete sur la table gen_wikini pour affichage de la liste des Wikini 
1707
	    // requete sur la table gen_wikini pour affichage de la liste des Wikini
1698
	    $requete = "select  gewi_id_wikini, gewi_code_alpha_wikini, gewi_page from gen_wikini" ;
1708
	    $requete = "select  gewi_id_wikini, gewi_code_alpha_wikini, gewi_page from gen_wikini" ;
1699
	    
1709
 
1700
	    $resultat = $db->query ($requete) ;
1710
	    $resultat = $db->query ($requete) ;
1701
	    if (DB::isError ($resultat)) {
1711
	    if (DB::isError ($resultat)) {
1702
	        $GLOBALS['_GEN_commun']['debogage_erreur']->gererErreur(E_USER_WARNING, "Echec de la requete : $requete<br />".$resultat->getMessage(),
1712
	        $GLOBALS['_GEN_commun']['debogage_erreur']->gererErreur(E_USER_WARNING, "Echec de la requete : $requete<br />".$resultat->getMessage(),
1703
	                                                                        __FILE__, __LINE__, 'admin_wikini')   ;
1713
	                                                                        __FILE__, __LINE__, 'admin_wikini')   ;
1704
	        return ;
1714
	        return ;
1705
	    }
1715
	    }
1706
	    
1716
 
1707
		
1717
 
1708
	    $liste = new HTML_TableFragmenteur () ;
1718
	    $liste = new HTML_TableFragmenteur () ;
1709
	    $liste->construireEntete(array (PROJET_NOM_WIKINI,PROJET_PAGE_WIKINI, PROJET_SELECTIONNER_WIKINI)) ;
1719
	    $liste->construireEntete(array (PROJET_NOM_WIKINI,PROJET_PAGE_WIKINI, PROJET_SELECTIONNER_WIKINI)) ;
1710
	    
1720
 
1711
	    $tableau_wikini = array() ;
1721
	    $tableau_wikini = array() ;
1712
	    
1722
 
1713
	    while ($ligne = $resultat->fetchRow()) {
1723
	    while ($ligne = $resultat->fetchRow()) {
1714
	        $this->_url->addQueryString ('id_wikini', $ligne[0]) ;
1724
	        $this->_url->addQueryString ('id_wikini', $ligne[0]) ;
1715
	        array_push ($tableau_wikini, array ($ligne[1]."\n",    // Première colonne, le nom de l'application
1725
	        array_push ($tableau_wikini, array ($ligne[1]."\n",    // Première colonne, le nom de l'application
1716
										        $ligne[2]."\n",    // Deuxieme colonne, la page par defaut
1726
										        $ligne[2]."\n",    // Deuxieme colonne, la page par defaut
1717
	        								  '<a href="'.$this->_url->getURL()."&amp;".PROJET_VARIABLE_ACTION."=".PROJET_ACTION_ASSOCIER_WIKI_V."".'">'.PROJET_CHOISIR_WIKINI.'</a>'."\n",
1727
	        								  '<a href="'.$this->_url->getURL()."&amp;".PROJET_VARIABLE_ACTION."=".PROJET_ACTION_ASSOCIER_WIKI_V."".'">'.PROJET_CHOISIR_WIKINI.'</a>'."\n",
1718
	                                            ));
1728
	                                            ));
1719
	    }
1729
	    }
1720
	    $liste->construireListe($tableau_wikini) ;
1730
	    $liste->construireListe($tableau_wikini) ;
1721
	    $res .= $liste->toHTML();
1731
	    $res .= $liste->toHTML();
1722
	    return $res ;
1732
	    return $res ;
1723
	    
1733
 
1724
        
1734
 
Line 1725... Line -...
1725
        
-
 
1726
    } // end of member function formulaireWiki
-
 
1727
 
-
 
1728
    /**
-
 
1729
     * Génère un wiki, à partir de la classe gestion wiki
-
 
1730
     *
-
 
1731
     * @return void
-
 
1732
     * @access public
-
 
1733
     */
-
 
1734
    function creationWiki( )
-
 
1735
    {
-
 
1736
        include_once PROJET_CHEMIN_CLASSES.'HTML_formulaireCreationWikini.class.php' ;
-
 
1737
        $this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_CREER_WIKI_V) ;
-
 
1738
        $HTML_formulaireCreationWikini = new HTML_formulaireCreationWikini('formulaire_wikini', 'post', str_replace('&amp;', '&', $this->_url->getURL())) ;
-
 
1739
        $HTML_formulaireCreationWikini->construitFormulaire() ;
-
 
1740
        if ($HTML_formulaireCreationWikini->validate()) {
-
 
1741
            include_once PROJET_CHEMIN_CLASSES.'gestion_wikini.class.php' ;
-
 
1742
            
-
 
1743
            // On crée une nouvelle connexion avec les paramètres spécifiques aux wikinis
-
 
1744
            $connexion_bd = DB::connect('mysql://'.PROJET_UTILISATEUR_WIKINI.':'.PROJET_MDP_WIKINI.'@'.PROJET_HOTE_WIKINI.'/'.PROJET_DB_WIKINI) ;
-
 
1745
            $gerantWikini = new gestion_wikini($connexion_bd) ;
-
 
1746
            $gerantWikini->creation_tables(strtolower($HTML_formulaireCreationWikini->getSubmitValue('nom_wikini'))) ;
-
 
1747
            
-
 
1748
            // On crée un objet avec le projet courant
-
 
1749
            $projet = new projet($this->_db, $this->_id_projet) ;
-
 
1750
            $projet->majNomWikini($HTML_formulaireCreationWikini->getSubmitValue('nom_wikini'));
-
 
1751
        } else {
-
 
Line 1752... Line 1735...
1752
            return $HTML_formulaireCreationWikini->toHTML() ;
1735
 
1753
        }
1736
    } // end of member function formulaireWiki
1754
    } // end of member function creationWiki
1737
 
1755
 
1738
 
1756
    /**
1739
    /**
1757
     * Associe un wiki au projet courant
1740
     * Associe un wiki au projet courant
Line 1758... Line 1741...
1758
     *
1741
     *
1759
     * @return void
1742
     * @return void
1760
     * @access public
1743
     * @access public
1761
     */
1744
     */
1762
 
1745
 
1763
	function associationWiki( )  {
1746
	function associationWiki( )  {
1764
		
1747
 
1765
        
1748
 
1766
    	if (isset($_GET['id_wikini'])) {
1749
    	if (isset($_GET['id_wikini'])) {
1767
    		$db = &$GLOBALS['_GEN_commun']['pear_db'] ;
1750
    		$db = &$GLOBALS['_GEN_commun']['pear_db'] ;
1768
		    $requete = "select gewi_code_alpha_wikini from gen_wikini where gewi_id_wikini = ".$_GET['id_wikini'] ;
1751
		    $requete = "select gewi_code_alpha_wikini from gen_wikini where gewi_id_wikini = ".$_GET['id_wikini'] ;
1769
	    	$resultat = $db->query ($requete) ;
1752
	    	$resultat = $db->query ($requete) ;
1770
	    	if (DB::isError ($resultat)) {
1753
	    	if (DB::isError ($resultat)) {
1771
	        	$GLOBALS['_GEN_commun']['debogage_erreur']->gererErreur(E_USER_WARNING, "Echec de la requete : $requete<br />".$resultat->getMessage(),
1754
	        	$GLOBALS['_GEN_commun']['debogage_erreur']->gererErreur(E_USER_WARNING, "Echec de la requete : $requete<br />".$resultat->getMessage(),
1772
	            	                                                            __FILE__, __LINE__, 'admin_wikini')   ;
1755
	            	                                                            __FILE__, __LINE__, 'admin_wikini')   ;
1773
	        	return ;
1756
	        	return ;
1774
	    	}
1757
	    	}
1775
	    
1758
 
1776
	    	$ligne = $resultat->fetchRow();
1759
	    	$ligne = $resultat->fetchRow();
Line 1777... Line 1760...
1777
			$projet = new projet($this->_db, $this->_id_projet) ;
1760
			$projet = new projet($this->_db, $this->_id_projet) ;
1778
        	$projet->majNomWikini($ligne[0]);
1761
        	$projet->majNomWikini($ligne[0]);
1779
    	}
1762
    	}
Line 1832... Line 1815...
1832
        include_once PROJET_CHEMIN_CLASSES.'liste_externe.class.php' ;
1815
        include_once PROJET_CHEMIN_CLASSES.'liste_externe.class.php' ;
1833
        $liste_externe = new liste_externe($this->_db) ;
1816
        $liste_externe = new liste_externe($this->_db) ;
1834
        include_once PROJET_CHEMIN_CLASSES.'HTML_formulaireListeExterne.class.php' ;
1817
        include_once PROJET_CHEMIN_CLASSES.'HTML_formulaireListeExterne.class.php' ;
1835
        $HTML_formulaireListeExterne = new HTML_formulaireListeExterne('formulaire_liste_externe', 'post', str_replace('&amp;', '&', $this->_url->getURL())) ;
1818
        $HTML_formulaireListeExterne = new HTML_formulaireListeExterne('formulaire_liste_externe', 'post', str_replace('&amp;', '&', $this->_url->getURL())) ;
1836
        $HTML_formulaireListeExterne->construitFormulaire($liste_externe->getListeNom()) ;
1819
        $HTML_formulaireListeExterne->construitFormulaire($liste_externe->getListeNom()) ;
1837
        
1820
 
1838
        $liste_externe->enregistrerSQL($HTML_formulaireListeExterne->getSubmitValues(), $this->_id_projet) ;
1821
        $liste_externe->enregistrerSQL($HTML_formulaireListeExterne->getSubmitValues(), $this->_id_projet) ;
1839
    } // end of member function referencerListeExterneValidation
1822
    } // end of member function referencerListeExterneValidation
Line 1840... Line 1823...
1840
 
1823
 
1841
    /**
1824
    /**