Subversion Repositories Applications.projet

Rev

Rev 208 | Rev 431 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

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