Subversion Repositories Applications.projet

Rev

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

Rev 241 Rev 341
1
<?php
1
<?php
2
/*vim: set expandtab tabstop=4 shiftwidth=4: */ 
2
/*vim: set expandtab tabstop=4 shiftwidth=4: */ 
3
// +------------------------------------------------------------------------------------------------------+
3
// +------------------------------------------------------------------------------------------------------+
4
// | PHP version 4.1                                                                                      |
4
// | PHP version 4.1                                                                                      |
5
// +------------------------------------------------------------------------------------------------------+
5
// +------------------------------------------------------------------------------------------------------+
6
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org)                                         |
6
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org)                                         |
7
// +------------------------------------------------------------------------------------------------------+
7
// +------------------------------------------------------------------------------------------------------+
8
// | This library is free software; you can redistribute it and/or                                        |
8
// | This library is free software; you can redistribute it and/or                                        |
9
// | modify it under the terms of the GNU Lesser General Public                                           |
9
// | modify it under the terms of the GNU Lesser General Public                                           |
10
// | License as published by the Free Software Foundation; either                                         |
10
// | License as published by the Free Software Foundation; either                                         |
11
// | version 2.1 of the License, or (at your option) any later version.                                   |
11
// | version 2.1 of the License, or (at your option) any later version.                                   |
12
// |                                                                                                      |
12
// |                                                                                                      |
13
// | This library is distributed in the hope that it will be useful,                                      |
13
// | This library is distributed in the hope that it will be useful,                                      |
14
// | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
14
// | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
15
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU                                    |
15
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU                                    |
16
// | Lesser General Public License for more details.                                                      |
16
// | Lesser General Public License for more details.                                                      |
17
// |                                                                                                      |
17
// |                                                                                                      |
18
// | You should have received a copy of the GNU Lesser General Public                                     |
18
// | You should have received a copy of the GNU Lesser General Public                                     |
19
// | License along with this library; if not, write to the Free Software                                  |
19
// | License along with this library; if not, write to the Free Software                                  |
20
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
20
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
21
// +------------------------------------------------------------------------------------------------------+
21
// +------------------------------------------------------------------------------------------------------+
22
// CVS : $Id: projet.desinscription.inc.php,v 1.3 2007-06-01 13:57:11 alexandre_tb Exp $
22
// CVS : $Id: projet.desinscription.inc.php,v 1.4 2008-09-16 14:10:06 alexandre_tb Exp $
23
/**
23
/**
24
* Inscription
24
* Inscription
25
*
25
*
26
* Le fichier de desinscription de projet, appele par l'inscription
26
* Le fichier de desinscription de projet, appele par l'inscription
27
* en cas de desinscription d'un utilisateur
27
* en cas de desinscription d'un utilisateur
28
*
28
*
29
*@package projet
29
*@package projet
30
//Auteur original :
30
//Auteur original :
31
*@author        Alexandre GRANIER <alexandre@tela-botanica.org>
31
*@author        Alexandre GRANIER <alexandre@tela-botanica.org>
32
*@copyright     Tela-Botanica 2000-2006
32
*@copyright     Tela-Botanica 2000-2006
33
*@version       $Revision: 1.3 $
33
*@version       $Revision: 1.4 $
34
// +------------------------------------------------------------------------------------------------------+
34
// +------------------------------------------------------------------------------------------------------+
35
*/
35
*/
36
 
36
 
37
// +------------------------------------------------------------------------------------------------------+
37
// +------------------------------------------------------------------------------------------------------+
38
// |                                            ENTETE du PROGRAMME                                       |
38
// |                                            ENTETE du PROGRAMME                                       |
39
// +------------------------------------------------------------------------------------------------------+
39
// +------------------------------------------------------------------------------------------------------+
40
 
40
 
41
// On recupere id_utilisateur, l'identifiant de la personne qui se desinscrit
41
// On recupere id_utilisateur, l'identifiant de la personne qui se desinscrit
42
// On se trouve dans la fonction afficherContenuCorps de inscription.php
42
// On se trouve dans la fonction afficherContenuCorps de inscription.php
43
 
43
 
44
 
44
 
45
 
45
 
46
include_once 'client/projet/configuration/projet.config.inc.php' ;
46
include_once 'client/projet/configuration/projet.config.inc.php' ;
47
include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
47
include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
48
include_once PROJET_CHEMIN_CLASSES.'participe.class.php' ;
48
include_once PROJET_CHEMIN_CLASSES.'participe.class.php' ;
-
 
49
include_once PROJET_CHEMIN_CLASSES.'projetControleur.class.php' ;
49
$participant = new participe($GLOBALS['ins_db']) ;
50
$participant = new participe($GLOBALS['ins_db']) ;
50
 
51
 
51
 
52
 
52
$tableau_projet = projet::getTousLesProjets($GLOBALS['ins_db']) ;
53
$tableau_projet = projet::getTousLesProjets($GLOBALS['ins_db']) ;
-
 
54
 
-
 
55
include_once PROJET_CHEMIN_CLASSES.'annuaire.class.php' ;
-
 
56
$annuaire = new annuaire($GLOBALS['ins_db'], array('identifiant' => INS_CHAMPS_ID, 'mail' => INS_CHAMPS_MAIL, 'table' => INS_ANNUAIRE, 'nom' => INS_CHAMPS_NOM,
-
 
57
						'prenom' => INS_CHAMPS_PRENOM)) ;
-
 
58
$annuaire->setId($id_utilisateur) ;
53
 
59
    
54
// On boucle sur chaque projet et on désinscrit l'utilisateur
60
// On boucle sur chaque projet et on desinscrit l'utilisateur
-
 
61
foreach ($tableau_projet as $projet) {
-
 
62
	// On verifie si l utilisateur est le dernier coordinateur
-
 
63
    // auquel cas on previent les administrateurs
-
 
64
    if ($participant->isCoordinateur($id_utilisateur, $projet->getId(), $GLOBALS['ins_db'])) {
-
 
65
    	$controleur = new projetControleur($GLOBALS['ins_db'], $GLOBALS['AUTH'], $GLOBALS['ins_url']);
-
 
66
    	$controleur->setIdProjet($projet->getId());
-
 
67
    	$coord = $participant->getCoordinateurs($projet->getId());
-
 
68
    	if (count($coord) == 0) {
-
 
69
    		$controleur->notifierCoordinateurs(PROJET_NOTIFICATION_DESINSCRIPTION_PROJET_DERNIER_COORD, $annuaire);
-
 
70
    	}
-
 
71
    }
55
foreach ($tableau_projet as $projet) {
72
    
56
	// Le statut 4 desinscrit l'utilisateur, dans la méthode setStatut
73
	// Le statut 4 desinscrit l'utilisateur, dans la methode setStatut
57
	$participant->setStatut(4, $id_utilisateur, $projet->getId()) ;
74
	$participant->setStatut(4, $id_utilisateur, $projet->getId()) ;
-
 
75
	$projet->getListesAssociees() ;
58
	$projet->getListesAssociees() ;
76
	
59
	if ($projet->avoirListe()) {
-
 
60
	    include_once PROJET_CHEMIN_CLASSES.'annuaire.class.php' ;
-
 
61
	    $annuaire = new annuaire($GLOBALS['ins_db'], array('identifiant' => PROJET_CHAMPS_ID, 'mail' => PROJET_CHAMPS_MAIL, 'table' => PROJET_ANNUAIRE)) ;
-
 
62
	    $annuaire->setId($id_utilisateur) ;
77
	if ($projet->avoirListe()) {
63
	    include_once PROJET_CHEMIN_CLASSES.'inscription_liste.class.php' ;
78
	    include_once PROJET_CHEMIN_CLASSES.'inscription_liste.class.php' ;
64
	    $desinscription= new inscription_liste($GLOBALS['ins_db']) ;
79
	    $desinscription= new inscription_liste($GLOBALS['ins_db']) ;
65
	    $desinscription->desinscrireUtilisateur($annuaire, $projet->_listes_associes[0]) ;
80
	    $desinscription->desinscrireUtilisateur($annuaire, $projet->_listes_associes[0]) ;
66
	}
81
	}
67
}
82
}
68
 
83
 
69
 
84
 
70
?>
85
?>