Subversion Repositories Applications.projet

Compare Revisions

Ignore whitespace Rev 208 → Rev 211

/tags/Racine_livraison_narmer/presentation/tela.php
New file
0,0 → 1,179
<?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.php,v 1.6 2007-04-19 15:34:35 neiluj Exp $
/**
* Application projet
*
* Fichier de présentation de la liste des projets pour Tela Botanica
*
*@package projet
//Auteur original :
*@author Alexandre Granier <alexandre@tela-botanica.org>
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.6 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
define ('PROJET_LISTE_RESUME', false) ;
 
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) ;
}
 
 
// requete pour recuperer la liste des projets
$requete = 'select p_id, p_titre, p_wikini, pl_id_liste, plle_id_liste, p_avoir_document 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'.
' group by p_id order by p_titre' ;
$resultat = $this->_db->query($requete) ;
if (DB::isError($resultat)) {
return ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ;
}
$res = '<h1>Liste des projets et forums de Tela Botanica</h1>'."\n" ;
// Ajout du cartouche résumant la création d'un projet.
$res .= '<div class="notes">
<h4>Cràez votre projet...</h4>
<p class="last"> Toute personne inscrite au réseau Tela Botanica peut demander à créer un forum de discussion ou monter un projet collaboratif. <br />
<a href="http://www.tela-botanica.org/page:creez_votre_projet">Voir la démarche en détail</a></p>
</div>';
// 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
 
$projetNonParticipantListe = & $projetListe ;
include_once PROJET_CHEMIN_CLASSES.'HTML_listeProjet.class.php' ;
$HTML_projetNonParticipantListe = new HTML_listeProjet(true) ;
$entete_liste = array ('Titre des projets et des forums', 'Forums', 'Wiki','RSS', 'Documents', 'Participants',) ;
$HTML_projetNonParticipantListe->construitEntete($entete_liste) ;
 
$liste_projet = array() ;
// La liste
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT)) {
$this->_url->addQueryString(PROJET_VARIABLE_ID_PROJET, $ligne->p_id) ;
// Recherche du forum
if ($ligne->pl_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>';
} 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>';
} else {
$forum = '-';
}
}
if ($ligne->p_wikini) {
$this->_url->addQueryString ('act',PROJET_ACTION_VOIR_WIKINI);
$link=$this->_url->getURL();
$wiki_res = '<a href="'.$link.'">voir</a>' ;
$this->_url->removeQueryString ('act');
} else {
$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>' ;
} else {
$document = '-' ;
}
if ($ligne->p_wikini) {
$this->_url->addQueryString ('act',PROJET_ACTION_VOIR_WIKINI);
$link=$this->_url->getURL();
$wiki_rss = '<a href="'.$link.'&wiki=DerniersChangementsRSS/xml'.'"><img src="sites/commun/generique/images/rss.gif" alt="rss"/></a>' ;
$this->_url->removeQueryString ('act');
} else {
$wiki_rss = '-' ;
}
$this->_url->addQueryString ('act', PROJET_ACTION_VOIR_PARTICIPANT);
$participant = '<a href="'.$this->_url->getURL().'">voir</a>' ;
$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) ;
}
$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
$this->_url->removeQueryString (PROJET_VARIABLE_ID_PROJET);
return $res ;
 
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.5.2.1 2007/04/11 14:24:39 alexandre_tb
* 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.
*
* Revision 1.4 2006/01/09 21:55:19 ddelon
* flux rss dans liste des projets
*
* Revision 1.3 2005/12/07 11:02:35 jp_milcent
* Ajout d'attribut alt aux images.
*
* Revision 1.2 2005/11/28 11:15:22 alexandre_tb
* nettoyage URL en sortie de programme
*
* Revision 1.1 2005/11/25 14:47:51 alexandre_tb
* version initiale
*
 
*
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
 
 
?>
/tags/Racine_livraison_narmer/presentation/arbre.php
New file
0,0 → 1,97
<?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: arbre.php,v 1.3 2007-04-19 15:34:35 neiluj Exp $
/**
* Application projet
*
* Fichier de présentation de la liste des projets par arbre
*
*@package projet
//Auteur original :
*@author Alexandre Granier <alexandre@tela-botanica.org>
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.3 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
// ON est dans la méthode mesProjets() de la classe projetControleur
 
$titre = '<h1>Arbre des Projets</h1>'."\n" ;
 
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
$intensite_feuille = '' ; $longueur_branche = '' ;
$arbre = new arbre() ;
// recherche du projet principal
 
$cime='';
 
foreach ($projetListe as $projet) {
$this->_url->addQueryString (PROJET_VARIABLE_ID_PROJET, $projet->getId()) ;
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_VOIR_PARTICIPANT) ;
$lien_feuille = $this->_url->getURL() ;
$this->_url->removeQueryString(PROJET_VARIABLE_ACTION) ;
 
if ($projet->isRacine()) {
$cime = $arbre->cime($projet->getTitre(), $this->_url->getURL(), $projet->getNombreInscrits(), $lien_feuille, '') ;
} else {
 
$arbre->addBranche($projet->getTitre(), $this->_url->getURL(), $projet->getNombreInscrits(),
$lien_feuille, $lien_feuille, $intensite_feuille, $longueur_branche) ;
}
}
return $titre.'<table id="arbre">'.$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
*
 
*
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
 
 
?>
/tags/Racine_livraison_narmer/presentation/liste.php
New file
0,0 → 1,252
<?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.6 2007-04-19 15:34:35 neiluj 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.6 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | 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 vérifie si l'utilisateur participe à 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 à 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 où l'utilisateur ne participe pas.
// Et si pas logué 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]) ;
}
 
$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.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 ----------------------------------------------------------------------------------------+
*/
 
 
?>