Subversion Repositories Applications.projet

Rev

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
// +------------------------------------------------------------------------------------------------------+
269 alexandre_ 22
// CVS : $Id: tela.php,v 1.7 2007-11-19 14:27:46 alexandre_tb Exp $
66 alexandre_ 23
/**
24
* Application projet
25
*
431 mathias 26
* Fichier de pr�sentation de la liste des projets pour Tela Botanica
66 alexandre_ 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
269 alexandre_ 34
*@version       $Revision: 1.7 $
66 alexandre_ 35
// +------------------------------------------------------------------------------------------------------+
36
*/
37
 
38
// +------------------------------------------------------------------------------------------------------+
39
// |                                            ENTETE du PROGRAMME                                       |
40
// +------------------------------------------------------------------------------------------------------+
41
 
269 alexandre_ 42
// La constante suivante est dans le fichier de conf
43
//define ('PROJET_LISTE_RESUME', false) ;
66 alexandre_ 44
 
208 neiluj 45
if (PROJET_UTILISE_TYPE && $this->_type != '') {
46
    $projetListe = projet::getProjetDuType($this->_type, $this->_db) ;
47
    if ($this->_presentation == 'arbre')array_push ($projetListe, projet::getProjetRacine($this->_db)) ;
48
} else {
49
    // Un tableau de tous les projets dans $projetListe
50
    //$projetListe = projet::getTousLesProjets($this->_db, $this->_projet_exclu) ;
51
}
52
 
53
 
54
// requete pour recuperer la liste des projets
55
$requete = 'select p_id, p_titre, p_wikini, pl_id_liste, plle_id_liste, p_avoir_document from'.
56
			' projet left join projet_lien_liste on p_id=pl_id_projet'.
57
			' left join projet_lien_liste_externe on p_id=plle_id_projet'.
58
			' group by p_id order by p_titre' ;
59
$resultat = $this->_db->query($requete) ;
60
if (DB::isError($resultat)) {
61
	return ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ;
62
}
63
 
66 alexandre_ 64
$res = '<h1>Liste des projets et forums de Tela Botanica</h1>'."\n" ;
269 alexandre_ 65
// Ajout du cartouche resumant la creation d'un projet.
66 alexandre_ 66
$res .= '<div class="notes">
269 alexandre_ 67
<h4>Cr&eacute;ez votre projet...</h4>
68
<p class="last"> Toute personne inscrite au r&eacute;seau Tela Botanica peut demander &agrave; cr&eacute;er un forum de discussion ou monter un projet collaboratif. <br />
69
<a href="http://www.tela-botanica.org/page:creez_votre_projet">Voir la d&eacute;marche en d&eacute;tail</a></p>
66 alexandre_ 70
</div>';
71
// On inclue un fichier local
72
if (file_exists(PROJET_CHEMIN_APPLI.'langues/pro_langues_fr.local.inc.php'))
73
	include_once PROJET_CHEMIN_APPLI.'langues/pro_langues_fr.local.inc.php' ;
431 mathias 74
// On v�rifie si l'utilisateur participe � des projets
66 alexandre_ 75
 
76
$projetNonParticipantListe = & $projetListe ;
208 neiluj 77
include_once PROJET_CHEMIN_CLASSES.'HTML_listeProjet.class.php' ;
66 alexandre_ 78
$HTML_projetNonParticipantListe = new HTML_listeProjet(true) ;
93 ddelon 79
$entete_liste = array ('Titre des projets et des forums', 'Forums', 'Wiki','RSS', 'Documents', 'Participants',) ;
66 alexandre_ 80
$HTML_projetNonParticipantListe->construitEntete($entete_liste) ;
81
 
82
$liste_projet = array() ;
83
// La liste
208 neiluj 84
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT)) {
85
    $this->_url->addQueryString(PROJET_VARIABLE_ID_PROJET, $ligne->p_id) ;
66 alexandre_ 86
 
87
    // Recherche du forum
208 neiluj 88
    if ($ligne->pl_id_liste != null) {
66 alexandre_ 89
    	$this->_url->addQueryString('act', PROJET_ACTION_VOIR_FORUM);
84 jp_milcent 90
    	$forum = '<a href="'.$this->_url->getURL().'"><img src="sites/commun/generique/images/favicones/tela_botanica.png" alt="Tela Botanica"/></a>';
66 alexandre_ 91
    } else {
92
 
93
		include_once PROJET_CHEMIN_CLASSES.'liste_externe.class.php' ;
94
		$listes_ext = new liste_externe ($this->_db) ;
208 neiluj 95
		if ($ligne->plle_id_liste != null) {
96
			$info_liste = $listes_ext->getInfoListe($ligne->plle_id_liste) ;
66 alexandre_ 97
 
98
			$forum = '<a href="'.$info_liste->AGO_A_URLGRP.
84 jp_milcent 99
					'"><img src="sites/commun/generique/images/favicones/yahoo.png" alt="Yahoo"/></a>';
66 alexandre_ 100
		} else {
101
			$forum = '-';
102
		}
103
    }
104
 
208 neiluj 105
    if ($ligne->p_wikini) {
66 alexandre_ 106
		$this->_url->addQueryString ('act',PROJET_ACTION_VOIR_WIKINI);
107
		$link=$this->_url->getURL();
108
	    $wiki_res = '<a href="'.$link.'">voir</a>' ;
109
	    $this->_url->removeQueryString ('act');
110
	} else {
111
	    $wiki_res = '-' ;
112
	}
208 neiluj 113
    $titre= '<a href="'.$this->_url->getURL().'">'.$ligne->p_titre.'</a>';
66 alexandre_ 114
 
208 neiluj 115
    if ($ligne->p_avoir_document != 0) {
66 alexandre_ 116
    	$this->_url->addQueryString('act', PROJET_ACTION_VOIR_DOCUMENT) ;
117
    	$document = '<a href="'.$this->_url->getURL().'">voir</a>' ;
118
    } else {
119
    	$document = '-' ;
120
    }
93 ddelon 121
 
122
 
208 neiluj 123
   if ($ligne->p_wikini) {
93 ddelon 124
		$this->_url->addQueryString ('act',PROJET_ACTION_VOIR_WIKINI);
125
		$link=$this->_url->getURL();
126
	    $wiki_rss = '<a href="'.$link.'&wiki=DerniersChangementsRSS/xml'.'"><img src="sites/commun/generique/images/rss.gif" alt="rss"/></a>' ;
127
	    $this->_url->removeQueryString ('act');
128
	} else {
129
	    $wiki_rss = '-' ;
130
	}
131
 
132
 
66 alexandre_ 133
    $this->_url->addQueryString ('act', PROJET_ACTION_VOIR_PARTICIPANT);
134
    $participant = '<a href="'.$this->_url->getURL().'">voir</a>' ;
135
    $ligne_projet = array ( '', $titre, $forum,  // le nom du projet
93 ddelon 136
                        $wiki_res, $wiki_rss,$document, $participant) ;
66 alexandre_ 137
 
138
    $this->_url->removeQueryString(PROJET_VARIABLE_ACTION);
139
    array_push ($liste_projet, $ligne_projet) ;
140
}
141
$this->_url->removeQueryString(PROJET_VARIABLE_ACTION) ;
142
$HTML_projetNonParticipantListe->construitListe($liste_projet) ;
143
if ($HTML_projetNonParticipantListe->getRowCount() > 1) {
144
	///$res .= '<p>'.PROJET_TOUS_LES_PROJETS.'</p>' ;
145
	$res .= $HTML_projetNonParticipantListe->toHTML() ;
146
}
147
 
73 alexandre_ 148
// Nettoyage de l'url
149
$this->_url->removeQueryString (PROJET_VARIABLE_ID_PROJET);
66 alexandre_ 150
return $res ;
151
 
152
/* +--Fin du code ----------------------------------------------------------------------------------------+
153
*
154
* $Log: not supported by cvs2svn $
269 alexandre_ 155
* Revision 1.6  2007-04-19 15:34:35  neiluj
431 mathias 156
* pr�parration release (livraison) "Narmer" - v0.25
269 alexandre_ 157
*
208 neiluj 158
* Revision 1.5.2.1  2007/04/11 14:24:39  alexandre_tb
431 mathias 159
* am�lioration des performances par l'appel d'une requete directe
208 neiluj 160
*
161
* Revision 1.5  2006/10/30 11:26:11  jp_milcent
431 mathias 162
* Modification du cartouche concernant la cr�ation d'un projet sur Tela.
208 neiluj 163
*
145 jp_milcent 164
* Revision 1.4  2006/01/09 21:55:19  ddelon
165
* flux rss dans liste des projets
166
*
93 ddelon 167
* Revision 1.3  2005/12/07 11:02:35  jp_milcent
168
* Ajout d'attribut alt aux images.
169
*
84 jp_milcent 170
* Revision 1.2  2005/11/28 11:15:22  alexandre_tb
171
* nettoyage URL en sortie de programme
172
*
73 alexandre_ 173
* Revision 1.1  2005/11/25 14:47:51  alexandre_tb
174
* version initiale
175
*
66 alexandre_ 176
 
177
*
178
*
179
* +-- Fin du code ----------------------------------------------------------------------------------------+
180
*/
181
 
182
 
183
?>