/trunk/presentation/liste.php |
---|
1,258 → 1,261 |
<?php |
/*vim: set expandtab tabstop=4 shiftwidth=4: */ |
// +------------------------------------------------------------------------------------------------------+ |
// | PHP version 4.1 | |
// +------------------------------------------------------------------------------------------------------+ |
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) | |
// +------------------------------------------------------------------------------------------------------+ |
// | This library is free software; you can redistribute it and/or | |
// | modify it under the terms of the GNU General Public | |
// | License as published by the Free Software Foundation; either | |
// | version 2.1 of the License, or (at your option) any later version. | |
// | | |
// | This library is distributed in the hope that it will be useful, | |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
// | General Public License for more details. | |
// | | |
// | You should have received a copy of the GNU General Public | |
// | License along with this library; if not, write to the Free Software | |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
// +------------------------------------------------------------------------------------------------------+ |
// CVS : $Id: liste.php,v 1.8 2007-06-25 12:15:07 alexandre_tb Exp $ |
/** |
* Application projet |
* |
* Fichier de présentation de la liste des projets |
* |
*@package projet |
//Auteur original : |
*@author Alexandre Granier <alexandre@tela-botanica.org> |
//Autres auteurs : |
*@author Aucun |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.8 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | ENTETE du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
$titre = '<h1>'.PROJET_LISTE.'</h1>'."\n" ; |
if (PROJET_UTILISE_TYPE && $this->_type != '') { |
$projetListe = projet::getProjetDuType($this->_type, $this->_db) ; |
} else { |
// Un tableau de tous les projets dans $projetListe |
$projetListe = projet::getTousLesProjets($this->_db, $this->_projet_exclu) ; |
} |
// On inclue un fichier local |
if (file_exists(PROJET_CHEMIN_APPLI.'langues/pro_langue_'.$GLOBALS['lang'].'.local.inc.php')) |
include_once PROJET_CHEMIN_APPLI.'langues/pro_langue_'.$GLOBALS['lang'].'.local.inc.php' ; |
// On verifie si l'utilisateur participe a des projets |
//echo PROJET_CHEMIN_APPLI.'langues/pro_langue_'.$GLOBALS['lang'].'.local.inc.php'; |
// Entete de la liste, qu'on recupere dans un template |
if (PROJET_UTILISE_TYPE && $this->_type != "") { |
include_once PROJET_CHEMIN_CLASSES.'projetTemplate.class.php' ; |
include_once 'HTML/Template/IT.php'; |
$template = new projetTemplate ($this->_db) ; |
$chaine = $template->getTemplate(2, $GLOBALS['lang'], $this->_type); |
if (projetTemplate::isError ($chaine)) return $chaine->getMessage() ; |
$tpl = new HTML_Template_IT() ; |
$tpl -> setTemplate($chaine); |
} |
if ($auth){ |
include_once PROJET_CHEMIN_CLASSES.'inscription_liste.class.php' ; |
$utilisateur_liste = new inscription_liste($this->_db) ; |
// On teste ici s'il y a une mise a jour de statut |
if (isset($_POST['statut'])) { |
// $_POST['statut'] et $_GET['identifiant_projet'] proviennent du formulaire voir HTML_listeProjet |
include_once PROJET_CHEMIN_CLASSES.'annuaire.class.php' ; |
$annuaire = new annuaire($this->_db, array('identifiant' => PROJET_CHAMPS_ID, 'mail' => PROJET_CHAMPS_MAIL, 'table' => PROJET_ANNUAIRE)) ; |
$annuaire->setId($this->_auth->getAuthData(PROJET_CHAMPS_ID)) ; |
$projet = new projet ($this->_db, $_GET['identifiant_projet']) ; |
$projet->getListesAssociees() ; |
$utilisateur_liste->modifierTypeInscription($projet->_listes_associes[0],$annuaire, $_POST['statut']) ; |
} |
if (count($participant->getIdProjetsStatuts($id_u))) { |
include_once PROJET_CHEMIN_CLASSES.'HTML_listeProjet.class.php' ; |
$HTML_projetListe = new HTML_listeProjet(true) ; |
$entete_liste = array($auth ? PROJET_VOUS_PARTICIPEZ : PROJET_LISTE) ; |
if ($auth) array_push ($entete_liste, PROJET_SE_DESINSCRIRE, PROJET_LISTE_DE_DISCUSSION) ; |
$tableau_resultat = array () ; |
$HTML_projetListe->construitEntete ($entete_liste) ; |
// On construit $tableau_resultat avec une ligne par projet contenant un tableau (titre, statut_nom, id_statut, id_projet) |
include_once PROJET_CHEMIN_CLASSES.'statut_liste.class.php' ; |
$statut_liste = new statut_liste($this->_db) ; |
$tableau_statut = $statut_liste->getTousLesStatuts() ; |
$statut = '' ; |
$i = 0 ; |
$HTML_projetListe->setModeModification() ; |
$HTML_projetListe->setURL($this->_url) ; |
foreach ($projetListe as $projet) { |
if (participe::getStatutSurProjetCourant($id_u, $projet->getId(), $this->_db) == 4) continue ; |
if ($auth) { |
if ($projet->avoirListe()) { |
$projet->getListesAssociees() ; |
$statut = $utilisateur_liste->getStatutInscrit($projet->_listes_associes[0]->getId(), $this->_auth) ; |
//if ($statut == '') $statut = 0 ; |
} |
} |
$this->_url->addQueryString (PROJET_VARIABLE_ID_PROJET, $projet->getId()) ; |
$ligne_tableau = array ($projet->getId(), $projet->getResume(), |
'<a href="'.$this->_url->getURL().'">'.$projet->getTitre().'</a>' |
) ; |
if ($auth) { |
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_DESINSCRIPTION_PROJET) ; |
array_push ($ligne_tableau, '<a href="'.$this->_url->getURL().'" onclick="javascript:return confirm(\''. |
PROJET_SE_DESINSCRIRE_CONFIRMATION.'\');">'.PROJET_SE_DESINSCRIRE.'</a>') ; |
if ($projet->avoirListe()) { |
array_push ($ligne_tableau, $statut) ; |
} else { |
array_push($ligne_tableau, '') ; |
} |
array_push ($tableau_resultat, $ligne_tableau) ; |
$this->_url->removeQueryString (PROJET_VARIABLE_ACTION) ; |
} |
$statut = '' ; |
} |
$HTML_projetListe->construitListe ($tableau_resultat, $tableau_statut) ; |
if ($HTML_projetListe->getRowCount() > 1) { |
$res .= '<p>'.PROJET_PARTICIPER.'</p>'; |
$res .= $HTML_projetListe->toHTML() ; |
} |
} else { |
$res .= '<p>'.PROJET_INSCRIT_AUCUN_PROJET.'</p>' ; |
} |
} |
// Un texte pour ceux qui ne sont pas identifiés |
if (!$auth) { |
$res .= '<p>'.PROJET_TEXTE_NON_IDENTIFIE.'</p>'."\n" ; |
} |
// Maintenant la liste des projets ou l'utilisateur ne participe pas. |
// Et si pas loggue tous les projets |
if ($auth) { |
$projetNonParticipantListe = $participant -> getProjetsNonParticipant($id_u) ; |
// Si certain projet sont à exclure, on les exclu |
$projet_a_exclure = array() ; |
if (count($this->_projet_exclu)) { |
arsort($this->_projet_exclu) ; |
foreach ($this->_projet_exclu as $valeur) { |
for ($i = 0; $i < count($projetNonParticipantListe); $i++) { |
if ($projetNonParticipantListe[$i]->getId() == $valeur) array_push ($projet_a_exclure, $i);} |
} |
} |
if (PROJET_UTILISE_TYPE && $this->_type != '') { |
for ($i = 0; $i < count($projetNonParticipantListe); $i++) { |
if ($projetNonParticipantListe[$i]->getType() != $this->_type) array_push ($projet_a_exclure, $i) ; |
} |
} |
foreach ($projet_a_exclure as $valeur) { |
unset ($projetNonParticipantListe[$valeur]) ; |
} |
include_once PROJET_CHEMIN_CLASSES.'HTML_listeProjet.class.php'; |
$HTML_projetNonParticipantListe = new HTML_listeProjet(true) ; |
$entete_liste = array (PROJET_LISTE) ; |
array_push ($entete_liste, PROJET_S_INSCRIRE) ; |
$HTML_projetNonParticipantListe->construitEntete($entete_liste) ; |
$liste_projet = array() ; |
// La liste |
foreach ($projetNonParticipantListe as $projet) { |
$this->_url->addQueryString(PROJET_VARIABLE_ID_PROJET, $projet->getId()) ; |
$ligne_projet = array ($projet->getResume(), |
'<a href="'.$this->_url->getURL().'">'.$projet->getTitre().'</a>' // le nom du projet |
) ; |
$this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_ACTION_S_INSCRIRE) ; |
array_push ($ligne_projet, '<a href="'.$this->_url->getURL().'">'.PROJET_S_INSCRIRE.'</a>') ; |
$this->_url->removeQueryString(PROJET_VARIABLE_ACTION); |
array_push ($liste_projet, $ligne_projet) ; |
} |
$this->_url->removeQueryString(PROJET_VARIABLE_ACTION) ; |
$HTML_projetNonParticipantListe->construitListe($liste_projet) ; |
if ($HTML_projetNonParticipantListe->getRowCount() > 1) $res .= $HTML_projetNonParticipantListe->toHTML() ; |
} else { |
$projetNonParticipantListe = & $projetListe ; |
include_once PROJET_CHEMIN_CLASSES.'HTML_listeProjet.class.php' ; |
$HTML_projetNonParticipantListe = new HTML_listeProjet(true) ; |
$entete_liste = array (PROJET_LISTE) ; |
$HTML_projetNonParticipantListe->construitEntete($entete_liste) ; |
$liste_projet = array() ; |
// La liste |
foreach ($projetNonParticipantListe as $projet) { |
$this->_url->addQueryString(PROJET_VARIABLE_ID_PROJET, $projet->getId()) ; |
$ligne_projet = array ( $projet->getResume(), |
'<a href="'.$this->_url->getURL().'">'.$projet->getTitre().'</a>', // le nom du projet |
) ; |
$this->_url->removeQueryString(PROJET_VARIABLE_ACTION); |
array_push ($liste_projet, $ligne_projet) ; |
} |
$this->_url->removeQueryString(PROJET_VARIABLE_ACTION) ; |
$HTML_projetNonParticipantListe->construitListe($liste_projet) ; |
if ($HTML_projetNonParticipantListe->getRowCount() > 1) { |
$res .= '<p>'.PROJET_TOUS_LES_PROJETS.'</p>' ; |
$res .= $HTML_projetNonParticipantListe->toHTML() ; |
} |
} |
// Nettoyage de l'url |
if (PROJET_UTILISE_TYPE && $this->_type != '') { |
$tpl->setVariable('liste_projet', $res) ; |
$res = $tpl->get(); |
} |
$this->_url->removeQueryString (PROJET_VARIABLE_ID_PROJET); |
return $titre.$res ; |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: not supported by cvs2svn $ |
* Revision 1.7 2007-06-01 13:56:13 alexandre_tb |
* ajout d un include manquant |
* |
* Revision 1.6 2007/04/19 15:34:35 neiluj |
* préparration release (livraison) "Narmer" - v0.25 |
* |
* Revision 1.5 2006/12/19 09:48:50 alexandre_tb |
* amélioration du retour erreur lors de l appel au template |
* |
* Revision 1.4 2006/12/18 17:24:09 alexandre_tb |
* inclusion du fichier de langue en utilisant la globale 'lang' |
* |
* Revision 1.3 2006/09/18 09:56:28 alexandre_tb |
* utilisation d'un template pour l'entête de la liste des projets |
* |
* Revision 1.2 2005/11/28 16:25:23 alexandre_tb |
* nettoyage URL en sortie de programme |
* |
* Revision 1.1 2005/11/25 14:47:51 alexandre_tb |
* version initiale |
* |
* |
* |
* +-- Fin du code ----------------------------------------------------------------------------------------+ |
*/ |
<?php |
/*vim: set expandtab tabstop=4 shiftwidth=4: */ |
// +------------------------------------------------------------------------------------------------------+ |
// | PHP version 4.1 | |
// +------------------------------------------------------------------------------------------------------+ |
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) | |
// +------------------------------------------------------------------------------------------------------+ |
// | This library is free software; you can redistribute it and/or | |
// | modify it under the terms of the GNU General Public | |
// | License as published by the Free Software Foundation; either | |
// | version 2.1 of the License, or (at your option) any later version. | |
// | | |
// | This library is distributed in the hope that it will be useful, | |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
// | General Public License for more details. | |
// | | |
// | You should have received a copy of the GNU General Public | |
// | License along with this library; if not, write to the Free Software | |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
// +------------------------------------------------------------------------------------------------------+ |
// CVS : $Id: liste.php,v 1.8 2007-06-25 12:15:07 alexandre_tb Exp $ |
/** |
* Application projet |
* |
* Fichier de pr�sentation de la liste des projets |
* |
*@package projet |
//Auteur original : |
*@author Alexandre Granier <alexandre@tela-botanica.org> |
//Autres auteurs : |
*@author Aucun |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.8 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | ENTETE du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
$titre = '<h1>'.PROJET_LISTE.'</h1>'."\n" ; |
if (PROJET_UTILISE_TYPE && $this->_type != '') { |
$projetListe = projet::getProjetDuType($this->_type, $this->_db) ; |
} else { |
// Un tableau de tous les projets dans $projetListe |
$projetListe = projet::getTousLesProjets($this->_db, $this->_projet_exclu) ; |
} |
// On inclue un fichier local |
if (file_exists(PROJET_CHEMIN_APPLI.'langues/pro_langue_'.$GLOBALS['lang'].'.local.inc.php')) |
include_once PROJET_CHEMIN_APPLI.'langues/pro_langue_'.$GLOBALS['lang'].'.local.inc.php' ; |
// On verifie si l'utilisateur participe a des projets |
//echo PROJET_CHEMIN_APPLI.'langues/pro_langue_'.$GLOBALS['lang'].'.local.inc.php'; |
// Entete de la liste, qu'on recupere dans un template |
if (PROJET_UTILISE_TYPE && $this->_type != "") { |
include_once PROJET_CHEMIN_CLASSES.'projetTemplate.class.php' ; |
include_once 'HTML/Template/IT.php'; |
$template = new projetTemplate ($this->_db) ; |
$chaine = $template->getTemplate(2, $GLOBALS['lang'], $this->_type); |
if (projetTemplate::isError ($chaine)) return $chaine->getMessage() ; |
$tpl = new HTML_Template_IT() ; |
$tpl -> setTemplate($chaine); |
} |
if ($auth){ |
include_once PROJET_CHEMIN_CLASSES.'inscription_liste.class.php' ; |
$utilisateur_liste = new inscription_liste($this->_db) ; |
// On teste ici s'il y a une mise a jour de statut |
if (isset($_POST['statut'])) { |
// $_POST['statut'] et $_GET['identifiant_projet'] proviennent du formulaire voir HTML_listeProjet |
include_once PROJET_CHEMIN_CLASSES.'annuaire.class.php' ; |
$annuaire = new annuaire($this->_db, array('identifiant' => PROJET_CHAMPS_ID, 'mail' => PROJET_CHAMPS_MAIL, 'table' => PROJET_ANNUAIRE)) ; |
$annuaire->setId($this->_auth->getAuthData(PROJET_CHAMPS_ID)) ; |
$projet = new projet ($this->_db, $_GET['identifiant_projet']) ; |
$projet->getListesAssociees() ; |
$utilisateur_liste->modifierTypeInscription($projet->_listes_associes[0],$annuaire, $_POST['statut']) ; |
} |
if (count($participant->getIdProjetsStatuts($id_u))) { |
include_once PROJET_CHEMIN_CLASSES.'HTML_listeProjet.class.php' ; |
$HTML_projetListe = new HTML_listeProjet(true) ; |
$entete_liste = array($auth ? PROJET_VOUS_PARTICIPEZ : PROJET_LISTE) ; |
if ($auth) array_push ($entete_liste, PROJET_SE_DESINSCRIRE, PROJET_LISTE_DE_DISCUSSION) ; |
$tableau_resultat = array () ; |
$HTML_projetListe->construitEntete ($entete_liste) ; |
// On construit $tableau_resultat avec une ligne par projet contenant un tableau (titre, statut_nom, id_statut, id_projet) |
include_once PROJET_CHEMIN_CLASSES.'statut_liste.class.php' ; |
$statut_liste = new statut_liste($this->_db) ; |
$tableau_statut = $statut_liste->getTousLesStatuts() ; |
$statut = '' ; |
$i = 0 ; |
$HTML_projetListe->setModeModification() ; |
$HTML_projetListe->setURL($this->_url) ; |
foreach ($projetListe as $projet) { |
if (participe::getStatutSurProjetCourant($id_u, $projet->getId(), $this->_db) == 4) continue ; |
if ($auth) { |
if ($projet->avoirListe()) { |
$projet->getListesAssociees() ; |
$statut = $utilisateur_liste->getStatutInscrit($projet->_listes_associes[0]->getId(), $this->_auth) ; |
//if ($statut == '') $statut = 0 ; |
} |
} |
$this->_url->addQueryString (PROJET_VARIABLE_ID_PROJET, $projet->getId()) ; |
$ligne_tableau = array ($projet->getId(), $projet->getResume(), |
'<a href="'.$this->_url->getURL().'">'.$projet->getTitre().'</a>' |
) ; |
if ($auth) { |
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_DESINSCRIPTION_PROJET) ; |
array_push ($ligne_tableau, '<a href="'.$this->_url->getURL().'" onclick="javascript:return confirm(\''. |
PROJET_SE_DESINSCRIRE_CONFIRMATION.'\');">'.PROJET_SE_DESINSCRIRE.'</a>') ; |
if ($projet->avoirListe()) { |
array_push ($ligne_tableau, $statut) ; |
} else { |
array_push($ligne_tableau, '') ; |
} |
array_push ($tableau_resultat, $ligne_tableau) ; |
$this->_url->removeQueryString (PROJET_VARIABLE_ACTION) ; |
} |
$statut = '' ; |
} |
$HTML_projetListe->construitListe ($tableau_resultat, $tableau_statut) ; |
if ($HTML_projetListe->getRowCount() > 1) { |
$res .= '<p>'.PROJET_PARTICIPER.'</p>'; |
$res .= $HTML_projetListe->toHTML() ; |
} |
} else { |
$res .= '<p>'.PROJET_INSCRIT_AUCUN_PROJET.'</p>' ; |
} |
} |
// Un texte pour ceux qui ne sont pas identifi�s |
if (!$auth) { |
$res .= '<p>'.PROJET_TEXTE_NON_IDENTIFIE.'</p>'."\n" ; |
} |
// Maintenant la liste des projets ou l'utilisateur ne participe pas. |
// Et si pas loggue tous les projets |
if ($auth) { |
$projetNonParticipantListe = $participant -> getProjetsNonParticipant($id_u) ; |
// Si certain projet sont � exclure, on les exclu |
$projet_a_exclure = array() ; |
if (count($this->_projet_exclu)) { |
arsort($this->_projet_exclu) ; |
foreach ($this->_projet_exclu as $valeur) { |
for ($i = 0; $i < count($projetNonParticipantListe); $i++) { |
if ($projetNonParticipantListe[$i]->getId() == $valeur) array_push ($projet_a_exclure, $i);} |
} |
} |
if (PROJET_UTILISE_TYPE && $this->_type != '') { |
for ($i = 0; $i < count($projetNonParticipantListe); $i++) { |
if ($projetNonParticipantListe[$i]->getType() != $this->_type) array_push ($projet_a_exclure, $i) ; |
} |
} |
foreach ($projet_a_exclure as $valeur) { |
unset ($projetNonParticipantListe[$valeur]) ; |
} |
include_once PROJET_CHEMIN_CLASSES.'HTML_listeProjet.class.php'; |
$HTML_projetNonParticipantListe = new HTML_listeProjet(true) ; |
$entete_liste = array (PROJET_LISTE) ; |
array_push ($entete_liste, PROJET_S_INSCRIRE) ; |
$HTML_projetNonParticipantListe->construitEntete($entete_liste) ; |
$liste_projet = array() ; |
// La liste |
foreach ($projetNonParticipantListe as $projet) { |
$this->_url->addQueryString(PROJET_VARIABLE_ID_PROJET, $projet->getId()) ; |
$ligne_projet = array ($projet->getResume(), |
'<a href="'.$this->_url->getURL().'">'.$projet->getTitre().'</a>' // le nom du projet |
) ; |
$this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_ACTION_S_INSCRIRE) ; |
array_push ($ligne_projet, '<a href="'.$this->_url->getURL().'">'.PROJET_S_INSCRIRE.'</a>') ; |
$this->_url->removeQueryString(PROJET_VARIABLE_ACTION); |
array_push ($liste_projet, $ligne_projet) ; |
} |
$this->_url->removeQueryString(PROJET_VARIABLE_ACTION) ; |
$HTML_projetNonParticipantListe->construitListe($liste_projet) ; |
if ($HTML_projetNonParticipantListe->getRowCount() > 1) $res .= $HTML_projetNonParticipantListe->toHTML() ; |
} else { |
$projetNonParticipantListe = & $projetListe ; |
include_once PROJET_CHEMIN_CLASSES.'HTML_listeProjet.class.php' ; |
$HTML_projetNonParticipantListe = new HTML_listeProjet(true) ; |
$entete_liste = array (PROJET_LISTE) ; |
$HTML_projetNonParticipantListe->construitEntete($entete_liste) ; |
$liste_projet = array() ; |
// La liste |
foreach ($projetNonParticipantListe as $projet) { |
$this->_url->addQueryString(PROJET_VARIABLE_ID_PROJET, $projet->getId()) ; |
$ligne_projet = array ( $projet->getResume(), |
'<a href="'.$this->_url->getURL().'">'.$projet->getTitre().'</a>', // le nom du projet |
) ; |
$this->_url->removeQueryString(PROJET_VARIABLE_ACTION); |
array_push ($liste_projet, $ligne_projet) ; |
} |
$this->_url->removeQueryString(PROJET_VARIABLE_ACTION) ; |
$HTML_projetNonParticipantListe->construitListe($liste_projet) ; |
if ($HTML_projetNonParticipantListe->getRowCount() > 1) { |
$res .= '<p>'.PROJET_TOUS_LES_PROJETS.'</p>' ; |
$res .= $HTML_projetNonParticipantListe->toHTML() ; |
} |
} |
// Nettoyage de l'url |
if (PROJET_UTILISE_TYPE && $this->_type != '') { |
$tpl->setVariable('liste_projet', $res) ; |
$res = $tpl->get(); |
} |
$this->_url->removeQueryString (PROJET_VARIABLE_ID_PROJET); |
return $titre.$res ; |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: liste.php,v $ |
* Revision 1.8 2007-06-25 12:15:07 alexandre_tb |
* merge from narmer |
* |
* Revision 1.7 2007-06-01 13:56:13 alexandre_tb |
* ajout d un include manquant |
* |
* Revision 1.6 2007/04/19 15:34:35 neiluj |
* préparration release (livraison) "Narmer" - v0.25 |
* |
* Revision 1.5 2006/12/19 09:48:50 alexandre_tb |
* am�lioration du retour erreur lors de l appel au template |
* |
* Revision 1.4 2006/12/18 17:24:09 alexandre_tb |
* inclusion du fichier de langue en utilisant la globale 'lang' |
* |
* Revision 1.3 2006/09/18 09:56:28 alexandre_tb |
* utilisation d'un template pour l'ent�te de la liste des projets |
* |
* Revision 1.2 2005/11/28 16:25:23 alexandre_tb |
* nettoyage URL en sortie de programme |
* |
* Revision 1.1 2005/11/25 14:47:51 alexandre_tb |
* version initiale |
* |
* |
* |
* +-- Fin du code ----------------------------------------------------------------------------------------+ |
*/ |
?> |
/trunk/presentation/tela_ergo.php |
---|
1,486 → 1,494 |
<?php |
/*vim: set expandtab tabstop=4 shiftwidth=4: */ |
// +------------------------------------------------------------------------------------------------------+ |
// | PHP version 4.1 | |
// +------------------------------------------------------------------------------------------------------+ |
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) | |
// +------------------------------------------------------------------------------------------------------+ |
// | This library is free software; you can redistribute it and/or | |
// | modify it under the terms of the GNU General Public | |
// | License as published by the Free Software Foundation; either | |
// | version 2.1 of the License, or (at your option) any later version. | |
// | | |
// | This library is distributed in the hope that it will be useful, | |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
// | General Public License for more details. | |
// | | |
// | You should have received a copy of the GNU General Public | |
// | License along with this library; if not, write to the Free Software | |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
// +------------------------------------------------------------------------------------------------------+ |
// CVS : $Id: tela_ergo.php,v 1.4 2008-10-27 16:54:59 aperonnet Exp $ |
/** |
* Application projet |
* |
* Fichier de presentation de la liste des projets pour Tela Botanica nouvelle version |
* |
*@package projet |
//Auteur original : |
*@author Alexandre Granier <alexandre@tela-botanica.org> |
//Autres auteurs : |
*@author Aucun |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.4 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | ENTETE du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
define ('PROJET_VARIABLE_MODE_AFFICHAGE', 'projet_affichage'); |
define ('PROJET_VARIABLE_TRI', 'projet_tri'); |
define ('PROJET_VARIABLE_ORDRE_TRI', 'projet_ordre_tri'); |
define ('PROJET_VARIABLE_THEME', 'theme'); |
if (PROJET_UTILISE_TYPE && $this->_type != '') { |
$projetListe = projet::getProjetDuType($this->_type, $this->_db) ; |
if ($this->_presentation == 'arbre')array_push ($projetListe, projet::getProjetRacine($this->_db)) ; |
} else { |
// Un tableau de tous les projets dans $projetListe |
//$projetListe = projet::getTousLesProjets($this->_db, $this->_projet_exclu) ; |
} |
$_SESSION['_PROJET_']['motif_recherche'] = ''; |
$url = $this->_url->getURL(); |
$loggue = $this->_auth->getAuth(); |
// Verification sur l ordre de tri et mise en place |
// du tri par defaut sur le titre |
$valeur_acceptable_tri = array ('p_titre', 'ps_pourcent', 'ps_nombre_inscrit', 'ps_doc_derniere_semaine', 'psu_id_statut'); // Securite |
if (isset($_GET[PROJET_VARIABLE_TRI]) && $_GET[PROJET_VARIABLE_TRI] != '' && in_array($_GET[PROJET_VARIABLE_TRI], $valeur_acceptable_tri)) { |
$tri = $_GET[PROJET_VARIABLE_TRI]; |
} else { |
$tri = 'p_titre'; |
} |
$valeur_acceptable_ordre_tri = array ('asc', 'desc'); // securite |
if (isset($_GET[PROJET_VARIABLE_ORDRE_TRI]) && $_GET[PROJET_VARIABLE_ORDRE_TRI] != '' |
&& in_array ($_GET[PROJET_VARIABLE_ORDRE_TRI], $valeur_acceptable_ordre_tri)) { |
$ordre_tri = $_GET[PROJET_VARIABLE_ORDRE_TRI]; |
} else { |
$ordre_tri = ''; |
} |
// variable de session pour se rappeler des choix du visiteur |
if (!isset ($_GET[PROJET_VARIABLE_MODE_AFFICHAGE]) && isset($_SESSION['_PROJET_']['projet_affichage']) && ($_SESSION['_PROJET_']['projet_affichage'] == 'simple' || $_SESSION['_PROJET_']['projet_affichage'] == 'expert')) { |
$_GET[PROJET_VARIABLE_MODE_AFFICHAGE] = $_SESSION['_PROJET_']['projet_affichage']; |
} |
if (isset($_GET[PROJET_VARIABLE_MODE_AFFICHAGE]) && $_GET[PROJET_VARIABLE_MODE_AFFICHAGE] != '') { |
$_SESSION['_PROJET_']['projet_affichage'] = $_GET[PROJET_VARIABLE_MODE_AFFICHAGE]; |
if ($_SESSION['_PROJET_']['projet_affichage'] == 'expert') { |
$this->_url->addQueryString (PROJET_VARIABLE_MODE_AFFICHAGE, 'simple'); |
$lien_interface_simple = '[<a href="'.$this->_url->getURL().'">Affichage simple</a>]'; |
$this->_url->addQueryString (PROJET_VARIABLE_MODE_AFFICHAGE, 'expert'); |
$lien_interface_expert = ''; |
} else { |
$_SESSION['_PROJET_']['projet_affichage'] = 'simple'; |
$this->_url->addQueryString (PROJET_VARIABLE_MODE_AFFICHAGE, 'expert'); |
$lien_interface_simple = ''; |
$lien_interface_expert = '[<a href="'.$this->_url->getURL().'">Affichage expert</a>]'; |
} |
} else { |
$_SESSION['_PROJET_']['projet_affichage'] = 'simple'; |
$this->_url->addQueryString (PROJET_VARIABLE_MODE_AFFICHAGE, 'expert'); |
$lien_interface_simple = ''; |
$lien_interface_expert = '[<a href="'.$this->_url->getURL().'">Affichage expert</a>]'; |
} |
if ($_SESSION['_PROJET_']['projet_affichage'] != 'expert') { |
$ordre_tri = 'desc'; |
$tri = 'ps_pourcent'; |
} |
/** Affichage des themes de projets */ |
$requete_type = 'SELECT count( p_id ) AS nbe, pt_label_theme,pt_id_theme |
FROM projet, projet_avoir_theme, projet_theme |
WHERE p_id = pat_id_projet |
AND pat_id_theme = pt_id_theme and p_en_dormance=0 |
GROUP BY pt_id_theme'; |
$resultat_type = $GLOBALS['projet_db']->query($requete_type); |
if (DB::isError($resultat_type)) return $resultat_type->getMessage(); |
$tableau_theme = array(); |
$requete_nb_pj = 'select count(*) as nb from projet'; |
$nombre_total_projet = $GLOBALS['projet_db']->getOne($requete_nb_pj); |
// On ajoute le theme tous |
$tableau_theme[0]['label'] = 'Tous les projets'; |
$tableau_theme[0]['id'] = 0; |
$tableau_theme[0]['nombre_projet'] = $nombre_total_projet; |
$this->_url->removeQueryString(PROJET_VARIABLE_MODE_AFFICHAGE); |
$tableau_theme[0]['lien'] = $this->_url->getURL(); |
// Et le theme en dormance |
$requete_dormance = 'select count(p_id) as nb_p_dorman from projet where p_en_dormance=1'; |
$nb_p_dormant = $GLOBALS['projet_db']->getOne($requete_dormance); |
while ($ligne_type = $resultat_type->fetchRow(DB_FETCHMODE_OBJECT)) { |
$tableau_theme[$ligne_type->pt_id_theme]['label'] = $ligne_type->pt_label_theme; |
$tableau_theme[$ligne_type->pt_id_theme]['id'] = $ligne_type->pt_id_theme; |
$tableau_theme[$ligne_type->pt_id_theme]['nombre_projet'] = $ligne_type->nbe; |
$this->_url->addQueryString(PROJET_VARIABLE_THEME, $ligne_type->pt_id_theme); |
$tableau_theme[$ligne_type->pt_id_theme]['lien'] = $this->_url->getURL(); |
} |
$tableau_theme[9]['label'] = 'En dormance'; |
$tableau_theme[9]['id'] = 9; |
$tableau_theme[9]['nombre_projet'] = $nb_p_dormant; |
$this->_url->addQueryString(PROJET_VARIABLE_THEME, 9); |
$tableau_theme[9]['lien'] = $this->_url->getURL(); |
$this->_url->removeQueryString(PROJET_VARIABLE_THEME); |
// Contruction de la requete, soit avec le moteur de recherche |
// soit la liste des projets |
if (isset($_GET['projet_recherche']) && $_GET['projet_recherche'] != '') { |
$_SESSION['_PROJET_']['motif_recherche'] = $_GET['projet_recherche']; |
if (!isset($GLOBALS['_MOTEUR_RECHERCHE_']['bd']['papyrus'])) $GLOBALS['_MOTEUR_RECHERCHE_']['bd']['papyrus'] = $this->_db; |
include_once 'papyrus/applettes/moteur_recherche/bibliotheque/more_recherche.class.php'; |
include_once 'papyrus/applettes/moteur_recherche/bibliotheque/more_recherche_projet.class.php'; |
$moteur = new More_Recherche($_SESSION['_PROJET_']['motif_recherche']); |
$recherche_projet = new More_Recherche_Projet($_SESSION['_PROJET_']['motif_recherche']); |
$moteur->ajouterRecherche($recherche_projet); |
$resultats = $moteur->rechercherMotif(); |
// $chaine_id_projet contient une liste d identifiant separer par une virgule |
if (!empty($resultats)) { |
$chaine_id_projet = ''; |
foreach ($resultats as $projet) { |
$chaine_id_projet .= $projet['id'].','; |
} |
$chaine_id_projet = substr($chaine_id_projet, 0, -1); |
$where_recherche = ' where p_id in ('.$chaine_id_projet.')'; |
$valeur_projet_recherche = $_GET['projet_recherche']; |
} |
} else { |
$where_recherche = ''; |
$valeur_projet_recherche = ''; |
} |
$select = ''; |
$from_recherche = ''; |
if (isset($_GET[PROJET_VARIABLE_THEME])) { |
$from_recherche = ' left join projet_avoir_theme on pat_id_projet=p_id left join projet_theme on pat_id_theme=pt_id_theme'; |
$where_recherche = ' where pat_id_theme='.$this->_db->escapeSimple(intval($_GET[PROJET_VARIABLE_THEME])); |
$theme_selectionne = $_GET[PROJET_VARIABLE_THEME]; |
} else { |
$theme_selectionne = 0; |
} |
if ($this->_auth->getAuth()) { |
/** on recherche egalement le statut si l utilisateur est loggue */ |
$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)). |
' left join projet_statut on psu_id_statut=ps_id_statut'; |
$select = 'psu_id_statut, ps_statut_nom,'; |
} |
$requete = 'select '.$select.'p_id, p_titre, p_resume, pl_id_liste, plle_id_liste, p_avoir_document, ps_nombre_inscrit, ps_pourcent,'. |
' p_wikini, ps_doc_derniere_semaine, p_avoir_document, ps_nombre_inscrit_derniere_semaine, '. |
' ps_nombre_membre_yahoo, ps_msg_derniere_semaine, ps_modifwiki_derniere_semaine, p_en_dormance from'. |
' projet left join projet_lien_liste on p_id=pl_id_projet'. |
' left join projet_lien_liste_externe on p_id=plle_id_projet'. |
' left join projet_statistiques on p_id=ps_ce_projet and ps_dernier=1'. |
$from_recherche. |
$where_recherche. |
' group by p_id order by '.$tri.' '.$ordre_tri ; |
if ($ordre_tri == '') $ordre_tri = 'desc'; |
$resultat = $this->_db->query($requete) ; |
if (DB::isError($resultat)) { |
return ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ; |
} |
$nombre_resultat = $resultat->numRows(); |
/* Si l utilisateur est loggue, on recherche son statut par rapport aux projets */ |
if ($this->_auth->getAuth()) { |
$requete_statut = 'select psu_id_projet, psu_id_statut, ps_statut_nom from projet_statut_utilisateurs, projet_statut'. |
' where ps_id_statut=psu_id_statut and psu_id_utilisateur='.$this->_db->escapeSimple($this->_auth->getAuthData(PROJET_CHAMPS_ID)); |
$resultat_statut = $GLOBALS['projet_db']->query($requete_statut); |
while ($ligne_statut = $resultat_statut->fetchRow(DB_FETCHMODE_OBJECT)) { |
$tableau_statut[$ligne_statut->psu_id_projet]['id_statut'] = $ligne_statut->psu_id_statut; |
$tableau_statut[$ligne_statut->psu_id_projet]['nom_statut'] = $ligne_statut->ps_statut_nom; |
} |
} |
include_once PROJET_CHEMIN_BIBLIOTHEQUE_API.'pear/Pager/Pager.php'; |
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT)) { |
// Si le projet est en dormance, on ne l affiche pas dans le mode normal |
// Sauf si le theme choisit est "en dormance" |
if ($_SESSION['_PROJET_']['projet_affichage'] != 'expert' && $ligne->p_en_dormance == 1 && $theme_selectionne != 9) { |
} else { |
$donnees[] = $ligne; |
} |
} |
if ($_SESSION['_PROJET_']['projet_affichage'] == 'expert') $perpage = $nombre_resultat; else $perpage = 20; |
// Parametre du pager |
$params = array ( |
'mode' => 'Sliding', |
'perPage' => $perpage, |
'delta' => '5', |
'linkClass' => 'num_page', |
'curPageLinkClassName' => 'page_courante', |
'spacesBeforeSeparator' => 0, |
'spacesAfterSeparator' => 0, |
'separator' => '', |
'prevImg' => '<< Page précédente', |
'nextImg' => 'Page suivante >>', |
'extraVars' => array ('projet_recherche' => $_SESSION['_PROJET_']['motif_recherche'], |
PROJET_VARIABLE_MODE_AFFICHAGE => $_SESSION['_PROJET_']['projet_affichage']), |
'itemData' => $donnees |
); |
$pager = & Pager::factory($params); |
$links = $pager->getLinks(); |
$data = $pager->getPageData(); |
$nombre_projets = $pager->numItems(); |
$range = $pager->getOffsetByPageId(); |
// On inclue un fichier local |
if (file_exists(PROJET_CHEMIN_APPLI.'langues/pro_langues_fr.local.inc.php')) |
include_once PROJET_CHEMIN_APPLI.'langues/pro_langues_fr.local.inc.php' ; |
// On verifie si l'utilisateur participe a des projets |
$projetNonParticipantListe = & $projetListe ; |
$liste_projet = array() ; |
// La liste |
$tableau_donnees = array(); |
foreach ($data as $ligne) { |
$this->_url->addQueryString(PROJET_VARIABLE_ID_PROJET, $ligne->p_id) ; |
$tableau_donnees[$ligne->p_id]['lien'] = $this->_url->getURL(); |
$tableau_donnees[$ligne->p_id]['titre'] = $ligne->p_titre; |
$tableau_donnees[$ligne->p_id]['nombre_participants'] = $ligne->ps_nombre_inscrit; |
$tableau_donnees[$ligne->p_id]['resume'] = $ligne->p_resume; |
if ($_SESSION['_PROJET_']['projet_affichage'] == 'simple') { |
if ($ligne->ps_pourcent <33) { |
$tableau_donnees[$ligne->p_id]['activite'] = 'Peu actif'; |
$tableau_donnees[$ligne->p_id]['classe_projet_activite'] = 'projet_activite_faible'; |
} |
else if ($ligne->ps_pourcent < 66) { |
$tableau_donnees[$ligne->p_id]['activite'] = 'Assez actif'; |
$tableau_donnees[$ligne->p_id]['classe_projet_activite'] = 'projet_activite_moyenne'; |
} |
else if ($ligne->ps_pourcent <= 100) { |
$tableau_donnees[$ligne->p_id]['activite'] = 'Très actif'; |
$tableau_donnees[$ligne->p_id]['classe_projet_activite'] = 'projet_activite_elevee'; |
} |
} else { |
$tableau_donnees[$ligne->p_id]['activite'] = $ligne->ps_pourcent.'%'; |
} |
$res .= $ligne->p_resume ; |
$this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_ACTION_S_INSCRIRE); |
$res .= '(<a href="'.$this->_url->getURL().'">Rejoindre ce projet</a>)'."\n"; |
// Recherche du forum |
if ($ligne->pl_id_liste != null && $ligne->plle_id_liste == null) { |
$this->_url->addQueryString('act', PROJET_ACTION_VOIR_FORUM); |
$forum = '<a href="'.$this->_url->getURL().'"><img src="sites/commun/generique/images/favicones/tela_botanica.png" alt="Tela Botanica" /></a>'."\n"; |
$res .= $forum; |
} else { |
include_once PROJET_CHEMIN_CLASSES.'liste_externe.class.php' ; |
$listes_ext = new liste_externe ($this->_db) ; |
if ($ligne->plle_id_liste != null) { |
$info_liste = $listes_ext->getInfoListe($ligne->plle_id_liste) ; |
$forum = '<a href="'.$info_liste->AGO_A_URLGRP. |
'"><img src="sites/commun/generique/images/favicones/yahoo.png" alt="Yahoo"/></a>'; |
$tableau_donnees[$ligne->p_id]['nombre_participants'] = $ligne->ps_nombre_membre_yahoo; |
} else { |
$forum = '-'; |
} |
} |
if ($ligne->ps_msg_derniere_semaine != 0) { |
$tableau_donnees[$ligne->p_id]['nombre_message'] = $ligne->ps_msg_derniere_semaine; |
} else { |
$tableau_donnees[$ligne->p_id]['nombre_message'] = 0; |
} |
$tableau_donnees[$ligne->p_id]['forum'] = $forum; |
if ($ligne->p_wikini) { |
$this->_url->addQueryString ('act',PROJET_ACTION_VOIR_WIKINI); |
$link=$this->_url->getURL(); |
$wiki_res = '<a href="'.$link.'">voir</a>' ; |
if ($ligne->ps_modifwiki_derniere_semaine != 0) { |
$wiki_res .= ' <span title="Nouvelles contributions cette semaine"> ( +'.$ligne->ps_modifwiki_derniere_semaine.' )</span>'; |
} |
$this->_url->removeQueryString ('act'); |
} else { |
$wiki_res = '-' ; |
} |
$tableau_donnees[$ligne->p_id]['wikini'] = $wiki_res; |
$titre= '<a href="'.$this->_url->getURL().'">'.$ligne->p_titre.'</a>'; |
if ($ligne->p_avoir_document != 0) { |
$this->_url->addQueryString('act', PROJET_ACTION_VOIR_DOCUMENT) ; |
$document = '<a href="'.$this->_url->getURL().'">voir</a>' ; |
if ($ligne->ps_doc_derniere_semaine != 0) { |
$document .= ' <span title="Nouveaux documents cette semaine">( + '.$ligne->ps_doc_derniere_semaine.')</span>'; |
} |
} else { |
$document = '-' ; |
} |
$tableau_donnees[$ligne->p_id]['document'] = $document; |
if ($ligne->p_wikini) { |
$this->_url->addQueryString ('act',PROJET_ACTION_VOIR_WIKINI); |
$link=$this->_url->getURL(); |
$url_rss = PROJET_URL_WIKINI.$ligne->p_wikini.'/wakka.php?wiki=DerniersChangementsRss/xml'; |
//$this->_url->addQueryString('wiki', 'DerniersChangementsRSS/xml'); |
$wiki_rss = '<a href="'.$url_rss.'"><img src="sites/commun/generique/images/rss.gif" alt="rss"/></a>' ; |
//$this->_url->removeQueryString ('act'); |
//$this->_url->removeQueryString ('wiki'); |
} else { |
$wiki_rss = '-' ; |
} |
$tableau_donnees[$ligne->p_id]['wikini_rss'] = $wiki_rss; |
$this->_url->addQueryString ('act', PROJET_ACTION_VOIR_PARTICIPANT); |
$participant = '<a href="'.$this->_url->getURL().'">voir</a>' ; |
$tableau_donnees[$ligne->p_id]['lien_participants'] = $this->_url->getURL(); |
if ($ligne->ps_nombre_inscrit_derniere_semaine != 0) { |
$tableau_donnees[$ligne->p_id]['ps_nombre_inscrit_derniere_semaine'] = '<span title="Nouveaux inscrits cette semaine">( + '.$ligne->ps_nombre_inscrit_derniere_semaine.' )</span>'; |
} else { |
$tableau_donnees[$ligne->p_id]['ps_nombre_inscrit_derniere_semaine'] = ''; |
} |
$ligne_projet = array ( '', $titre, $forum, // le nom du projet |
$wiki_res, $wiki_rss,$document, $participant) ; |
$this->_url->removeQueryString(PROJET_VARIABLE_ACTION); |
array_push ($liste_projet, $ligne_projet) ; |
if ($loggue) { |
switch ($ligne->psu_id_statut) { |
case 1 : $icone_statut = 'etoile_rouge'; |
$tableau_donnees[$ligne->p_id]['id_statut'] = 3; |
break; |
case 2 : $icone_statut = 'etoile_verte'; |
$tableau_donnees[$ligne->p_id]['id_statut'] = 2; |
break; |
case 3 : $icone_statut = 'etoile_grise'; |
$tableau_donnees[$ligne->p_id]['id_statut'] = 1; |
break; |
default : $tableau_donnees[$ligne->p_id]['statut_icone'] = ''; |
$tableau_donnees[$ligne->p_id]['id_statut'] = 0; |
$icone_statut = false; |
} |
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.'" />'; |
} |
$res .= '</li>'."\n"; |
} |
$res .= '</ul>'."\n"; |
$this->_url->removeQueryString(PROJET_VARIABLE_ACTION) ; |
$this->_url->removeQueryString (PROJET_VARIABLE_ID_PROJET); |
// Correction bug tri par participant |
if ($_GET[PROJET_VARIABLE_TRI] == 'ps_nombre_inscrit') { |
foreach ($tableau_donnees as $key => $row) { |
$nombre_inscrit[$key] = $row['nombre_participants']; |
} |
if ($_GET[PROJET_VARIABLE_ORDRE_TRI] == 'asc') $flag = SORT_ASC ; else $flag = SORT_DESC ; |
array_multisort($nombre_inscrit, $flag, $tableau_donnees); |
} |
// Correction bug tri sur les statuts |
if ($_GET[PROJET_VARIABLE_TRI] == 'psu_id_statut') { |
foreach ($tableau_donnees as $key => $row) { |
$id_statut[$key] = $row['id_statut']; |
} |
if ($_GET[PROJET_VARIABLE_ORDRE_TRI] == 'asc') $flag = SORT_ASC ; else $flag = SORT_DESC ; |
array_multisort($id_statut, $flag, $tableau_donnees); |
} |
$pair = true; |
ob_start(); |
if ($_SESSION['_PROJET_']['projet_affichage'] == 'expert') { |
GEN_stockerFichierScript('jquery', 'api/js/jquery/jquery.js'); |
GEN_stockerFichierScript('animatedcollapse', 'api/js/jquery/animatedcollapse.js'); |
GEN_stockerCodeScript('animatedcollapse.addDiv(\'legende\', \'fade=1, height="100px"\');' ."\n". |
'animatedcollapse.init();' ."\n"); |
include_once PROJET_CHEMIN_CLASSES.'enteteColonneTriable.class.php'; |
foreach ($valeur_acceptable_tri as $var_tri) { |
$enteteTri[$var_tri] = new enteteColonneTriable($var_tri); |
$enteteTri[$var_tri]->setColonneCliquee($tri, PROJET_VARIABLE_TRI); |
$enteteTri[$var_tri]->setOrdre($ordre_tri, PROJET_VARIABLE_ORDRE_TRI); |
} |
$lien_tri_titre = $enteteTri['p_titre']->getLien($this->_url); |
$lien_tri_activite = $enteteTri['ps_pourcent']->getLien($this->_url); |
$lien_tri_participants = $enteteTri['ps_nombre_inscrit']->getLien($this->_url); |
$lien_tri_doc = $enteteTri['ps_doc_derniere_semaine']->getLien($this->_url); |
$lien_tri_statut = $enteteTri['psu_id_statut']->getLien($this->_url); |
include_once PROJET_CHEMIN_APPLI.'/squelettes/liste_projet_expert.tpl.html'; |
} else { |
include_once PROJET_CHEMIN_APPLI.'/squelettes/liste_projet.tpl.html'; |
} |
$res = ob_get_contents(); |
ob_end_clean(); |
// Nettoyage de l'url |
$this->_url->removeQueryString (PROJET_VARIABLE_ID_PROJET); |
$this->_url->removeQueryString (PROJET_VARIABLE_MODE_AFFICHAGE); |
$this->_url->removeQueryString (PROJET_VARIABLE_ORDRE_TRI); |
$this->_url->removeQueryString (PROJET_VARIABLE_TRI); |
return $res ; |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: not supported by cvs2svn $ |
* Revision 1.3 2008-09-16 14:07:40 alexandre_tb |
* suppression du bug intermittent sur le moteur de recherche |
* |
* Revision 1.2 2008-09-01 14:37:15 alexandre_tb |
* modification du tri par defaut |
* |
* Revision 1.1 2008-08-25 15:00:28 alexandre_tb |
* version initiale |
* |
* +-- Fin du code ----------------------------------------------------------------------------------------+ |
*/ |
<?php |
/*vim: set expandtab tabstop=4 shiftwidth=4: */ |
// +------------------------------------------------------------------------------------------------------+ |
// | PHP version 4.1 | |
// +------------------------------------------------------------------------------------------------------+ |
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) | |
// +------------------------------------------------------------------------------------------------------+ |
// | This library is free software; you can redistribute it and/or | |
// | modify it under the terms of the GNU General Public | |
// | License as published by the Free Software Foundation; either | |
// | version 2.1 of the License, or (at your option) any later version. | |
// | | |
// | This library is distributed in the hope that it will be useful, | |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
// | General Public License for more details. | |
// | | |
// | You should have received a copy of the GNU General Public | |
// | License along with this library; if not, write to the Free Software | |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
// +------------------------------------------------------------------------------------------------------+ |
// CVS : $Id: tela_ergo.php,v 1.2 2008-09-01 14:37:15 alexandre_tb Exp $ |
/** |
* Application projet |
* |
* Fichier de presentation de la liste des projets pour Tela Botanica nouvelle version |
* |
*@package projet |
//Auteur original : |
*@author Alexandre Granier <alexandre@tela-botanica.org> |
//Autres auteurs : |
*@author Aucun |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.2 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | ENTETE du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
define ('PROJET_VARIABLE_MODE_AFFICHAGE', 'projet_affichage'); |
define ('PROJET_VARIABLE_TRI', 'projet_tri'); |
define ('PROJET_VARIABLE_ORDRE_TRI', 'projet_ordre_tri'); |
define ('PROJET_VARIABLE_THEME', 'theme'); |
if (PROJET_UTILISE_TYPE && $this->_type != '') { |
$projetListe = projet::getProjetDuType($this->_type, $this->_db) ; |
if ($this->_presentation == 'arbre')array_push ($projetListe, projet::getProjetRacine($this->_db)) ; |
} else { |
// Un tableau de tous les projets dans $projetListe |
//$projetListe = projet::getTousLesProjets($this->_db, $this->_projet_exclu) ; |
} |
$_SESSION['_PROJET_']['motif_recherche'] = ''; |
$url = $this->_url->getURL(); |
$loggue = $this->_auth->getAuth(); |
// Verification sur l ordre de tri et mise en place |
// du tri par defaut sur le titre |
$valeur_acceptable_tri = array ('p_titre', 'ps_pourcent', 'ps_nombre_inscrit', 'ps_doc_derniere_semaine', 'psu_id_statut'); // Securite |
if (isset($_GET[PROJET_VARIABLE_TRI]) && $_GET[PROJET_VARIABLE_TRI] != '' && in_array($_GET[PROJET_VARIABLE_TRI], $valeur_acceptable_tri)) { |
$tri = $_GET[PROJET_VARIABLE_TRI]; |
} else { |
$tri = 'p_titre'; |
} |
$valeur_acceptable_ordre_tri = array ('asc', 'desc'); // securite |
if (isset($_GET[PROJET_VARIABLE_ORDRE_TRI]) && $_GET[PROJET_VARIABLE_ORDRE_TRI] != '' |
&& in_array ($_GET[PROJET_VARIABLE_ORDRE_TRI], $valeur_acceptable_ordre_tri)) { |
$ordre_tri = $_GET[PROJET_VARIABLE_ORDRE_TRI]; |
} else { |
$ordre_tri = ''; |
} |
// variable de session pour se rappeler des choix du visiteur |
if (!isset ($_GET[PROJET_VARIABLE_MODE_AFFICHAGE]) && isset($_SESSION['_PROJET_']['projet_affichage']) && ($_SESSION['_PROJET_']['projet_affichage'] == 'simple' || $_SESSION['_PROJET_']['projet_affichage'] == 'expert')) { |
$_GET[PROJET_VARIABLE_MODE_AFFICHAGE] = $_SESSION['_PROJET_']['projet_affichage']; |
} |
if (isset($_GET[PROJET_VARIABLE_MODE_AFFICHAGE]) && $_GET[PROJET_VARIABLE_MODE_AFFICHAGE] != '') { |
$_SESSION['_PROJET_']['projet_affichage'] = $_GET[PROJET_VARIABLE_MODE_AFFICHAGE]; |
if ($_SESSION['_PROJET_']['projet_affichage'] == 'expert') { |
$this->_url->addQueryString (PROJET_VARIABLE_MODE_AFFICHAGE, 'simple'); |
$lien_interface_simple = '[<a href="'.$this->_url->getURL().'">Affichage simple</a>]'; |
$this->_url->addQueryString (PROJET_VARIABLE_MODE_AFFICHAGE, 'expert'); |
$lien_interface_expert = ''; |
} else { |
$_SESSION['_PROJET_']['projet_affichage'] = 'simple'; |
$this->_url->addQueryString (PROJET_VARIABLE_MODE_AFFICHAGE, 'expert'); |
$lien_interface_simple = ''; |
$lien_interface_expert = '[<a href="'.$this->_url->getURL().'">Affichage expert</a>]'; |
} |
} else { |
$_SESSION['_PROJET_']['projet_affichage'] = 'simple'; |
$this->_url->addQueryString (PROJET_VARIABLE_MODE_AFFICHAGE, 'expert'); |
$lien_interface_simple = ''; |
$lien_interface_expert = '[<a href="'.$this->_url->getURL().'">Affichage expert</a>]'; |
} |
if ($_SESSION['_PROJET_']['projet_affichage'] != 'expert') { |
$ordre_tri = 'desc'; |
$tri = 'ps_pourcent'; |
} |
/** Affichage des themes de projets */ |
$requete_type = 'SELECT count( p_id ) AS nbe, pt_label_theme,pt_id_theme |
FROM projet, projet_avoir_theme, projet_theme |
WHERE p_id = pat_id_projet |
AND pat_id_theme = pt_id_theme and p_en_dormance=0 |
GROUP BY pt_id_theme'; |
$resultat_type = $GLOBALS['projet_db']->query($requete_type); |
if (DB::isError($resultat_type)) return $resultat_type->getMessage(); |
$tableau_theme = array(); |
$requete_nb_pj = 'select count(*) as nb from projet'; |
$nombre_total_projet = $GLOBALS['projet_db']->getOne($requete_nb_pj); |
// On ajoute le theme tous |
$tableau_theme[0]['label'] = 'Tous les projets'; |
$tableau_theme[0]['id'] = 0; |
$tableau_theme[0]['nombre_projet'] = $nombre_total_projet; |
$this->_url->removeQueryString(PROJET_VARIABLE_MODE_AFFICHAGE); |
$tableau_theme[0]['lien'] = $this->_url->getURL(); |
// Et le theme en dormance |
$requete_dormance = 'select count(p_id) as nb_p_dorman from projet where p_en_dormance=1'; |
$nb_p_dormant = $GLOBALS['projet_db']->getOne($requete_dormance); |
while ($ligne_type = $resultat_type->fetchRow(DB_FETCHMODE_OBJECT)) { |
$tableau_theme[$ligne_type->pt_id_theme]['label'] = $ligne_type->pt_label_theme; |
$tableau_theme[$ligne_type->pt_id_theme]['id'] = $ligne_type->pt_id_theme; |
$tableau_theme[$ligne_type->pt_id_theme]['nombre_projet'] = $ligne_type->nbe; |
$this->_url->addQueryString(PROJET_VARIABLE_THEME, $ligne_type->pt_id_theme); |
$tableau_theme[$ligne_type->pt_id_theme]['lien'] = $this->_url->getURL(); |
} |
$tableau_theme[9]['label'] = 'En dormance'; |
$tableau_theme[9]['id'] = 9; |
$tableau_theme[9]['nombre_projet'] = $nb_p_dormant; |
$this->_url->addQueryString(PROJET_VARIABLE_THEME, 9); |
$tableau_theme[9]['lien'] = $this->_url->getURL(); |
$this->_url->removeQueryString(PROJET_VARIABLE_THEME); |
// Contruction de la requete, soit avec le moteur de recherche |
// soit la liste des projets |
if (isset($_GET['projet_recherche']) && $_GET['projet_recherche'] != '') { |
$_SESSION['_PROJET_']['motif_recherche'] = $_GET['projet_recherche']; |
if (!isset($GLOBALS['_MOTEUR_RECHERCHE_']['bd']['papyrus'])) $GLOBALS['_MOTEUR_RECHERCHE_']['bd']['papyrus'] = $this->_db; |
include_once 'papyrus/applettes/moteur_recherche/bibliotheque/more_recherche.class.php'; |
include_once 'papyrus/applettes/moteur_recherche/bibliotheque/more_recherche_projet.class.php'; |
$moteur = new More_Recherche($_SESSION['_PROJET_']['motif_recherche']); |
$recherche_projet = new More_Recherche_Projet($_SESSION['_PROJET_']['motif_recherche']); |
$moteur->ajouterRecherche($recherche_projet); |
$resultats = $moteur->rechercherMotif(); |
// $chaine_id_projet contient une liste d identifiant separer par une virgule |
if (!empty($resultats)) { |
$chaine_id_projet = ''; |
foreach ($resultats as $projet) { |
$chaine_id_projet .= $projet['id'].','; |
} |
$chaine_id_projet = substr($chaine_id_projet, 0, -1); |
$where_recherche = ' where p_id in ('.$chaine_id_projet.')'; |
$valeur_projet_recherche = $_GET['projet_recherche']; |
} |
} else { |
$where_recherche = ''; |
$valeur_projet_recherche = ''; |
} |
$select = ''; |
$from_recherche = ''; |
if (isset($_GET[PROJET_VARIABLE_THEME])) { |
$from_recherche = ' left join projet_avoir_theme on pat_id_projet=p_id left join projet_theme on pat_id_theme=pt_id_theme'; |
$where_recherche = ' where pat_id_theme='.intval($_GET[PROJET_VARIABLE_THEME]); |
$theme_selectionne = $_GET[PROJET_VARIABLE_THEME]; |
} else { |
$theme_selectionne = 0; |
} |
if ($this->_auth->getAuth()) { |
/** on recherche egalement le statut si l utilisateur est loggue */ |
$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)). |
' left join projet_statut on psu_id_statut=ps_id_statut'; |
$select = 'psu_id_statut, ps_statut_nom,'; |
} |
if ($ordre_tri == '') $ordre_tri = 'desc'; |
$requete = 'select '.$select.'p_id, p_titre, p_resume, pl_id_liste, plle_id_liste, p_avoir_document, ps_nombre_inscrit, ps_pourcent,'. |
' p_wikini, ps_doc_derniere_semaine, p_avoir_document, ps_nombre_inscrit_derniere_semaine, '. |
' ps_nombre_membre_yahoo, ps_msg_derniere_semaine, ps_modifwiki_derniere_semaine, p_en_dormance from'. |
' projet left join projet_lien_liste on p_id=pl_id_projet'. |
' left join projet_lien_liste_externe on p_id=plle_id_projet'. |
' left join projet_statistiques on p_id=ps_ce_projet and ps_dernier=1'. |
$from_recherche. |
$where_recherche. |
' group by p_id order by '.$tri.' '.$ordre_tri ; |
$resultat = $this->_db->query($requete) ; |
if (DB::isError($resultat)) { |
return ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ; |
} |
$nombre_resultat = $resultat->numRows(); |
/* Si l utilisateur est loggue, on recherche son statut par rapport aux projets */ |
if ($this->_auth->getAuth()) { |
$requete_statut = 'select psu_id_projet, psu_id_statut, ps_statut_nom from projet_statut_utilisateurs, projet_statut'. |
' where ps_id_statut=psu_id_statut and psu_id_utilisateur='.$this->_db->escapeSimple($this->_auth->getAuthData(PROJET_CHAMPS_ID)); |
$resultat_statut = $GLOBALS['projet_db']->query($requete_statut); |
while ($ligne_statut = $resultat_statut->fetchRow(DB_FETCHMODE_OBJECT)) { |
$tableau_statut[$ligne_statut->psu_id_projet]['id_statut'] = $ligne_statut->psu_id_statut; |
$tableau_statut[$ligne_statut->psu_id_projet]['nom_statut'] = $ligne_statut->ps_statut_nom; |
} |
} |
include_once PROJET_CHEMIN_BIBLIOTHEQUE_API.'pear/Pager/Pager.php'; |
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT)) { |
// Si le projet est en dormance, on ne l affiche pas dans le mode normal |
// Sauf si le theme choisit est "en dormance" |
/*if ($_SESSION['_PROJET_']['projet_affichage'] != 'expert' && $ligne->p_en_dormance == 1 && $theme_selectionne != 9) { |
} else {*/ |
$donnees[] = $ligne; |
//} |
} |
if ($_SESSION['_PROJET_']['projet_affichage'] == 'expert') $perpage = $nombre_resultat; else $perpage = 20; |
// Parametre du pager |
$params = array ( |
'mode' => 'Sliding', |
'perPage' => $perpage, |
'delta' => '5', |
'linkClass' => 'num_page', |
'curPageLinkClassName' => 'page_courante', |
'spacesBeforeSeparator' => 0, |
'spacesAfterSeparator' => 0, |
'separator' => '', |
'prevImg' => '<< Page précédente', |
'nextImg' => 'Page suivante >>', |
'extraVars' => array ('projet_recherche' => $_SESSION['_PROJET_']['motif_recherche'], |
PROJET_VARIABLE_MODE_AFFICHAGE => $_SESSION['_PROJET_']['projet_affichage']), |
'itemData' => $donnees |
); |
$pager = & Pager::factory($params); |
$links = $pager->getLinks(); |
$data = $pager->getPageData(); |
$nombre_projets = $pager->numItems(); |
$range = $pager->getOffsetByPageId(); |
// On inclue un fichier local |
if (file_exists(PROJET_CHEMIN_APPLI.'langues/pro_langues_fr.local.inc.php')) |
include_once PROJET_CHEMIN_APPLI.'langues/pro_langues_fr.local.inc.php' ; |
// On verifie si l'utilisateur participe a des projets |
$projetNonParticipantListe = & $projetListe ; |
$liste_projet = array() ; |
// La liste |
$tableau_donnees = array(); |
foreach ($data as $ligne) { |
$this->_url->addQueryString(PROJET_VARIABLE_ID_PROJET, $ligne->p_id) ; |
$tableau_donnees[$ligne->p_id]['lien'] = $this->_url->getURL(); |
$tableau_donnees[$ligne->p_id]['titre'] = $ligne->p_titre; |
$tableau_donnees[$ligne->p_id]['nombre_participants'] = $ligne->ps_nombre_inscrit; |
$tableau_donnees[$ligne->p_id]['resume'] = $ligne->p_resume; |
if ($_SESSION['_PROJET_']['projet_affichage'] == 'simple') { |
if ($ligne->ps_pourcent <33) { |
$tableau_donnees[$ligne->p_id]['activite'] = 'Peu actif'; |
$tableau_donnees[$ligne->p_id]['classe_projet_activite'] = 'projet_activite_faible'; |
} |
else if ($ligne->ps_pourcent < 66) { |
$tableau_donnees[$ligne->p_id]['activite'] = 'Assez actif'; |
$tableau_donnees[$ligne->p_id]['classe_projet_activite'] = 'projet_activite_moyenne'; |
} |
else if ($ligne->ps_pourcent <= 100) { |
$tableau_donnees[$ligne->p_id]['activite'] = 'Très actif'; |
$tableau_donnees[$ligne->p_id]['classe_projet_activite'] = 'projet_activite_elevee'; |
} |
} else { |
$tableau_donnees[$ligne->p_id]['activite'] = $ligne->ps_pourcent.'%'; |
} |
$res .= $ligne->p_resume ; |
$this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_ACTION_S_INSCRIRE); |
$res .= '(<a href="'.$this->_url->getURL().'">Rejoindre ce projet</a>)'."\n"; |
// Recherche du forum |
if ($ligne->pl_id_liste != null && $ligne->plle_id_liste == null) { |
$this->_url->addQueryString('act', PROJET_ACTION_VOIR_FORUM); |
$forum = '<a href="'.$this->_url->getURL().'"><img src="sites/commun/generique/images/favicones/tela_botanica.png" alt="Tela Botanica" /></a>'."\n"; |
$res .= $forum; |
} else { |
include_once PROJET_CHEMIN_CLASSES.'liste_externe.class.php' ; |
$listes_ext = new liste_externe ($this->_db) ; |
if ($ligne->plle_id_liste != null) { |
$info_liste = $listes_ext->getInfoListe($ligne->plle_id_liste) ; |
$forum = '<a href="'.$info_liste->AGO_A_URLGRP. |
'"><img src="sites/commun/generique/images/favicones/yahoo.png" alt="Yahoo"/></a>'; |
$tableau_donnees[$ligne->p_id]['nombre_participants'] = $ligne->ps_nombre_membre_yahoo; |
} else { |
$forum = '-'; |
} |
} |
if ($ligne->ps_msg_derniere_semaine != 0) { |
$tableau_donnees[$ligne->p_id]['nombre_message'] = $ligne->ps_msg_derniere_semaine; |
} else { |
$tableau_donnees[$ligne->p_id]['nombre_message'] = 0; |
} |
$tableau_donnees[$ligne->p_id]['forum'] = $forum; |
if ($ligne->p_wikini) { |
$this->_url->addQueryString ('act',PROJET_ACTION_VOIR_WIKINI); |
$link=$this->_url->getURL(); |
$wiki_res = '<a href="'.$link.'">voir</a>' ; |
if ($ligne->ps_modifwiki_derniere_semaine != 0) { |
$wiki_res .= ' <span title="Nouvelles contributions cette semaine"> ( +'.$ligne->ps_modifwiki_derniere_semaine.' )</span>'; |
} |
$this->_url->removeQueryString ('act'); |
} else { |
$wiki_res = '-' ; |
} |
$tableau_donnees[$ligne->p_id]['wikini'] = $wiki_res; |
$titre= '<a href="'.$this->_url->getURL().'">'.$ligne->p_titre.'</a>'; |
if ($ligne->p_avoir_document != 0) { |
$this->_url->addQueryString('act', PROJET_ACTION_VOIR_DOCUMENT) ; |
$document = '<a href="'.$this->_url->getURL().'">voir</a>' ; |
if ($ligne->ps_doc_derniere_semaine != 0) { |
$document .= ' <span title="Nouveaux documents cette semaine">( + '.$ligne->ps_doc_derniere_semaine.')</span>'; |
} |
} else { |
$document = '-' ; |
} |
$tableau_donnees[$ligne->p_id]['document'] = $document; |
/*if ($ligne->p_wikini) { |
$this->_url->addQueryString ('act',PROJET_ACTION_VOIR_WIKINI); |
$link=$this->_url->getURL(); |
$this->_url->addQueryString('wiki', 'DerniersChangementsRSS/xml'); |
$wiki_rss = '<a href="'.$this->_url->getURL().'"><img src="sites/commun/generique/images/rss.gif" alt="rss"/></a>' ; |
$this->_url->removeQueryString ('act'); |
$this->_url->removeQueryString ('wiki'); |
} else { |
$wiki_rss = '-' ; |
}*/ |
if ($ligne->p_wikini) { |
$this->_url->addQueryString ('act',PROJET_ACTION_VOIR_WIKINI); |
$link=$this->_url->getURL(); |
$url_rss = PROJET_URL_WIKINI.$ligne->p_wikini.'/wakka.php?wiki=DerniersChangementsRss/xml'; |
//$this->_url->addQueryString('wiki', 'DerniersChangementsRSS/xml'); |
$wiki_rss = '<a href="'.$url_rss.'"><img src="sites/commun/generique/images/rss.gif" alt="rss"/></a>' ; |
//$this->_url->removeQueryString ('act'); |
//$this->_url->removeQueryString ('wiki'); |
} else { |
$wiki_rss = '-' ; |
} |
$tableau_donnees[$ligne->p_id]['wikini_rss'] = $wiki_rss; |
$this->_url->addQueryString ('act', PROJET_ACTION_VOIR_PARTICIPANT); |
$participant = '<a href="'.$this->_url->getURL().'">voir</a>' ; |
$tableau_donnees[$ligne->p_id]['lien_participants'] = $this->_url->getURL(); |
if ($ligne->ps_nombre_inscrit_derniere_semaine != 0) { |
$tableau_donnees[$ligne->p_id]['ps_nombre_inscrit_derniere_semaine'] = '<span title="Nouveaux inscrits cette semaine">( + '.$ligne->ps_nombre_inscrit_derniere_semaine.' )</span>'; |
} else { |
$tableau_donnees[$ligne->p_id]['ps_nombre_inscrit_derniere_semaine'] = ''; |
} |
$ligne_projet = array ( '', $titre, $forum, // le nom du projet |
$wiki_res, $wiki_rss,$document, $participant) ; |
$this->_url->removeQueryString(PROJET_VARIABLE_ACTION); |
array_push ($liste_projet, $ligne_projet) ; |
if ($loggue) { |
switch ($ligne->psu_id_statut) { |
case 1 : $icone_statut = 'etoile_rouge'; |
$tableau_donnees[$ligne->p_id]['id_statut'] = 3; |
break; |
case 2 : $icone_statut = 'etoile_verte'; |
$tableau_donnees[$ligne->p_id]['id_statut'] = 2; |
break; |
case 3 : $icone_statut = 'etoile_grise'; |
$tableau_donnees[$ligne->p_id]['id_statut'] = 1; |
break; |
default : $tableau_donnees[$ligne->p_id]['statut_icone'] = ''; |
$tableau_donnees[$ligne->p_id]['id_statut'] = 0; |
$icone_statut = false; |
} |
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.'" />'; |
} |
$res .= '</li>'."\n"; |
} |
$res .= '</ul>'."\n"; |
$this->_url->removeQueryString(PROJET_VARIABLE_ACTION) ; |
$this->_url->removeQueryString (PROJET_VARIABLE_ID_PROJET); |
// Correction bug tri par participant |
if ($_GET[PROJET_VARIABLE_TRI] == 'ps_nombre_inscrit') { |
foreach ($tableau_donnees as $key => $row) { |
$nombre_inscrit[$key] = $row['nombre_participants']; |
} |
if ($_GET[PROJET_VARIABLE_ORDRE_TRI] == 'asc') $flag = SORT_ASC ; else $flag = SORT_DESC ; |
array_multisort($nombre_inscrit, $flag, $tableau_donnees); |
} |
// Correction bug tri sur les statuts |
if ($_GET[PROJET_VARIABLE_TRI] == 'psu_id_statut') { |
foreach ($tableau_donnees as $key => $row) { |
$id_statut[$key] = $row['id_statut']; |
} |
if ($_GET[PROJET_VARIABLE_ORDRE_TRI] == 'asc') $flag = SORT_ASC ; else $flag = SORT_DESC ; |
array_multisort($id_statut, $flag, $tableau_donnees); |
} |
$pair = true; |
ob_start(); |
if ($_SESSION['_PROJET_']['projet_affichage'] == 'expert') { |
GEN_stockerFichierScript('jquery', 'api/js/jquery/jquery.js'); |
GEN_stockerFichierScript('animatedcollapse', 'api/js/jquery/animatedcollapse.js'); |
GEN_stockerCodeScript('animatedcollapse.addDiv(\'legende\', \'fade=1, height="100px"\');' ."\n". |
'animatedcollapse.init();' ."\n"); |
include_once PROJET_CHEMIN_CLASSES.'enteteColonneTriable.class.php'; |
foreach ($valeur_acceptable_tri as $var_tri) { |
$enteteTri[$var_tri] = new enteteColonneTriable($var_tri); |
$enteteTri[$var_tri]->setColonneCliquee($tri, PROJET_VARIABLE_TRI); |
$enteteTri[$var_tri]->setOrdre($ordre_tri, PROJET_VARIABLE_ORDRE_TRI); |
} |
$lien_tri_titre = $enteteTri['p_titre']->getLien($this->_url); |
$lien_tri_activite = $enteteTri['ps_pourcent']->getLien($this->_url); |
$lien_tri_participants = $enteteTri['ps_nombre_inscrit']->getLien($this->_url); |
$lien_tri_doc = $enteteTri['ps_doc_derniere_semaine']->getLien($this->_url); |
$lien_tri_statut = $enteteTri['psu_id_statut']->getLien($this->_url); |
include_once PROJET_CHEMIN_APPLI.'/squelettes/liste_projet_expert.tpl.html'; |
} else { |
include_once PROJET_CHEMIN_APPLI.'/squelettes/liste_projet.tpl.html'; |
} |
$res = ob_get_contents(); |
ob_end_clean(); |
// Nettoyage de l'url |
$this->_url->removeQueryString (PROJET_VARIABLE_ID_PROJET); |
$this->_url->removeQueryString (PROJET_VARIABLE_MODE_AFFICHAGE); |
$this->_url->removeQueryString (PROJET_VARIABLE_ORDRE_TRI); |
$this->_url->removeQueryString (PROJET_VARIABLE_TRI); |
return $res ; |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: tela_ergo.php,v $ |
* Revision 1.2 2008-09-01 14:37:15 alexandre_tb |
* modification du tri par defaut |
* |
* Revision 1.1 2008-08-25 15:00:28 alexandre_tb |
* version initiale |
* |
* +-- Fin du code ----------------------------------------------------------------------------------------+ |
*/ |
?> |
/trunk/presentation/tela.php |
---|
23,7 → 23,7 |
/** |
* Application projet |
* |
* Fichier de présentation de la liste des projets pour Tela Botanica |
* Fichier de pr�sentation de la liste des projets pour Tela Botanica |
* |
*@package projet |
//Auteur original : |
71,7 → 71,7 |
// On inclue un fichier local |
if (file_exists(PROJET_CHEMIN_APPLI.'langues/pro_langues_fr.local.inc.php')) |
include_once PROJET_CHEMIN_APPLI.'langues/pro_langues_fr.local.inc.php' ; |
// On vérifie si l'utilisateur participe à des projets |
// On v�rifie si l'utilisateur participe � des projets |
$projetNonParticipantListe = & $projetListe ; |
include_once PROJET_CHEMIN_CLASSES.'HTML_listeProjet.class.php' ; |
153,13 → 153,13 |
* |
* $Log: not supported by cvs2svn $ |
* Revision 1.6 2007-04-19 15:34:35 neiluj |
* préparration release (livraison) "Narmer" - v0.25 |
* pr�parration release (livraison) "Narmer" - v0.25 |
* |
* Revision 1.5.2.1 2007/04/11 14:24:39 alexandre_tb |
* amélioration des performances par l'appel d'une requete directe |
* am�lioration des performances par l'appel d'une requete directe |
* |
* Revision 1.5 2006/10/30 11:26:11 jp_milcent |
* Modification du cartouche concernant la création d'un projet sur Tela. |
* Modification du cartouche concernant la cr�ation d'un projet sur Tela. |
* |
* Revision 1.4 2006/01/09 21:55:19 ddelon |
* flux rss dans liste des projets |
/trunk/presentation/mes_projets.php |
---|
1,505 → 1,505 |
<?php |
/*vim: set expandtab tabstop=4 shiftwidth=4: */ |
// +------------------------------------------------------------------------------------------------------+ |
// | PHP version 4.1 | |
// +------------------------------------------------------------------------------------------------------+ |
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) | |
// +------------------------------------------------------------------------------------------------------+ |
// | This library is free software; you can redistribute it and/or | |
// | modify it under the terms of the GNU General Public | |
// | License as published by the Free Software Foundation; either | |
// | version 2.1 of the License, or (at your option) any later version. | |
// | | |
// | This library is distributed in the hope that it will be useful, | |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
// | General Public License for more details. | |
// | | |
// | You should have received a copy of the GNU General Public | |
// | License along with this library; if not, write to the Free Software | |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
// +------------------------------------------------------------------------------------------------------+ |
// CVS : $Id: mes_projets.php,v 1.1 2008-09-01 14:36:48 alexandre_tb Exp $ |
/** |
* Application projet |
* |
* Fichier de presentation de la liste des projets pour Tela Botanica nouvelle version |
* |
*@package projet |
//Auteur original : |
*@author Alexandre Granier <alexandre@tela-botanica.org> |
//Autres auteurs : |
*@author Aucun |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.1 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | ENTETE du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
define ('PROJET_VARIABLE_MODE_AFFICHAGE', 'projet_affichage'); |
define ('PROJET_VARIABLE_TRI', 'projet_tri'); |
define ('PROJET_VARIABLE_ORDRE_TRI', 'projet_ordre_tri'); |
define ('PROJET_VARIABLE_THEME', 'theme'); |
if (PROJET_UTILISE_TYPE && $this->_type != '') { |
$projetListe = projet::getProjetDuType($this->_type, $this->_db) ; |
if ($this->_presentation == 'arbre')array_push ($projetListe, projet::getProjetRacine($this->_db)) ; |
} else { |
// Un tableau de tous les projets dans $projetListe |
//$projetListe = projet::getTousLesProjets($this->_db, $this->_projet_exclu) ; |
} |
$_SESSION['_PROJET_']['motif_recherche'] = ''; |
$url = $this->_url->getURL(); |
$loggue = $this->_auth->getAuth(); |
// Verification sur l ordre de tri et mise en place |
// du tri par defaut sur le titre |
$valeur_acceptable_tri = array ('p_titre', 'ps_pourcent', 'ps_nombre_inscrit', 'ps_doc_derniere_semaine', 'psu_id_statut'); // Securite |
if (isset($_GET[PROJET_VARIABLE_TRI]) && $_GET[PROJET_VARIABLE_TRI] != '' && in_array($_GET[PROJET_VARIABLE_TRI], $valeur_acceptable_tri)) { |
$tri = $_GET[PROJET_VARIABLE_TRI]; |
} else { |
$tri = 'p_titre'; |
} |
$valeur_acceptable_ordre_tri = array ('asc', 'desc'); // securite |
if (isset($_GET[PROJET_VARIABLE_ORDRE_TRI]) && $_GET[PROJET_VARIABLE_ORDRE_TRI] != '' |
&& in_array ($_GET[PROJET_VARIABLE_ORDRE_TRI], $valeur_acceptable_ordre_tri)) { |
$ordre_tri = $_GET[PROJET_VARIABLE_ORDRE_TRI]; |
} else { |
$ordre_tri = ''; |
} |
// variable de session pour se rappeler des choix du visiteur |
if (!isset ($_GET[PROJET_VARIABLE_MODE_AFFICHAGE]) && isset($_SESSION['_PROJET_']['projet_affichage']) && ($_SESSION['_PROJET_']['projet_affichage'] == 'simple' || $_SESSION['_PROJET_']['projet_affichage'] == 'expert')) { |
$_GET[PROJET_VARIABLE_MODE_AFFICHAGE] = $_SESSION['_PROJET_']['projet_affichage']; |
} |
if (isset($_GET[PROJET_VARIABLE_MODE_AFFICHAGE]) && $_GET[PROJET_VARIABLE_MODE_AFFICHAGE] != '') { |
$_SESSION['_PROJET_']['projet_affichage'] = $_GET[PROJET_VARIABLE_MODE_AFFICHAGE]; |
if ($_SESSION['_PROJET_']['projet_affichage'] == 'expert') { |
$this->_url->addQueryString (PROJET_VARIABLE_MODE_AFFICHAGE, 'simple'); |
$lien_interface_simple = '[<a href="'.$this->_url->getURL().'">Affichage simple</a>]'; |
$this->_url->addQueryString (PROJET_VARIABLE_MODE_AFFICHAGE, 'expert'); |
$lien_interface_expert = ''; |
} else { |
$_SESSION['_PROJET_']['projet_affichage'] = 'simple'; |
$this->_url->addQueryString (PROJET_VARIABLE_MODE_AFFICHAGE, 'expert'); |
$lien_interface_simple = ''; |
$lien_interface_expert = '[<a href="'.$this->_url->getURL().'">Affichage expert</a>]'; |
} |
} else { |
$_SESSION['_PROJET_']['projet_affichage'] = 'simple'; |
$this->_url->addQueryString (PROJET_VARIABLE_MODE_AFFICHAGE, 'expert'); |
$lien_interface_simple = ''; |
$lien_interface_expert = '[<a href="'.$this->_url->getURL().'">Affichage expert</a>]'; |
} |
if ($_SESSION['_PROJET_']['projet_affichage'] != 'expert') { |
$ordre_tri = 'desc'; |
$tri = 'ps_pourcent'; |
} |
/** Affichage des themes de projets */ |
$requete_type = 'SELECT count( p_id ) AS nbe, pt_label_theme,pt_id_theme |
FROM projet, projet_avoir_theme, projet_theme |
WHERE p_id = pat_id_projet |
AND pat_id_theme = pt_id_theme and p_en_dormance=0 |
GROUP BY pt_id_theme'; |
$resultat_type = $GLOBALS['projet_db']->query($requete_type); |
if (DB::isError($resultat_type)) return $resultat_type->getMessage(); |
$tableau_theme = array(); |
$requete_nb_pj = 'select count(*) as nb from projet'; |
$nombre_total_projet = $GLOBALS['projet_db']->getOne($requete_nb_pj); |
// On ajoute le theme tous |
$tableau_theme[0]['label'] = 'Tous les projets'; |
$tableau_theme[0]['id'] = 0; |
$tableau_theme[0]['nombre_projet'] = $nombre_total_projet; |
$this->_url->removeQueryString(PROJET_VARIABLE_MODE_AFFICHAGE); |
$tableau_theme[0]['lien'] = $this->_url->getURL(); |
// Et le theme en dormance |
$requete_dormance = 'select count(p_id) as nb_p_dorman from projet where p_en_dormance=1'; |
$nb_p_dormant = $GLOBALS['projet_db']->getOne($requete_dormance); |
while ($ligne_type = $resultat_type->fetchRow(DB_FETCHMODE_OBJECT)) { |
$tableau_theme[$ligne_type->pt_id_theme]['label'] = $ligne_type->pt_label_theme; |
$tableau_theme[$ligne_type->pt_id_theme]['id'] = $ligne_type->pt_id_theme; |
$tableau_theme[$ligne_type->pt_id_theme]['nombre_projet'] = $ligne_type->nbe; |
$this->_url->addQueryString(PROJET_VARIABLE_THEME, $ligne_type->pt_id_theme); |
$tableau_theme[$ligne_type->pt_id_theme]['lien'] = $this->_url->getURL(); |
} |
$tableau_theme[9]['label'] = 'En dormance'; |
$tableau_theme[9]['id'] = 9; |
$tableau_theme[9]['nombre_projet'] = $nb_p_dormant; |
$this->_url->addQueryString(PROJET_VARIABLE_THEME, 9); |
$tableau_theme[9]['lien'] = $this->_url->getURL(); |
$this->_url->removeQueryString(PROJET_VARIABLE_THEME); |
// Contruction de la requete, soit avec le moteur de recherche |
// soit la liste des projets |
if (isset($_GET['projet_recherche']) && $_GET['projet_recherche'] != '') { |
$_SESSION['_PROJET_']['motif_recherche'] = $_GET['projet_recherche']; |
include_once 'papyrus/applettes/moteur_recherche/bibliotheque/more_recherche.class.php'; |
include_once 'papyrus/applettes/moteur_recherche/bibliotheque/more_recherche_projet.class.php'; |
$moteur = new More_Recherche($_SESSION['_PROJET_']['motif_recherche']); |
$recherche_projet = new More_Recherche_Projet($_SESSION['_PROJET_']['motif_recherche']); |
$moteur->ajouterRecherche($recherche_projet); |
$resultats = $moteur->rechercherMotif(); |
// $chaine_id_projet contient une liste d identifiant separer par une virgule |
if (!empty($resultats)) { |
$chaine_id_projet = ''; |
foreach ($resultats as $projet) { |
$chaine_id_projet .= $projet['id'].','; |
} |
$chaine_id_projet = substr($chaine_id_projet, 0, -1); |
$where_recherche = ' where p_id in ('.$chaine_id_projet.')'; |
$valeur_projet_recherche = $_GET['projet_recherche']; |
} |
} else { |
$where_recherche = ''; |
$valeur_projet_recherche = ''; |
} |
$select = ''; |
$from_recherche = ''; |
if (isset($_GET[PROJET_VARIABLE_THEME])) { |
$from_recherche = ' left join projet_avoir_theme on pat_id_projet=p_id left join projet_theme on pat_id_theme=pt_id_theme'; |
$where_recherche = ' where pat_id_theme='.$this->_db->escapeSimple($_GET[PROJET_VARIABLE_THEME]); |
$theme_selectionne = $_GET[PROJET_VARIABLE_THEME]; |
} else { |
$theme_selectionne = 0; |
} |
if ($this->_auth->getAuth()) { |
/** on recherche egalement le statut si l utilisateur est loggue */ |
// On recherche les projets auquels l utilisateur participe |
include_once PROJET_CHEMIN_CLASSES.'participe.class.php'; |
$participant = new participe ($this->_db); |
$tableau_projet = $participant->getInformationsUtilisateurs($this->_auth->getAuthData(PROJET_CHAMPS_ID)); |
$chaine_id_projet = ''; |
if (count ($tableau_projet) == 0) { |
return '<p class="information">Vous n\'êtes inscrit à aucun projet</p>'; |
} |
foreach ($tableau_projet as $projet) { |
$chaine_id_projet .= $projet[3].','; |
} |
$chaine_id_projet = substr($chaine_id_projet, 0, -1); |
$where_recherche .= ' where p_id in ('.$chaine_id_projet.')'; |
$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)). |
' left join projet_statut on psu_id_statut=ps_id_statut'; |
$select = 'psu_id_statut, ps_statut_nom,'; |
} |
$requete = 'select '.$select.'p_id, p_titre, p_resume, pl_id_liste, plle_id_liste, p_avoir_document, ps_nombre_inscrit, ps_pourcent,'. |
' p_wikini, ps_doc_derniere_semaine, p_avoir_document, ps_nombre_inscrit_derniere_semaine, '. |
' ps_nombre_membre_yahoo, ps_msg_derniere_semaine, ps_modifwiki_derniere_semaine, p_en_dormance from'. |
' projet left join projet_lien_liste on p_id=pl_id_projet'. |
' left join projet_lien_liste_externe on p_id=plle_id_projet'. |
' left join projet_statistiques on p_id=ps_ce_projet and ps_dernier=1'. |
$from_recherche. |
$where_recherche. |
' group by p_id order by '.$tri.' '.$ordre_tri ; |
if ($ordre_tri == '') { |
$ordre_tri = 'desc'; |
} |
$resultat = $this->_db->query($requete) ; |
if (DB::isError($resultat)) { |
return ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ; |
} |
$nombre_resultat = $resultat->numRows(); |
/* Si l utilisateur est loggue, on recherche son statut par rapport aux projets */ |
if ($this->_auth->getAuth()) { |
$requete_statut = 'select psu_id_projet, psu_id_statut, ps_statut_nom from projet_statut_utilisateurs, projet_statut'. |
' where ps_id_statut=psu_id_statut and psu_id_utilisateur='.$this->_db->escapeSimple($this->_auth->getAuthData(PROJET_CHAMPS_ID)); |
$resultat_statut = $GLOBALS['projet_db']->query($requete_statut); |
while ($ligne_statut = $resultat_statut->fetchRow(DB_FETCHMODE_OBJECT)) { |
$tableau_statut[$ligne_statut->psu_id_projet]['id_statut'] = $ligne_statut->psu_id_statut; |
$tableau_statut[$ligne_statut->psu_id_projet]['nom_statut'] = $ligne_statut->ps_statut_nom; |
} |
} |
include_once PROJET_CHEMIN_BIBLIOTHEQUE_API.'pear/Pager/Pager.php'; |
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT)) { |
// Si le projet est en dormance, on ne l affiche pas dans le mode normal |
// Sauf si le theme choisit est "en dormance" |
if ($_SESSION['_PROJET_']['projet_affichage'] != 'expert' && $ligne->p_en_dormance == 1 && $theme_selectionne != 9) { |
} else { |
$donnees[] = $ligne; |
} |
} |
if ($_SESSION['_PROJET_']['projet_affichage'] == 'expert') { |
$perpage = $nombre_resultat; |
} else { |
$perpage = 20; |
} |
// Parametre du pager |
$params = array ( |
'mode' => 'Sliding', |
'perPage' => $perpage, |
'delta' => '5', |
'linkClass' => 'num_page', |
'curPageLinkClassName' => 'page_courante', |
'spacesBeforeSeparator' => 0, |
'spacesAfterSeparator' => 0, |
'separator' => '', |
'prevImg' => '<< Page précédente', |
'nextImg' => 'Page suivante >>', |
'extraVars' => array ('projet_recherche' => $_SESSION['_PROJET_']['motif_recherche'], |
PROJET_VARIABLE_MODE_AFFICHAGE => $_SESSION['_PROJET_']['projet_affichage']), |
'itemData' => $donnees |
); |
$pager = & Pager::factory($params); |
$links = $pager->getLinks(); |
$data = $pager->getPageData(); |
$nombre_projets = $pager->numItems(); |
$range = $pager->getOffsetByPageId(); |
// On inclue un fichier local |
if (file_exists(PROJET_CHEMIN_APPLI.'langues/pro_langues_fr.local.inc.php')) |
include_once PROJET_CHEMIN_APPLI.'langues/pro_langues_fr.local.inc.php' ; |
// On verifie si l'utilisateur participe a des projets |
$projetNonParticipantListe = & $projetListe ; |
$liste_projet = array() ; |
// La liste |
$tableau_donnees = array(); |
foreach ($data as $ligne) { |
$this->_url->addQueryString(PROJET_VARIABLE_ID_PROJET, $ligne->p_id) ; |
$tableau_donnees[$ligne->p_id]['lien'] = $this->_url->getURL(); |
$tableau_donnees[$ligne->p_id]['titre'] = $ligne->p_titre; |
$tableau_donnees[$ligne->p_id]['nombre_participants'] = $ligne->ps_nombre_inscrit; |
$tableau_donnees[$ligne->p_id]['resume'] = $ligne->p_resume; |
if ($_SESSION['_PROJET_']['projet_affichage'] == 'simple') { |
if ($ligne->ps_pourcent < 33) { |
$tableau_donnees[$ligne->p_id]['activite'] = 'Peu actif'; |
$tableau_donnees[$ligne->p_id]['classe_projet_activite'] = 'projet_activite_faible'; |
} else if ($ligne->ps_pourcent < 66) { |
$tableau_donnees[$ligne->p_id]['activite'] = 'Assez actif'; |
$tableau_donnees[$ligne->p_id]['classe_projet_activite'] = 'projet_activite_moyenne'; |
} else if ($ligne->ps_pourcent <= 100) { |
$tableau_donnees[$ligne->p_id]['activite'] = 'Très actif'; |
$tableau_donnees[$ligne->p_id]['classe_projet_activite'] = 'projet_activite_elevee'; |
} |
} else { |
$tableau_donnees[$ligne->p_id]['activite'] = $ligne->ps_pourcent.'%'; |
} |
$res .= $ligne->p_resume ; |
$this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_ACTION_S_INSCRIRE); |
$res .= '(<a href="'.$this->_url->getURL().'">Rejoindre ce projet</a>)'."\n"; |
// Recherche du forum |
if ($ligne->pl_id_liste != null && $ligne->plle_id_liste == null) { |
$this->_url->addQueryString('act', PROJET_ACTION_VOIR_FORUM); |
$forum = '<a href="'.$this->_url->getURL().'"><img src="sites/commun/generique/images/favicones/tela_botanica.png" alt="Tela Botanica" /></a>'."\n"; |
$res .= $forum; |
} else { |
include_once PROJET_CHEMIN_CLASSES.'liste_externe.class.php' ; |
$listes_ext = new liste_externe ($this->_db) ; |
if ($ligne->plle_id_liste != null) { |
$info_liste = $listes_ext->getInfoListe($ligne->plle_id_liste) ; |
$forum = '<a href="'.$info_liste->AGO_A_URLGRP. |
'"><img src="sites/commun/generique/images/icones/yahoo.png" alt="Yahoo"/></a>'; |
$tableau_donnees[$ligne->p_id]['nombre_participants'] = $ligne->ps_nombre_membre_yahoo; |
} else { |
$forum = '-'; |
} |
} |
if ($ligne->ps_msg_derniere_semaine != 0) { |
$tableau_donnees[$ligne->p_id]['nombre_message'] = $ligne->ps_msg_derniere_semaine; |
} else { |
$tableau_donnees[$ligne->p_id]['nombre_message'] = 0; |
} |
$tableau_donnees[$ligne->p_id]['forum'] = $forum; |
if ($ligne->p_wikini) { |
$this->_url->addQueryString ('act',PROJET_ACTION_VOIR_WIKINI); |
$link=$this->_url->getURL(); |
$wiki_res = '<a href="'.$link.'">voir</a>' ; |
if ($ligne->ps_modifwiki_derniere_semaine != 0) { |
$wiki_res .= ' <span title="Nouvelles contributions cette semaine"> ( +'.$ligne->ps_modifwiki_derniere_semaine.' )</span>'; |
} |
$this->_url->removeQueryString ('act'); |
} else { |
$wiki_res = '-' ; |
} |
$tableau_donnees[$ligne->p_id]['wikini'] = $wiki_res; |
$titre = '<a href="'.$this->_url->getURL().'">'.$ligne->p_titre.'</a>'; |
if ($ligne->p_avoir_document != 0) { |
$this->_url->addQueryString('act', PROJET_ACTION_VOIR_DOCUMENT) ; |
$document = '<a href="'.$this->_url->getURL().'">voir</a>' ; |
if ($ligne->ps_doc_derniere_semaine != 0) { |
$document .= ' <span title="Nouveaux documents cette semaine">( + '.$ligne->ps_doc_derniere_semaine.')</span>'; |
} |
} else { |
$document = '-' ; |
} |
$tableau_donnees[$ligne->p_id]['document'] = $document; |
if ($ligne->p_wikini) { |
$this->_url->addQueryString ('act',PROJET_ACTION_VOIR_WIKINI); |
$link=$this->_url->getURL(); |
$this->_url->addQueryString('wiki', 'DerniersChangementsRSS/xml'); |
$wiki_rss = '<a href="'.$this->_url->getURL().'"><img src="sites/commun/generique/images/rss.gif" alt="rss"/></a>' ; |
$this->_url->removeQueryString ('act'); |
$this->_url->removeQueryString ('wiki'); |
} else { |
$wiki_rss = '-' ; |
} |
$tableau_donnees[$ligne->p_id]['wikini_rss'] = $wiki_rss; |
$this->_url->addQueryString ('act', PROJET_ACTION_VOIR_PARTICIPANT); |
$participant = '<a href="'.$this->_url->getURL().'">voir</a>' ; |
$tableau_donnees[$ligne->p_id]['lien_participants'] = $this->_url->getURL(); |
if ($ligne->ps_nombre_inscrit_derniere_semaine != 0) { |
$tableau_donnees[$ligne->p_id]['ps_nombre_inscrit_derniere_semaine'] = '<span title="Nouveaux inscrits cette semaine">( + '.$ligne->ps_nombre_inscrit_derniere_semaine.' )</span>'; |
} else { |
$tableau_donnees[$ligne->p_id]['ps_nombre_inscrit_derniere_semaine'] = ''; |
} |
$ligne_projet = array ( '', $titre, $forum, // le nom du projet |
$wiki_res, $wiki_rss,$document, $participant); |
$this->_url->removeQueryString(PROJET_VARIABLE_ACTION); |
array_push ($liste_projet, $ligne_projet) ; |
if ($loggue) { |
switch ($ligne->psu_id_statut) { |
case 1 : $icone_statut = 'etoile_rouge'; |
$tableau_donnees[$ligne->p_id]['id_statut'] = 3; |
break; |
case 2 : $icone_statut = 'etoile_verte'; |
$tableau_donnees[$ligne->p_id]['id_statut'] = 2; |
break; |
case 3 : $icone_statut = 'etoile_grise'; |
$tableau_donnees[$ligne->p_id]['id_statut'] = 1; |
break; |
default : |
$tableau_donnees[$ligne->p_id]['statut_icone'] = ''; |
$tableau_donnees[$ligne->p_id]['id_statut'] = 0; |
$icone_statut = false; |
} |
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.'" />'; |
} |
} |
$res .= '</li>'."\n"; |
} |
$res .= '</ul>'."\n"; |
$this->_url->removeQueryString(PROJET_VARIABLE_ACTION); |
$this->_url->removeQueryString (PROJET_VARIABLE_ID_PROJET); |
// Correction bug tri par participant |
if ($_GET[PROJET_VARIABLE_TRI] == 'ps_nombre_inscrit') { |
foreach ($tableau_donnees as $key => $row) { |
$nombre_inscrit[$key] = $row['nombre_participants']; |
} |
if ($_GET[PROJET_VARIABLE_ORDRE_TRI] == 'asc') { |
$flag = SORT_ASC ; |
} else { |
$flag = SORT_DESC ; |
} |
array_multisort($nombre_inscrit, $flag, $tableau_donnees); |
} |
// Correction bug tri sur les statuts |
if ($_GET[PROJET_VARIABLE_TRI] == 'psu_id_statut') { |
foreach ($tableau_donnees as $key => $row) { |
$id_statut[$key] = $row['id_statut']; |
} |
if ($_GET[PROJET_VARIABLE_ORDRE_TRI] == 'asc') { |
$flag = SORT_ASC ; |
} else { |
$flag = SORT_DESC ; |
} |
array_multisort($id_statut, $flag, $tableau_donnees); |
} |
$pair = true; |
ob_start(); |
if ($_SESSION['_PROJET_']['projet_affichage'] == 'expert') { |
GEN_stockerFichierScript('jquery', 'api/js/jquery/jquery.js'); |
GEN_stockerFichierScript('animatedcollapse', 'api/js/jquery/animatedcollapse.js'); |
GEN_stockerCodeScript('animatedcollapse.addDiv(\'legende\', \'fade=1, height="100px"\');' ."\n". |
'animatedcollapse.init();' ."\n"); |
include_once PROJET_CHEMIN_CLASSES.'enteteColonneTriable.class.php'; |
foreach ($valeur_acceptable_tri as $var_tri) { |
$enteteTri[$var_tri] = new enteteColonneTriable($var_tri); |
$enteteTri[$var_tri]->setColonneCliquee($tri, PROJET_VARIABLE_TRI); |
$enteteTri[$var_tri]->setOrdre($ordre_tri, PROJET_VARIABLE_ORDRE_TRI); |
} |
$lien_tri_titre = $enteteTri['p_titre']->getLien($this->_url); |
$lien_tri_activite = $enteteTri['ps_pourcent']->getLien($this->_url); |
$lien_tri_participants = $enteteTri['ps_nombre_inscrit']->getLien($this->_url); |
$lien_tri_doc = $enteteTri['ps_doc_derniere_semaine']->getLien($this->_url); |
$lien_tri_statut = $enteteTri['psu_id_statut']->getLien($this->_url); |
include_once PROJET_CHEMIN_APPLI.'/squelettes/liste_projet_expert.tpl.html'; |
} else { |
include_once PROJET_CHEMIN_APPLI.'/squelettes/mes_projets.tpl.html'; |
} |
$res = ob_get_contents(); |
ob_end_clean(); |
// Nettoyage de l'url |
$this->_url->removeQueryString(PROJET_VARIABLE_ID_PROJET); |
$this->_url->removeQueryString(PROJET_VARIABLE_MODE_AFFICHAGE); |
$this->_url->removeQueryString(PROJET_VARIABLE_ORDRE_TRI); |
$this->_url->removeQueryString(PROJET_VARIABLE_TRI); |
return $res; |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: mes_projets.php,v $ |
* Revision 1.1 2008-09-01 14:36:48 alexandre_tb |
* version intiale |
* sert a afficher les projets auquels on est inscrit |
* |
* Revision 1.1 2008-08-25 15:00:28 alexandre_tb |
* version initiale |
* |
* +-- Fin du code ----------------------------------------------------------------------------------------+ |
*/ |
?> |
<?php |
/*vim: set expandtab tabstop=4 shiftwidth=4: */ |
// +------------------------------------------------------------------------------------------------------+ |
// | PHP version 4.1 | |
// +------------------------------------------------------------------------------------------------------+ |
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) | |
// +------------------------------------------------------------------------------------------------------+ |
// | This library is free software; you can redistribute it and/or | |
// | modify it under the terms of the GNU General Public | |
// | License as published by the Free Software Foundation; either | |
// | version 2.1 of the License, or (at your option) any later version. | |
// | | |
// | This library is distributed in the hope that it will be useful, | |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
// | General Public License for more details. | |
// | | |
// | You should have received a copy of the GNU General Public | |
// | License along with this library; if not, write to the Free Software | |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
// +------------------------------------------------------------------------------------------------------+ |
// CVS : $Id: mes_projets.php,v 1.1 2008-09-01 14:36:48 alexandre_tb Exp $ |
/** |
* Application projet |
* |
* Fichier de presentation de la liste des projets pour Tela Botanica nouvelle version |
* |
*@package projet |
//Auteur original : |
*@author Alexandre Granier <alexandre@tela-botanica.org> |
//Autres auteurs : |
*@author Aucun |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.1 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | ENTETE du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
define ('PROJET_VARIABLE_MODE_AFFICHAGE', 'projet_affichage'); |
define ('PROJET_VARIABLE_TRI', 'projet_tri'); |
define ('PROJET_VARIABLE_ORDRE_TRI', 'projet_ordre_tri'); |
define ('PROJET_VARIABLE_THEME', 'theme'); |
if (PROJET_UTILISE_TYPE && $this->_type != '') { |
$projetListe = projet::getProjetDuType($this->_type, $this->_db) ; |
if ($this->_presentation == 'arbre')array_push ($projetListe, projet::getProjetRacine($this->_db)) ; |
} else { |
// Un tableau de tous les projets dans $projetListe |
//$projetListe = projet::getTousLesProjets($this->_db, $this->_projet_exclu) ; |
} |
$_SESSION['_PROJET_']['motif_recherche'] = ''; |
$url = $this->_url->getURL(); |
$loggue = $this->_auth->getAuth(); |
// Verification sur l ordre de tri et mise en place |
// du tri par defaut sur le titre |
$valeur_acceptable_tri = array ('p_titre', 'ps_pourcent', 'ps_nombre_inscrit', 'ps_doc_derniere_semaine', 'psu_id_statut'); // Securite |
if (isset($_GET[PROJET_VARIABLE_TRI]) && $_GET[PROJET_VARIABLE_TRI] != '' && in_array($_GET[PROJET_VARIABLE_TRI], $valeur_acceptable_tri)) { |
$tri = $_GET[PROJET_VARIABLE_TRI]; |
} else { |
$tri = 'p_titre'; |
} |
$valeur_acceptable_ordre_tri = array ('asc', 'desc'); // securite |
if (isset($_GET[PROJET_VARIABLE_ORDRE_TRI]) && $_GET[PROJET_VARIABLE_ORDRE_TRI] != '' |
&& in_array ($_GET[PROJET_VARIABLE_ORDRE_TRI], $valeur_acceptable_ordre_tri)) { |
$ordre_tri = $_GET[PROJET_VARIABLE_ORDRE_TRI]; |
} else { |
$ordre_tri = ''; |
} |
// variable de session pour se rappeler des choix du visiteur |
if (!isset ($_GET[PROJET_VARIABLE_MODE_AFFICHAGE]) && isset($_SESSION['_PROJET_']['projet_affichage']) && ($_SESSION['_PROJET_']['projet_affichage'] == 'simple' || $_SESSION['_PROJET_']['projet_affichage'] == 'expert')) { |
$_GET[PROJET_VARIABLE_MODE_AFFICHAGE] = $_SESSION['_PROJET_']['projet_affichage']; |
} |
if (isset($_GET[PROJET_VARIABLE_MODE_AFFICHAGE]) && $_GET[PROJET_VARIABLE_MODE_AFFICHAGE] != '') { |
$_SESSION['_PROJET_']['projet_affichage'] = $_GET[PROJET_VARIABLE_MODE_AFFICHAGE]; |
if ($_SESSION['_PROJET_']['projet_affichage'] == 'expert') { |
$this->_url->addQueryString (PROJET_VARIABLE_MODE_AFFICHAGE, 'simple'); |
$lien_interface_simple = '[<a href="'.$this->_url->getURL().'">Affichage simple</a>]'; |
$this->_url->addQueryString (PROJET_VARIABLE_MODE_AFFICHAGE, 'expert'); |
$lien_interface_expert = ''; |
} else { |
$_SESSION['_PROJET_']['projet_affichage'] = 'simple'; |
$this->_url->addQueryString (PROJET_VARIABLE_MODE_AFFICHAGE, 'expert'); |
$lien_interface_simple = ''; |
$lien_interface_expert = '[<a href="'.$this->_url->getURL().'">Affichage expert</a>]'; |
} |
} else { |
$_SESSION['_PROJET_']['projet_affichage'] = 'simple'; |
$this->_url->addQueryString (PROJET_VARIABLE_MODE_AFFICHAGE, 'expert'); |
$lien_interface_simple = ''; |
$lien_interface_expert = '[<a href="'.$this->_url->getURL().'">Affichage expert</a>]'; |
} |
if ($_SESSION['_PROJET_']['projet_affichage'] != 'expert') { |
$ordre_tri = 'desc'; |
$tri = 'ps_pourcent'; |
} |
/** Affichage des themes de projets */ |
$requete_type = 'SELECT count( p_id ) AS nbe, pt_label_theme,pt_id_theme |
FROM projet, projet_avoir_theme, projet_theme |
WHERE p_id = pat_id_projet |
AND pat_id_theme = pt_id_theme and p_en_dormance=0 |
GROUP BY pt_id_theme'; |
$resultat_type = $GLOBALS['projet_db']->query($requete_type); |
if (DB::isError($resultat_type)) return $resultat_type->getMessage(); |
$tableau_theme = array(); |
$requete_nb_pj = 'select count(*) as nb from projet'; |
$nombre_total_projet = $GLOBALS['projet_db']->getOne($requete_nb_pj); |
// On ajoute le theme tous |
$tableau_theme[0]['label'] = 'Tous les projets'; |
$tableau_theme[0]['id'] = 0; |
$tableau_theme[0]['nombre_projet'] = $nombre_total_projet; |
$this->_url->removeQueryString(PROJET_VARIABLE_MODE_AFFICHAGE); |
$tableau_theme[0]['lien'] = $this->_url->getURL(); |
// Et le theme en dormance |
$requete_dormance = 'select count(p_id) as nb_p_dorman from projet where p_en_dormance=1'; |
$nb_p_dormant = $GLOBALS['projet_db']->getOne($requete_dormance); |
while ($ligne_type = $resultat_type->fetchRow(DB_FETCHMODE_OBJECT)) { |
$tableau_theme[$ligne_type->pt_id_theme]['label'] = $ligne_type->pt_label_theme; |
$tableau_theme[$ligne_type->pt_id_theme]['id'] = $ligne_type->pt_id_theme; |
$tableau_theme[$ligne_type->pt_id_theme]['nombre_projet'] = $ligne_type->nbe; |
$this->_url->addQueryString(PROJET_VARIABLE_THEME, $ligne_type->pt_id_theme); |
$tableau_theme[$ligne_type->pt_id_theme]['lien'] = $this->_url->getURL(); |
} |
$tableau_theme[9]['label'] = 'En dormance'; |
$tableau_theme[9]['id'] = 9; |
$tableau_theme[9]['nombre_projet'] = $nb_p_dormant; |
$this->_url->addQueryString(PROJET_VARIABLE_THEME, 9); |
$tableau_theme[9]['lien'] = $this->_url->getURL(); |
$this->_url->removeQueryString(PROJET_VARIABLE_THEME); |
// Contruction de la requete, soit avec le moteur de recherche |
// soit la liste des projets |
if (isset($_GET['projet_recherche']) && $_GET['projet_recherche'] != '') { |
$_SESSION['_PROJET_']['motif_recherche'] = $_GET['projet_recherche']; |
include_once 'papyrus/applettes/moteur_recherche/bibliotheque/more_recherche.class.php'; |
include_once 'papyrus/applettes/moteur_recherche/bibliotheque/more_recherche_projet.class.php'; |
$moteur = new More_Recherche($_SESSION['_PROJET_']['motif_recherche']); |
$recherche_projet = new More_Recherche_Projet($_SESSION['_PROJET_']['motif_recherche']); |
$moteur->ajouterRecherche($recherche_projet); |
$resultats = $moteur->rechercherMotif(); |
// $chaine_id_projet contient une liste d identifiant separer par une virgule |
if (!empty($resultats)) { |
$chaine_id_projet = ''; |
foreach ($resultats as $projet) { |
$chaine_id_projet .= $projet['id'].','; |
} |
$chaine_id_projet = substr($chaine_id_projet, 0, -1); |
$where_recherche = ' where p_id in ('.$chaine_id_projet.')'; |
$valeur_projet_recherche = $_GET['projet_recherche']; |
} |
} else { |
$where_recherche = ''; |
$valeur_projet_recherche = ''; |
} |
$select = ''; |
$from_recherche = ''; |
if (isset($_GET[PROJET_VARIABLE_THEME])) { |
$from_recherche = ' left join projet_avoir_theme on pat_id_projet=p_id left join projet_theme on pat_id_theme=pt_id_theme'; |
$where_recherche = ' where pat_id_theme='.$this->_db->escapeSimple($_GET[PROJET_VARIABLE_THEME]); |
$theme_selectionne = $_GET[PROJET_VARIABLE_THEME]; |
} else { |
$theme_selectionne = 0; |
} |
if ($this->_auth->getAuth()) { |
/** on recherche egalement le statut si l utilisateur est loggue */ |
// On recherche les projets auquels l utilisateur participe |
include_once PROJET_CHEMIN_CLASSES.'participe.class.php'; |
$participant = new participe ($this->_db); |
$tableau_projet = $participant->getInformationsUtilisateurs($this->_auth->getAuthData(PROJET_CHAMPS_ID)); |
$chaine_id_projet = ''; |
if (count ($tableau_projet) == 0) { |
return '<p class="information">Vous n\'êtes inscrit à aucun projet</p>'; |
} |
foreach ($tableau_projet as $projet) { |
$chaine_id_projet .= $projet[3].','; |
} |
$chaine_id_projet = substr($chaine_id_projet, 0, -1); |
$where_recherche .= ' where p_id in ('.$chaine_id_projet.')'; |
$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)). |
' left join projet_statut on psu_id_statut=ps_id_statut'; |
$select = 'psu_id_statut, ps_statut_nom,'; |
} |
$requete = 'select '.$select.'p_id, p_titre, p_resume, pl_id_liste, plle_id_liste, p_avoir_document, ps_nombre_inscrit, ps_pourcent,'. |
' p_wikini, ps_doc_derniere_semaine, p_avoir_document, ps_nombre_inscrit_derniere_semaine, '. |
' ps_nombre_membre_yahoo, ps_msg_derniere_semaine, ps_modifwiki_derniere_semaine, p_en_dormance from'. |
' projet left join projet_lien_liste on p_id=pl_id_projet'. |
' left join projet_lien_liste_externe on p_id=plle_id_projet'. |
' left join projet_statistiques on p_id=ps_ce_projet and ps_dernier=1'. |
$from_recherche. |
$where_recherche. |
' group by p_id order by '.$tri.' '.$ordre_tri ; |
if ($ordre_tri == '') { |
$ordre_tri = 'desc'; |
} |
$resultat = $this->_db->query($requete) ; |
if (DB::isError($resultat)) { |
return ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ; |
} |
$nombre_resultat = $resultat->numRows(); |
/* Si l utilisateur est loggue, on recherche son statut par rapport aux projets */ |
if ($this->_auth->getAuth()) { |
$requete_statut = 'select psu_id_projet, psu_id_statut, ps_statut_nom from projet_statut_utilisateurs, projet_statut'. |
' where ps_id_statut=psu_id_statut and psu_id_utilisateur='.$this->_db->escapeSimple($this->_auth->getAuthData(PROJET_CHAMPS_ID)); |
$resultat_statut = $GLOBALS['projet_db']->query($requete_statut); |
while ($ligne_statut = $resultat_statut->fetchRow(DB_FETCHMODE_OBJECT)) { |
$tableau_statut[$ligne_statut->psu_id_projet]['id_statut'] = $ligne_statut->psu_id_statut; |
$tableau_statut[$ligne_statut->psu_id_projet]['nom_statut'] = $ligne_statut->ps_statut_nom; |
} |
} |
include_once PROJET_CHEMIN_BIBLIOTHEQUE_API.'pear/Pager/Pager.php'; |
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT)) { |
// Si le projet est en dormance, on ne l affiche pas dans le mode normal |
// Sauf si le theme choisit est "en dormance" |
if ($_SESSION['_PROJET_']['projet_affichage'] != 'expert' && $ligne->p_en_dormance == 1 && $theme_selectionne != 9) { |
} else { |
$donnees[] = $ligne; |
} |
} |
if ($_SESSION['_PROJET_']['projet_affichage'] == 'expert') { |
$perpage = $nombre_resultat; |
} else { |
$perpage = 20; |
} |
// Parametre du pager |
$params = array ( |
'mode' => 'Sliding', |
'perPage' => $perpage, |
'delta' => '5', |
'linkClass' => 'num_page', |
'curPageLinkClassName' => 'page_courante', |
'spacesBeforeSeparator' => 0, |
'spacesAfterSeparator' => 0, |
'separator' => '', |
'prevImg' => '<< Page précédente', |
'nextImg' => 'Page suivante >>', |
'extraVars' => array ('projet_recherche' => $_SESSION['_PROJET_']['motif_recherche'], |
PROJET_VARIABLE_MODE_AFFICHAGE => $_SESSION['_PROJET_']['projet_affichage']), |
'itemData' => $donnees |
); |
$pager = & Pager::factory($params); |
$links = $pager->getLinks(); |
$data = $pager->getPageData(); |
$nombre_projets = $pager->numItems(); |
$range = $pager->getOffsetByPageId(); |
// On inclue un fichier local |
if (file_exists(PROJET_CHEMIN_APPLI.'langues/pro_langues_fr.local.inc.php')) |
include_once PROJET_CHEMIN_APPLI.'langues/pro_langues_fr.local.inc.php' ; |
// On verifie si l'utilisateur participe a des projets |
$projetNonParticipantListe = & $projetListe ; |
$liste_projet = array() ; |
// La liste |
$tableau_donnees = array(); |
foreach ($data as $ligne) { |
$this->_url->addQueryString(PROJET_VARIABLE_ID_PROJET, $ligne->p_id) ; |
$tableau_donnees[$ligne->p_id]['lien'] = $this->_url->getURL(); |
$tableau_donnees[$ligne->p_id]['titre'] = $ligne->p_titre; |
$tableau_donnees[$ligne->p_id]['nombre_participants'] = $ligne->ps_nombre_inscrit; |
$tableau_donnees[$ligne->p_id]['resume'] = $ligne->p_resume; |
if ($_SESSION['_PROJET_']['projet_affichage'] == 'simple') { |
if ($ligne->ps_pourcent < 33) { |
$tableau_donnees[$ligne->p_id]['activite'] = 'Peu actif'; |
$tableau_donnees[$ligne->p_id]['classe_projet_activite'] = 'projet_activite_faible'; |
} else if ($ligne->ps_pourcent < 66) { |
$tableau_donnees[$ligne->p_id]['activite'] = 'Assez actif'; |
$tableau_donnees[$ligne->p_id]['classe_projet_activite'] = 'projet_activite_moyenne'; |
} else if ($ligne->ps_pourcent <= 100) { |
$tableau_donnees[$ligne->p_id]['activite'] = 'Très actif'; |
$tableau_donnees[$ligne->p_id]['classe_projet_activite'] = 'projet_activite_elevee'; |
} |
} else { |
$tableau_donnees[$ligne->p_id]['activite'] = $ligne->ps_pourcent.'%'; |
} |
$res .= $ligne->p_resume ; |
$this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_ACTION_S_INSCRIRE); |
$res .= '(<a href="'.$this->_url->getURL().'">Rejoindre ce projet</a>)'."\n"; |
// Recherche du forum |
if ($ligne->pl_id_liste != null && $ligne->plle_id_liste == null) { |
$this->_url->addQueryString('act', PROJET_ACTION_VOIR_FORUM); |
$forum = '<a href="'.$this->_url->getURL().'"><img src="sites/commun/generique/images/favicones/tela_botanica.png" alt="Tela Botanica" /></a>'."\n"; |
$res .= $forum; |
} else { |
include_once PROJET_CHEMIN_CLASSES.'liste_externe.class.php' ; |
$listes_ext = new liste_externe ($this->_db) ; |
if ($ligne->plle_id_liste != null) { |
$info_liste = $listes_ext->getInfoListe($ligne->plle_id_liste) ; |
$forum = '<a href="'.$info_liste->AGO_A_URLGRP. |
'"><img src="sites/commun/generique/images/icones/yahoo.png" alt="Yahoo"/></a>'; |
$tableau_donnees[$ligne->p_id]['nombre_participants'] = $ligne->ps_nombre_membre_yahoo; |
} else { |
$forum = '-'; |
} |
} |
if ($ligne->ps_msg_derniere_semaine != 0) { |
$tableau_donnees[$ligne->p_id]['nombre_message'] = $ligne->ps_msg_derniere_semaine; |
} else { |
$tableau_donnees[$ligne->p_id]['nombre_message'] = 0; |
} |
$tableau_donnees[$ligne->p_id]['forum'] = $forum; |
if ($ligne->p_wikini) { |
$this->_url->addQueryString ('act',PROJET_ACTION_VOIR_WIKINI); |
$link=$this->_url->getURL(); |
$wiki_res = '<a href="'.$link.'">voir</a>' ; |
if ($ligne->ps_modifwiki_derniere_semaine != 0) { |
$wiki_res .= ' <span title="Nouvelles contributions cette semaine"> ( +'.$ligne->ps_modifwiki_derniere_semaine.' )</span>'; |
} |
$this->_url->removeQueryString ('act'); |
} else { |
$wiki_res = '-' ; |
} |
$tableau_donnees[$ligne->p_id]['wikini'] = $wiki_res; |
$titre = '<a href="'.$this->_url->getURL().'">'.$ligne->p_titre.'</a>'; |
if ($ligne->p_avoir_document != 0) { |
$this->_url->addQueryString('act', PROJET_ACTION_VOIR_DOCUMENT) ; |
$document = '<a href="'.$this->_url->getURL().'">voir</a>' ; |
if ($ligne->ps_doc_derniere_semaine != 0) { |
$document .= ' <span title="Nouveaux documents cette semaine">( + '.$ligne->ps_doc_derniere_semaine.')</span>'; |
} |
} else { |
$document = '-' ; |
} |
$tableau_donnees[$ligne->p_id]['document'] = $document; |
if ($ligne->p_wikini) { |
$this->_url->addQueryString ('act',PROJET_ACTION_VOIR_WIKINI); |
$link=$this->_url->getURL(); |
$this->_url->addQueryString('wiki', 'DerniersChangementsRSS/xml'); |
$wiki_rss = '<a href="'.$this->_url->getURL().'"><img src="sites/commun/generique/images/rss.gif" alt="rss"/></a>' ; |
$this->_url->removeQueryString ('act'); |
$this->_url->removeQueryString ('wiki'); |
} else { |
$wiki_rss = '-' ; |
} |
$tableau_donnees[$ligne->p_id]['wikini_rss'] = $wiki_rss; |
$this->_url->addQueryString ('act', PROJET_ACTION_VOIR_PARTICIPANT); |
$participant = '<a href="'.$this->_url->getURL().'">voir</a>' ; |
$tableau_donnees[$ligne->p_id]['lien_participants'] = $this->_url->getURL(); |
if ($ligne->ps_nombre_inscrit_derniere_semaine != 0) { |
$tableau_donnees[$ligne->p_id]['ps_nombre_inscrit_derniere_semaine'] = '<span title="Nouveaux inscrits cette semaine">( + '.$ligne->ps_nombre_inscrit_derniere_semaine.' )</span>'; |
} else { |
$tableau_donnees[$ligne->p_id]['ps_nombre_inscrit_derniere_semaine'] = ''; |
} |
$ligne_projet = array ( '', $titre, $forum, // le nom du projet |
$wiki_res, $wiki_rss,$document, $participant); |
$this->_url->removeQueryString(PROJET_VARIABLE_ACTION); |
array_push ($liste_projet, $ligne_projet) ; |
if ($loggue) { |
switch ($ligne->psu_id_statut) { |
case 1 : $icone_statut = 'etoile_rouge'; |
$tableau_donnees[$ligne->p_id]['id_statut'] = 3; |
break; |
case 2 : $icone_statut = 'etoile_verte'; |
$tableau_donnees[$ligne->p_id]['id_statut'] = 2; |
break; |
case 3 : $icone_statut = 'etoile_grise'; |
$tableau_donnees[$ligne->p_id]['id_statut'] = 1; |
break; |
default : |
$tableau_donnees[$ligne->p_id]['statut_icone'] = ''; |
$tableau_donnees[$ligne->p_id]['id_statut'] = 0; |
$icone_statut = false; |
} |
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.'" />'; |
} |
} |
$res .= '</li>'."\n"; |
} |
$res .= '</ul>'."\n"; |
$this->_url->removeQueryString(PROJET_VARIABLE_ACTION); |
$this->_url->removeQueryString (PROJET_VARIABLE_ID_PROJET); |
// Correction bug tri par participant |
if ($_GET[PROJET_VARIABLE_TRI] == 'ps_nombre_inscrit') { |
foreach ($tableau_donnees as $key => $row) { |
$nombre_inscrit[$key] = $row['nombre_participants']; |
} |
if ($_GET[PROJET_VARIABLE_ORDRE_TRI] == 'asc') { |
$flag = SORT_ASC ; |
} else { |
$flag = SORT_DESC ; |
} |
array_multisort($nombre_inscrit, $flag, $tableau_donnees); |
} |
// Correction bug tri sur les statuts |
if ($_GET[PROJET_VARIABLE_TRI] == 'psu_id_statut') { |
foreach ($tableau_donnees as $key => $row) { |
$id_statut[$key] = $row['id_statut']; |
} |
if ($_GET[PROJET_VARIABLE_ORDRE_TRI] == 'asc') { |
$flag = SORT_ASC ; |
} else { |
$flag = SORT_DESC ; |
} |
array_multisort($id_statut, $flag, $tableau_donnees); |
} |
$pair = true; |
ob_start(); |
if ($_SESSION['_PROJET_']['projet_affichage'] == 'expert') { |
GEN_stockerFichierScript('jquery', 'api/js/jquery/jquery.js'); |
GEN_stockerFichierScript('animatedcollapse', 'api/js/jquery/animatedcollapse.js'); |
GEN_stockerCodeScript('animatedcollapse.addDiv(\'legende\', \'fade=1, height="100px"\');' ."\n". |
'animatedcollapse.init();' ."\n"); |
include_once PROJET_CHEMIN_CLASSES.'enteteColonneTriable.class.php'; |
foreach ($valeur_acceptable_tri as $var_tri) { |
$enteteTri[$var_tri] = new enteteColonneTriable($var_tri); |
$enteteTri[$var_tri]->setColonneCliquee($tri, PROJET_VARIABLE_TRI); |
$enteteTri[$var_tri]->setOrdre($ordre_tri, PROJET_VARIABLE_ORDRE_TRI); |
} |
$lien_tri_titre = $enteteTri['p_titre']->getLien($this->_url); |
$lien_tri_activite = $enteteTri['ps_pourcent']->getLien($this->_url); |
$lien_tri_participants = $enteteTri['ps_nombre_inscrit']->getLien($this->_url); |
$lien_tri_doc = $enteteTri['ps_doc_derniere_semaine']->getLien($this->_url); |
$lien_tri_statut = $enteteTri['psu_id_statut']->getLien($this->_url); |
include_once PROJET_CHEMIN_APPLI.'/squelettes/liste_projet_expert.tpl.html'; |
} else { |
include_once PROJET_CHEMIN_APPLI.'/squelettes/mes_projets.tpl.html'; |
} |
$res = ob_get_contents(); |
ob_end_clean(); |
// Nettoyage de l'url |
$this->_url->removeQueryString(PROJET_VARIABLE_ID_PROJET); |
$this->_url->removeQueryString(PROJET_VARIABLE_MODE_AFFICHAGE); |
$this->_url->removeQueryString(PROJET_VARIABLE_ORDRE_TRI); |
$this->_url->removeQueryString(PROJET_VARIABLE_TRI); |
return $res; |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: mes_projets.php,v $ |
* Revision 1.1 2008-09-01 14:36:48 alexandre_tb |
* version intiale |
* sert a afficher les projets auquels on est inscrit |
* |
* Revision 1.1 2008-08-25 15:00:28 alexandre_tb |
* version initiale |
* |
* +-- Fin du code ----------------------------------------------------------------------------------------+ |
*/ |
?> |
/trunk/presentation/arbre.php |
---|
19,11 → 19,11 |
// | License along with this library; if not, write to the Free Software | |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
// +------------------------------------------------------------------------------------------------------+ |
// CVS : $Id: arbre.php,v 1.3 2007-04-19 15:34:35 neiluj Exp $ |
// CVS : $Id:$ |
/** |
* Application projet |
* |
* Fichier de présentation de la liste des projets par arbre |
* Fichier de pr�sentation de la liste des projets par arbre |
* |
*@package projet |
//Auteur original : |
31,7 → 31,7 |
//Autres auteurs : |
*@author Aucun |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.3 $ |
*@version $Revision:$ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
39,17 → 39,17 |
// | ENTETE du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
// ON est dans la méthode mesProjets() de la classe projetControleur |
// ON est dans la m�thode mesProjets() de la classe projetControleur |
$titre = '<h1>Arbre des Projets</h1>'."\n" ; |
if (PROJET_UTILISE_TYPE && $this->_type != '') { |
/*if (PROJET_UTILISE_TYPE && $this->_type != '') { |
$projetListe = projet::getProjetDuType($this->_type, $this->_db) ; |
if ($this->_presentation == 'arbre')array_push ($projetListe, projet::getProjetRacine($this->_db)) ; |
} else { |
// Un tableau de tous les projets dans $projetListe |
$projetListe = projet::getTousLesProjets($this->_db, $this->_projet_exclu) ; |
} |
}*/ |
include_once PROJET_CHEMIN_API_ARBRE.'arbre.class.php' ; |
// initialisation de variables |
73,20 → 73,11 |
$lien_feuille, $lien_feuille, $intensite_feuille, $longueur_branche) ; |
} |
} |
return $titre.'<table id="arbre">'.$cime.$arbre->affBranche().$arbre->affRacine().'</table>'; |
return $titre.'<table>'.$cime.$arbre->affBranche().$arbre->affRacine().'</table>'; |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: not supported by cvs2svn $ |
* Revision 1.2.2.1 2007/04/11 14:26:00 alexandre_tb |
* ajout d'un include de projet.class.php et participe.class.php pour limiter le nombre de fichier inclu par projetControleur.class.php |
* |
* Revision 1.2 2006/03/02 16:07:17 alexandre_tb |
* ajout d'un id pour l'arbre |
* |
* Revision 1.1 2005/11/25 14:47:51 alexandre_tb |
* version initiale |
* |
* $Log:$ |
* |
* |