1 |
<?php
|
1 |
<?php
|
2 |
/*vim: set expandtab tabstop=4 shiftwidth=4: */
|
2 |
/*vim: set expandtab tabstop=4 shiftwidth=4: */
|
3 |
// +------------------------------------------------------------------------------------------------------+
|
3 |
// +------------------------------------------------------------------------------------------------------+
|
4 |
// | PHP version 4.1 |
|
4 |
// | PHP version 4.1 |
|
5 |
// +------------------------------------------------------------------------------------------------------+
|
5 |
// +------------------------------------------------------------------------------------------------------+
|
6 |
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
|
6 |
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
|
7 |
// +------------------------------------------------------------------------------------------------------+
|
7 |
// +------------------------------------------------------------------------------------------------------+
|
8 |
// | This library is free software; you can redistribute it and/or |
|
8 |
// | This library is free software; you can redistribute it and/or |
|
9 |
// | modify it under the terms of the GNU General Public |
|
9 |
// | modify it under the terms of the GNU General Public |
|
10 |
// | License as published by the Free Software Foundation; either |
|
10 |
// | License as published by the Free Software Foundation; either |
|
11 |
// | version 2.1 of the License, or (at your option) any later version. |
|
11 |
// | version 2.1 of the License, or (at your option) any later version. |
|
12 |
// | |
|
12 |
// | |
|
13 |
// | This library is distributed in the hope that it will be useful, |
|
13 |
// | This library is distributed in the hope that it will be useful, |
|
14 |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
14 |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
15 |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
15 |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
16 |
// | General Public License for more details. |
|
16 |
// | General Public License for more details. |
|
17 |
// | |
|
17 |
// | |
|
18 |
// | You should have received a copy of the GNU General Public |
|
18 |
// | You should have received a copy of the GNU General Public |
|
19 |
// | License along with this library; if not, write to the Free Software |
|
19 |
// | License along with this library; if not, write to the Free Software |
|
20 |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
20 |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
21 |
// +------------------------------------------------------------------------------------------------------+
|
21 |
// +------------------------------------------------------------------------------------------------------+
|
22 |
// CVS : $Id: tela.php,v 1.5 2006-10-30 11:26:11 jp_milcent Exp $
|
22 |
// CVS : $Id: tela.php,v 1.6 2007-04-19 15:34:35 neiluj Exp $
|
23 |
/**
|
23 |
/**
|
24 |
* Application projet
|
24 |
* Application projet
|
25 |
*
|
25 |
*
|
26 |
* Fichier de présentation de la liste des projets pour Tela Botanica
|
26 |
* Fichier de présentation de la liste des projets pour Tela Botanica
|
27 |
*
|
27 |
*
|
28 |
*@package projet
|
28 |
*@package projet
|
29 |
//Auteur original :
|
29 |
//Auteur original :
|
30 |
*@author Alexandre Granier <alexandre@tela-botanica.org>
|
30 |
*@author Alexandre Granier <alexandre@tela-botanica.org>
|
31 |
//Autres auteurs :
|
31 |
//Autres auteurs :
|
32 |
*@author Aucun
|
32 |
*@author Aucun
|
33 |
*@copyright Tela-Botanica 2000-2004
|
33 |
*@copyright Tela-Botanica 2000-2004
|
34 |
*@version $Revision: 1.5 $
|
34 |
*@version $Revision: 1.6 $
|
35 |
// +------------------------------------------------------------------------------------------------------+
|
35 |
// +------------------------------------------------------------------------------------------------------+
|
36 |
*/
|
36 |
*/
|
37 |
|
37 |
|
38 |
// +------------------------------------------------------------------------------------------------------+
|
38 |
// +------------------------------------------------------------------------------------------------------+
|
39 |
// | ENTETE du PROGRAMME |
|
39 |
// | ENTETE du PROGRAMME |
|
40 |
// +------------------------------------------------------------------------------------------------------+
|
40 |
// +------------------------------------------------------------------------------------------------------+
|
41 |
|
41 |
|
42 |
define ('PROJET_LISTE_RESUME', false) ;
|
42 |
define ('PROJET_LISTE_RESUME', false) ;
|
- |
|
43 |
|
- |
|
44 |
if (PROJET_UTILISE_TYPE && $this->_type != '') {
|
- |
|
45 |
$projetListe = projet::getProjetDuType($this->_type, $this->_db) ;
|
- |
|
46 |
if ($this->_presentation == 'arbre')array_push ($projetListe, projet::getProjetRacine($this->_db)) ;
|
- |
|
47 |
} else {
|
- |
|
48 |
// Un tableau de tous les projets dans $projetListe
|
- |
|
49 |
//$projetListe = projet::getTousLesProjets($this->_db, $this->_projet_exclu) ;
|
- |
|
50 |
}
|
- |
|
51 |
|
- |
|
52 |
|
- |
|
53 |
// requete pour recuperer la liste des projets
|
- |
|
54 |
$requete = 'select p_id, p_titre, p_wikini, pl_id_liste, plle_id_liste, p_avoir_document from'.
|
- |
|
55 |
' projet left join projet_lien_liste on p_id=pl_id_projet'.
|
- |
|
56 |
' left join projet_lien_liste_externe on p_id=plle_id_projet'.
|
- |
|
57 |
' group by p_id order by p_titre' ;
|
- |
|
58 |
$resultat = $this->_db->query($requete) ;
|
- |
|
59 |
if (DB::isError($resultat)) {
|
- |
|
60 |
return ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ;
|
- |
|
61 |
}
|
43 |
|
62 |
|
44 |
$res = '<h1>Liste des projets et forums de Tela Botanica</h1>'."\n" ;
|
63 |
$res = '<h1>Liste des projets et forums de Tela Botanica</h1>'."\n" ;
|
45 |
// Ajout du cartouche résumant la création d'un projet.
|
64 |
// Ajout du cartouche résumant la création d'un projet.
|
46 |
$res .= '<div class="notes">
|
65 |
$res .= '<div class="notes">
|
47 |
<h4>Créez votre projet...</h4>
|
66 |
<h4>Cràez votre projet...</h4>
|
48 |
<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 />
|
67 |
<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 />
|
49 |
<a href="http://www.tela-botanica.org/page:creez_votre_projet">Voir la démarche en détail</a></p>
|
68 |
<a href="http://www.tela-botanica.org/page:creez_votre_projet">Voir la démarche en détail</a></p>
|
50 |
</div>';
|
69 |
</div>';
|
51 |
// On inclue un fichier local
|
70 |
// On inclue un fichier local
|
52 |
if (file_exists(PROJET_CHEMIN_APPLI.'langues/pro_langues_fr.local.inc.php'))
|
71 |
if (file_exists(PROJET_CHEMIN_APPLI.'langues/pro_langues_fr.local.inc.php'))
|
53 |
include_once PROJET_CHEMIN_APPLI.'langues/pro_langues_fr.local.inc.php' ;
|
72 |
include_once PROJET_CHEMIN_APPLI.'langues/pro_langues_fr.local.inc.php' ;
|
54 |
// On vérifie si l'utilisateur participe à des projets
|
73 |
// On vérifie si l'utilisateur participe à des projets
|
55 |
|
74 |
|
56 |
$projetNonParticipantListe = & $projetListe ;
|
75 |
$projetNonParticipantListe = & $projetListe ;
|
- |
|
76 |
include_once PROJET_CHEMIN_CLASSES.'HTML_listeProjet.class.php' ;
|
57 |
$HTML_projetNonParticipantListe = new HTML_listeProjet(true) ;
|
77 |
$HTML_projetNonParticipantListe = new HTML_listeProjet(true) ;
|
58 |
$entete_liste = array ('Titre des projets et des forums', 'Forums', 'Wiki','RSS', 'Documents', 'Participants',) ;
|
78 |
$entete_liste = array ('Titre des projets et des forums', 'Forums', 'Wiki','RSS', 'Documents', 'Participants',) ;
|
59 |
$HTML_projetNonParticipantListe->construitEntete($entete_liste) ;
|
79 |
$HTML_projetNonParticipantListe->construitEntete($entete_liste) ;
|
60 |
|
80 |
|
61 |
$liste_projet = array() ;
|
81 |
$liste_projet = array() ;
|
62 |
// La liste
|
82 |
// La liste
|
63 |
foreach ($projetNonParticipantListe as $projet) {
|
83 |
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT)) {
|
64 |
$this->_url->addQueryString(PROJET_VARIABLE_ID_PROJET, $projet->getId()) ;
|
84 |
$this->_url->addQueryString(PROJET_VARIABLE_ID_PROJET, $ligne->p_id) ;
|
65 |
|
85 |
|
66 |
// Recherche du forum
|
86 |
// Recherche du forum
|
67 |
if ($projet->avoirListe()) {
|
87 |
if ($ligne->pl_id_liste != null) {
|
68 |
$this->_url->addQueryString('act', PROJET_ACTION_VOIR_FORUM);
|
88 |
$this->_url->addQueryString('act', PROJET_ACTION_VOIR_FORUM);
|
69 |
$forum = '<a href="'.$this->_url->getURL().'"><img src="sites/commun/generique/images/favicones/tela_botanica.png" alt="Tela Botanica"/></a>';
|
89 |
$forum = '<a href="'.$this->_url->getURL().'"><img src="sites/commun/generique/images/favicones/tela_botanica.png" alt="Tela Botanica"/></a>';
|
70 |
} else {
|
90 |
} else {
|
71 |
|
91 |
|
72 |
include_once PROJET_CHEMIN_CLASSES.'liste_externe.class.php' ;
|
92 |
include_once PROJET_CHEMIN_CLASSES.'liste_externe.class.php' ;
|
73 |
$listes_ext = new liste_externe ($this->_db) ;
|
93 |
$listes_ext = new liste_externe ($this->_db) ;
|
74 |
$tableau_liste = $listes_ext->getListesAssociees($projet->getId()) ;
|
- |
|
75 |
if (count($tableau_liste)) {
|
94 |
if ($ligne->plle_id_liste != null) {
|
76 |
$info_liste = $listes_ext->getInfoListe($tableau_liste[0]) ;
|
95 |
$info_liste = $listes_ext->getInfoListe($ligne->plle_id_liste) ;
|
77 |
|
96 |
|
78 |
$forum = '<a href="'.$info_liste->AGO_A_URLGRP.
|
97 |
$forum = '<a href="'.$info_liste->AGO_A_URLGRP.
|
79 |
'"><img src="sites/commun/generique/images/favicones/yahoo.png" alt="Yahoo"/></a>';
|
98 |
'"><img src="sites/commun/generique/images/favicones/yahoo.png" alt="Yahoo"/></a>';
|
80 |
} else {
|
99 |
} else {
|
81 |
$forum = '-';
|
100 |
$forum = '-';
|
82 |
}
|
101 |
}
|
83 |
}
|
102 |
}
|
84 |
|
103 |
|
85 |
if ($projet->getWikini()) {
|
104 |
if ($ligne->p_wikini) {
|
86 |
$this->_url->addQueryString ('act',PROJET_ACTION_VOIR_WIKINI);
|
105 |
$this->_url->addQueryString ('act',PROJET_ACTION_VOIR_WIKINI);
|
87 |
$link=$this->_url->getURL();
|
106 |
$link=$this->_url->getURL();
|
88 |
$wiki_res = '<a href="'.$link.'">voir</a>' ;
|
107 |
$wiki_res = '<a href="'.$link.'">voir</a>' ;
|
89 |
$this->_url->removeQueryString ('act');
|
108 |
$this->_url->removeQueryString ('act');
|
90 |
} else {
|
109 |
} else {
|
91 |
$wiki_res = '-' ;
|
110 |
$wiki_res = '-' ;
|
92 |
}
|
111 |
}
|
93 |
$titre= '<a href="'.$this->_url->getURL().'">'.$projet->getTitre().'</a>';
|
112 |
$titre= '<a href="'.$this->_url->getURL().'">'.$ligne->p_titre.'</a>';
|
94 |
|
113 |
|
95 |
if (count ($projet->getListesDocuments(PROJET_CHEMIN_FICHIERS))) {
|
114 |
if ($ligne->p_avoir_document != 0) {
|
96 |
$this->_url->addQueryString('act', PROJET_ACTION_VOIR_DOCUMENT) ;
|
115 |
$this->_url->addQueryString('act', PROJET_ACTION_VOIR_DOCUMENT) ;
|
97 |
$document = '<a href="'.$this->_url->getURL().'">voir</a>' ;
|
116 |
$document = '<a href="'.$this->_url->getURL().'">voir</a>' ;
|
98 |
} else {
|
117 |
} else {
|
99 |
$document = '-' ;
|
118 |
$document = '-' ;
|
100 |
}
|
119 |
}
|
101 |
|
120 |
|
102 |
|
121 |
|
103 |
if ($projet->getWikini()) {
|
122 |
if ($ligne->p_wikini) {
|
104 |
$this->_url->addQueryString ('act',PROJET_ACTION_VOIR_WIKINI);
|
123 |
$this->_url->addQueryString ('act',PROJET_ACTION_VOIR_WIKINI);
|
105 |
$link=$this->_url->getURL();
|
124 |
$link=$this->_url->getURL();
|
106 |
$wiki_rss = '<a href="'.$link.'&wiki=DerniersChangementsRSS/xml'.'"><img src="sites/commun/generique/images/rss.gif" alt="rss"/></a>' ;
|
125 |
$wiki_rss = '<a href="'.$link.'&wiki=DerniersChangementsRSS/xml'.'"><img src="sites/commun/generique/images/rss.gif" alt="rss"/></a>' ;
|
107 |
$this->_url->removeQueryString ('act');
|
126 |
$this->_url->removeQueryString ('act');
|
108 |
} else {
|
127 |
} else {
|
109 |
$wiki_rss = '-' ;
|
128 |
$wiki_rss = '-' ;
|
110 |
}
|
129 |
}
|
111 |
|
130 |
|
112 |
|
131 |
|
113 |
$this->_url->addQueryString ('act', PROJET_ACTION_VOIR_PARTICIPANT);
|
132 |
$this->_url->addQueryString ('act', PROJET_ACTION_VOIR_PARTICIPANT);
|
114 |
$participant = '<a href="'.$this->_url->getURL().'">voir</a>' ;
|
133 |
$participant = '<a href="'.$this->_url->getURL().'">voir</a>' ;
|
115 |
$ligne_projet = array ( '', $titre, $forum, // le nom du projet
|
134 |
$ligne_projet = array ( '', $titre, $forum, // le nom du projet
|
116 |
$wiki_res, $wiki_rss,$document, $participant) ;
|
135 |
$wiki_res, $wiki_rss,$document, $participant) ;
|
117 |
|
136 |
|
118 |
$this->_url->removeQueryString(PROJET_VARIABLE_ACTION);
|
137 |
$this->_url->removeQueryString(PROJET_VARIABLE_ACTION);
|
119 |
array_push ($liste_projet, $ligne_projet) ;
|
138 |
array_push ($liste_projet, $ligne_projet) ;
|
120 |
}
|
139 |
}
|
121 |
$this->_url->removeQueryString(PROJET_VARIABLE_ACTION) ;
|
140 |
$this->_url->removeQueryString(PROJET_VARIABLE_ACTION) ;
|
122 |
$HTML_projetNonParticipantListe->construitListe($liste_projet) ;
|
141 |
$HTML_projetNonParticipantListe->construitListe($liste_projet) ;
|
123 |
if ($HTML_projetNonParticipantListe->getRowCount() > 1) {
|
142 |
if ($HTML_projetNonParticipantListe->getRowCount() > 1) {
|
124 |
///$res .= '<p>'.PROJET_TOUS_LES_PROJETS.'</p>' ;
|
143 |
///$res .= '<p>'.PROJET_TOUS_LES_PROJETS.'</p>' ;
|
125 |
$res .= $HTML_projetNonParticipantListe->toHTML() ;
|
144 |
$res .= $HTML_projetNonParticipantListe->toHTML() ;
|
126 |
}
|
145 |
}
|
127 |
|
146 |
|
128 |
// Nettoyage de l'url
|
147 |
// Nettoyage de l'url
|
129 |
$this->_url->removeQueryString (PROJET_VARIABLE_ID_PROJET);
|
148 |
$this->_url->removeQueryString (PROJET_VARIABLE_ID_PROJET);
|
130 |
return $res ;
|
149 |
return $res ;
|
131 |
|
150 |
|
132 |
/* +--Fin du code ----------------------------------------------------------------------------------------+
|
151 |
/* +--Fin du code ----------------------------------------------------------------------------------------+
|
133 |
*
|
152 |
*
|
134 |
* $Log: not supported by cvs2svn $
|
153 |
* $Log: not supported by cvs2svn $
|
- |
|
154 |
* Revision 1.5.2.1 2007/04/11 14:24:39 alexandre_tb
|
- |
|
155 |
* amélioration des performances par l'appel d'une requete directe
|
- |
|
156 |
*
|
- |
|
157 |
* Revision 1.5 2006/10/30 11:26:11 jp_milcent
|
- |
|
158 |
* Modification du cartouche concernant la création d'un projet sur Tela.
|
- |
|
159 |
*
|
135 |
* Revision 1.4 2006/01/09 21:55:19 ddelon
|
160 |
* Revision 1.4 2006/01/09 21:55:19 ddelon
|
136 |
* flux rss dans liste des projets
|
161 |
* flux rss dans liste des projets
|
137 |
*
|
162 |
*
|
138 |
* Revision 1.3 2005/12/07 11:02:35 jp_milcent
|
163 |
* Revision 1.3 2005/12/07 11:02:35 jp_milcent
|
139 |
* Ajout d'attribut alt aux images.
|
164 |
* Ajout d'attribut alt aux images.
|
140 |
*
|
165 |
*
|
141 |
* Revision 1.2 2005/11/28 11:15:22 alexandre_tb
|
166 |
* Revision 1.2 2005/11/28 11:15:22 alexandre_tb
|
142 |
* nettoyage URL en sortie de programme
|
167 |
* nettoyage URL en sortie de programme
|
143 |
*
|
168 |
*
|
144 |
* Revision 1.1 2005/11/25 14:47:51 alexandre_tb
|
169 |
* Revision 1.1 2005/11/25 14:47:51 alexandre_tb
|
145 |
* version initiale
|
170 |
* version initiale
|
146 |
*
|
171 |
*
|
147 |
|
172 |
|
148 |
*
|
173 |
*
|
149 |
*
|
174 |
*
|
150 |
* +-- Fin du code ----------------------------------------------------------------------------------------+
|
175 |
* +-- Fin du code ----------------------------------------------------------------------------------------+
|
151 |
*/
|
176 |
*/
|
152 |
|
177 |
|
153 |
|
178 |
|
154 |
?>
|
179 |
?>
|