Subversion Repositories Applications.projet

Rev

Rev 338 | Go to most recent revision | Details | Last modification | View Log | RSS feed

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