Subversion Repositories Applications.projet

Rev

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

Rev 241 Rev 341
Line 17... Line 17...
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
*/
Line 36... Line 36...
36
 
36
 
37
// +------------------------------------------------------------------------------------------------------+
37
// +------------------------------------------------------------------------------------------------------+
Line 44... Line 44...
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' ;
Line 48... Line 49...
48
include_once PROJET_CHEMIN_CLASSES.'participe.class.php' ;
49
include_once PROJET_CHEMIN_CLASSES.'projetControleur.class.php' ;
Line -... Line 50...
-
 
50
$participant = new participe($GLOBALS['ins_db']) ;
-
 
51
 
-
 
52
 
-
 
53
$tableau_projet = projet::getTousLesProjets($GLOBALS['ins_db']) ;
-
 
54
 
49
$participant = new participe($GLOBALS['ins_db']) ;
55
include_once PROJET_CHEMIN_CLASSES.'annuaire.class.php' ;
50
 
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());
51
 
68
    	if (count($coord) == 0) {
52
$tableau_projet = projet::getTousLesProjets($GLOBALS['ins_db']) ;
69
    		$controleur->notifierCoordinateurs(PROJET_NOTIFICATION_DESINSCRIPTION_PROJET_DERNIER_COORD, $annuaire);
53
 
70
    	}
-
 
71
    }
54
// On boucle sur chaque projet et on désinscrit l'utilisateur
72
    
55
foreach ($tableau_projet as $projet) {
-
 
56
	// Le statut 4 desinscrit l'utilisateur, dans la méthode setStatut
-
 
57
	$participant->setStatut(4, $id_utilisateur, $projet->getId()) ;
-
 
58
	$projet->getListesAssociees() ;
73
	// Le statut 4 desinscrit l'utilisateur, dans la methode setStatut
59
	if ($projet->avoirListe()) {
74
	$participant->setStatut(4, $id_utilisateur, $projet->getId()) ;
60
	    include_once PROJET_CHEMIN_CLASSES.'annuaire.class.php' ;
75
	$projet->getListesAssociees() ;
61
	    $annuaire = new annuaire($GLOBALS['ins_db'], array('identifiant' => PROJET_CHAMPS_ID, 'mail' => PROJET_CHAMPS_MAIL, 'table' => PROJET_ANNUAIRE)) ;
76
	
62
	    $annuaire->setId($id_utilisateur) ;
77
	if ($projet->avoirListe()) {