Subversion Repositories Applications.projet

Rev

Rev 431 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 431 Rev 459
1
<?php
1
<?php
2
/*vim: set expandtab tabstop=4 shiftwidth=4: */
2
/*vim: set expandtab tabstop=4 shiftwidth=4: */
3
// +------------------------------------------------------------------------------------------------------+
3
// +------------------------------------------------------------------------------------------------------+
4
// | PHP version 4.1                                                                                      |
4
// | PHP version 4.1                                                                                      |
5
// +------------------------------------------------------------------------------------------------------+
5
// +------------------------------------------------------------------------------------------------------+
6
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org)                                         |
6
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org)                                         |
7
// +------------------------------------------------------------------------------------------------------+
7
// +------------------------------------------------------------------------------------------------------+
8
// | This library is free software; you can redistribute it and/or                                        |
8
// | This library is free software; you can redistribute it and/or                                        |
9
// | modify it under the terms of the GNU General Public                                                  |
9
// | modify it under the terms of the GNU General Public                                                  |
10
// | License as published by the Free Software Foundation; either                                         |
10
// | License as published by the Free Software Foundation; either                                         |
11
// | version 2.1 of the License, or (at your option) any later version.                                   |
11
// | version 2.1 of the License, or (at your option) any later version.                                   |
12
// |                                                                                                      |
12
// |                                                                                                      |
13
// | This library is distributed in the hope that it will be useful,                                      |
13
// | This library is distributed in the hope that it will be useful,                                      |
14
// | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
14
// | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
15
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU                                    |
15
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU                                    |
16
// | General Public License for more details.                                                             |
16
// | General Public License for more details.                                                             |
17
// |                                                                                                      |
17
// |                                                                                                      |
18
// | You should have received a copy of the GNU General Public                                            |
18
// | You should have received a copy of the GNU General Public                                            |
19
// | License along with this library; if not, write to the Free Software                                  |
19
// | License along with this library; if not, write to the Free Software                                  |
20
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
20
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
21
// +------------------------------------------------------------------------------------------------------+
21
// +------------------------------------------------------------------------------------------------------+
22
// CVS : $Id: mes_projets.php,v 1.1 2008-09-01 14:36:48 alexandre_tb Exp $
22
// CVS : $Id: mes_projets.php,v 1.1 2008-09-01 14:36:48 alexandre_tb Exp $
23
/**
23
/**
24
* Application projet
24
* Application projet
25
*
25
*
26
* Fichier de presentation de la liste des projets pour Tela Botanica nouvelle version
26
* Fichier de presentation de la liste des projets pour Tela Botanica nouvelle version
27
*
27
*
28
*@package projet
28
*@package projet
29
//Auteur original :
29
//Auteur original :
30
*@author        Alexandre Granier <alexandre@tela-botanica.org>
30
*@author        Alexandre Granier <alexandre@tela-botanica.org>
31
//Autres auteurs :
31
//Autres auteurs :
32
*@author        Aucun
32
*@author        Aucun
33
*@copyright     Tela-Botanica 2000-2004
33
*@copyright     Tela-Botanica 2000-2004
34
*@version       $Revision: 1.1 $
34
*@version       $Revision: 1.1 $
35
// +------------------------------------------------------------------------------------------------------+
35
// +------------------------------------------------------------------------------------------------------+
36
*/
36
*/
37
 
37
 
38
// +------------------------------------------------------------------------------------------------------+
38
// +------------------------------------------------------------------------------------------------------+
39
// |                                            ENTETE du PROGRAMME                                       |
39
// |                                            ENTETE du PROGRAMME                                       |
40
// +------------------------------------------------------------------------------------------------------+
40
// +------------------------------------------------------------------------------------------------------+
41
 
41
 
42
 
42
 
43
define ('PROJET_VARIABLE_MODE_AFFICHAGE', 'projet_affichage');
43
define ('PROJET_VARIABLE_MODE_AFFICHAGE', 'projet_affichage');
44
define ('PROJET_VARIABLE_TRI', 'projet_tri');
44
define ('PROJET_VARIABLE_TRI', 'projet_tri');
45
define ('PROJET_VARIABLE_ORDRE_TRI', 'projet_ordre_tri');
45
define ('PROJET_VARIABLE_ORDRE_TRI', 'projet_ordre_tri');
46
define ('PROJET_VARIABLE_THEME', 'theme');
46
define ('PROJET_VARIABLE_THEME', 'theme');
47
 
47
 
48
if (PROJET_UTILISE_TYPE && $this->_type != '') {
48
if (PROJET_UTILISE_TYPE && $this->_type != '') {
49
    $projetListe = projet::getProjetDuType($this->_type, $this->_db) ;
49
    $projetListe = projet::getProjetDuType($this->_type, $this->_db) ;
50
    if ($this->_presentation == 'arbre')array_push ($projetListe, projet::getProjetRacine($this->_db)) ;
50
    if ($this->_presentation == 'arbre')array_push ($projetListe, projet::getProjetRacine($this->_db)) ;
51
} else {
51
} else {
52
    // Un tableau de tous les projets dans $projetListe
52
    // Un tableau de tous les projets dans $projetListe
53
    //$projetListe = projet::getTousLesProjets($this->_db, $this->_projet_exclu) ;
53
    //$projetListe = projet::getTousLesProjets($this->_db, $this->_projet_exclu) ;
54
}
54
}
55
 
55
 
56
$_SESSION['_PROJET_']['motif_recherche'] = '';
56
$_SESSION['_PROJET_']['motif_recherche'] = '';
57
 
57
 
58
$url = $this->_url->getURL();
58
$url = $this->_url->getURL();
59
$loggue = $this->_auth->getAuth();
59
$loggue = $this->_auth->getAuth();
60
 
60
 
61
// Verification sur l ordre de tri et mise en place
61
// Verification sur l ordre de tri et mise en place
62
// du tri par defaut sur le titre
62
// du tri par defaut sur le titre
63
 
63
 
64
$valeur_acceptable_tri = array ('p_titre', 'ps_pourcent', 'ps_nombre_inscrit', 'ps_doc_derniere_semaine', 'psu_id_statut');  // Securite
64
$valeur_acceptable_tri = array ('p_titre', 'ps_pourcent', 'ps_nombre_inscrit', 'ps_doc_derniere_semaine', 'psu_id_statut');  // Securite
65
 
65
 
66
if (isset($_GET[PROJET_VARIABLE_TRI]) && $_GET[PROJET_VARIABLE_TRI] != '' && in_array($_GET[PROJET_VARIABLE_TRI], $valeur_acceptable_tri)) {
66
if (isset($_GET[PROJET_VARIABLE_TRI]) && $_GET[PROJET_VARIABLE_TRI] != '' && in_array($_GET[PROJET_VARIABLE_TRI], $valeur_acceptable_tri)) {
67
	$tri = $_GET[PROJET_VARIABLE_TRI];
67
	$tri = $_GET[PROJET_VARIABLE_TRI];
68
 
68
 
69
} else {
69
} else {
70
	$tri = 'p_titre';
70
	$tri = 'p_titre';
71
}
71
}
72
 
72
 
73
$valeur_acceptable_ordre_tri = array ('asc', 'desc');  // securite
73
$valeur_acceptable_ordre_tri = array ('asc', 'desc');  // securite
74
 
74
 
75
if (isset($_GET[PROJET_VARIABLE_ORDRE_TRI]) && $_GET[PROJET_VARIABLE_ORDRE_TRI] != ''
75
if (isset($_GET[PROJET_VARIABLE_ORDRE_TRI]) && $_GET[PROJET_VARIABLE_ORDRE_TRI] != ''
76
			&& in_array ($_GET[PROJET_VARIABLE_ORDRE_TRI], $valeur_acceptable_ordre_tri)) {
76
			&& in_array ($_GET[PROJET_VARIABLE_ORDRE_TRI], $valeur_acceptable_ordre_tri)) {
77
	$ordre_tri = $_GET[PROJET_VARIABLE_ORDRE_TRI];
77
	$ordre_tri = $_GET[PROJET_VARIABLE_ORDRE_TRI];
78
 
78
 
79
} else {
79
} else {
80
	$ordre_tri = '';
80
	$ordre_tri = '';
81
}
81
}
82
 
82
 
83
// variable de session pour se rappeler des choix du visiteur
83
// variable de session pour se rappeler des choix du visiteur
84
if (!isset ($_GET[PROJET_VARIABLE_MODE_AFFICHAGE]) && isset($_SESSION['_PROJET_']['projet_affichage']) && ($_SESSION['_PROJET_']['projet_affichage'] == 'simple' || $_SESSION['_PROJET_']['projet_affichage'] == 'expert')) {
84
if (!isset ($_GET[PROJET_VARIABLE_MODE_AFFICHAGE]) && isset($_SESSION['_PROJET_']['projet_affichage']) && ($_SESSION['_PROJET_']['projet_affichage'] == 'simple' || $_SESSION['_PROJET_']['projet_affichage'] == 'expert')) {
85
	$_GET[PROJET_VARIABLE_MODE_AFFICHAGE] = $_SESSION['_PROJET_']['projet_affichage'];
85
	$_GET[PROJET_VARIABLE_MODE_AFFICHAGE] = $_SESSION['_PROJET_']['projet_affichage'];
86
}
86
}
87
 
87
 
88
if (isset($_GET[PROJET_VARIABLE_MODE_AFFICHAGE]) && $_GET[PROJET_VARIABLE_MODE_AFFICHAGE] != '') {
88
if (isset($_GET[PROJET_VARIABLE_MODE_AFFICHAGE]) && $_GET[PROJET_VARIABLE_MODE_AFFICHAGE] != '') {
89
	$_SESSION['_PROJET_']['projet_affichage'] = $_GET[PROJET_VARIABLE_MODE_AFFICHAGE];
89
	$_SESSION['_PROJET_']['projet_affichage'] = $_GET[PROJET_VARIABLE_MODE_AFFICHAGE];
90
	if ($_SESSION['_PROJET_']['projet_affichage'] == 'expert') {
90
	if ($_SESSION['_PROJET_']['projet_affichage'] == 'expert') {
91
		$this->_url->addQueryString (PROJET_VARIABLE_MODE_AFFICHAGE, 'simple');
91
		$this->_url->addQueryString (PROJET_VARIABLE_MODE_AFFICHAGE, 'simple');
92
		$lien_interface_simple = '[<a href="'.$this->_url->getURL().'">Affichage simple</a>]';
92
		$lien_interface_simple = '[<a href="'.$this->_url->getURL().'">Affichage simple</a>]';
93
		$this->_url->addQueryString (PROJET_VARIABLE_MODE_AFFICHAGE, 'expert');
93
		$this->_url->addQueryString (PROJET_VARIABLE_MODE_AFFICHAGE, 'expert');
94
		$lien_interface_expert = '';
94
		$lien_interface_expert = '';
95
	} else {
95
	} else {
96
		$_SESSION['_PROJET_']['projet_affichage'] = 'simple';
96
		$_SESSION['_PROJET_']['projet_affichage'] = 'simple';
97
		$this->_url->addQueryString (PROJET_VARIABLE_MODE_AFFICHAGE, 'expert');
97
		$this->_url->addQueryString (PROJET_VARIABLE_MODE_AFFICHAGE, 'expert');
98
		$lien_interface_simple = '';
98
		$lien_interface_simple = '';
99
		$lien_interface_expert = '[<a href="'.$this->_url->getURL().'">Affichage expert</a>]';
99
		$lien_interface_expert = '[<a href="'.$this->_url->getURL().'">Affichage expert</a>]';
100
	}
100
	}
101
} else {
101
} else {
102
	$_SESSION['_PROJET_']['projet_affichage'] = 'simple';
102
	$_SESSION['_PROJET_']['projet_affichage'] = 'simple';
103
	$this->_url->addQueryString (PROJET_VARIABLE_MODE_AFFICHAGE, 'expert');
103
	$this->_url->addQueryString (PROJET_VARIABLE_MODE_AFFICHAGE, 'expert');
104
	$lien_interface_simple = '';
104
	$lien_interface_simple = '';
105
	$lien_interface_expert = '[<a href="'.$this->_url->getURL().'">Affichage expert</a>]';
105
	$lien_interface_expert = '[<a href="'.$this->_url->getURL().'">Affichage expert</a>]';
106
}
106
}
107
 
107
 
108
if ($_SESSION['_PROJET_']['projet_affichage'] != 'expert') {
108
if ($_SESSION['_PROJET_']['projet_affichage'] != 'expert') {
109
	$ordre_tri = 'desc';
109
	$ordre_tri = 'desc';
110
	$tri = 'ps_pourcent';
110
	$tri = 'ps_pourcent';
111
}
111
}
112
/** Affichage des themes de projets */
112
/** Affichage des themes de projets */
113
$requete_type = 'SELECT count( p_id ) AS nbe, pt_label_theme,pt_id_theme
113
$requete_type = 'SELECT count( p_id ) AS nbe, pt_label_theme,pt_id_theme
114
FROM projet, projet_avoir_theme, projet_theme
114
FROM projet, projet_avoir_theme, projet_theme
115
WHERE p_id = pat_id_projet
115
WHERE p_id = pat_id_projet
116
AND pat_id_theme = pt_id_theme and p_en_dormance=0
116
AND pat_id_theme = pt_id_theme and p_en_dormance=0
117
GROUP BY pt_id_theme';
117
GROUP BY pt_id_theme';
118
 
118
 
119
$resultat_type = $GLOBALS['projet_db']->query($requete_type);
119
$resultat_type = $GLOBALS['projet_db']->query($requete_type);
120
 
120
 
121
if (DB::isError($resultat_type)) return $resultat_type->getMessage();
121
if (DB::isError($resultat_type)) return $resultat_type->getMessage();
122
 
122
 
123
$tableau_theme = array();
123
$tableau_theme = array();
124
 
124
 
125
$requete_nb_pj = 'select count(*) as nb from projet';
125
$requete_nb_pj = 'select count(*) as nb from projet';
126
$nombre_total_projet = $GLOBALS['projet_db']->getOne($requete_nb_pj);
126
$nombre_total_projet = $GLOBALS['projet_db']->getOne($requete_nb_pj);
127
 
127
 
128
// On ajoute le theme tous
128
// On ajoute le theme tous
129
$tableau_theme[0]['label'] = 'Tous les projets';
129
$tableau_theme[0]['label'] = 'Tous les projets';
130
$tableau_theme[0]['id'] = 0;
130
$tableau_theme[0]['id'] = 0;
131
$tableau_theme[0]['nombre_projet'] = $nombre_total_projet;
131
$tableau_theme[0]['nombre_projet'] = $nombre_total_projet;
132
$this->_url->removeQueryString(PROJET_VARIABLE_MODE_AFFICHAGE);
132
$this->_url->removeQueryString(PROJET_VARIABLE_MODE_AFFICHAGE);
133
$tableau_theme[0]['lien'] = $this->_url->getURL();
133
$tableau_theme[0]['lien'] = $this->_url->getURL();
134
 
134
 
135
// Et le theme en dormance
135
// Et le theme en dormance
136
$requete_dormance = 'select count(p_id) as nb_p_dorman from projet where p_en_dormance=1';
136
$requete_dormance = 'select count(p_id) as nb_p_dorman from projet where p_en_dormance=1';
137
$nb_p_dormant = $GLOBALS['projet_db']->getOne($requete_dormance);
137
$nb_p_dormant = $GLOBALS['projet_db']->getOne($requete_dormance);
138
 
138
 
139
 
139
 
140
 
140
 
141
while ($ligne_type = $resultat_type->fetchRow(DB_FETCHMODE_OBJECT)) {
141
while ($ligne_type = $resultat_type->fetchRow(DB_FETCHMODE_OBJECT)) {
142
	$tableau_theme[$ligne_type->pt_id_theme]['label'] = $ligne_type->pt_label_theme;
142
	$tableau_theme[$ligne_type->pt_id_theme]['label'] = $ligne_type->pt_label_theme;
143
	$tableau_theme[$ligne_type->pt_id_theme]['id'] = $ligne_type->pt_id_theme;
143
	$tableau_theme[$ligne_type->pt_id_theme]['id'] = $ligne_type->pt_id_theme;
144
	$tableau_theme[$ligne_type->pt_id_theme]['nombre_projet'] = $ligne_type->nbe;
144
	$tableau_theme[$ligne_type->pt_id_theme]['nombre_projet'] = $ligne_type->nbe;
145
	$this->_url->addQueryString(PROJET_VARIABLE_THEME, $ligne_type->pt_id_theme);
145
	$this->_url->addQueryString(PROJET_VARIABLE_THEME, $ligne_type->pt_id_theme);
146
	$tableau_theme[$ligne_type->pt_id_theme]['lien'] = $this->_url->getURL();
146
	$tableau_theme[$ligne_type->pt_id_theme]['lien'] = $this->_url->getURL();
147
}
147
}
148
$tableau_theme[9]['label'] = 'En dormance';
148
$tableau_theme[9]['label'] = 'En dormance';
149
$tableau_theme[9]['id'] = 9;
149
$tableau_theme[9]['id'] = 9;
150
$tableau_theme[9]['nombre_projet'] = $nb_p_dormant;
150
$tableau_theme[9]['nombre_projet'] = $nb_p_dormant;
151
$this->_url->addQueryString(PROJET_VARIABLE_THEME, 9);
151
$this->_url->addQueryString(PROJET_VARIABLE_THEME, 9);
152
$tableau_theme[9]['lien'] = $this->_url->getURL();
152
$tableau_theme[9]['lien'] = $this->_url->getURL();
153
 
153
 
154
 
154
 
155
$this->_url->removeQueryString(PROJET_VARIABLE_THEME);
155
$this->_url->removeQueryString(PROJET_VARIABLE_THEME);
156
 
156
 
157
// Contruction de la requete, soit avec le moteur de recherche
157
// Contruction de la requete, soit avec le moteur de recherche
158
// soit la liste des projets
158
// soit la liste des projets
159
if (isset($_GET['projet_recherche']) && $_GET['projet_recherche'] != '') {
159
if (isset($_GET['projet_recherche']) && $_GET['projet_recherche'] != '') {
160
	$_SESSION['_PROJET_']['motif_recherche'] = $_GET['projet_recherche'];
160
	$_SESSION['_PROJET_']['motif_recherche'] = $_GET['projet_recherche'];
161
	include_once 'papyrus/applettes/moteur_recherche/bibliotheque/more_recherche.class.php';
161
	include_once 'papyrus/applettes/moteur_recherche/bibliotheque/more_recherche.class.php';
162
	include_once 'papyrus/applettes/moteur_recherche/bibliotheque/more_recherche_projet.class.php';
162
	include_once 'papyrus/applettes/moteur_recherche/bibliotheque/more_recherche_projet.class.php';
163
 
163
 
164
	$moteur = new More_Recherche($_SESSION['_PROJET_']['motif_recherche']);
164
	$moteur = new More_Recherche($_SESSION['_PROJET_']['motif_recherche']);
165
    $recherche_projet = new More_Recherche_Projet($_SESSION['_PROJET_']['motif_recherche']);
165
    $recherche_projet = new More_Recherche_Projet($_SESSION['_PROJET_']['motif_recherche']);
166
    $moteur->ajouterRecherche($recherche_projet);
166
    $moteur->ajouterRecherche($recherche_projet);
167
    $resultats = $moteur->rechercherMotif();
167
    $resultats = $moteur->rechercherMotif();
168
 
168
 
169
    // $chaine_id_projet contient une liste d identifiant separer par une virgule
169
    // $chaine_id_projet contient une liste d identifiant separer par une virgule
170
    if (!empty($resultats)) {
170
    if (!empty($resultats)) {
171
	    $chaine_id_projet = '';
171
	    $chaine_id_projet = '';
172
	    foreach ($resultats as $projet) {
172
	    foreach ($resultats as $projet) {
173
	    	$chaine_id_projet .= $projet['id'].',';
173
	    	$chaine_id_projet .= $projet['id'].',';
174
	    }
174
	    }
175
	    $chaine_id_projet = substr($chaine_id_projet, 0, -1);
175
	    $chaine_id_projet = substr($chaine_id_projet, 0, -1);
176
		$where_recherche = ' where p_id in ('.$chaine_id_projet.')';
176
		$where_recherche = ' where p_id in ('.$chaine_id_projet.')';
177
 
177
 
178
		$valeur_projet_recherche = $_GET['projet_recherche'];
178
		$valeur_projet_recherche = $_GET['projet_recherche'];
179
    }
179
    }
180
} else {
180
} else {
181
	$where_recherche = '';
181
	$where_recherche = '';
182
	$valeur_projet_recherche = '';
182
	$valeur_projet_recherche = '';
183
}
183
}
184
$select = '';
184
$select = '';
185
$from_recherche = '';
185
$from_recherche = '';
186
if (isset($_GET[PROJET_VARIABLE_THEME])) {
186
if (isset($_GET[PROJET_VARIABLE_THEME])) {
187
	$from_recherche = ' left join projet_avoir_theme on pat_id_projet=p_id left join projet_theme on pat_id_theme=pt_id_theme';
187
	$from_recherche = ' left join projet_avoir_theme on pat_id_projet=p_id left join projet_theme on pat_id_theme=pt_id_theme';
188
	$where_recherche = ' where pat_id_theme='.$this->_db->escapeSimple($_GET[PROJET_VARIABLE_THEME]);
188
	$where_recherche = ' where pat_id_theme='.$this->_db->escapeSimple($_GET[PROJET_VARIABLE_THEME]);
189
	$theme_selectionne = $_GET[PROJET_VARIABLE_THEME];
189
	$theme_selectionne = $_GET[PROJET_VARIABLE_THEME];
190
} else {
190
} else {
191
	$theme_selectionne = 0;
191
	$theme_selectionne = 0;
192
}
192
}
193
 
193
 
194
if ($this->_auth->getAuth()) {
194
if ($this->_auth->getAuth()) {
195
	/** on recherche egalement le statut si l utilisateur est loggue */
195
	/** on recherche egalement le statut si l utilisateur est loggue */
196
	// On recherche les projets auquels l utilisateur participe
196
	// On recherche les projets auquels l utilisateur participe
197
	include_once PROJET_CHEMIN_CLASSES.'participe.class.php';
197
	include_once PROJET_CHEMIN_CLASSES.'participe.class.php';
198
	$participant = new participe ($this->_db);
198
	$participant = new participe ($this->_db);
199
	$tableau_projet = $participant->getInformationsUtilisateurs($this->_auth->getAuthData(PROJET_CHAMPS_ID));
199
	$tableau_projet = $participant->getInformationsUtilisateurs($this->_auth->getAuthData(PROJET_CHAMPS_ID));
200
	$chaine_id_projet = '';
200
	$chaine_id_projet = '';
201
	if (count ($tableau_projet) == 0) {
201
	if (count ($tableau_projet) == 0) {
202
		return '<p class="information">Vous n\'&ecirc;tes inscrit &agrave; aucun projet</p>';
202
		return '<p class="information">Vous n\'&ecirc;tes inscrit &agrave; aucun projet</p>';
203
	}
203
	}
204
	foreach ($tableau_projet as $projet) {
204
	foreach ($tableau_projet as $projet) {
205
		$chaine_id_projet .= $projet[3].',';
205
		$chaine_id_projet .= $projet[3].',';
206
	}
206
	}
207
	$chaine_id_projet = substr($chaine_id_projet, 0, -1);
207
	$chaine_id_projet = substr($chaine_id_projet, 0, -1);
208
	$where_recherche .= ' where p_id in ('.$chaine_id_projet.')';
208
	$where_recherche .= ' where p_id in ('.$chaine_id_projet.')';
209
 
209
 
210
	$from_recherche .= ' left join projet_statut_utilisateurs on psu_id_projet=p_id and psu_id_utilisateur='.$this->_db->escapeSimple($this->_auth->getAuthData(PROJET_CHAMPS_ID)).
210
	$from_recherche .= ' left join projet_statut_utilisateurs on psu_id_projet=p_id and psu_id_utilisateur='.$this->_db->escapeSimple($this->_auth->getAuthData(PROJET_CHAMPS_ID)).
211
						' left join projet_statut on psu_id_statut=ps_id_statut';
211
						' left join projet_statut on psu_id_statut=ps_id_statut';
212
	$select = 'psu_id_statut, ps_statut_nom,';
212
	$select = 'psu_id_statut, ps_statut_nom,';
213
}
213
}
214
$requete = 'select '.$select.'p_id, p_titre, p_resume, pl_id_liste, plle_id_liste, p_avoir_document, ps_nombre_inscrit, ps_pourcent,'.
214
$requete = 'select '.$select.'p_id, p_titre, p_resume, pl_id_liste, plle_id_liste, p_avoir_document, ps_nombre_inscrit, ps_pourcent,'.
215
	' p_wikini, ps_doc_derniere_semaine, p_avoir_document, ps_nombre_inscrit_derniere_semaine, '.
215
	' p_wikini, ps_doc_derniere_semaine, p_avoir_document, ps_nombre_inscrit_derniere_semaine, '.
216
	'  ps_nombre_membre_yahoo, ps_msg_derniere_semaine, ps_modifwiki_derniere_semaine, p_en_dormance from'.
216
	'  ps_nombre_membre_yahoo, ps_msg_derniere_semaine, ps_modifwiki_derniere_semaine, p_en_dormance from'.
217
	' projet left join projet_lien_liste on p_id=pl_id_projet'.
217
	' projet left join projet_lien_liste on p_id=pl_id_projet'.
218
	' left join projet_lien_liste_externe on p_id=plle_id_projet'.
218
	' left join projet_lien_liste_externe on p_id=plle_id_projet'.
219
	' left join projet_statistiques on p_id=ps_ce_projet and ps_dernier=1'.
219
	' left join projet_statistiques on p_id=ps_ce_projet and ps_dernier=1'.
220
	$from_recherche.
220
	$from_recherche.
221
	$where_recherche.
221
	$where_recherche.
222
	' group by p_id order by '.$tri.' '.$ordre_tri ;
222
	' group by p_id order by '.$tri.' '.$ordre_tri ;
223
 
223
 
224
if ($ordre_tri == '') {
224
if ($ordre_tri == '') {
225
	$ordre_tri = 'desc';
225
	$ordre_tri = 'desc';
226
}
226
}
227
 
227
 
228
$resultat = $this->_db->query($requete) ;
228
$resultat = $this->_db->query($requete) ;
229
if (DB::isError($resultat)) {
229
if (DB::isError($resultat)) {
230
	return ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ;
230
	return ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ;
231
}
231
}
232
 
232
 
233
$nombre_resultat = $resultat->numRows();
233
$nombre_resultat = $resultat->numRows();
234
 
234
 
235
/* Si  l utilisateur est loggue, on recherche son statut par rapport aux projets */
235
/* Si  l utilisateur est loggue, on recherche son statut par rapport aux projets */
236
if ($this->_auth->getAuth()) {
236
if ($this->_auth->getAuth()) {
237
	$requete_statut = 'select psu_id_projet, psu_id_statut, ps_statut_nom from projet_statut_utilisateurs, projet_statut'.
237
	$requete_statut = 'select psu_id_projet, psu_id_statut, ps_statut_nom from projet_statut_utilisateurs, projet_statut'.
238
		' where ps_id_statut=psu_id_statut and psu_id_utilisateur='.$this->_db->escapeSimple($this->_auth->getAuthData(PROJET_CHAMPS_ID));
238
		' where ps_id_statut=psu_id_statut and psu_id_utilisateur='.$this->_db->escapeSimple($this->_auth->getAuthData(PROJET_CHAMPS_ID));
239
	$resultat_statut = $GLOBALS['projet_db']->query($requete_statut);
239
	$resultat_statut = $GLOBALS['projet_db']->query($requete_statut);
240
	while ($ligne_statut = $resultat_statut->fetchRow(DB_FETCHMODE_OBJECT)) {
240
	while ($ligne_statut = $resultat_statut->fetchRow(DB_FETCHMODE_OBJECT)) {
241
		$tableau_statut[$ligne_statut->psu_id_projet]['id_statut'] = $ligne_statut->psu_id_statut;
241
		$tableau_statut[$ligne_statut->psu_id_projet]['id_statut'] = $ligne_statut->psu_id_statut;
242
		$tableau_statut[$ligne_statut->psu_id_projet]['nom_statut'] = $ligne_statut->ps_statut_nom;
242
		$tableau_statut[$ligne_statut->psu_id_projet]['nom_statut'] = $ligne_statut->ps_statut_nom;
243
	}
243
	}
244
}
244
}
245
 
245
 
246
include_once PROJET_CHEMIN_BIBLIOTHEQUE_API.'pear/Pager/Pager.php';
246
include_once PROJET_CHEMIN_BIBLIOTHEQUE_API.'pear/Pager/Pager.php';
247
 
247
 
248
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT)) {
248
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT)) {
249
	// Si le projet est en dormance, on ne l affiche pas dans le mode normal
249
	// Si le projet est en dormance, on ne l affiche pas dans le mode normal
250
	// Sauf si le theme choisit est "en dormance"
250
	// Sauf si le theme choisit est "en dormance"
251
	if ($_SESSION['_PROJET_']['projet_affichage'] != 'expert' && $ligne->p_en_dormance == 1  && $theme_selectionne != 9) {
251
	if ($_SESSION['_PROJET_']['projet_affichage'] != 'expert' && $ligne->p_en_dormance == 1  && $theme_selectionne != 9) {
252
 
252
 
253
	} else {
253
	} else {
254
		$donnees[] = $ligne;
254
		$donnees[] = $ligne;
255
	}
255
	}
256
 
256
 
257
}
257
}
258
 
258
 
259
if ($_SESSION['_PROJET_']['projet_affichage'] == 'expert') {
259
if ($_SESSION['_PROJET_']['projet_affichage'] == 'expert') {
260
	$perpage = $nombre_resultat;
260
	$perpage = $nombre_resultat;
261
} else {
261
} else {
262
	$perpage = 20;
262
	$perpage = 20;
263
}
263
}
264
// Parametre du pager
264
// Parametre du pager
265
$params = array (
265
$params = array (
266
	'mode' => 'Sliding',
266
	'mode' => 'Sliding',
267
	'perPage' => $perpage,
267
	'perPage' => $perpage,
268
	'delta' => '5',
268
	'delta' => '5',
269
	'linkClass' => 'num_page',
269
	'linkClass' => 'num_page',
270
	'curPageLinkClassName' => 'page_courante',
270
	'curPageLinkClassName' => 'page_courante',
271
	'spacesBeforeSeparator' => 0,
271
	'spacesBeforeSeparator' => 0,
272
	'spacesAfterSeparator' => 0,
272
	'spacesAfterSeparator' => 0,
273
	'separator' => '',
273
	'separator' => '',
274
	'prevImg' => '&lt;&lt; Page pr&eacute;c&eacute;dente',
274
	'prevImg' => '&lt;&lt; Page pr&eacute;c&eacute;dente',
275
	'nextImg' => 'Page suivante &gt;&gt;',
275
	'nextImg' => 'Page suivante &gt;&gt;',
276
	'extraVars' => array ('projet_recherche' => $_SESSION['_PROJET_']['motif_recherche'],
276
	'extraVars' => array ('projet_recherche' => $_SESSION['_PROJET_']['motif_recherche'],
277
		PROJET_VARIABLE_MODE_AFFICHAGE => $_SESSION['_PROJET_']['projet_affichage']),
277
		PROJET_VARIABLE_MODE_AFFICHAGE => $_SESSION['_PROJET_']['projet_affichage']),
278
	'itemData' => $donnees
278
	'itemData' => $donnees
279
	);
279
	);
280
$pager = & Pager::factory($params);
280
$pager = & Pager::factory($params);
281
$links = $pager->getLinks();
281
$links = $pager->getLinks();
282
$data  = $pager->getPageData();
282
$data  = $pager->getPageData();
283
$nombre_projets = $pager->numItems();
283
$nombre_projets = $pager->numItems();
284
$range = $pager->getOffsetByPageId();
284
$range = $pager->getOffsetByPageId();
285
 
285
 
286
// On inclue un fichier local
286
// On inclue un fichier local
287
if (file_exists(PROJET_CHEMIN_APPLI.'langues/pro_langues_fr.local.inc.php'))
287
if (file_exists(PROJET_CHEMIN_APPLI.'langues/pro_langues_fr.local.inc.php'))
288
	include_once PROJET_CHEMIN_APPLI.'langues/pro_langues_fr.local.inc.php' ;
288
	include_once PROJET_CHEMIN_APPLI.'langues/pro_langues_fr.local.inc.php' ;
289
// On verifie si l'utilisateur participe a des projets
289
// On verifie si l'utilisateur participe a des projets
290
 
290
 
291
$projetNonParticipantListe = & $projetListe ;
291
$projetNonParticipantListe = & $projetListe ;
292
 
292
 
293
 
293
 
294
$liste_projet = array() ;
294
$liste_projet = array() ;
295
// La liste
295
// La liste
296
 
296
 
297
 
297
 
298
$tableau_donnees = array();
298
$tableau_donnees = array();
299
foreach ($data as $ligne) {
299
foreach ($data as $ligne) {
300
	$this->_url->addQueryString(PROJET_VARIABLE_ID_PROJET, $ligne->p_id) ;
300
	$this->_url->addQueryString(PROJET_VARIABLE_ID_PROJET, $ligne->p_id) ;
301
 
301
 
302
	$tableau_donnees[$ligne->p_id]['lien'] = $this->_url->getURL();
302
	$tableau_donnees[$ligne->p_id]['lien'] = $this->_url->getURL();
303
	$tableau_donnees[$ligne->p_id]['titre'] = $ligne->p_titre;
303
	$tableau_donnees[$ligne->p_id]['titre'] = $ligne->p_titre;
304
 
304
 
305
	$tableau_donnees[$ligne->p_id]['nombre_participants'] = $ligne->ps_nombre_inscrit;
305
	$tableau_donnees[$ligne->p_id]['nombre_participants'] = $ligne->ps_nombre_inscrit;
306
 
306
 
307
	$tableau_donnees[$ligne->p_id]['resume'] = $ligne->p_resume;
307
	$tableau_donnees[$ligne->p_id]['resume'] = $ligne->p_resume;
308
	if ($_SESSION['_PROJET_']['projet_affichage'] == 'simple') {
308
	if ($_SESSION['_PROJET_']['projet_affichage'] == 'simple') {
309
		if ($ligne->ps_pourcent < 33) {
309
		if ($ligne->ps_pourcent < 33) {
310
			$tableau_donnees[$ligne->p_id]['activite'] = 'Peu actif';
310
			$tableau_donnees[$ligne->p_id]['activite'] = 'Peu actif';
311
			$tableau_donnees[$ligne->p_id]['classe_projet_activite'] = 'projet_activite_faible';
311
			$tableau_donnees[$ligne->p_id]['classe_projet_activite'] = 'projet_activite_faible';
312
		} else if ($ligne->ps_pourcent < 66) {
312
		} else if ($ligne->ps_pourcent < 66) {
313
			$tableau_donnees[$ligne->p_id]['activite'] = 'Assez actif';
313
			$tableau_donnees[$ligne->p_id]['activite'] = 'Assez actif';
314
			$tableau_donnees[$ligne->p_id]['classe_projet_activite'] = 'projet_activite_moyenne';
314
			$tableau_donnees[$ligne->p_id]['classe_projet_activite'] = 'projet_activite_moyenne';
315
		} else if ($ligne->ps_pourcent <= 100) {
315
		} else if ($ligne->ps_pourcent <= 100) {
316
			$tableau_donnees[$ligne->p_id]['activite'] = 'Tr&egrave;s actif';
316
			$tableau_donnees[$ligne->p_id]['activite'] = 'Tr&egrave;s actif';
317
			$tableau_donnees[$ligne->p_id]['classe_projet_activite'] = 'projet_activite_elevee';
317
			$tableau_donnees[$ligne->p_id]['classe_projet_activite'] = 'projet_activite_elevee';
318
		}
318
		}
319
	} else {
319
	} else {
320
		$tableau_donnees[$ligne->p_id]['activite'] = $ligne->ps_pourcent.'%';
320
		$tableau_donnees[$ligne->p_id]['activite'] = $ligne->ps_pourcent.'%';
321
	}
321
	}
322
	$res .= $ligne->p_resume ;
322
	$res .= $ligne->p_resume ;
323
	$this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_ACTION_S_INSCRIRE);
323
	$this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_ACTION_S_INSCRIRE);
324
	$res .= '(<a href="'.$this->_url->getURL().'">Rejoindre ce projet</a>)'."\n";
324
	$res .= '(<a href="'.$this->_url->getURL().'">Rejoindre ce projet</a>)'."\n";
325
 
325
 
326
	// Recherche du forum
326
	// Recherche du forum
327
	if ($ligne->pl_id_liste != null && $ligne->plle_id_liste == null) {
327
	if ($ligne->pl_id_liste != null && $ligne->plle_id_liste == null) {
328
		$this->_url->addQueryString('act', PROJET_ACTION_VOIR_FORUM);
328
		$this->_url->addQueryString('act', PROJET_ACTION_VOIR_FORUM);
329
 
329
 
330
		$forum = '<a href="'.$this->_url->getURL().'"><img src="sites/commun/generique/images/favicones/tela_botanica.png" alt="Tela Botanica" /></a>'."\n";
330
		$forum = '<a href="'.$this->_url->getURL().'"><img src="http://resources.tela-botanica.org/tb/img/16x16/favicon.png" alt="Tela Botanica" /></a>'."\n";
331
		$res .= $forum;
331
		$res .= $forum;
332
 
332
 
333
	} else {
333
	} else {
334
 
334
 
335
		include_once PROJET_CHEMIN_CLASSES.'liste_externe.class.php' ;
335
		include_once PROJET_CHEMIN_CLASSES.'liste_externe.class.php' ;
336
		$listes_ext = new liste_externe ($this->_db) ;
336
		$listes_ext = new liste_externe ($this->_db) ;
337
		if ($ligne->plle_id_liste != null) {
337
		if ($ligne->plle_id_liste != null) {
338
			$info_liste = $listes_ext->getInfoListe($ligne->plle_id_liste) ;
338
			$info_liste = $listes_ext->getInfoListe($ligne->plle_id_liste) ;
339
 
339
 
340
			$forum = '<a href="'.$info_liste->AGO_A_URLGRP.
340
			$forum = '<a href="'.$info_liste->AGO_A_URLGRP.
341
					'"><img src="sites/commun/generique/images/icones/yahoo.png" alt="Yahoo"/></a>';
341
					'"><img src="sites/commun/generique/images/icones/yahoo.png" alt="Yahoo"/></a>';
342
			$tableau_donnees[$ligne->p_id]['nombre_participants'] = $ligne->ps_nombre_membre_yahoo;
342
			$tableau_donnees[$ligne->p_id]['nombre_participants'] = $ligne->ps_nombre_membre_yahoo;
343
		} else {
343
		} else {
344
			$forum = '-';
344
			$forum = '-';
345
		}
345
		}
346
	}
346
	}
347
	if ($ligne->ps_msg_derniere_semaine != 0) {
347
	if ($ligne->ps_msg_derniere_semaine != 0) {
348
		$tableau_donnees[$ligne->p_id]['nombre_message'] = $ligne->ps_msg_derniere_semaine;
348
		$tableau_donnees[$ligne->p_id]['nombre_message'] = $ligne->ps_msg_derniere_semaine;
349
	} else {
349
	} else {
350
		$tableau_donnees[$ligne->p_id]['nombre_message'] = 0;
350
		$tableau_donnees[$ligne->p_id]['nombre_message'] = 0;
351
	}
351
	}
352
	$tableau_donnees[$ligne->p_id]['forum'] = $forum;
352
	$tableau_donnees[$ligne->p_id]['forum'] = $forum;
353
	if ($ligne->p_wikini) {
353
	if ($ligne->p_wikini) {
354
		$this->_url->addQueryString ('act',PROJET_ACTION_VOIR_WIKINI);
354
		$this->_url->addQueryString ('act',PROJET_ACTION_VOIR_WIKINI);
355
		$link=$this->_url->getURL();
355
		$link=$this->_url->getURL();
356
		$wiki_res = '<a href="'.$link.'">voir</a>' ;
356
		$wiki_res = '<a href="'.$link.'">voir</a>' ;
357
		if ($ligne->ps_modifwiki_derniere_semaine != 0) {
357
		if ($ligne->ps_modifwiki_derniere_semaine != 0) {
358
			$wiki_res .= ' <span title="Nouvelles contributions cette semaine"> ( +'.$ligne->ps_modifwiki_derniere_semaine.' )</span>';
358
			$wiki_res .= ' <span title="Nouvelles contributions cette semaine"> ( +'.$ligne->ps_modifwiki_derniere_semaine.' )</span>';
359
		}
359
		}
360
		$this->_url->removeQueryString ('act');
360
		$this->_url->removeQueryString ('act');
361
	} else {
361
	} else {
362
		$wiki_res = '-' ;
362
		$wiki_res = '-' ;
363
	}
363
	}
364
	$tableau_donnees[$ligne->p_id]['wikini'] = $wiki_res;
364
	$tableau_donnees[$ligne->p_id]['wikini'] = $wiki_res;
365
	$titre = '<a href="'.$this->_url->getURL().'">'.$ligne->p_titre.'</a>';
365
	$titre = '<a href="'.$this->_url->getURL().'">'.$ligne->p_titre.'</a>';
366
 
366
 
367
	if ($ligne->p_avoir_document != 0) {
367
	if ($ligne->p_avoir_document != 0) {
368
		$this->_url->addQueryString('act', PROJET_ACTION_VOIR_DOCUMENT) ;
368
		$this->_url->addQueryString('act', PROJET_ACTION_VOIR_DOCUMENT) ;
369
		$document = '<a href="'.$this->_url->getURL().'">voir</a>' ;
369
		$document = '<a href="'.$this->_url->getURL().'">voir</a>' ;
370
		if ($ligne->ps_doc_derniere_semaine != 0) {
370
		if ($ligne->ps_doc_derniere_semaine != 0) {
371
			$document .= ' <span title="Nouveaux documents cette semaine">( + '.$ligne->ps_doc_derniere_semaine.')</span>';
371
			$document .= ' <span title="Nouveaux documents cette semaine">( + '.$ligne->ps_doc_derniere_semaine.')</span>';
372
		}
372
		}
373
	} else {
373
	} else {
374
		$document = '-' ;
374
		$document = '-' ;
375
	}
375
	}
376
	$tableau_donnees[$ligne->p_id]['document'] = $document;
376
	$tableau_donnees[$ligne->p_id]['document'] = $document;
377
 
377
 
378
	if ($ligne->p_wikini) {
378
	if ($ligne->p_wikini) {
379
		$this->_url->addQueryString ('act',PROJET_ACTION_VOIR_WIKINI);
379
		$this->_url->addQueryString ('act',PROJET_ACTION_VOIR_WIKINI);
380
		$link=$this->_url->getURL();
380
		$link=$this->_url->getURL();
381
		$this->_url->addQueryString('wiki', 'DerniersChangementsRSS/xml');
381
		$this->_url->addQueryString('wiki', 'DerniersChangementsRSS/xml');
382
		$wiki_rss = '<a href="'.$this->_url->getURL().'"><img src="sites/commun/generique/images/rss.gif" alt="rss"/></a>' ;
382
		$wiki_rss = '<a href="'.$this->_url->getURL().'"><img src="sites/commun/generique/images/rss.gif" alt="rss"/></a>' ;
383
		$this->_url->removeQueryString ('act');
383
		$this->_url->removeQueryString ('act');
384
		$this->_url->removeQueryString ('wiki');
384
		$this->_url->removeQueryString ('wiki');
385
	} else {
385
	} else {
386
		$wiki_rss = '-' ;
386
		$wiki_rss = '-' ;
387
	}
387
	}
388
	$tableau_donnees[$ligne->p_id]['wikini_rss'] = $wiki_rss;
388
	$tableau_donnees[$ligne->p_id]['wikini_rss'] = $wiki_rss;
389
 
389
 
390
	$this->_url->addQueryString ('act', PROJET_ACTION_VOIR_PARTICIPANT);
390
	$this->_url->addQueryString ('act', PROJET_ACTION_VOIR_PARTICIPANT);
391
	$participant = '<a href="'.$this->_url->getURL().'">voir</a>' ;
391
	$participant = '<a href="'.$this->_url->getURL().'">voir</a>' ;
392
	$tableau_donnees[$ligne->p_id]['lien_participants'] = $this->_url->getURL();
392
	$tableau_donnees[$ligne->p_id]['lien_participants'] = $this->_url->getURL();
393
	if ($ligne->ps_nombre_inscrit_derniere_semaine != 0) {
393
	if ($ligne->ps_nombre_inscrit_derniere_semaine != 0) {
394
		$tableau_donnees[$ligne->p_id]['ps_nombre_inscrit_derniere_semaine'] = '<span title="Nouveaux inscrits cette semaine">( + '.$ligne->ps_nombre_inscrit_derniere_semaine.' )</span>';
394
		$tableau_donnees[$ligne->p_id]['ps_nombre_inscrit_derniere_semaine'] = '<span title="Nouveaux inscrits cette semaine">( + '.$ligne->ps_nombre_inscrit_derniere_semaine.' )</span>';
395
	} else {
395
	} else {
396
		$tableau_donnees[$ligne->p_id]['ps_nombre_inscrit_derniere_semaine'] = '';
396
		$tableau_donnees[$ligne->p_id]['ps_nombre_inscrit_derniere_semaine'] = '';
397
	}
397
	}
398
 
398
 
399
	$ligne_projet = array ( '', $titre, $forum,  // le nom du projet
399
	$ligne_projet = array ( '', $titre, $forum,  // le nom du projet
400
		$wiki_res, $wiki_rss,$document, $participant);
400
		$wiki_res, $wiki_rss,$document, $participant);
401
 
401
 
402
	$this->_url->removeQueryString(PROJET_VARIABLE_ACTION);
402
	$this->_url->removeQueryString(PROJET_VARIABLE_ACTION);
403
	array_push ($liste_projet, $ligne_projet) ;
403
	array_push ($liste_projet, $ligne_projet) ;
404
 
404
 
405
	if ($loggue) {
405
	if ($loggue) {
406
		switch ($ligne->psu_id_statut) {
406
		switch ($ligne->psu_id_statut) {
407
			case 1 : $icone_statut = 'etoile_rouge';
407
			case 1 : $icone_statut = 'etoile_rouge';
408
				$tableau_donnees[$ligne->p_id]['id_statut'] = 3;
408
				$tableau_donnees[$ligne->p_id]['id_statut'] = 3;
409
				break;
409
				break;
410
			case 2 : $icone_statut = 'etoile_verte';
410
			case 2 : $icone_statut = 'etoile_verte';
411
				$tableau_donnees[$ligne->p_id]['id_statut'] = 2;
411
				$tableau_donnees[$ligne->p_id]['id_statut'] = 2;
412
				break;
412
				break;
413
			case 3 : $icone_statut = 'etoile_grise';
413
			case 3 : $icone_statut = 'etoile_grise';
414
				$tableau_donnees[$ligne->p_id]['id_statut'] = 1;
414
				$tableau_donnees[$ligne->p_id]['id_statut'] = 1;
415
				break;
415
				break;
416
			default :
416
			default :
417
				$tableau_donnees[$ligne->p_id]['statut_icone'] = '';
417
				$tableau_donnees[$ligne->p_id]['statut_icone'] = '';
418
				$tableau_donnees[$ligne->p_id]['id_statut'] = 0;
418
				$tableau_donnees[$ligne->p_id]['id_statut'] = 0;
419
				$icone_statut = false;
419
				$icone_statut = false;
420
		}
420
		}
421
		if ($icone_statut) {
421
		if ($icone_statut) {
422
			$tableau_donnees[$ligne->p_id]['statut_icone'] = '<img src="'.PROJET_CHEMIN_ICONES.$icone_statut.'.png" alt="'.$ligne->ps_statut_nom.'" title="'.$ligne->ps_statut_nom.'" />';
422
			$tableau_donnees[$ligne->p_id]['statut_icone'] = '<img src="'.PROJET_CHEMIN_ICONES.$icone_statut.'.png" alt="'.$ligne->ps_statut_nom.'" title="'.$ligne->ps_statut_nom.'" />';
423
		}
423
		}
424
 
424
 
425
	}
425
	}
426
	$res .= '</li>'."\n";
426
	$res .= '</li>'."\n";
427
}
427
}
428
$res .= '</ul>'."\n";
428
$res .= '</ul>'."\n";
429
$this->_url->removeQueryString(PROJET_VARIABLE_ACTION);
429
$this->_url->removeQueryString(PROJET_VARIABLE_ACTION);
430
$this->_url->removeQueryString (PROJET_VARIABLE_ID_PROJET);
430
$this->_url->removeQueryString (PROJET_VARIABLE_ID_PROJET);
431
 
431
 
432
// Correction bug tri par participant
432
// Correction bug tri par participant
433
if ($_GET[PROJET_VARIABLE_TRI] == 'ps_nombre_inscrit') {
433
if ($_GET[PROJET_VARIABLE_TRI] == 'ps_nombre_inscrit') {
434
	foreach ($tableau_donnees as $key => $row) {
434
	foreach ($tableau_donnees as $key => $row) {
435
		$nombre_inscrit[$key]  = $row['nombre_participants'];
435
		$nombre_inscrit[$key]  = $row['nombre_participants'];
436
	}
436
	}
437
	if ($_GET[PROJET_VARIABLE_ORDRE_TRI] == 'asc') {
437
	if ($_GET[PROJET_VARIABLE_ORDRE_TRI] == 'asc') {
438
		$flag = SORT_ASC ;
438
		$flag = SORT_ASC ;
439
	} else {
439
	} else {
440
		$flag = SORT_DESC ;
440
		$flag = SORT_DESC ;
441
	}
441
	}
442
	array_multisort($nombre_inscrit, $flag, $tableau_donnees);
442
	array_multisort($nombre_inscrit, $flag, $tableau_donnees);
443
}
443
}
444
 
444
 
445
// Correction bug tri sur les statuts
445
// Correction bug tri sur les statuts
446
if ($_GET[PROJET_VARIABLE_TRI] == 'psu_id_statut') {
446
if ($_GET[PROJET_VARIABLE_TRI] == 'psu_id_statut') {
447
	foreach ($tableau_donnees as $key => $row) {
447
	foreach ($tableau_donnees as $key => $row) {
448
		$id_statut[$key]  = $row['id_statut'];
448
		$id_statut[$key]  = $row['id_statut'];
449
	}
449
	}
450
	if ($_GET[PROJET_VARIABLE_ORDRE_TRI] == 'asc') {
450
	if ($_GET[PROJET_VARIABLE_ORDRE_TRI] == 'asc') {
451
		$flag = SORT_ASC ;
451
		$flag = SORT_ASC ;
452
	} else {
452
	} else {
453
		$flag = SORT_DESC ;
453
		$flag = SORT_DESC ;
454
	}
454
	}
455
	array_multisort($id_statut, $flag, $tableau_donnees);
455
	array_multisort($id_statut, $flag, $tableau_donnees);
456
}
456
}
457
 
457
 
458
$pair = true;
458
$pair = true;
459
 
459
 
460
ob_start();
460
ob_start();
461
if ($_SESSION['_PROJET_']['projet_affichage'] == 'expert') {
461
if ($_SESSION['_PROJET_']['projet_affichage'] == 'expert') {
462
	GEN_stockerFichierScript('jquery', 'api/js/jquery/jquery.js');
462
	GEN_stockerFichierScript('jquery', 'api/js/jquery/jquery.js');
463
	GEN_stockerFichierScript('animatedcollapse', 'api/js/jquery/animatedcollapse.js');
463
	GEN_stockerFichierScript('animatedcollapse', 'api/js/jquery/animatedcollapse.js');
464
	GEN_stockerCodeScript('animatedcollapse.addDiv(\'legende\', \'fade=1, height="100px"\');' ."\n".
464
	GEN_stockerCodeScript('animatedcollapse.addDiv(\'legende\', \'fade=1, height="100px"\');' ."\n".
465
		'animatedcollapse.init();' ."\n");
465
		'animatedcollapse.init();' ."\n");
466
	include_once PROJET_CHEMIN_CLASSES.'enteteColonneTriable.class.php';
466
	include_once PROJET_CHEMIN_CLASSES.'enteteColonneTriable.class.php';
467
	foreach ($valeur_acceptable_tri as $var_tri) {
467
	foreach ($valeur_acceptable_tri as $var_tri) {
468
		$enteteTri[$var_tri] = new enteteColonneTriable($var_tri);
468
		$enteteTri[$var_tri] = new enteteColonneTriable($var_tri);
469
		$enteteTri[$var_tri]->setColonneCliquee($tri, PROJET_VARIABLE_TRI);
469
		$enteteTri[$var_tri]->setColonneCliquee($tri, PROJET_VARIABLE_TRI);
470
		$enteteTri[$var_tri]->setOrdre($ordre_tri, PROJET_VARIABLE_ORDRE_TRI);
470
		$enteteTri[$var_tri]->setOrdre($ordre_tri, PROJET_VARIABLE_ORDRE_TRI);
471
	}
471
	}
472
 
472
 
473
	$lien_tri_titre = $enteteTri['p_titre']->getLien($this->_url);
473
	$lien_tri_titre = $enteteTri['p_titre']->getLien($this->_url);
474
	$lien_tri_activite = $enteteTri['ps_pourcent']->getLien($this->_url);
474
	$lien_tri_activite = $enteteTri['ps_pourcent']->getLien($this->_url);
475
	$lien_tri_participants = $enteteTri['ps_nombre_inscrit']->getLien($this->_url);
475
	$lien_tri_participants = $enteteTri['ps_nombre_inscrit']->getLien($this->_url);
476
	$lien_tri_doc = $enteteTri['ps_doc_derniere_semaine']->getLien($this->_url);
476
	$lien_tri_doc = $enteteTri['ps_doc_derniere_semaine']->getLien($this->_url);
477
	$lien_tri_statut = $enteteTri['psu_id_statut']->getLien($this->_url);
477
	$lien_tri_statut = $enteteTri['psu_id_statut']->getLien($this->_url);
478
	include_once PROJET_CHEMIN_APPLI.'/squelettes/liste_projet_expert.tpl.html';
478
	include_once PROJET_CHEMIN_APPLI.'/squelettes/liste_projet_expert.tpl.html';
479
} else {
479
} else {
480
	include_once PROJET_CHEMIN_APPLI.'/squelettes/mes_projets.tpl.html';
480
	include_once PROJET_CHEMIN_APPLI.'/squelettes/mes_projets.tpl.html';
481
}
481
}
482
$res = ob_get_contents();
482
$res = ob_get_contents();
483
ob_end_clean();
483
ob_end_clean();
484
 
484
 
485
 
485
 
486
// Nettoyage de l'url
486
// Nettoyage de l'url
487
$this->_url->removeQueryString(PROJET_VARIABLE_ID_PROJET);
487
$this->_url->removeQueryString(PROJET_VARIABLE_ID_PROJET);
488
$this->_url->removeQueryString(PROJET_VARIABLE_MODE_AFFICHAGE);
488
$this->_url->removeQueryString(PROJET_VARIABLE_MODE_AFFICHAGE);
489
$this->_url->removeQueryString(PROJET_VARIABLE_ORDRE_TRI);
489
$this->_url->removeQueryString(PROJET_VARIABLE_ORDRE_TRI);
490
$this->_url->removeQueryString(PROJET_VARIABLE_TRI);
490
$this->_url->removeQueryString(PROJET_VARIABLE_TRI);
491
return $res;
491
return $res;
492
 
492
 
493
/* +--Fin du code ----------------------------------------------------------------------------------------+
493
/* +--Fin du code ----------------------------------------------------------------------------------------+
494
*
494
*
495
* $Log: mes_projets.php,v $
495
* $Log: mes_projets.php,v $
496
* Revision 1.1  2008-09-01 14:36:48  alexandre_tb
496
* Revision 1.1  2008-09-01 14:36:48  alexandre_tb
497
* version intiale
497
* version intiale
498
* sert a afficher les projets auquels on est inscrit
498
* sert a afficher les projets auquels on est inscrit
499
*
499
*
500
* Revision 1.1  2008-08-25 15:00:28  alexandre_tb
500
* Revision 1.1  2008-08-25 15:00:28  alexandre_tb
501
* version initiale
501
* version initiale
502
*
502
*
503
* +-- Fin du code ----------------------------------------------------------------------------------------+
503
* +-- Fin du code ----------------------------------------------------------------------------------------+
504
*/
504
*/
505
?>
505
?>