Subversion Repositories Applications.projet

Rev

Rev 145 | Rev 269 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

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