Subversion Repositories Applications.projet

Rev

Rev 389 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
431 mathias 1
<?php
2
/*vim: set expandtab tabstop=4 shiftwidth=4: */
3
// +------------------------------------------------------------------------------------------------------+
4
// | PHP version 4.1                                                                                      |
5
// +------------------------------------------------------------------------------------------------------+
6
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org)                                         |
7
// +------------------------------------------------------------------------------------------------------+
8
// | This library is free software; you can redistribute it and/or                                        |
9
// | modify it under the terms of the GNU Lesser General Public                                           |
10
// | License as published by the Free Software Foundation; either                                         |
11
// | version 2.1 of the License, or (at your option) any later version.                                   |
12
// |                                                                                                      |
13
// | This library is distributed in the hope that it will be useful,                                      |
14
// | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
15
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU                                    |
16
// | Lesser General Public License for more details.                                                      |
17
// |                                                                                                      |
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                                  |
20
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
21
// +------------------------------------------------------------------------------------------------------+
22
// CVS : $Id: projet.desinscription.inc.php,v 1.3 2007-06-01 13:57:11 alexandre_tb Exp $
23
/**
24
* Inscription
25
*
26
* Le fichier de desinscription de projet, appele par l'inscription
27
* en cas de desinscription d'un utilisateur
28
*
29
*@package projet
30
//Auteur original :
31
*@author        Alexandre GRANIER <alexandre@tela-botanica.org>
32
*@copyright     Tela-Botanica 2000-2006
33
*@version       $Revision: 1.3 $
34
// +------------------------------------------------------------------------------------------------------+
35
*/
36
 
37
// +------------------------------------------------------------------------------------------------------+
38
// |                                            ENTETE du PROGRAMME                                       |
39
// +------------------------------------------------------------------------------------------------------+
40
 
41
// On recupere id_utilisateur, l'identifiant de la personne qui se desinscrit
42
// On se trouve dans la fonction afficherContenuCorps de inscription.php
43
 
44
 
45
 
46
include_once 'client/projet/configuration/projet.config.inc.php' ;
47
include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
48
include_once PROJET_CHEMIN_CLASSES.'participe.class.php' ;
49
include_once PROJET_CHEMIN_CLASSES.'projetControleur.class.php' ;
50
$participant = new participe($GLOBALS['ins_db']) ;
51
 
52
 
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) ;
59
 
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
    }
72
 
73
	// Le statut 4 desinscrit l'utilisateur, dans la methode setStatut
74
	$participant->setStatut(4, $id_utilisateur, $projet->getId()) ;
75
	$projet->getListesAssociees() ;
76
 
77
	if ($projet->avoirListe()) {
78
	    include_once PROJET_CHEMIN_CLASSES.'inscription_liste.class.php' ;
79
	    $desinscription= new inscription_liste($GLOBALS['ins_db']) ;
80
	    $desinscription->desinscrireUtilisateur($annuaire, $projet->_listes_associes[0]) ;
81
 
82
	}
83
}
84
 
85
 
105 alexandre_ 86
?>