//Autres auteurs : *@author Aucun *@copyright Tela-Botanica 2000-2004 *@version $Revision: 1.8 $ // +------------------------------------------------------------------------------------------------------+ */ // +------------------------------------------------------------------------------------------------------+ // | ENTETE du PROGRAMME | // +------------------------------------------------------------------------------------------------------+ $titre = '

'.PROJET_LISTE.'

'."\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(), ''.$projet->getTitre().'' ) ; if ($auth) { $this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_DESINSCRIPTION_PROJET) ; array_push ($ligne_tableau, ''.PROJET_SE_DESINSCRIRE.'') ; 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 .= '

'.PROJET_PARTICIPER.'

'; $res .= $HTML_projetListe->toHTML() ; } } else { $res .= '

'.PROJET_INSCRIT_AUCUN_PROJET.'

' ; } } // Un texte pour ceux qui ne sont pas identifi�s if (!$auth) { $res .= '

'.PROJET_TEXTE_NON_IDENTIFIE.'

'."\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(), ''.$projet->getTitre().'' // le nom du projet ) ; $this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_ACTION_S_INSCRIRE) ; array_push ($ligne_projet, ''.PROJET_S_INSCRIRE.'') ; $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(), ''.$projet->getTitre().'', // 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 .= '

'.PROJET_TOUS_LES_PROJETS.'

' ; $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 ----------------------------------------------------------------------------------------+ */ ?>