Subversion Repositories Applications.projet

Rev

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

Rev 334 Rev 339
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: tela_ergo.php,v 1.2 2008-09-01 14:37:15 alexandre_tb Exp $
22
// CVS : $Id: tela_ergo.php,v 1.3 2008-09-16 14:07:40 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.2 $
34
*@version       $Revision: 1.3 $
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
	if (!isset($GLOBALS['_MOTEUR_RECHERCHE_']['bd']['papyrus'])) $GLOBALS['_MOTEUR_RECHERCHE_']['bd']['papyrus'] = $this->_db;
-
 
162
	include_once 'papyrus/applettes/moteur_recherche/bibliotheque/more_recherche.class.php';
161
	include_once 'papyrus/applettes/moteur_recherche/bibliotheque/more_recherche.class.php';
163
	include_once 'papyrus/applettes/moteur_recherche/bibliotheque/more_recherche.class.php';
162
	include_once 'papyrus/applettes/moteur_recherche/bibliotheque/more_recherche_projet.class.php';
164
	include_once 'papyrus/applettes/moteur_recherche/bibliotheque/more_recherche_projet.class.php';
163
	
165
	
164
	$moteur = new More_Recherche($_SESSION['_PROJET_']['motif_recherche']);
166
	$moteur = new More_Recherche($_SESSION['_PROJET_']['motif_recherche']);
165
    $recherche_projet = new More_Recherche_Projet($_SESSION['_PROJET_']['motif_recherche']);
167
    $recherche_projet = new More_Recherche_Projet($_SESSION['_PROJET_']['motif_recherche']);
166
    $moteur->ajouterRecherche($recherche_projet);
168
    $moteur->ajouterRecherche($recherche_projet);
167
    $resultats = $moteur->rechercherMotif();
169
    $resultats = $moteur->rechercherMotif();
168
    
170
    
169
    // $chaine_id_projet contient une liste d identifiant separer par une virgule
171
    // $chaine_id_projet contient une liste d identifiant separer par une virgule
170
    if (!empty($resultats)) {
172
    if (!empty($resultats)) {
171
	    $chaine_id_projet = '';
173
	    $chaine_id_projet = '';
172
	    foreach ($resultats as $projet) {
174
	    foreach ($resultats as $projet) {
173
	    	$chaine_id_projet .= $projet['id'].',';
175
	    	$chaine_id_projet .= $projet['id'].',';
174
	    }
176
	    }
175
	    $chaine_id_projet = substr($chaine_id_projet, 0, -1);
177
	    $chaine_id_projet = substr($chaine_id_projet, 0, -1);
176
		$where_recherche = ' where p_id in ('.$chaine_id_projet.')';
178
		$where_recherche = ' where p_id in ('.$chaine_id_projet.')';
177
				
179
				
178
		$valeur_projet_recherche = $_GET['projet_recherche'];
180
		$valeur_projet_recherche = $_GET['projet_recherche'];
179
    }
181
    }
180
} else {
182
} else {
181
	$where_recherche = '';
183
	$where_recherche = '';
182
	$valeur_projet_recherche = '';
184
	$valeur_projet_recherche = '';
183
}
185
}
184
$select = '';
186
$select = '';
185
$from_recherche = '';
187
$from_recherche = '';
186
if (isset($_GET[PROJET_VARIABLE_THEME])) {
188
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';
189
	$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='.$_GET[PROJET_VARIABLE_THEME];
190
	$where_recherche = ' where pat_id_theme='.$_GET[PROJET_VARIABLE_THEME];
189
	$theme_selectionne = $_GET[PROJET_VARIABLE_THEME];
191
	$theme_selectionne = $_GET[PROJET_VARIABLE_THEME];
190
} else {
192
} else {
191
	$theme_selectionne = 0;
193
	$theme_selectionne = 0;
192
}
194
}
193
 
195
 
194
if ($this->_auth->getAuth()) {
196
if ($this->_auth->getAuth()) {
195
	/** on recherche egalement le statut si l utilisateur est loggue */
197
	/** on recherche egalement le statut si l utilisateur est loggue */
196
	
198
	
197
	$from_recherche .= ' left join projet_statut_utilisateurs on psu_id_projet=p_id and psu_id_utilisateur='.$this->_auth->getAuthData(PROJET_CHAMPS_ID).
199
	$from_recherche .= ' left join projet_statut_utilisateurs on psu_id_projet=p_id and psu_id_utilisateur='.$this->_auth->getAuthData(PROJET_CHAMPS_ID).
198
						' left join projet_statut on psu_id_statut=ps_id_statut';
200
						' left join projet_statut on psu_id_statut=ps_id_statut';
199
	$select = 'psu_id_statut, ps_statut_nom,';
201
	$select = 'psu_id_statut, ps_statut_nom,';
200
}
202
}
201
$requete = 'select '.$select.'p_id, p_titre, p_resume, pl_id_liste, plle_id_liste, p_avoir_document, ps_nombre_inscrit, ps_pourcent,'.
203
$requete = 'select '.$select.'p_id, p_titre, p_resume, pl_id_liste, plle_id_liste, p_avoir_document, ps_nombre_inscrit, ps_pourcent,'.
202
				' p_wikini, ps_doc_derniere_semaine, p_avoir_document, ps_nombre_inscrit_derniere_semaine, '.
204
				' p_wikini, ps_doc_derniere_semaine, p_avoir_document, ps_nombre_inscrit_derniere_semaine, '.
203
				'  ps_nombre_membre_yahoo, ps_msg_derniere_semaine, ps_modifwiki_derniere_semaine, p_en_dormance from'.
205
				'  ps_nombre_membre_yahoo, ps_msg_derniere_semaine, ps_modifwiki_derniere_semaine, p_en_dormance from'.
204
				' projet left join projet_lien_liste on p_id=pl_id_projet'.
206
				' projet left join projet_lien_liste on p_id=pl_id_projet'.
205
				' left join projet_lien_liste_externe on p_id=plle_id_projet'.
207
				' left join projet_lien_liste_externe on p_id=plle_id_projet'.
206
				' left join projet_statistiques on p_id=ps_ce_projet and ps_dernier=1'.
208
				' left join projet_statistiques on p_id=ps_ce_projet and ps_dernier=1'.
207
				$from_recherche.
209
				$from_recherche.
208
				$where_recherche.
210
				$where_recherche.
209
				' group by p_id order by '.$tri.' '.$ordre_tri ;
211
				' group by p_id order by '.$tri.' '.$ordre_tri ;
210
 
212
 
211
if ($ordre_tri == '') $ordre_tri = 'desc';
213
if ($ordre_tri == '') $ordre_tri = 'desc';
212
 
214
 
213
$resultat = $this->_db->query($requete) ;
215
$resultat = $this->_db->query($requete) ;
214
if (DB::isError($resultat)) {
216
if (DB::isError($resultat)) {
215
	return ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ;
217
	return ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ;
216
}
218
}
217
 
219
 
218
$nombre_resultat = $resultat->numRows();
220
$nombre_resultat = $resultat->numRows();
219
 
221
 
220
/* Si  l utilisateur est loggue, on recherche son statut par rapport aux projets */
222
/* Si  l utilisateur est loggue, on recherche son statut par rapport aux projets */
221
if ($this->_auth->getAuth()) {
223
if ($this->_auth->getAuth()) {
222
	$requete_statut = 'select psu_id_projet, psu_id_statut, ps_statut_nom from projet_statut_utilisateurs, projet_statut'.
224
	$requete_statut = 'select psu_id_projet, psu_id_statut, ps_statut_nom from projet_statut_utilisateurs, projet_statut'.
223
						' where ps_id_statut=psu_id_statut and psu_id_utilisateur='.$this->_auth->getAuthData(PROJET_CHAMPS_ID);
225
						' where ps_id_statut=psu_id_statut and psu_id_utilisateur='.$this->_auth->getAuthData(PROJET_CHAMPS_ID);
224
	$resultat_statut = $GLOBALS['projet_db']->query($requete_statut);
226
	$resultat_statut = $GLOBALS['projet_db']->query($requete_statut);
225
	while ($ligne_statut = $resultat_statut->fetchRow(DB_FETCHMODE_OBJECT)) {
227
	while ($ligne_statut = $resultat_statut->fetchRow(DB_FETCHMODE_OBJECT)) {
226
		$tableau_statut[$ligne_statut->psu_id_projet]['id_statut'] = $ligne_statut->psu_id_statut;
228
		$tableau_statut[$ligne_statut->psu_id_projet]['id_statut'] = $ligne_statut->psu_id_statut;
227
		$tableau_statut[$ligne_statut->psu_id_projet]['nom_statut'] = $ligne_statut->ps_statut_nom;
229
		$tableau_statut[$ligne_statut->psu_id_projet]['nom_statut'] = $ligne_statut->ps_statut_nom;
228
	}
230
	}
229
}
231
}
230
 
232
 
231
include_once PROJET_CHEMIN_BIBLIOTHEQUE_API.'pear/Pager/Pager.php';
233
include_once PROJET_CHEMIN_BIBLIOTHEQUE_API.'pear/Pager/Pager.php';
232
 
234
 
233
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT)) {
235
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT)) {
234
	
236
	
235
	// Si le projet est en dormance, on ne l affiche pas dans le mode normal
237
	// Si le projet est en dormance, on ne l affiche pas dans le mode normal
236
	// Sauf si le theme choisit est "en dormance"
238
	// Sauf si le theme choisit est "en dormance"
237
	if ($_SESSION['_PROJET_']['projet_affichage'] != 'expert' && $ligne->p_en_dormance == 1  && $theme_selectionne != 9) {	
239
	if ($_SESSION['_PROJET_']['projet_affichage'] != 'expert' && $ligne->p_en_dormance == 1  && $theme_selectionne != 9) {	
238
					
240
					
239
	} else {
241
	} else {
240
		$donnees[] = $ligne;
242
		$donnees[] = $ligne;
241
	}
243
	}
242
	 
244
	 
243
}
245
}
244
 
246
 
245
if ($_SESSION['_PROJET_']['projet_affichage'] == 'expert') $perpage = $nombre_resultat; else $perpage = 20;
247
if ($_SESSION['_PROJET_']['projet_affichage'] == 'expert') $perpage = $nombre_resultat; else $perpage = 20;
246
// Parametre du pager
248
// Parametre du pager
247
$params = array (
249
$params = array (
248
	'mode' => 'Sliding',
250
	'mode' => 'Sliding',
249
	'perPage' => $perpage,
251
	'perPage' => $perpage,
250
	'delta' => '5',
252
	'delta' => '5',
251
	'linkClass' => 'num_page',
253
	'linkClass' => 'num_page',
252
	'curPageLinkClassName' => 'page_courante',
254
	'curPageLinkClassName' => 'page_courante',
253
	'spacesBeforeSeparator' => 0,
255
	'spacesBeforeSeparator' => 0,
254
	'spacesAfterSeparator' => 0,
256
	'spacesAfterSeparator' => 0,
255
	'separator' => '',
257
	'separator' => '',
256
	'prevImg' => '&lt;&lt; Page pr&eacute;c&eacute;dente',
258
	'prevImg' => '&lt;&lt; Page pr&eacute;c&eacute;dente',
257
	'nextImg' => 'Page suivante &gt;&gt;',
259
	'nextImg' => 'Page suivante &gt;&gt;',
258
	'extraVars' => array ('projet_recherche' => $_SESSION['_PROJET_']['motif_recherche'], 
260
	'extraVars' => array ('projet_recherche' => $_SESSION['_PROJET_']['motif_recherche'], 
259
					PROJET_VARIABLE_MODE_AFFICHAGE => $_SESSION['_PROJET_']['projet_affichage']),
261
					PROJET_VARIABLE_MODE_AFFICHAGE => $_SESSION['_PROJET_']['projet_affichage']),
260
	'itemData' => $donnees
262
	'itemData' => $donnees
261
	);
263
	);
262
$pager = & Pager::factory($params);
264
$pager = & Pager::factory($params);
263
$links = $pager->getLinks();
265
$links = $pager->getLinks();
264
$data  = $pager->getPageData();
266
$data  = $pager->getPageData();
265
$nombre_projets = $pager->numItems();
267
$nombre_projets = $pager->numItems();
266
$range = $pager->getOffsetByPageId(); 
268
$range = $pager->getOffsetByPageId(); 
267
 
269
 
268
 
270
 
269
// On inclue un fichier local
271
// On inclue un fichier local
270
if (file_exists(PROJET_CHEMIN_APPLI.'langues/pro_langues_fr.local.inc.php'))
272
if (file_exists(PROJET_CHEMIN_APPLI.'langues/pro_langues_fr.local.inc.php'))
271
	include_once PROJET_CHEMIN_APPLI.'langues/pro_langues_fr.local.inc.php' ;
273
	include_once PROJET_CHEMIN_APPLI.'langues/pro_langues_fr.local.inc.php' ;
272
// On verifie si l'utilisateur participe a des projets
274
// On verifie si l'utilisateur participe a des projets
273
 
275
 
274
$projetNonParticipantListe = & $projetListe ;
276
$projetNonParticipantListe = & $projetListe ;
275
 
277
 
276
 
278
 
277
$liste_projet = array() ;
279
$liste_projet = array() ;
278
// La liste
280
// La liste
279
 
281
 
280
 
282
 
281
$tableau_donnees = array();
283
$tableau_donnees = array();
282
foreach ($data as $ligne) {
284
foreach ($data as $ligne) {
283
    $this->_url->addQueryString(PROJET_VARIABLE_ID_PROJET, $ligne->p_id) ;
285
    $this->_url->addQueryString(PROJET_VARIABLE_ID_PROJET, $ligne->p_id) ;
284
 
286
 
285
    $tableau_donnees[$ligne->p_id]['lien'] = $this->_url->getURL();
287
    $tableau_donnees[$ligne->p_id]['lien'] = $this->_url->getURL();
286
    $tableau_donnees[$ligne->p_id]['titre'] = $ligne->p_titre;
288
    $tableau_donnees[$ligne->p_id]['titre'] = $ligne->p_titre;
287
 
289
 
288
    $tableau_donnees[$ligne->p_id]['nombre_participants'] = $ligne->ps_nombre_inscrit;
290
    $tableau_donnees[$ligne->p_id]['nombre_participants'] = $ligne->ps_nombre_inscrit;
289
 
291
 
290
    $tableau_donnees[$ligne->p_id]['resume'] = $ligne->p_resume;
292
    $tableau_donnees[$ligne->p_id]['resume'] = $ligne->p_resume;
291
    if ($_SESSION['_PROJET_']['projet_affichage'] == 'simple') {
293
    if ($_SESSION['_PROJET_']['projet_affichage'] == 'simple') {
292
	    if ($ligne->ps_pourcent <33) {
294
	    if ($ligne->ps_pourcent <33) {
293
	    	$tableau_donnees[$ligne->p_id]['activite'] = 'Peu actif';
295
	    	$tableau_donnees[$ligne->p_id]['activite'] = 'Peu actif';
294
	    	$tableau_donnees[$ligne->p_id]['classe_projet_activite'] = 'projet_activite_faible';	
296
	    	$tableau_donnees[$ligne->p_id]['classe_projet_activite'] = 'projet_activite_faible';	
295
	    }
297
	    }
296
	    	else if ($ligne->ps_pourcent < 66) {
298
	    	else if ($ligne->ps_pourcent < 66) {
297
	    		$tableau_donnees[$ligne->p_id]['activite'] = 'Assez actif';
299
	    		$tableau_donnees[$ligne->p_id]['activite'] = 'Assez actif';
298
	    		$tableau_donnees[$ligne->p_id]['classe_projet_activite'] = 'projet_activite_moyenne';	
300
	    		$tableau_donnees[$ligne->p_id]['classe_projet_activite'] = 'projet_activite_moyenne';	
299
	    	}
301
	    	}
300
	    	else if ($ligne->ps_pourcent <= 100) { 
302
	    	else if ($ligne->ps_pourcent <= 100) { 
301
	    		$tableau_donnees[$ligne->p_id]['activite'] = 'Tr&egrave;s actif';
303
	    		$tableau_donnees[$ligne->p_id]['activite'] = 'Tr&egrave;s actif';
302
	    		$tableau_donnees[$ligne->p_id]['classe_projet_activite'] = 'projet_activite_elevee';
304
	    		$tableau_donnees[$ligne->p_id]['classe_projet_activite'] = 'projet_activite_elevee';
303
	    	}
305
	    	}
304
    } else {
306
    } else {
305
    	$tableau_donnees[$ligne->p_id]['activite'] = $ligne->ps_pourcent.'%';
307
    	$tableau_donnees[$ligne->p_id]['activite'] = $ligne->ps_pourcent.'%';
306
    }
308
    }
307
    $res .= $ligne->p_resume ;
309
    $res .= $ligne->p_resume ;
308
    $this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_ACTION_S_INSCRIRE);
310
    $this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_ACTION_S_INSCRIRE);
309
    $res .= '(<a href="'.$this->_url->getURL().'">Rejoindre ce projet</a>)'."\n";
311
    $res .= '(<a href="'.$this->_url->getURL().'">Rejoindre ce projet</a>)'."\n";
310
    
312
    
311
    // Recherche du forum
313
    // Recherche du forum
312
    if ($ligne->pl_id_liste != null && $ligne->plle_id_liste == null) {
314
    if ($ligne->pl_id_liste != null && $ligne->plle_id_liste == null) {
313
    	$this->_url->addQueryString('act', PROJET_ACTION_VOIR_FORUM);
315
    	$this->_url->addQueryString('act', PROJET_ACTION_VOIR_FORUM);
314
 
316
 
315
	    $forum = '<a href="'.$this->_url->getURL().'"><img src="sites/commun/generique/images/favicones/tela_botanica.png" alt="Tela Botanica" /></a>'."\n";
317
	    $forum = '<a href="'.$this->_url->getURL().'"><img src="sites/commun/generique/images/favicones/tela_botanica.png" alt="Tela Botanica" /></a>'."\n";
316
		$res .= $forum;
318
		$res .= $forum;
317
	
319
	
318
    } else {
320
    } else {
319
    
321
    
320
		include_once PROJET_CHEMIN_CLASSES.'liste_externe.class.php' ;
322
		include_once PROJET_CHEMIN_CLASSES.'liste_externe.class.php' ;
321
		$listes_ext = new liste_externe ($this->_db) ;
323
		$listes_ext = new liste_externe ($this->_db) ;
322
		if ($ligne->plle_id_liste != null) {
324
		if ($ligne->plle_id_liste != null) {
323
			$info_liste = $listes_ext->getInfoListe($ligne->plle_id_liste) ;
325
			$info_liste = $listes_ext->getInfoListe($ligne->plle_id_liste) ;
324
		
326
		
325
			$forum = '<a href="'.$info_liste->AGO_A_URLGRP.
327
			$forum = '<a href="'.$info_liste->AGO_A_URLGRP.
326
					'"><img src="sites/commun/generique/images/favicones/yahoo.png" alt="Yahoo"/></a>';
328
					'"><img src="sites/commun/generique/images/favicones/yahoo.png" alt="Yahoo"/></a>';
327
			$tableau_donnees[$ligne->p_id]['nombre_participants'] = $ligne->ps_nombre_membre_yahoo;
329
			$tableau_donnees[$ligne->p_id]['nombre_participants'] = $ligne->ps_nombre_membre_yahoo;
328
		} else {
330
		} else {
329
			$forum = '-';
331
			$forum = '-';
330
		}
332
		}
331
    }
333
    }
332
    if ($ligne->ps_msg_derniere_semaine != 0) {
334
    if ($ligne->ps_msg_derniere_semaine != 0) {
333
    	
335
    	
334
    	$tableau_donnees[$ligne->p_id]['nombre_message'] = $ligne->ps_msg_derniere_semaine;
336
    	$tableau_donnees[$ligne->p_id]['nombre_message'] = $ligne->ps_msg_derniere_semaine;
335
    } else {
337
    } else {
336
    	$tableau_donnees[$ligne->p_id]['nombre_message'] = 0;
338
    	$tableau_donnees[$ligne->p_id]['nombre_message'] = 0;
337
    }
339
    }
338
    $tableau_donnees[$ligne->p_id]['forum'] = $forum;
340
    $tableau_donnees[$ligne->p_id]['forum'] = $forum;
339
    if ($ligne->p_wikini) {
341
    if ($ligne->p_wikini) {
340
		$this->_url->addQueryString ('act',PROJET_ACTION_VOIR_WIKINI);
342
		$this->_url->addQueryString ('act',PROJET_ACTION_VOIR_WIKINI);
341
		$link=$this->_url->getURL();
343
		$link=$this->_url->getURL();
342
	    $wiki_res = '<a href="'.$link.'">voir</a>' ;
344
	    $wiki_res = '<a href="'.$link.'">voir</a>' ;
343
		if ($ligne->ps_modifwiki_derniere_semaine != 0) {
345
		if ($ligne->ps_modifwiki_derniere_semaine != 0) {
344
			$wiki_res .= ' <span title="Nouvelles contributions cette semaine"> ( +'.$ligne->ps_modifwiki_derniere_semaine.' )</span>';
346
			$wiki_res .= ' <span title="Nouvelles contributions cette semaine"> ( +'.$ligne->ps_modifwiki_derniere_semaine.' )</span>';
345
		}
347
		}
346
	    $this->_url->removeQueryString ('act');
348
	    $this->_url->removeQueryString ('act');
347
	} else {
349
	} else {
348
	    $wiki_res = '-' ;
350
	    $wiki_res = '-' ;
349
	}
351
	}
350
	$tableau_donnees[$ligne->p_id]['wikini'] = $wiki_res;
352
	$tableau_donnees[$ligne->p_id]['wikini'] = $wiki_res;
351
    $titre= '<a href="'.$this->_url->getURL().'">'.$ligne->p_titre.'</a>';
353
    $titre= '<a href="'.$this->_url->getURL().'">'.$ligne->p_titre.'</a>';
352
    
354
    
353
    if ($ligne->p_avoir_document != 0) {
355
    if ($ligne->p_avoir_document != 0) {
354
    	$this->_url->addQueryString('act', PROJET_ACTION_VOIR_DOCUMENT) ;
356
    	$this->_url->addQueryString('act', PROJET_ACTION_VOIR_DOCUMENT) ;
355
    	$document = '<a href="'.$this->_url->getURL().'">voir</a>' ;
357
    	$document = '<a href="'.$this->_url->getURL().'">voir</a>' ;
356
    	if ($ligne->ps_doc_derniere_semaine != 0) {
358
    	if ($ligne->ps_doc_derniere_semaine != 0) {
357
    		$document .= ' <span title="Nouveaux documents cette semaine">( + '.$ligne->ps_doc_derniere_semaine.')</span>';
359
    		$document .= ' <span title="Nouveaux documents cette semaine">( + '.$ligne->ps_doc_derniere_semaine.')</span>';
358
    	}
360
    	}
359
    } else {
361
    } else {
360
    	$document = '-' ;
362
    	$document = '-' ;
361
    }
363
    }
362
    $tableau_donnees[$ligne->p_id]['document'] = $document;
364
    $tableau_donnees[$ligne->p_id]['document'] = $document;
363
                            
365
                            
364
   if ($ligne->p_wikini) {
366
   if ($ligne->p_wikini) {
365
		$this->_url->addQueryString ('act',PROJET_ACTION_VOIR_WIKINI);
367
		$this->_url->addQueryString ('act',PROJET_ACTION_VOIR_WIKINI);
366
		$link=$this->_url->getURL();
368
		$link=$this->_url->getURL();
367
		$this->_url->addQueryString('wiki', 'DerniersChangementsRSS/xml');
369
		$this->_url->addQueryString('wiki', 'DerniersChangementsRSS/xml');
368
	    $wiki_rss = '<a href="'.$this->_url->getURL().'"><img src="sites/commun/generique/images/rss.gif" alt="rss"/></a>' ;
370
	    $wiki_rss = '<a href="'.$this->_url->getURL().'"><img src="sites/commun/generique/images/rss.gif" alt="rss"/></a>' ;
369
	    $this->_url->removeQueryString ('act');
371
	    $this->_url->removeQueryString ('act');
370
	    $this->_url->removeQueryString ('wiki');
372
	    $this->_url->removeQueryString ('wiki');
371
	} else {
373
	} else {
372
	    $wiki_rss = '-' ;
374
	    $wiki_rss = '-' ;
373
	}
375
	}
374
    $tableau_donnees[$ligne->p_id]['wikini_rss'] = $wiki_rss;
376
    $tableau_donnees[$ligne->p_id]['wikini_rss'] = $wiki_rss;
375
    
377
    
376
    $this->_url->addQueryString ('act', PROJET_ACTION_VOIR_PARTICIPANT);
378
    $this->_url->addQueryString ('act', PROJET_ACTION_VOIR_PARTICIPANT);
377
    $participant = '<a href="'.$this->_url->getURL().'">voir</a>' ;
379
    $participant = '<a href="'.$this->_url->getURL().'">voir</a>' ;
378
    $tableau_donnees[$ligne->p_id]['lien_participants'] = $this->_url->getURL();
380
    $tableau_donnees[$ligne->p_id]['lien_participants'] = $this->_url->getURL();
379
    if ($ligne->ps_nombre_inscrit_derniere_semaine != 0) {
381
    if ($ligne->ps_nombre_inscrit_derniere_semaine != 0) {
380
    	$tableau_donnees[$ligne->p_id]['ps_nombre_inscrit_derniere_semaine'] = '<span title="Nouveaux inscrits cette semaine">( + '.$ligne->ps_nombre_inscrit_derniere_semaine.' )</span>';	
382
    	$tableau_donnees[$ligne->p_id]['ps_nombre_inscrit_derniere_semaine'] = '<span title="Nouveaux inscrits cette semaine">( + '.$ligne->ps_nombre_inscrit_derniere_semaine.' )</span>';	
381
    } else {
383
    } else {
382
    	$tableau_donnees[$ligne->p_id]['ps_nombre_inscrit_derniere_semaine'] = '';
384
    	$tableau_donnees[$ligne->p_id]['ps_nombre_inscrit_derniere_semaine'] = '';
383
    }
385
    }
384
    
386
    
385
    $ligne_projet = array ( '', $titre, $forum,  // le nom du projet
387
    $ligne_projet = array ( '', $titre, $forum,  // le nom du projet
386
                        $wiki_res, $wiki_rss,$document, $participant) ;
388
                        $wiki_res, $wiki_rss,$document, $participant) ;
387
 
389
 
388
    $this->_url->removeQueryString(PROJET_VARIABLE_ACTION);
390
    $this->_url->removeQueryString(PROJET_VARIABLE_ACTION);
389
    array_push ($liste_projet, $ligne_projet) ;
391
    array_push ($liste_projet, $ligne_projet) ;
390
    
392
    
391
    if ($loggue) {
393
    if ($loggue) {
392
	    switch ($ligne->psu_id_statut) {
394
	    switch ($ligne->psu_id_statut) {
393
	    	case 1 : $icone_statut = 'etoile_rouge';
395
	    	case 1 : $icone_statut = 'etoile_rouge';
394
	    	$tableau_donnees[$ligne->p_id]['id_statut'] = 3;
396
	    	$tableau_donnees[$ligne->p_id]['id_statut'] = 3;
395
	    	break;
397
	    	break;
396
	    	case 2 : $icone_statut = 'etoile_verte';
398
	    	case 2 : $icone_statut = 'etoile_verte';
397
	    	$tableau_donnees[$ligne->p_id]['id_statut'] = 2;
399
	    	$tableau_donnees[$ligne->p_id]['id_statut'] = 2;
398
	    	break;
400
	    	break;
399
	    	case 3 : $icone_statut = 'etoile_grise';
401
	    	case 3 : $icone_statut = 'etoile_grise';
400
	    	$tableau_donnees[$ligne->p_id]['id_statut'] = 1;
402
	    	$tableau_donnees[$ligne->p_id]['id_statut'] = 1;
401
	    	break;
403
	    	break;
402
	    	default :  $tableau_donnees[$ligne->p_id]['statut_icone'] = '';
404
	    	default :  $tableau_donnees[$ligne->p_id]['statut_icone'] = '';
403
	    	$tableau_donnees[$ligne->p_id]['id_statut'] = 0;
405
	    	$tableau_donnees[$ligne->p_id]['id_statut'] = 0;
404
	    		$icone_statut = false;
406
	    		$icone_statut = false;
405
	    }
407
	    }
406
	    if ($icone_statut) $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.'" />';
408
	    if ($icone_statut) $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.'" />';
407
	    
409
	    
408
    }
410
    }
409
    $res .= '</li>'."\n";
411
    $res .= '</li>'."\n";
410
}
412
}
411
$res .= '</ul>'."\n";
413
$res .= '</ul>'."\n";
412
$this->_url->removeQueryString(PROJET_VARIABLE_ACTION) ;
414
$this->_url->removeQueryString(PROJET_VARIABLE_ACTION) ;
413
$this->_url->removeQueryString (PROJET_VARIABLE_ID_PROJET);
415
$this->_url->removeQueryString (PROJET_VARIABLE_ID_PROJET);
414
 
416
 
415
// Correction bug tri par participant
417
// Correction bug tri par participant
416
if ($_GET[PROJET_VARIABLE_TRI] == 'ps_nombre_inscrit') {
418
if ($_GET[PROJET_VARIABLE_TRI] == 'ps_nombre_inscrit') {
417
	foreach ($tableau_donnees as $key => $row) {
419
	foreach ($tableau_donnees as $key => $row) {
418
    $nombre_inscrit[$key]  = $row['nombre_participants'];
420
    $nombre_inscrit[$key]  = $row['nombre_participants'];
419
    }
421
    }
420
    if  ($_GET[PROJET_VARIABLE_ORDRE_TRI] == 'asc') $flag = SORT_ASC ; else $flag = SORT_DESC ;
422
    if  ($_GET[PROJET_VARIABLE_ORDRE_TRI] == 'asc') $flag = SORT_ASC ; else $flag = SORT_DESC ;
421
	array_multisort($nombre_inscrit, $flag, $tableau_donnees);
423
	array_multisort($nombre_inscrit, $flag, $tableau_donnees);
422
}
424
}
423
 
425
 
424
// Correction bug tri sur les statuts
426
// Correction bug tri sur les statuts
425
if ($_GET[PROJET_VARIABLE_TRI] == 'psu_id_statut') {
427
if ($_GET[PROJET_VARIABLE_TRI] == 'psu_id_statut') {
426
	foreach ($tableau_donnees as $key => $row) {
428
	foreach ($tableau_donnees as $key => $row) {
427
    $id_statut[$key]  = $row['id_statut'];
429
    $id_statut[$key]  = $row['id_statut'];
428
    }
430
    }
429
    if  ($_GET[PROJET_VARIABLE_ORDRE_TRI] == 'asc') $flag = SORT_ASC ; else $flag = SORT_DESC ;
431
    if  ($_GET[PROJET_VARIABLE_ORDRE_TRI] == 'asc') $flag = SORT_ASC ; else $flag = SORT_DESC ;
430
	array_multisort($id_statut, $flag, $tableau_donnees);
432
	array_multisort($id_statut, $flag, $tableau_donnees);
431
}
433
}
432
 
434
 
433
$pair = true;
435
$pair = true;
434
 
436
 
435
ob_start();
437
ob_start();
436
if ($_SESSION['_PROJET_']['projet_affichage'] == 'expert') {
438
if ($_SESSION['_PROJET_']['projet_affichage'] == 'expert') {
437
	GEN_stockerFichierScript('jquery', 'api/js/jquery/jquery.js');
439
	GEN_stockerFichierScript('jquery', 'api/js/jquery/jquery.js');
438
	GEN_stockerFichierScript('animatedcollapse', 'api/js/jquery/animatedcollapse.js');
440
	GEN_stockerFichierScript('animatedcollapse', 'api/js/jquery/animatedcollapse.js');
439
	GEN_stockerCodeScript('animatedcollapse.addDiv(\'legende\', \'fade=1, height="100px"\');' ."\n".
441
	GEN_stockerCodeScript('animatedcollapse.addDiv(\'legende\', \'fade=1, height="100px"\');' ."\n".
440
			'animatedcollapse.init();' ."\n");
442
			'animatedcollapse.init();' ."\n");
441
	include_once PROJET_CHEMIN_CLASSES.'enteteColonneTriable.class.php';
443
	include_once PROJET_CHEMIN_CLASSES.'enteteColonneTriable.class.php';
442
	foreach ($valeur_acceptable_tri as $var_tri) {
444
	foreach ($valeur_acceptable_tri as $var_tri) {
443
		$enteteTri[$var_tri] = new enteteColonneTriable($var_tri);
445
		$enteteTri[$var_tri] = new enteteColonneTriable($var_tri);
444
		$enteteTri[$var_tri]->setColonneCliquee($tri, PROJET_VARIABLE_TRI);
446
		$enteteTri[$var_tri]->setColonneCliquee($tri, PROJET_VARIABLE_TRI);
445
		$enteteTri[$var_tri]->setOrdre($ordre_tri, PROJET_VARIABLE_ORDRE_TRI);
447
		$enteteTri[$var_tri]->setOrdre($ordre_tri, PROJET_VARIABLE_ORDRE_TRI);
446
		
448
		
447
	}
449
	}
448
 
450
 
449
	$lien_tri_titre = $enteteTri['p_titre']->getLien($this->_url);
451
	$lien_tri_titre = $enteteTri['p_titre']->getLien($this->_url);
450
	$lien_tri_activite = $enteteTri['ps_pourcent']->getLien($this->_url);
452
	$lien_tri_activite = $enteteTri['ps_pourcent']->getLien($this->_url);
451
	$lien_tri_participants = $enteteTri['ps_nombre_inscrit']->getLien($this->_url);
453
	$lien_tri_participants = $enteteTri['ps_nombre_inscrit']->getLien($this->_url);
452
	$lien_tri_doc = $enteteTri['ps_doc_derniere_semaine']->getLien($this->_url);
454
	$lien_tri_doc = $enteteTri['ps_doc_derniere_semaine']->getLien($this->_url);
453
	$lien_tri_statut = $enteteTri['psu_id_statut']->getLien($this->_url);
455
	$lien_tri_statut = $enteteTri['psu_id_statut']->getLien($this->_url);
454
	include_once PROJET_CHEMIN_APPLI.'/squelettes/liste_projet_expert.tpl.html';
456
	include_once PROJET_CHEMIN_APPLI.'/squelettes/liste_projet_expert.tpl.html';
455
} else {
457
} else {
456
	include_once PROJET_CHEMIN_APPLI.'/squelettes/liste_projet.tpl.html';
458
	include_once PROJET_CHEMIN_APPLI.'/squelettes/liste_projet.tpl.html';
457
}
459
}
458
$res = ob_get_contents();
460
$res = ob_get_contents();
459
ob_end_clean();
461
ob_end_clean();
460
 
462
 
461
 
463
 
462
// Nettoyage de l'url
464
// Nettoyage de l'url
463
$this->_url->removeQueryString (PROJET_VARIABLE_ID_PROJET);
465
$this->_url->removeQueryString (PROJET_VARIABLE_ID_PROJET);
464
$this->_url->removeQueryString (PROJET_VARIABLE_MODE_AFFICHAGE);
466
$this->_url->removeQueryString (PROJET_VARIABLE_MODE_AFFICHAGE);
465
$this->_url->removeQueryString (PROJET_VARIABLE_ORDRE_TRI);
467
$this->_url->removeQueryString (PROJET_VARIABLE_ORDRE_TRI);
466
$this->_url->removeQueryString (PROJET_VARIABLE_TRI);
468
$this->_url->removeQueryString (PROJET_VARIABLE_TRI);
467
return $res ;
469
return $res ;
468
 
470
 
469
/* +--Fin du code ----------------------------------------------------------------------------------------+
471
/* +--Fin du code ----------------------------------------------------------------------------------------+
470
*
472
*
471
* $Log: not supported by cvs2svn $
473
* $Log: not supported by cvs2svn $
-
 
474
* Revision 1.2  2008-09-01 14:37:15  alexandre_tb
-
 
475
* modification du tri par defaut
-
 
476
*
472
* Revision 1.1  2008-08-25 15:00:28  alexandre_tb
477
* Revision 1.1  2008-08-25 15:00:28  alexandre_tb
473
* version initiale
478
* version initiale
474
*
479
*
475
* +-- Fin du code ----------------------------------------------------------------------------------------+
480
* +-- Fin du code ----------------------------------------------------------------------------------------+
476
*/
481
*/
477
 
482
 
478
 
483
 
479
?>
484
?>