Subversion Repositories Applications.papyrus

Rev

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

Rev Author Line No. Line
614 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
// +------------------------------------------------------------------------------------------------------+
1308 alexandre_ 22
// CVS : $Id: tela.php,v 1.5.2.1 2007-04-11 14:24:39 alexandre_tb Exp $
614 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
1308 alexandre_ 34
*@version       $Revision: 1.5.2.1 $
614 alexandre_ 35
// +------------------------------------------------------------------------------------------------------+
36
*/
37
 
38
// +------------------------------------------------------------------------------------------------------+
39
// |                                            ENTETE du PROGRAMME                                       |
40
// +------------------------------------------------------------------------------------------------------+
41
 
42
define ('PROJET_LISTE_RESUME', false) ;
43
 
1308 alexandre_ 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
 
614 alexandre_ 63
$res = '<h1>Liste des projets et forums de Tela Botanica</h1>'."\n" ;
1042 jp_milcent 64
// Ajout du cartouche résumant la création d'un projet.
614 alexandre_ 65
$res .= '<div class="notes">
66
<h4>Créez votre projet...</h4>
1042 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>
614 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 ;
1308 alexandre_ 76
include_once PROJET_CHEMIN_CLASSES.'HTML_listeProjet.class.php' ;
614 alexandre_ 77
$HTML_projetNonParticipantListe = new HTML_listeProjet(true) ;
690 ddelon 78
$entete_liste = array ('Titre des projets et des forums', 'Forums', 'Wiki','RSS', 'Documents', 'Participants',) ;
614 alexandre_ 79
$HTML_projetNonParticipantListe->construitEntete($entete_liste) ;
80
 
81
$liste_projet = array() ;
82
// La liste
1308 alexandre_ 83
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT)) {
84
    $this->_url->addQueryString(PROJET_VARIABLE_ID_PROJET, $ligne->p_id) ;
614 alexandre_ 85
 
86
    // Recherche du forum
1308 alexandre_ 87
    if ($ligne->pl_id_liste != null) {
614 alexandre_ 88
    	$this->_url->addQueryString('act', PROJET_ACTION_VOIR_FORUM);
640 jp_milcent 89
    	$forum = '<a href="'.$this->_url->getURL().'"><img src="sites/commun/generique/images/favicones/tela_botanica.png" alt="Tela Botanica"/></a>';
614 alexandre_ 90
    } else {
91
 
92
		include_once PROJET_CHEMIN_CLASSES.'liste_externe.class.php' ;
93
		$listes_ext = new liste_externe ($this->_db) ;
1308 alexandre_ 94
		if ($ligne->plle_id_liste != null) {
95
			$info_liste = $listes_ext->getInfoListe($ligne->plle_id_liste) ;
614 alexandre_ 96
 
97
			$forum = '<a href="'.$info_liste->AGO_A_URLGRP.
640 jp_milcent 98
					'"><img src="sites/commun/generique/images/favicones/yahoo.png" alt="Yahoo"/></a>';
614 alexandre_ 99
		} else {
100
			$forum = '-';
101
		}
102
    }
103
 
1308 alexandre_ 104
    if ($ligne->p_wikini) {
614 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
	}
1308 alexandre_ 112
    $titre= '<a href="'.$this->_url->getURL().'">'.$ligne->p_titre.'</a>';
614 alexandre_ 113
 
1308 alexandre_ 114
    if ($ligne->p_avoir_document != 0) {
614 alexandre_ 115
    	$this->_url->addQueryString('act', PROJET_ACTION_VOIR_DOCUMENT) ;
116
    	$document = '<a href="'.$this->_url->getURL().'">voir</a>' ;
117
    } else {
118
    	$document = '-' ;
119
    }
690 ddelon 120
 
121
 
1308 alexandre_ 122
   if ($ligne->p_wikini) {
690 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
 
614 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
690 ddelon 135
                        $wiki_res, $wiki_rss,$document, $participant) ;
614 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
 
621 alexandre_ 147
// Nettoyage de l'url
148
$this->_url->removeQueryString (PROJET_VARIABLE_ID_PROJET);
614 alexandre_ 149
return $res ;
150
 
151
/* +--Fin du code ----------------------------------------------------------------------------------------+
152
*
153
* $Log: not supported by cvs2svn $
1308 alexandre_ 154
* Revision 1.5  2006/10/30 11:26:11  jp_milcent
155
* Modification du cartouche concernant la création d'un projet sur Tela.
156
*
1042 jp_milcent 157
* Revision 1.4  2006/01/09 21:55:19  ddelon
158
* flux rss dans liste des projets
159
*
690 ddelon 160
* Revision 1.3  2005/12/07 11:02:35  jp_milcent
161
* Ajout d'attribut alt aux images.
162
*
640 jp_milcent 163
* Revision 1.2  2005/11/28 11:15:22  alexandre_tb
164
* nettoyage URL en sortie de programme
165
*
621 alexandre_ 166
* Revision 1.1  2005/11/25 14:47:51  alexandre_tb
167
* version initiale
168
*
614 alexandre_ 169
 
170
*
171
*
172
* +-- Fin du code ----------------------------------------------------------------------------------------+
173
*/
174
 
175
 
176
?>