Subversion Repositories Applications.bazar

Rev

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

Rev 189 Rev 196
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 Lesser General Public                                           |
9
// | modify it under the terms of the GNU Lesser 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
// | Lesser General Public License for more details.                                                      |
16
// | Lesser General Public License for more details.                                                      |
17
// |                                                                                                      |
17
// |                                                                                                      |
18
// | You should have received a copy of the GNU Lesser General Public                                     |
18
// | You should have received a copy of the GNU Lesser 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: bazar.fonct.rss.php,v 1.60.2.9 2007-02-27 15:32:40 alexandre_tb Exp $
22
// CVS : $Id: bazar.fonct.rss.php,v 1.60.2.10 2007-03-06 09:41:15 alexandre_tb Exp $
23
/**
23
/**
24
* 
24
* 
25
*@package bazar
25
*@package bazar
26
//Auteur original :
26
//Auteur original :
27
*@author        Alexandre GRANIER <alexandre@tela-botanica.org>
27
*@author        Alexandre GRANIER <alexandre@tela-botanica.org>
28
*@author        Florian Schmitt <florian@ecole-et-nature.org>
28
*@author        Florian Schmitt <florian@ecole-et-nature.org>
29
//Autres auteurs :
29
//Autres auteurs :
30
*@copyright     Tela-Botanica 2000-2006
30
*@copyright     Tela-Botanica 2000-2006
31
*@version       $Revision: 1.60.2.9 $
31
*@version       $Revision: 1.60.2.10 $
32
// +------------------------------------------------------------------------------------------------------+
32
// +------------------------------------------------------------------------------------------------------+
33
*/
33
*/
34
 
34
 
35
// +------------------------------------------------------------------------------------------------------+
35
// +------------------------------------------------------------------------------------------------------+
36
// |                                            ENTETE du PROGRAMME                                       |
36
// |                                            ENTETE du PROGRAMME                                       |
37
// +------------------------------------------------------------------------------------------------------+
37
// +------------------------------------------------------------------------------------------------------+
38
 
38
 
39
require_once BAZ_CHEMIN_APPLI.'bibliotheque/bazar.class.php';
39
require_once BAZ_CHEMIN_APPLI.'bibliotheque/bazar.class.php';
40
require_once BAZ_CHEMIN_APPLI.'bibliotheque/bazar.fonct.php';
40
require_once BAZ_CHEMIN_APPLI.'bibliotheque/bazar.fonct.php';
41
 
41
 
42
 
42
 
43
/** baz_valeur_template() - Renvoi des valeurs inscrite dans le fichier de template
43
/** baz_valeur_template() - Renvoi des valeurs inscrite dans le fichier de template
44
*
44
*
45
* @param   string valeur du template de bazar_nature
45
* @param   string valeur du template de bazar_nature
46
*
46
*
47
* @return   mixed  tableau contenant les champs du fichier template
47
* @return   mixed  tableau contenant les champs du fichier template
48
*/
48
*/
49
function baz_valeurs_template($valeur_template) {
49
function baz_valeurs_template($valeur_template) {
50
	//Parcours du fichier de templates, pour mettre les champs specifiques
50
	//Parcours du fichier de templates, pour mettre les champs specifiques
51
	$tableau= array();
51
	$tableau= array();
52
	$nblignes=0;
52
	$nblignes=0;
53
	$chaine = explode ("\n", $valeur_template);
53
	$chaine = explode ("\n", $valeur_template);
54
	array_pop($chaine);
54
	array_pop($chaine);
55
	foreach ($chaine as $ligne)  {
55
	foreach ($chaine as $ligne)  {
56
		$souschaine = explode ("***", $ligne) ;
56
		$souschaine = explode ("***", $ligne) ;
57
		$tableau[$nblignes]['type'] = trim($souschaine[0]) ;
57
		$tableau[$nblignes]['type'] = trim($souschaine[0]) ;
58
		if (isset($souschaine[1])) {$tableau[$nblignes]['nom_bdd'] = trim($souschaine[1]);}
58
		if (isset($souschaine[1])) {$tableau[$nblignes]['nom_bdd'] = trim($souschaine[1]);}
59
		else {$tableau[$nblignes]['nom_bdd'] ='';}
59
		else {$tableau[$nblignes]['nom_bdd'] ='';}
60
		if (isset($souschaine[2])) $tableau[$nblignes]['label'] = trim($souschaine[2]);
60
		if (isset($souschaine[2])) $tableau[$nblignes]['label'] = trim($souschaine[2]);
61
		else {$tableau[$nblignes]['label'] ='';}
61
		else {$tableau[$nblignes]['label'] ='';}
62
		if (isset($souschaine[3])) $tableau[$nblignes]['limite1'] = trim($souschaine[3]);
62
		if (isset($souschaine[3])) $tableau[$nblignes]['limite1'] = trim($souschaine[3]);
63
		else {$tableau[$nblignes]['limite1'] ='';}
63
		else {$tableau[$nblignes]['limite1'] ='';}
64
		if (isset($souschaine[4])) $tableau[$nblignes]['limite2'] = trim($souschaine[4]);
64
		if (isset($souschaine[4])) $tableau[$nblignes]['limite2'] = trim($souschaine[4]);
65
		else {$tableau[$nblignes]['limite2'] ='';}
65
		else {$tableau[$nblignes]['limite2'] ='';}
66
		if (isset($souschaine[5])) $tableau[$nblignes]['defaut'] = trim($souschaine[5]);
66
		if (isset($souschaine[5])) $tableau[$nblignes]['defaut'] = trim($souschaine[5]);
67
		else {$tableau[$nblignes]['defaut'] ='';}
67
		else {$tableau[$nblignes]['defaut'] ='';}
68
		if (isset($souschaine[6])) $tableau[$nblignes]['table_source'] = trim($souschaine[6]);
68
		if (isset($souschaine[6])) $tableau[$nblignes]['table_source'] = trim($souschaine[6]);
69
		else {$tableau[$nblignes]['table_source'] ='';}
69
		else {$tableau[$nblignes]['table_source'] ='';}
70
		if (isset($souschaine[7])) $tableau[$nblignes]['id_source'] = trim($souschaine[7]);
70
		if (isset($souschaine[7])) $tableau[$nblignes]['id_source'] = trim($souschaine[7]);
71
		else {$tableau[$nblignes]['id_source'] ='';}
71
		else {$tableau[$nblignes]['id_source'] ='';}
72
		if (isset($souschaine[8])) $tableau[$nblignes]['obligatoire'] = trim($souschaine[8]);
72
		if (isset($souschaine[8])) $tableau[$nblignes]['obligatoire'] = trim($souschaine[8]);
73
		else {$tableau[$nblignes]['obligatoire'] ='';}
73
		else {$tableau[$nblignes]['obligatoire'] ='';}
74
		if (isset($souschaine[9])) $tableau[$nblignes]['recherche'] = trim($souschaine[9]);
74
		if (isset($souschaine[9])) $tableau[$nblignes]['recherche'] = trim($souschaine[9]);
75
		else {$tableau[$nblignes]['recherche'] ='';}
75
		else {$tableau[$nblignes]['recherche'] ='';}
76
		
76
		
77
		
77
		
78
		// traitement des cases à cocher, dans ce cas la, on a une table de jointure entre la table
78
		// traitement des cases à cocher, dans ce cas la, on a une table de jointure entre la table
79
		// de liste et la table bazar_fiche (elle porte un nom du genre bazar_ont_***)
79
		// de liste et la table bazar_fiche (elle porte un nom du genre bazar_ont_***)
80
		// dans le template, à la place d'un nom de champs dans 'nom_bdd', on a un nom de table
80
		// dans le template, à la place d'un nom de champs dans 'nom_bdd', on a un nom de table
81
		// et 2 noms de champs séparés par un virgule ex : bazar_ont_theme,bot_id_theme,bot_id_fiche
81
		// et 2 noms de champs séparés par un virgule ex : bazar_ont_theme,bot_id_theme,bot_id_fiche
82
		
82
		
83
		if (isset($tableau[$nblignes]['nom_bdd']) && preg_match('/,/', $tableau[$nblignes]['nom_bdd'])) {
83
		if (isset($tableau[$nblignes]['nom_bdd']) && preg_match('/,/', $tableau[$nblignes]['nom_bdd'])) {
84
			$tableau_info_jointe = explode (',', $tableau[$nblignes]['nom_bdd']) ;
84
			$tableau_info_jointe = explode (',', $tableau[$nblignes]['nom_bdd']) ;
85
			$tableau[$nblignes]['table_jointe'] = $tableau_info_jointe[0] ;
85
			$tableau[$nblignes]['table_jointe'] = $tableau_info_jointe[0] ;
86
			$tableau[$nblignes]['champs_id_fiche'] = $tableau_info_jointe[1] ;
86
			$tableau[$nblignes]['champs_id_fiche'] = $tableau_info_jointe[1] ;
87
			$tableau[$nblignes]['champs_id_table_jointe'] = $tableau_info_jointe[2] ;		
87
			$tableau[$nblignes]['champs_id_table_jointe'] = $tableau_info_jointe[2] ;		
88
		}
88
		}
89
		$nblignes++;
89
		$nblignes++;
90
	}
90
	}
91
	return $tableau;
91
	return $tableau;
92
}
92
}
93
 
93
 
94
/**  baz_voir_fiches() - Permet de visualiser en detail une liste de fiche  au format XHTML
94
/**  baz_voir_fiches() - Permet de visualiser en detail une liste de fiche  au format XHTML
95
*
95
*
96
* @global boolean Rajoute des informations internes à l'application (date de modification, lien vers la page de départ de l'appli)
96
* @global boolean Rajoute des informations internes à l'application (date de modification, lien vers la page de départ de l'appli)
97
* @global integer Tableau d(Identifiant des fiches à afficher
97
* @global integer Tableau d(Identifiant des fiches à afficher
98
*
98
*
99
* @return   string  HTML
99
* @return   string  HTML
100
*/
100
*/
101
function baz_voir_fiches($danslappli, $idfiches=array()) {
101
function baz_voir_fiches($danslappli, $idfiches=array()) {
102
	$res='';
102
	$res='';
103
	foreach($idfiches as $idfiche) {
103
	foreach($idfiches as $idfiche) {
104
			$res.=baz_voir_fiche($danslappli, $idfiche);
104
			$res.=baz_voir_fiche($danslappli, $idfiche);
105
	}
105
	}
106
	return $res;
106
	return $res;
107
}
107
}
108
 
108
 
109
 
109
 
110
/**  baz_voir_fiche() - Permet de visualiser en detail une fiche  au format XHTML
110
/**  baz_voir_fiche() - Permet de visualiser en detail une fiche  au format XHTML
111
*
111
*
112
* @global boolean Rajoute des informations internes a l'application (date de modification, lien vers la page de départ de l'appli) si a 1
112
* @global boolean Rajoute des informations internes a l'application (date de modification, lien vers la page de départ de l'appli) si a 1
113
* @global integer Identifiant de la fiche a afficher
113
* @global integer Identifiant de la fiche a afficher
114
*
114
*
115
* @return   string  HTML
115
* @return   string  HTML
116
*/
116
*/
117
function baz_voir_fiche($danslappli, $idfiche='') {
117
function baz_voir_fiche($danslappli, $idfiche='') {
118
	$res='';
118
	$res='';
119
	if (isset($_GET['id_fiche'])) $GLOBALS['_BAZAR_']['id_fiche']=$_GET['id_fiche'];
119
	if (isset($_GET['id_fiche'])) $GLOBALS['_BAZAR_']['id_fiche']=$_GET['id_fiche'];
120
	if ($idfiche!='') $GLOBALS['_BAZAR_']['id_fiche']=$idfiche;	
120
	if ($idfiche!='') $GLOBALS['_BAZAR_']['id_fiche']=$idfiche;	
121
	$url= $GLOBALS['_BAZAR_']['url'];
121
	$url= $GLOBALS['_BAZAR_']['url'];
122
	$url->addQueryString('action', BAZ_VOIR_FICHE);
122
	$url->addQueryString('action', BAZ_VOIR_FICHE);
123
	$url->addQueryString('id_fiche', $GLOBALS['_BAZAR_']['id_fiche']);
123
	$url->addQueryString('id_fiche', $GLOBALS['_BAZAR_']['id_fiche']);
124
	$url = preg_replace ('/&amp;/', '&', $url->getURL()) ;
124
	$url = preg_replace ('/&amp;/', '&', $url->getURL()) ;
125
	
125
	
126
	//cas ou la fiche a été validee
126
	//cas ou la fiche a été validee
127
	if (isset($_GET['publiee'])) {
127
	if (isset($_GET['publiee'])) {
128
		publier_fiche($_GET['publiee']);			
128
		publier_fiche($_GET['publiee']);			
129
	}
129
	}
130
	
130
	
131
	//cas on une structure s'approprie une ressource
131
	//cas on une structure s'approprie une ressource
132
	if (isset($_GET['appropriation'])) {
132
	if (isset($_GET['appropriation'])) {
133
		if ($_GET['appropriation']==1) {
133
		if ($_GET['appropriation']==1) {
134
			$requete = 'INSERT INTO bazar_appropriation VALUES ('.$GLOBALS['_BAZAR_']['id_fiche'].', '.$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID).')';
134
			$requete = 'INSERT INTO bazar_appropriation VALUES ('.$GLOBALS['_BAZAR_']['id_fiche'].', '.$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID).')';
135
			$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
135
			$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
136
		}
136
		}
137
		elseif ($_GET['appropriation']==0) {
137
		elseif ($_GET['appropriation']==0) {
138
			$requete = 'DELETE FROM bazar_appropriation WHERE  ba_ce_id_fiche='.$GLOBALS['_BAZAR_']['id_fiche'].' AND ba_ce_id_structure='.$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID);
138
			$requete = 'DELETE FROM bazar_appropriation WHERE  ba_ce_id_fiche='.$GLOBALS['_BAZAR_']['id_fiche'].' AND ba_ce_id_structure='.$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID);
139
			$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
139
			$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
140
		}
140
		}
141
	}
141
	}
142
		
142
		
143
	//cas ou un commentaire a été entre
143
	//cas ou un commentaire a été entre
144
	if (isset($_POST['Nom'])) {
144
	if (isset($_POST['Nom'])) {
145
		$requete = 'INSERT INTO bazar_commentaires VALUES ('.
145
		$requete = 'INSERT INTO bazar_commentaires VALUES ('.
146
					baz_nextid('bazar_commentaires', 'bc_id_commentaire', $GLOBALS['_BAZAR_']['db']).
146
					baz_nextid('bazar_commentaires', 'bc_id_commentaire', $GLOBALS['_BAZAR_']['db']).
147
					', '.$GLOBALS['_BAZAR_']['id_fiche'].', "'.$_POST['Nom'].'", "'.$_POST['Commentaire'].
147
					', '.$GLOBALS['_BAZAR_']['id_fiche'].', "'.$_POST['Nom'].'", "'.$_POST['Commentaire'].
148
					'", NOW() )';
148
					'", NOW() )';
149
		$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
149
		$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
150
	}
150
	}
151
	//cas ou un commentaire va etre supprime
151
	//cas ou un commentaire va etre supprime
152
	elseif (isset($_GET['id_commentaire'])) {
152
	elseif (isset($_GET['id_commentaire'])) {
153
		$requete = 'DELETE FROM bazar_commentaires WHERE bc_id_commentaire='.$_GET['id_commentaire'].' LIMIT 1';
153
		$requete = 'DELETE FROM bazar_commentaires WHERE bc_id_commentaire='.$_GET['id_commentaire'].' LIMIT 1';
154
		$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
154
		$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
155
	}
155
	}
156
	else {
156
	else {
157
		if (isset($_GET['action'])) {
157
		if (isset($_GET['action'])) {
158
			if ($_GET['action']==BAZ_VOIR_FICHE) {
158
			if ($_GET['action']==BAZ_VOIR_FICHE) {
159
				//sinon on met a jour le nb de visites pour la fiche, puisque c'est une simple consultation
159
				//sinon on met a jour le nb de visites pour la fiche, puisque c'est une simple consultation
160
				$requete = 'UPDATE bazar_fiche SET bf_nb_consultations=bf_nb_consultations+1 WHERE bf_id_fiche='.$GLOBALS['_BAZAR_']['id_fiche'];
160
				$requete = 'UPDATE bazar_fiche SET bf_nb_consultations=bf_nb_consultations+1 WHERE bf_id_fiche='.$GLOBALS['_BAZAR_']['id_fiche'];
161
				$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
161
				$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
162
			}
162
			}
163
		}
163
		}
164
	}
164
	}
165
	$requete = 'SELECT * FROM bazar_fiche WHERE bf_id_fiche='.$GLOBALS['_BAZAR_']['id_fiche'];
165
	$requete = 'SELECT * FROM bazar_fiche WHERE bf_id_fiche='.$GLOBALS['_BAZAR_']['id_fiche'];
166
	
166
	
167
	$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
167
	$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
168
	(DB::isError($resultat)) ? die(BOG_afficherErreurSql(__FILE__, __LINE__, $resultat->getMessage(), $requete))
168
	(DB::isError($resultat)) ? die(BOG_afficherErreurSql(__FILE__, __LINE__, $resultat->getMessage(), $requete))
169
	    : '';
169
	    : '';
170
	
170
	
171
		$ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC) ;
171
		$ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC) ;
172
	if (!isset($GLOBALS['_BAZAR_']['typeannonce'])) $GLOBALS['_BAZAR_']['typeannonce'] = $ligne['bf_ce_nature'];
172
	if (!isset($GLOBALS['_BAZAR_']['typeannonce'])) $GLOBALS['_BAZAR_']['typeannonce'] = $ligne['bf_ce_nature'];
173
	
173
	
174
	//on verifie si l'utilisateur est administrateur
174
	//on verifie si l'utilisateur est administrateur
175
	$est_admin=0;
175
	$est_admin=0;
176
	$requete='SELECT bn_id_nature, bn_template, bn_commentaire FROM bazar_nature WHERE bn_id_nature="'.$GLOBALS['_BAZAR_']['typeannonce'].'"';
176
	$requete='SELECT bn_id_nature, bn_template, bn_commentaire FROM bazar_nature WHERE bn_id_nature="'.$GLOBALS['_BAZAR_']['typeannonce'].'"';
177
 
177
 
178
	$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
178
	$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
179
	if (DB::isError($resultat)) {
179
	if (DB::isError($resultat)) {
180
		die ($resultat->getMessage().$resultat->getDebugInfo()) ;
180
		die ($resultat->getMessage().$resultat->getDebugInfo()) ;
181
	}
181
	}
182
	$result = $resultat->fetchRow(DB_FETCHMODE_ASSOC);
182
	$result = $resultat->fetchRow(DB_FETCHMODE_ASSOC);
183
	$id_nature = $result['bn_id_nature'];
183
	$id_nature = $result['bn_id_nature'];
184
	if (!isset($GLOBALS['_BAZAR_']['template'])) $GLOBALS['_BAZAR_']['template'] = $result['bn_template'];
184
	if (!isset($GLOBALS['_BAZAR_']['template'])) $GLOBALS['_BAZAR_']['template'] = $result['bn_template'];
185
	if (!isset($GLOBALS['_BAZAR_']['commentaire'])) $GLOBALS['_BAZAR_']['commentaire'] = $result['bn_commentaire'];
185
	if (!isset($GLOBALS['_BAZAR_']['commentaire'])) $GLOBALS['_BAZAR_']['commentaire'] = $result['bn_commentaire'];
186
	if ($GLOBALS['AUTH']->getAuth()) {
186
	if ($GLOBALS['AUTH']->getAuth()) {
187
		if ((niveau_droit($result['bn_id_nature'],$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID))=='administrateur')
187
		if ((niveau_droit($result['bn_id_nature'],$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID))=='administrateur')
188
		     or(niveau_droit('0',$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID))=='superadministrateur'))
188
		     or(niveau_droit('0',$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID))=='superadministrateur'))
189
		{
189
		{
190
		        $est_admin=1;
190
		        $est_admin=1;
191
		}
191
		}
192
	}
192
	}
193
	//affiche le titre sous forme d'image
193
	//affiche le titre sous forme d'image
194
	if (isset ($GLOBALS['_BAZAR_']['image_titre']) && $GLOBALS['_BAZAR_']['image_titre']!='') {
194
	if (isset ($GLOBALS['_BAZAR_']['image_titre']) && $GLOBALS['_BAZAR_']['image_titre']!='') {
195
		$res .= '<img id="BAZ_img_titre" src="client/bazar/images/'.$GLOBALS['_BAZAR_']['image_titre'].'" alt="'.$result['bn_label_nature'].'" />'.'<br />'."\n";
195
		$res .= '<img id="BAZ_img_titre" src="client/bazar/images/'.$GLOBALS['_BAZAR_']['image_titre'].'" alt="'.$result['bn_label_nature'].'" />'.'<br />'."\n";
196
	}
196
	}
197
	//affiche le texte sinon
197
	//affiche le texte sinon
198
	else {
198
	else {
199
		//$res .= '<h2 class="BAZ_titre">'.$GLOBALS['_BAZAR_']['typeannonce'].'</h2>'."\n";
199
		//$res .= '<h2 class="BAZ_titre">'.$GLOBALS['_BAZAR_']['typeannonce'].'</h2>'."\n";
200
	}
200
	}
201
	$res .= '<div class="BAZ_cadre_fiche">'."\n";
201
	$res .= '<div class="BAZ_cadre_fiche">'."\n";
202
	
202
	
203
	$GLOBALS['_BAZAR_']['annonceur'] = $ligne['bf_ce_utilisateur'] ;
203
	$GLOBALS['_BAZAR_']['annonceur'] = $ligne['bf_ce_utilisateur'] ;
204
	//si le template existe, on genere le template
204
	//si le template existe, on genere le template
205
	if ((file_exists(BAZ_CHEMIN_APPLI.'templates/'.$GLOBALS['_BAZAR_']['typeannonce'].'-fiche.php'))) {
205
	if ((file_exists(BAZ_CHEMIN_APPLI.'templates/'.$GLOBALS['_BAZAR_']['typeannonce'].'-fiche.php'))) {
206
		include_once(BAZ_CHEMIN_APPLI.'templates/'.$GLOBALS['_BAZAR_']['typeannonce'].'-fiche.php');
206
		include_once(BAZ_CHEMIN_APPLI.'templates/'.$GLOBALS['_BAZAR_']['typeannonce'].'-fiche.php');
207
		$res .=genere_fiche($ligne);
207
		$res .=genere_fiche($ligne);
208
	}
208
	}
209
	//on affiche ligne par ligne sinon
209
	//on affiche ligne par ligne sinon
210
	else {
210
	else {
211
		//cas d'une image personalisée
211
		//cas d'une image personalisée
212
		if (isset($ligne['bf_url_image'])) {
212
		if (isset($ligne['bf_url_image'])) {
213
			$res .= '<div id="fiche_image">'."\n";
213
			$res .= '<div id="fiche_image">'."\n";
214
			$res .= '<img src="client/bazar/upload/'.$ligne['bf_url_image'].'" border=0 alt="'.BAZ_TEXTE_IMG_ALTERNATIF.'" />'."\n";
214
			$res .= '<img src="client/bazar/upload/'.$ligne['bf_url_image'].'" border=0 alt="'.BAZ_TEXTE_IMG_ALTERNATIF.'" />'."\n";
215
			$res .= '</div>'."\n";
215
			$res .= '</div>'."\n";
216
		}
216
		}
217
		//cas d'une image par défaut
217
		//cas d'une image par défaut
218
		elseif (isset ($GLOBALS['_BAZAR_']['image_logo']) && $GLOBALS['_BAZAR_']['image_logo']!='') {
218
		elseif (isset ($GLOBALS['_BAZAR_']['image_logo']) && $GLOBALS['_BAZAR_']['image_logo']!='') {
219
			$res .= '<div id="fiche_image">'."\n";
219
			$res .= '<div id="fiche_image">'."\n";
220
			$res .= '<img src="client/bazar/images/'.$GLOBALS['_BAZAR_']['image_logo'].'" border=0 alt="'.BAZ_TEXTE_IMG_ALTERNATIF.'" width="130" height="130" />'."\n";
220
			$res .= '<img src="client/bazar/images/'.$GLOBALS['_BAZAR_']['image_logo'].'" border=0 alt="'.BAZ_TEXTE_IMG_ALTERNATIF.'" width="130" height="130" />'."\n";
221
			$res .= '</div>'."\n";
221
			$res .= '</div>'."\n";
222
		}
222
		}
223
		$res .= '<h1 id="fiche_titre">'.$ligne['bf_titre'].'</h1>'."\n";
223
		$res .= '<h1 id="fiche_titre">'.$ligne['bf_titre'].'</h1>'."\n";
224
		$res .= '<div id="BAZ_description">'.nl2br($ligne['bf_description']).'</div>'."\n";
224
		$res .= '<div id="BAZ_description">'.nl2br($ligne['bf_description']).'</div>'."\n";
225
		$tableau=baz_valeurs_template($GLOBALS['_BAZAR_']['template']);
225
		$tableau=baz_valeurs_template($GLOBALS['_BAZAR_']['template']);
226
		for ($i=0; $i<count($tableau); $i++) {
226
		for ($i=0; $i<count($tableau); $i++) {
227
			if (isset($ligne[$tableau[$i]['nom_bdd']]) && ( $tableau[$i]['type']=='texte' || $tableau[$i]['type']=='textelong' ) ) {
227
			if (isset($ligne[$tableau[$i]['nom_bdd']]) && ( $tableau[$i]['type']=='texte' || $tableau[$i]['type']=='textelong' ) ) {
228
				$val=$tableau[$i]['nom_bdd'];
228
				$val=$tableau[$i]['nom_bdd'];
229
				if (!in_array($val, array ('bf_titre', 'bf_description'))) {
229
				if (!in_array($val, array ('bf_titre', 'bf_description'))) {
230
					if ($ligne[$val] != '' and $ligne[$val] != BAZ_CHOISIR and $ligne[$val] != BAZ_NON_PRECISE) {
230
					if ($ligne[$val] != '' and $ligne[$val] != BAZ_CHOISIR and $ligne[$val] != BAZ_NON_PRECISE) {
231
						$res .= '<span class="rubrique">'.$tableau[$i]['label'].':</span>'."\n";
231
						$res .= '<span class="rubrique" id="'.$tableau[$i]['nom_bdd'].'_rubrique">'.$tableau[$i]['label'].':</span>'."\n";
232
						$res .= '<span class="description"> '.nl2br($ligne[$val]).'</span>'."\n".'<br />'."\n";
232
						$res .= '<span class="description" id="'.$tableau[$i]['nom_bdd'].'_description"> '.nl2br($ligne[$val]).'</span>'."\n".'<br />'."\n";
233
					}
233
					}
234
				}
234
				}
235
			}
235
			}
236
			elseif ( $tableau[$i]['type']=='liste' || $tableau[$i]['type']=='checkbox' ) {
236
			elseif ( $tableau[$i]['type']=='liste' || $tableau[$i]['type']=='checkbox' ) {
237
				//pour les champs renseignes par une liste, on va chercher le label de la liste, plutot que l'id				
237
				//pour les champs renseignes par une liste, on va chercher le label de la liste, plutot que l'id				
238
				$requete = 'SELECT blv_label FROM bazar_fiche_valeur_liste, bazar_liste_valeurs WHERE bfvl_ce_fiche='.$GLOBALS['_BAZAR_']['id_fiche'].
238
				$requete = 'SELECT blv_label FROM bazar_fiche_valeur_liste, bazar_liste_valeurs WHERE bfvl_ce_fiche='.$GLOBALS['_BAZAR_']['id_fiche'].
239
				' AND  bfvl_ce_liste='.$tableau[$i]['nom_bdd'].' AND bfvl_valeur=blv_valeur AND blv_ce_liste='.$tableau[$i]['nom_bdd'].' AND blv_ce_i18n="'.$GLOBALS['_BAZAR_']['langue'].'"';
239
				' AND  bfvl_ce_liste='.$tableau[$i]['nom_bdd'].' AND bfvl_valeur=blv_valeur AND blv_ce_liste='.$tableau[$i]['nom_bdd'].' AND blv_ce_i18n="'.$GLOBALS['_BAZAR_']['langue'].'"';
240
				$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
240
				$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
241
				if (DB::isError ($resultat)) {
241
				if (DB::isError ($resultat)) {
242
					die ($resultat->getMessage().'<br />'.$resultat->getDebugInfo()) ;
242
					die ($resultat->getMessage().'<br />'.$resultat->getDebugInfo()) ;
243
				}
243
				}
244
				$val='';$nb=0;
244
				$val='';$nb=0;
245
				while ($tab = $resultat->fetchRow()) {
245
				while ($tab = $resultat->fetchRow()) {
246
					if ($nb>0) $val .= ', ';
246
					if ($nb>0) $val .= ', ';
247
					$val .= $tab[0];
247
					$val .= $tab[0];
248
					$nb++;
248
					$nb++;
249
				}				
249
				}				
250
				if ($val != '' and $val != BAZ_CHOISIR and $val != BAZ_NON_PRECISE) {
250
				if ($val != '' and $val != BAZ_CHOISIR and $val != BAZ_NON_PRECISE) {
251
					$res .= '<span class="rubrique">'.$tableau[$i]['label'].':</span>'."\n";
251
					$res .= '<span class="rubrique" id="rubrique_'.$tableau[$i]['nom_bdd'].'">'.$tableau[$i]['label'].':</span>'."\n";
252
					$res .= '<span class="description"> '.$val.'</span>'."\n".'<br />'."\n";
252
					$res .= '<span class="description" id="description_'.$tableau[$i]['nom_bdd'].'"> '.$val.'</span>'."\n".'<br />'."\n";
253
				}
253
				}
254
			}
254
			}
255
			elseif ( $tableau[$i]['type']=='listedatedeb' || $tableau[$i]['type']=='listedatefin' ) {
255
			elseif ( $tableau[$i]['type']=='listedatedeb' || $tableau[$i]['type']=='listedatefin' ) {
256
				$val=$tableau[$i]['nom_bdd'];
256
				$val=$tableau[$i]['nom_bdd'];
257
				if (!in_array($val, array ('bf_date_debut_validite_fiche', 'bf_date_fin_validite_fiche'))) {
257
				if (!in_array($val, array ('bf_date_debut_validite_fiche', 'bf_date_fin_validite_fiche'))) {
258
					if ($ligne[$val] != '' && $ligne[$val] != '0000-00-00') {
258
					if ($ligne[$val] != '' && $ligne[$val] != '0000-00-00') {
259
						$res .= '<span class="rubrique">'.$tableau[$i]['label'].':</span>'."\n";
259
						$res .= '<span class="rubrique" id="'.$tableau[$i]['nom_bdd'].'_rubrique">'.$tableau[$i]['label'].':</span>'."\n";
260
						$res .= '<span class="description"> '.strftime('%d.%m.%Y',strtotime($ligne[$val])).'</span>'."\n".'<br />'."\n";
260
						$res .= '<span class="description" id="'.$tableau[$i]['nom_bdd'].'_description"> '.strftime('%d.%m.%Y',strtotime($ligne[$val])).'</span>'."\n".'<br />'."\n";
261
					}
261
					}
262
				}		
262
				}		
263
			}
263
			}
264
			elseif ( $tableau[$i]['type']=='wikini' ) {
264
			elseif ( $tableau[$i]['type']=='wikini' ) {
265
				$res .= '<div class="lien_wikini"><a href="wikini/'.baz_titre_wiki($ligne["bf_titre"]).'">'.BAZ_ENTRER_PROJET.'</a></div>'."\n";
265
				$res .= '<div class="lien_wikini"><a href="wikini/'.baz_titre_wiki($ligne["bf_titre"]).'">'.BAZ_ENTRER_PROJET.'</a></div>'."\n";
266
			}
266
			}
267
		}
267
		}
268
	//afficher les liens pour l'annonce
268
	//afficher les liens pour l'annonce
269
	$requete = 'SELECT  bu_url, bu_descriptif_url FROM bazar_url WHERE bu_ce_fiche='.$GLOBALS['_BAZAR_']['id_fiche'];
269
	$requete = 'SELECT  bu_url, bu_descriptif_url FROM bazar_url WHERE bu_ce_fiche='.$GLOBALS['_BAZAR_']['id_fiche'];
270
	$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
270
	$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
271
	if (DB::isError($resultat)) {
271
	if (DB::isError($resultat)) {
272
		die ($resultat->getMessage().$resultat->getDebugInfo()) ;
272
		die ($resultat->getMessage().$resultat->getDebugInfo()) ;
273
	}
273
	}
274
	if ($resultat->numRows()>0) {
274
	if ($resultat->numRows()>0) {
275
		$res .= '<span class="rubrique">'.BAZ_LIEN_INTERNET.':</span>'."\n";
275
		$res .= '<span class="rubrique">'.BAZ_LIEN_INTERNET.':</span>'."\n";
276
		$res .= '<span class="description">'."\n";
276
		$res .= '<span class="description">'."\n";
277
		$res .= '<ul>'."\n";
277
		$res .= '<ul>'."\n";
278
		while ($ligne1 = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
278
		while ($ligne1 = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
279
			$res .= '<li><a href="'.$ligne1['bu_url'].'" target="_blank">'.$ligne1['bu_descriptif_url'].'</a></li>'."\n";
279
			$res .= '<li><a href="'.$ligne1['bu_url'].'" target="_blank">'.$ligne1['bu_descriptif_url'].'</a></li>'."\n";
280
		}
280
		}
281
		$res .= '</ul></span>'."\n";
281
		$res .= '</ul></span>'."\n";
282
	}
282
	}
283
	
283
	
284
	//afficher les fichiers pour l'annonce
284
	//afficher les fichiers pour l'annonce
285
	$requete = 'SELECT  bfj_description, bfj_fichier FROM bazar_fichier_joint WHERE bfj_ce_fiche='.$GLOBALS['_BAZAR_']['id_fiche'];
285
	$requete = 'SELECT  bfj_description, bfj_fichier FROM bazar_fichier_joint WHERE bfj_ce_fiche='.$GLOBALS['_BAZAR_']['id_fiche'];
286
	$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
286
	$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
287
	if (DB::isError($resultat)) {
287
	if (DB::isError($resultat)) {
288
		die ($resultat->getMessage().$resultat->getDebugInfo()) ;
288
		die ($resultat->getMessage().$resultat->getDebugInfo()) ;
289
	}
289
	}
290
	if ($resultat->numRows()>0) {
290
	if ($resultat->numRows()>0) {
291
		$res .= '<span class="rubrique">'.BAZ_LISTE_FICHIERS_JOINTS.':</span>'."\n";
291
		$res .= '<span class="rubrique">'.BAZ_LISTE_FICHIERS_JOINTS.':</span>'."\n";
292
		$res .= '<span class="description">'."\n";
292
		$res .= '<span class="description">'."\n";
293
		$res .= '<ul>'."\n";
293
		$res .= '<ul>'."\n";
294
		while ($ligne2 = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
294
		while ($ligne2 = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
295
			$res .= '<li><a href="client/bazar/upload/'.$ligne2['bfj_fichier'].'">'.$ligne2['bfj_description'].'</a></li>'."\n";
295
			$res .= '<li><a href="client/bazar/upload/'.$ligne2['bfj_fichier'].'">'.$ligne2['bfj_description'].'</a></li>'."\n";
296
		}
296
		}
297
		$res .= '</ul></span>'."\n";
297
		$res .= '</ul></span>'."\n";
298
	}
298
	}
299
	$res .= '<div class="bulle_haut">&nbsp;</div>'."\n";
299
	$res .= '<div class="bulle_haut">&nbsp;</div>'."\n";
300
	$res .= '<div class="bulle_corps">'."\n";
300
	$res .= '<div class="bulle_corps">'."\n";
301
	
301
	
302
	//affichage du redacteur de la fiche
302
	//affichage du redacteur de la fiche
303
	$requete = 'SELECT '.BAZ_CHAMPS_NOM.', '.BAZ_CHAMPS_PRENOM.', '.BAZ_CHAMPS_EMAIL.
303
	$requete = 'SELECT '.BAZ_CHAMPS_NOM.', '.BAZ_CHAMPS_PRENOM.', '.BAZ_CHAMPS_EMAIL.
304
					' FROM '.BAZ_ANNUAIRE.' WHERE '.BAZ_CHAMPS_ID.'='.$ligne['bf_ce_utilisateur'];
304
					' FROM '.BAZ_ANNUAIRE.' WHERE '.BAZ_CHAMPS_ID.'='.$ligne['bf_ce_utilisateur'];
305
	$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
305
	$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
306
	if (DB::isError($resultat)) {
306
	if (DB::isError($resultat)) {
307
		die ($resultat->getMessage().$resultat->getDebugInfo()) ;
307
		die ($resultat->getMessage().$resultat->getDebugInfo()) ;
308
	}
308
	}
309
	while ($redacteur = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
309
	while ($redacteur = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
310
		$res .= BAZ_FICHE_ECRITE.'<a href="mailto:'.$redacteur[BAZ_CHAMPS_EMAIL].'">'.$redacteur[BAZ_CHAMPS_PRENOM].' '.$redacteur[BAZ_CHAMPS_NOM].'</a><br />'."\n";
310
		$res .= BAZ_FICHE_ECRITE.'<a href="mailto:'.$redacteur[BAZ_CHAMPS_EMAIL].'">'.$redacteur[BAZ_CHAMPS_PRENOM].' '.$redacteur[BAZ_CHAMPS_NOM].'</a><br />'."\n";
311
	}
311
	}
312
	$res .= BAZ_NB_VUS.'<strong>'.$ligne['bf_nb_consultations'].'</strong>'.BAZ_FOIS.'<br />'."\n";
312
	$res .= BAZ_NB_VUS.'<strong>'.$ligne['bf_nb_consultations'].'</strong>'.BAZ_FOIS.'<br />'."\n";
313
	$res .= '</div>'."\n";
313
	$res .= '</div>'."\n";
314
	$res .= '<div class="bulle_bas">&nbsp;</div>'."\n";
314
	$res .= '<div class="bulle_bas">&nbsp;</div>'."\n";
315
	$res .= '<div id="BAZ_bas_page">';
315
	$res .= '<div id="BAZ_bas_page">';
316
	}
316
	}
317
	
317
	
318
	//informations complementaires (id fiche, etat publication,... )
318
	//informations complementaires (id fiche, etat publication,... )
319
	if ($danslappli==1) {
319
	if ($danslappli==1) {
320
		if ($ligne['bf_statut_fiche']==1 && $GLOBALS['_BAZAR_']['appropriation']!=1) {
320
		if ($ligne['bf_statut_fiche']==1 && $GLOBALS['_BAZAR_']['appropriation']!=1) {
321
			if ($ligne['bf_date_debut_validite_fiche'] != '0000-00-00' && $ligne['bf_date_fin_validite_fiche'] != '0000-00-00') {
321
			if ($ligne['bf_date_debut_validite_fiche'] != '0000-00-00' && $ligne['bf_date_fin_validite_fiche'] != '0000-00-00') {
322
			$res .= '<span class="rubrique">'.BAZ_PUBLIEE.':</span> '.BAZ_DU.
322
			$res .= '<span class="rubrique">'.BAZ_PUBLIEE.':</span> '.BAZ_DU.
323
					' '.strftime('%d.%m.%Y',strtotime($ligne['bf_date_debut_validite_fiche'])).' '.
323
					' '.strftime('%d.%m.%Y',strtotime($ligne['bf_date_debut_validite_fiche'])).' '.
324
					BAZ_AU.' '.strftime('%d.%m.%Y',strtotime($ligne['bf_date_fin_validite_fiche'])).'<br />'."\n";
324
					BAZ_AU.' '.strftime('%d.%m.%Y',strtotime($ligne['bf_date_fin_validite_fiche'])).'<br />'."\n";
325
			}
325
			}
326
		}
326
		}
327
		elseif ($GLOBALS['_BAZAR_']['appropriation']!=1 || $ligne['bf_statut_fiche']!=1) {
327
		elseif ($GLOBALS['_BAZAR_']['appropriation']!=1 || $ligne['bf_statut_fiche']!=1) {
328
			$res .= '<span class="rubrique">'.BAZ_PUBLIEE.':</span> '.BAZ_NON;							
328
			$res .= '<span class="rubrique">'.BAZ_PUBLIEE.':</span> '.BAZ_NON;							
329
			if ( $est_admin ) {
329
			if ( $est_admin ) {
330
				$res .= '&nbsp;&nbsp;&nbsp;<strong>'.BAZ_VALIDER_PUBLICATION.'&nbsp;:&nbsp;</strong>'."\n";
330
				$res .= '&nbsp;&nbsp;&nbsp;<strong>'.BAZ_VALIDER_PUBLICATION.'&nbsp;:&nbsp;</strong>'."\n";
331
				$lien_publie = &$GLOBALS['_BAZAR_']['url'];
331
				$lien_publie = &$GLOBALS['_BAZAR_']['url'];
332
				$lien_publie->addQueryString('action', BAZ_VOIR_FICHE);
332
				$lien_publie->addQueryString('action', BAZ_VOIR_FICHE);
333
				$lien_publie->addQueryString('id_fiche', $GLOBALS['_BAZAR_']['id_fiche']);
333
				$lien_publie->addQueryString('id_fiche', $GLOBALS['_BAZAR_']['id_fiche']);
334
				$lien_publie->addQueryString('typeannonce', $ligne['bf_ce_nature']);
334
				$lien_publie->addQueryString('typeannonce', $ligne['bf_ce_nature']);
335
				$lien_publie->addQueryString('publiee', 1);
335
				$lien_publie->addQueryString('publiee', 1);
336
				$res .= '<a href="'.$lien_publie->getURL().'">'.BAZ_OUI.'</a>&nbsp;/&nbsp;';
336
				$res .= '<a href="'.$lien_publie->getURL().'">'.BAZ_OUI.'</a>&nbsp;/&nbsp;';
337
				$lien_publie->removeQueryString('publiee');
337
				$lien_publie->removeQueryString('publiee');
338
				$lien_publie->addQueryString('publiee', 0);
338
				$lien_publie->addQueryString('publiee', 0);
339
				$res .='<a href="'.$lien_publie->getURL().'">'.BAZ_NON.'</a>'."\n";
339
				$res .='<a href="'.$lien_publie->getURL().'">'.BAZ_NON.'</a>'."\n";
340
				$lien_publie->removeQueryString('publiee');
340
				$lien_publie->removeQueryString('publiee');
341
			}
341
			}
342
			$res .= '<br />'."\n";
342
			$res .= '<br />'."\n";
343
		}
343
		}
344
		//affichage des infos pouvant interesser les admins
344
		//affichage des infos pouvant interesser les admins
345
		if ( $est_admin ) {
345
		if ( $est_admin ) {
346
			$res .= '<span class="rubrique" id="numero_fiche">'.BAZ_NUM_FICHE.':</span> '.$GLOBALS['_BAZAR_']['id_fiche'].'<br />'."\n";
346
			$res .= '<span class="rubrique" id="numero_fiche">'.BAZ_NUM_FICHE.':</span> '.$GLOBALS['_BAZAR_']['id_fiche'].'<br />'."\n";
347
			$res .= '<span class="rubrique" id="date_creation">'.BAZ_DATE_CREATION.' :</span> '.strftime('%d.%m.%Y &agrave; %H:%M',strtotime($ligne['bf_date_creation_fiche'])).'<br />'."\n";			
347
			$res .= '<span class="rubrique" id="date_creation">'.BAZ_DATE_CREATION.' :</span> '.strftime('%d.%m.%Y &agrave; %H:%M',strtotime($ligne['bf_date_creation_fiche'])).'<br />'."\n";			
348
		}		
348
		}		
349
		//affichage des infos et du lien pour la mise a jour de la fiche
349
		//affichage des infos et du lien pour la mise a jour de la fiche
350
		if ( $est_admin || $GLOBALS['_BAZAR_']['annonceur']==$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID) ) {			
350
		if ( $est_admin || $GLOBALS['_BAZAR_']['annonceur']==$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID) ) {			
351
			$res .= '<span class="rubrique" id="date_mise_a_jour">'.BAZ_DATE_MAJ.' :</span> '.strftime('%d.%m.%Y &agrave; %H:%M',strtotime($ligne['bf_date_maj_fiche']))."\n";
351
			$res .= '<span class="rubrique" id="date_mise_a_jour">'.BAZ_DATE_MAJ.' :</span> '.strftime('%d.%m.%Y &agrave; %H:%M',strtotime($ligne['bf_date_maj_fiche']))."\n";
352
			$lien_modifier=$GLOBALS['_BAZAR_']['url'];
352
			$lien_modifier=$GLOBALS['_BAZAR_']['url'];
353
			$lien_modifier->addQueryString('action', BAZ_ACTION_MODIFIER);
353
			$lien_modifier->addQueryString('action', BAZ_ACTION_MODIFIER);
354
			$lien_modifier->addQueryString('id_fiche', $GLOBALS['_BAZAR_']['id_fiche']);
354
			$lien_modifier->addQueryString('id_fiche', $GLOBALS['_BAZAR_']['id_fiche']);
355
			$lien_modifier->addQueryString('typeannonce', $ligne['bf_ce_nature']);
355
			$lien_modifier->addQueryString('typeannonce', $ligne['bf_ce_nature']);
356
			$res .= '&nbsp;&nbsp;&nbsp;<a href="'.$lien_modifier->getURL().'" id="modifier_fiche">'.BAZ_MODIFIER_LA_FICHE.'</a>'."\n";
356
			$res .= '&nbsp;&nbsp;&nbsp;<a href="'.$lien_modifier->getURL().'" id="modifier_fiche">'.BAZ_MODIFIER_LA_FICHE.'</a>'."\n";
357
		}
357
		}
358
	}
358
	}
359
	$res .= '</div>'."\n";
359
	$res .= '</div>'."\n";
360
	$res .= '</div>'."\n";
360
	$res .= '</div>'."\n";
361
	
361
	
362
	//on ajoute les appropriations, s'il le faut
362
	//on ajoute les appropriations, s'il le faut
363
	if (($danslappli==1)and($GLOBALS['_BAZAR_']['appropriation']==1)) {
363
	if (($danslappli==1)and($GLOBALS['_BAZAR_']['appropriation']==1)) {
364
		$res .= '<br />'."\n".'<div class="BAZ_cadre_fiche">'."\n";
364
		$res .= '<br />'."\n".'<div class="BAZ_cadre_fiche">'."\n";
365
		$res .= '<h3>'.BAZ_LES_STRUCTURES_POSSEDANT_UNE_RESSOURCE.'</h3>'."\n";		
365
		$res .= '<h3>'.BAZ_LES_STRUCTURES_POSSEDANT_UNE_RESSOURCE.'</h3>'."\n";		
366
		$requete = 'SELECT '.BAZ_CHAMPS_ID.', '.BAZ_CHAMPS_NOM.' FROM bazar_appropriation,'.BAZ_ANNUAIRE.' WHERE ba_ce_id_fiche='.$GLOBALS['_BAZAR_']['id_fiche'].' AND ba_ce_id_structure='.BAZ_CHAMPS_ID.' ORDER BY '.BAZ_CHAMPS_NOM.' ASC';
366
		$requete = 'SELECT '.BAZ_CHAMPS_ID.', '.BAZ_CHAMPS_NOM.' FROM bazar_appropriation,'.BAZ_ANNUAIRE.' WHERE ba_ce_id_fiche='.$GLOBALS['_BAZAR_']['id_fiche'].' AND ba_ce_id_structure='.BAZ_CHAMPS_ID.' ORDER BY '.BAZ_CHAMPS_NOM.' ASC';
367
		$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
367
		$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
368
		if (DB::isError ($resultat)) {
368
		if (DB::isError ($resultat)) {
369
			die ($resultat->getMessage().'<br />'.$resultat->getDebugInfo()) ;
369
			die ($resultat->getMessage().'<br />'.$resultat->getDebugInfo()) ;
370
		}
370
		}
371
		$possede_ressource=0;
371
		$possede_ressource=0;
372
		if ($resultat->numRows()>0) {
372
		if ($resultat->numRows()>0) {
373
			$res .= BAZ_IL_Y_A.$resultat->numRows().' ';
373
			$res .= BAZ_IL_Y_A.$resultat->numRows().' ';
374
			if ($resultat->numRows()==1) $res .= BAZ_STRUCTURE_POSSEDANT.'<br />'."\n";
374
			if ($resultat->numRows()==1) $res .= BAZ_STRUCTURE_POSSEDANT.'<br />'."\n";
375
			else $res .= BAZ_STRUCTURES_POSSEDANT.'<br />'."\n";
375
			else $res .= BAZ_STRUCTURES_POSSEDANT.'<br />'."\n";
376
			$res .= '<ul>'."\n";
376
			$res .= '<ul>'."\n";
377
			while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
377
			while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
378
				$res .= '<li><a href="'.BAZ_URL_ANNUAIRE.'&amp;voir_fiche='.$ligne[BAZ_CHAMPS_ID].'" onclick="javascript:window.open(this.href);return false;">'.$ligne[BAZ_CHAMPS_NOM].'</a></li>'."\n";
378
				$res .= '<li><a href="'.BAZ_URL_ANNUAIRE.'&amp;voir_fiche='.$ligne[BAZ_CHAMPS_ID].'" onclick="javascript:window.open(this.href);return false;">'.$ligne[BAZ_CHAMPS_NOM].'</a></li>'."\n";
379
				if ($GLOBALS['AUTH']->getAuth() && $GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID)==$ligne[BAZ_CHAMPS_ID]) $possede_ressource=1;
379
				if ($GLOBALS['AUTH']->getAuth() && $GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID)==$ligne[BAZ_CHAMPS_ID]) $possede_ressource=1;
380
			}
380
			}
381
			$res .= '</ul><br />'."\n";
381
			$res .= '</ul><br />'."\n";
382
		}
382
		}
383
		else $res .= BAZ_PAS_D_APPROPRIATION.'<br /><br />'."\n";
383
		else $res .= BAZ_PAS_D_APPROPRIATION.'<br /><br />'."\n";
384
		$res .='<p class="bulle_corps">'."\n";
384
		$res .='<p class="bulle_corps">'."\n";
385
		$lien_appropriation = $GLOBALS['_BAZAR_']['url'];
385
		$lien_appropriation = $GLOBALS['_BAZAR_']['url'];
386
		$lien_appropriation->addQueryString('action', BAZ_VOIR_FICHE);
386
		$lien_appropriation->addQueryString('action', BAZ_VOIR_FICHE);
387
		$lien_appropriation->addQueryString('id_fiche', $GLOBALS['_BAZAR_']['id_fiche']);			
387
		$lien_appropriation->addQueryString('id_fiche', $GLOBALS['_BAZAR_']['id_fiche']);			
388
		if ($possede_ressource) {
388
		if ($possede_ressource) {
389
			$lien_appropriation->addQueryString('appropriation', 0);
389
			$lien_appropriation->addQueryString('appropriation', 0);
390
			$res .= BAZ_POSSEDE_DEJA_RESSOURCE.'<br />'."\n".'<a href="'.$lien_appropriation->getURL().'">'.BAZ_CLIQUER_POUR_VOUS_ENLEVER.'</a>'."\n";
390
			$res .= BAZ_POSSEDE_DEJA_RESSOURCE.'<br />'."\n".'<a href="'.$lien_appropriation->getURL().'">'.BAZ_CLIQUER_POUR_VOUS_ENLEVER.'</a>'."\n";
391
			$lien_appropriation->removeQueryString('appropriation');
391
			$lien_appropriation->removeQueryString('appropriation');
392
		}
392
		}
393
		elseif ($GLOBALS['AUTH']->getAuth() && $GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_EST_STRUCTURE)) {
393
		elseif ($GLOBALS['AUTH']->getAuth() && $GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_EST_STRUCTURE)) {
394
			$lien_appropriation->addQueryString('appropriation', 1);
394
			$lien_appropriation->addQueryString('appropriation', 1);
395
			$res .= BAZ_SI_POSSEDE_RESSOURCE.'<br />'."\n".'<a href="'.$lien_appropriation->getURL().'">'.BAZ_CLIQUER_POUR_APPARAITRE.'</a>'."\n";
395
			$res .= BAZ_SI_POSSEDE_RESSOURCE.'<br />'."\n".'<a href="'.$lien_appropriation->getURL().'">'.BAZ_CLIQUER_POUR_APPARAITRE.'</a>'."\n";
396
			$lien_appropriation->removeQueryString('appropriation');
396
			$lien_appropriation->removeQueryString('appropriation');
397
		}
397
		}
398
		elseif ($GLOBALS['AUTH']->getAuth() && !$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_EST_STRUCTURE)) {
398
		elseif ($GLOBALS['AUTH']->getAuth() && !$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_EST_STRUCTURE)) {
399
			$res .= BAZ_IL_FAUT_ETRE_STRUCTURE."\n";
399
			$res .= BAZ_IL_FAUT_ETRE_STRUCTURE."\n";
400
		}
400
		}
401
		elseif (!$GLOBALS['AUTH']->getAuth()) {
401
		elseif (!$GLOBALS['AUTH']->getAuth()) {
402
			$res .= BAZ_IL_FAUT_ETRE_IDENTIFIE_STRUCTURE."\n";
402
			$res .= BAZ_IL_FAUT_ETRE_IDENTIFIE_STRUCTURE."\n";
403
		}
403
		}
404
		$res .='</p>'."\n";
404
		$res .='</p>'."\n";
405
		$res .= '</div>'."\n";
405
		$res .= '</div>'."\n";
406
	}
406
	}
407
	
407
	
408
	//on ajoute les commentaires, s'il le faut
408
	//on ajoute les commentaires, s'il le faut
409
	if (($danslappli==1)and($GLOBALS['_BAZAR_']['commentaire']==1)) {
409
	if (($danslappli==1)and($GLOBALS['_BAZAR_']['commentaire']==1)) {
410
		$res .= '<br />'."\n".'<div class="BAZ_cadre_fiche">'."\n";
410
		$res .= '<br />'."\n".'<div class="BAZ_cadre_fiche">'."\n";
411
		$res .= '<h3>'.BAZ_LES_COMMENTAIRES.'</h3>'."\n";
411
		$res .= '<h3>'.BAZ_LES_COMMENTAIRES.'</h3>'."\n";
412
		$requete = 'SELECT * FROM bazar_commentaires WHERE bc_ce_id_fiche='.$GLOBALS['_BAZAR_']['id_fiche'].' ORDER BY bc_date ASC';
412
		$requete = 'SELECT * FROM bazar_commentaires WHERE bc_ce_id_fiche='.$GLOBALS['_BAZAR_']['id_fiche'].' ORDER BY bc_date ASC';
413
		$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
413
		$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
414
		if (DB::isError ($resultat)) {
414
		if (DB::isError ($resultat)) {
415
			die ($resultat->getMessage().'<br />'.$resultat->getDebugInfo()) ;
415
			die ($resultat->getMessage().'<br />'.$resultat->getDebugInfo()) ;
416
		}
416
		}
417
		if ($resultat->numRows()>0) {
417
		if ($resultat->numRows()>0) {
418
			$res .= BAZ_IL_Y_A.$resultat->numRows().' ';
418
			$res .= BAZ_IL_Y_A.$resultat->numRows().' ';
419
			if ($resultat->numRows()==1) $res .= BAZ_COMMENTAIRE.'<br />'."\n";
419
			if ($resultat->numRows()==1) $res .= BAZ_COMMENTAIRE.'<br />'."\n";
420
			else $res .= BAZ_COMMENTAIRES.'<br />'."\n";
420
			else $res .= BAZ_COMMENTAIRES.'<br />'."\n";
421
			while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
421
			while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
422
				$res .= '<div class="bulle_haut">&nbsp;</div>'."\n";
422
				$res .= '<div class="bulle_haut">&nbsp;</div>'."\n";
423
				$res .= '<div class="bulle_corps">'."\n";
423
				$res .= '<div class="bulle_corps">'."\n";
424
				//affichage du commentaire
424
				//affichage du commentaire
425
				$res .= $ligne['bc_commentaire'].'<br />'."\n";
425
				$res .= $ligne['bc_commentaire'].'<br />'."\n";
426
				$res .= '</div>'."\n";
426
				$res .= '</div>'."\n";
427
				$res .= '<div class="bulle_bas">'."\n";
427
				$res .= '<div class="bulle_bas">'."\n";
428
				$res .= '<div style="font-size:9px;margin-left:10px;">'.BAZ_PAR.' : <strong>'.$ligne['bc_nom'].'</strong>'.BAZ_ECRIT_LE.$ligne['bc_date'].'</div>'."\n";
428
				$res .= '<div style="font-size:9px;margin-left:10px;">'.BAZ_PAR.' : <strong>'.$ligne['bc_nom'].'</strong>'.BAZ_ECRIT_LE.$ligne['bc_date'].'</div>'."\n";
429
				//pour les identifies seulement, administrateurs de la rubrique ou superadmins
429
				//pour les identifies seulement, administrateurs de la rubrique ou superadmins
430
				if ($est_admin==1) {
430
				if ($est_admin==1) {
431
					$url_comment= $GLOBALS['_BAZAR_']['url'];
431
					$url_comment= $GLOBALS['_BAZAR_']['url'];
432
					$url_comment->addQueryString('action', BAZ_VOIR_FICHE);
432
					$url_comment->addQueryString('action', BAZ_VOIR_FICHE);
433
					$url_comment->addQueryString('id_fiche', $GLOBALS['_BAZAR_']['id_fiche']);
433
					$url_comment->addQueryString('id_fiche', $GLOBALS['_BAZAR_']['id_fiche']);
434
					$url_comment->addQueryString('id_commentaire', $ligne['bc_id_commentaire']);
434
					$url_comment->addQueryString('id_commentaire', $ligne['bc_id_commentaire']);
435
					$res .= '<a href="'.$url_comment->getURL().'" style="font-size:9px;float:right;">'.BAZ_SUPPRIMER.'</a>'."\n";
435
					$res .= '<a href="'.$url_comment->getURL().'" style="font-size:9px;float:right;">'.BAZ_SUPPRIMER.'</a>'."\n";
436
				}
436
				}
437
				$res .= '</div>'."\n";
437
				$res .= '</div>'."\n";
438
			}
438
			}
439
		}
439
		}
440
		else $res .= BAZ_PAS_DE_COMMENTAIRES.'<br /><br />'."\n";
440
		else $res .= BAZ_PAS_DE_COMMENTAIRES.'<br /><br />'."\n";
441
		
441
		
442
		//formulaire des commentaires
442
		//formulaire des commentaires
443
		$form_commentaire = new HTML_QuickForm('bazar_commentaire', 'post', $url);
443
		$form_commentaire = new HTML_QuickForm('bazar_commentaire', 'post', $url);
444
		$squelette =& $form_commentaire->defaultRenderer();
444
		$squelette =& $form_commentaire->defaultRenderer();
445
		$squelette->setFormTemplate("\n".'<form {attributes}>'."\n".'{content}'."\n".'</form>'."\n");
445
		$squelette->setFormTemplate("\n".'<form {attributes}>'."\n".'{content}'."\n".'</form>'."\n");
446
		$squelette->setElementTemplate( '<label style="width:200px;">{label}'.
446
		$squelette->setElementTemplate( '<label style="width:200px;">{label}'.
447
										'<!-- BEGIN required --><span class="symbole_obligatoire">&nbsp;*</span><!-- END required -->'."\n".
447
										'<!-- BEGIN required --><span class="symbole_obligatoire">&nbsp;*</span><!-- END required -->'."\n".
448
									    '</label><br />'."\n".'{element}<br />'."\n");
448
									    '</label><br />'."\n".'{element}<br />'."\n");
449
		$squelette->setRequiredNoteTemplate("\n".'<span class="symbole_obligatoire"> *{requiredNote}</span>'."\n");
449
		$squelette->setRequiredNoteTemplate("\n".'<span class="symbole_obligatoire"> *{requiredNote}</span>'."\n");
450
		$option=array('style'=>'width:300px;border:1px solid #000;', 'maxlength'=>100);
450
		$option=array('style'=>'width:300px;border:1px solid #000;', 'maxlength'=>100);
451
		$form_commentaire->addElement('text', 'Nom', BAZ_ENTREZ_VOTRE_NOM, $option);
451
		$form_commentaire->addElement('text', 'Nom', BAZ_ENTREZ_VOTRE_NOM, $option);
452
		$option=array('style'=>'width:95%;height:100px;white-space: pre;padding:3px;border:1px solid #000;');
452
		$option=array('style'=>'width:95%;height:100px;white-space: pre;padding:3px;border:1px solid #000;');
453
		require_once PAP_CHEMIN_API_PEAR.'HTML/QuickForm/textarea.php';
453
		require_once PAP_CHEMIN_API_PEAR.'HTML/QuickForm/textarea.php';
454
		$formtexte= new HTML_QuickForm_textarea('Commentaire', BAZ_ENTREZ_VOTRE_COMMENTAIRE, $option);
454
		$formtexte= new HTML_QuickForm_textarea('Commentaire', BAZ_ENTREZ_VOTRE_COMMENTAIRE, $option);
455
		$form_commentaire->addElement($formtexte) ;
455
		$form_commentaire->addElement($formtexte) ;
456
		$option=array('style'=>'border:1px solid #000;');
456
		$option=array('style'=>'border:1px solid #000;');
457
		$form_commentaire->addElement('submit', 'Envoyer', BAZ_ENVOYER, $option);
457
		$form_commentaire->addElement('submit', 'Envoyer', BAZ_ENVOYER, $option);
458
		$form_commentaire->addRule('Nom', BAZ_NOM_REQUIS, 'required', '', 'client') ;
458
		$form_commentaire->addRule('Nom', BAZ_NOM_REQUIS, 'required', '', 'client') ;
459
		$form_commentaire->addRule('Commentaire', BAZ_COMMENTAIRE_REQUIS, 'required', '', 'client') ;
459
		$form_commentaire->addRule('Commentaire', BAZ_COMMENTAIRE_REQUIS, 'required', '', 'client') ;
460
		$form_commentaire->setRequiredNote(BAZ_CHAMPS_REQUIS) ;
460
		$form_commentaire->setRequiredNote(BAZ_CHAMPS_REQUIS) ;
461
		$res .= $form_commentaire->toHTML();
461
		$res .= $form_commentaire->toHTML();
462
		$res .= '</div>'."\n";
462
		$res .= '</div>'."\n";
463
	}
463
	}
464
	
464
	
465
	return $res ;
465
	return $res ;
466
}
466
}
467
 
467
 
468
 
468
 
469
/** RSSversHTML () transforme un flux RSS (en XML) en page HTML
469
/** RSSversHTML () transforme un flux RSS (en XML) en page HTML
470
*
470
*
471
*   On passe en paramètre le contenu du flux RSS, on affiche ou non la description,
471
*   On passe en paramètre le contenu du flux RSS, on affiche ou non la description,
472
*   et on choisit de format de la date à l'affichage. On a en sortie du code HTML à afficher 
472
*   et on choisit de format de la date à l'affichage. On a en sortie du code HTML à afficher 
473
*
473
*
474
*   @param  string   le contenu du flux RSS
474
*   @param  string   le contenu du flux RSS
475
*   @param  boolean  afficher ou non la description
475
*   @param  boolean  afficher ou non la description
476
*   @param  string  choisir le format de date: jmah (12/02/2004 12h34) jmh (12/02 12h34) jma (12/02/2004) jm (12/02) ou rien
476
*   @param  string  choisir le format de date: jmah (12/02/2004 12h34) jmh (12/02 12h34) jma (12/02/2004) jm (12/02) ou rien
477
*
477
*
478
*   @return  string    le code HTML
478
*   @return  string    le code HTML
479
*/
479
*/
480
function RSSversHTML($rss, $voirdesc, $formatdate, $affichenb) {
480
function RSSversHTML($rss, $voirdesc, $formatdate, $affichenb) {
481
	if ($rss!='') {
481
	if ($rss!='') {
482
		$rawitems='';$title='';$url='';$cat='';$date='';
482
		$rawitems='';$title='';$url='';$cat='';$date='';
483
		$res='';
483
		$res='';
484
		if( eregi('<item>(.*)</item>', $rss, $rawitems ) ) {
484
		if( eregi('<item>(.*)</item>', $rss, $rawitems ) ) {
485
			$items = explode('<item>', $rawitems[0]);
485
			$items = explode('<item>', $rawitems[0]);
486
			$res.='<ul id="BAZ_liste_fiche">'."\n";
486
			$res.='<ul id="BAZ_liste_fiche">'."\n";
487
			for( $i = 0; $i < count($items)-1; $i++ ) {
487
			for( $i = 0; $i < count($items)-1; $i++ ) {
488
				eregi('<title>(.*)</title>',$items[$i+1], $title );
488
				eregi('<title>(.*)</title>',$items[$i+1], $title );
489
				eregi('<link>(.*)</link>',$items[$i+1], $url );
489
				eregi('<link>(.*)</link>',$items[$i+1], $url );
490
				eregi('<description>(.*)</description>',$items[$i+1], $cat);
490
				eregi('<description>(.*)</description>',$items[$i+1], $cat);
491
				eregi('<pubDate>(.*)</pubDate>',$items[$i+1], $date);
491
				eregi('<pubDate>(.*)</pubDate>',$items[$i+1], $date);
492
				$res.='<li>';
492
				$res.='<li>';
493
				if ($formatdate=='jm') {$res.=strftime('%d.%m',strtotime($date[1])).': ';}
493
				if ($formatdate=='jm') {$res.=strftime('%d.%m',strtotime($date[1])).': ';}
494
				if ($formatdate=='jma') {$res.=strftime('%d.%m.%Y',strtotime($date[1])).': ';}
494
				if ($formatdate=='jma') {$res.=strftime('%d.%m.%Y',strtotime($date[1])).': ';}
495
				if ($formatdate=='jmh') {$res.=strftime('%d.%m %H:%M',strtotime($date[1])).': ';}
495
				if ($formatdate=='jmh') {$res.=strftime('%d.%m %H:%M',strtotime($date[1])).': ';}
496
				if ($formatdate=='jmah') {$res.=strftime('%d.%m.%Y %H:%M',strtotime($date[1])).': ';}
496
				if ($formatdate=='jmah') {$res.=strftime('%d.%m.%Y %H:%M',strtotime($date[1])).': ';}
497
				$res.='<a href="'.preg_replace ('/&amp;/', '&', $url[1]).'">'.$title[1].'</a>';
497
				$res.='<a href="'.preg_replace ('/&amp;/', '&', $url[1]).'">'.$title[1].'</a>';
498
				if ($voirdesc) {$res.=$cat[1];}
498
				if ($voirdesc) {$res.=$cat[1];}
499
				// Ajout du bouton supprimer pour les superadministrateur
499
				// Ajout du bouton supprimer pour les superadministrateur
500
				if (($GLOBALS['AUTH']->getAuth() && niveau_droit(0,$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID))=='superadministrateur')and($url[1]!='#')) {
500
				if (($GLOBALS['AUTH']->getAuth() && niveau_droit(0,$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID))=='superadministrateur')and($url[1]!='#')) {
501
					$mon_url = preg_replace ('/&amp;/', '&', $url[1]) ; 
501
					$mon_url = preg_replace ('/&amp;/', '&', $url[1]) ; 
502
					$url_suppr = new Net_URL(preg_replace ('/&amp;/', '&', $mon_url)) ;
502
					$url_suppr = new Net_URL(preg_replace ('/&amp;/', '&', $mon_url)) ;
503
					$url_suppr->addQueryString('action', BAZ_ACTION_SUPPRESSION) ;
503
					$url_suppr->addQueryString('action', BAZ_ACTION_SUPPRESSION) ;
504
		        	$res .= ' ( <a href="'.$url_suppr->getURL().
504
		        	$res .= ' ( <a href="'.$url_suppr->getURL().
505
							'" onclick="javascript:return confirm(\''.BAZ_SUPPRIMER.' ?\');">'.
505
							'" onclick="javascript:return confirm(\''.BAZ_SUPPRIMER.' ?\');">'.
506
							BAZ_SUPPRIMER.'</a> )'."\n" ;
506
							BAZ_SUPPRIMER.'</a> )'."\n" ;
507
					}
507
					}
508
				$res.='</li>'."\n";
508
				$res.='</li>'."\n";
509
			}
509
			}
510
			$res.='</ul>'."\n";
510
			$res.='</ul>'."\n";
511
			if ($affichenb==1) {
511
			if ($affichenb==1) {
512
				//une annonce trouvee, on accorde au singulier
512
				//une annonce trouvee, on accorde au singulier
513
				if (((count($items)-1)==1)and($title!=BAZ_PAS_D_ANNONCES)) {
513
				if (((count($items)-1)==1)and($title!=BAZ_PAS_D_ANNONCES)) {
514
					$res = '<br /><h4>'.BAZ_IL_Y_A.' 1 '.BAZ_FICHE_CORRESPONDANTE.'</h4><br />'."\n".$res;
514
					$res = '<br /><h4>'.BAZ_IL_Y_A.' 1 '.BAZ_FICHE_CORRESPONDANTE.'</h4><br />'."\n".$res;
515
				}
515
				}
516
				//plusieures annonces trouvees, on accorde au pluriel
516
				//plusieures annonces trouvees, on accorde au pluriel
517
				else {
517
				else {
518
					$res = '<br /><h4>'.BAZ_IL_Y_A.(count($items)-1).' '.BAZ_FICHES_CORRESPONDANTES.'</h4><br />'."\n".$res;
518
					$res = '<br /><h4>'.BAZ_IL_Y_A.(count($items)-1).' '.BAZ_FICHES_CORRESPONDANTES.'</h4><br />'."\n".$res;
519
				}
519
				}
520
			}
520
			}
521
			//cas des fiches pas trouvées
521
			//cas des fiches pas trouvées
522
			if (((count($items)-1)==1)and($title[1]==BAZ_PAS_D_ANNONCES)) {
522
			if (((count($items)-1)==1)and($title[1]==BAZ_PAS_D_ANNONCES)) {
523
				$res = '<br /><h4>'.BAZ_PAS_D_ANNONCES.'</h4><br />'."\n";
523
				$res = '<br /><h4>'.BAZ_PAS_D_ANNONCES.'</h4><br />'."\n";
524
			}  
524
			}  
525
		}
525
		}
526
	}
526
	}
527
	else $res = BAZ_PAS_D_ANNONCES;
527
	else $res = BAZ_PAS_D_ANNONCES;
528
	
528
	
529
	return $res;
529
	return $res;
530
}
530
}
531
 
531
 
532
/** gen_RSS() - generer un fichier de flux RSS par type d'annonce 
532
/** gen_RSS() - generer un fichier de flux RSS par type d'annonce 
533
*
533
*
534
* @param   string Le type de l'annonce (laisser vide pour tout type d'annonce)
534
* @param   string Le type de l'annonce (laisser vide pour tout type d'annonce)
535
* @param   integer Le nombre d'annonces a regrouper dans le fichier XML (laisser vide pour toutes)
535
* @param   integer Le nombre d'annonces a regrouper dans le fichier XML (laisser vide pour toutes)
536
* @param   integer L'identifiant de l'emetteur (laisser vide pour tous)
536
* @param   integer L'identifiant de l'emetteur (laisser vide pour tous)
537
* @param   integer L'etat de validation de l'annonce (laisser 1 pour les annonces validees, 0 pour les non-validees)
537
* @param   integer L'etat de validation de l'annonce (laisser 1 pour les annonces validees, 0 pour les non-validees)
538
* @param   string La requete SQL personnalisee
538
* @param   string La requete SQL personnalisee
539
* @param   integer La categorie des fiches bazar
539
* @param   integer La categorie des fiches bazar
540
*
540
*
541
* @return  string Le code du flux RSS
541
* @return  string Le code du flux RSS
542
*/
542
*/
543
function gen_RSS($typeannonce='', $nbitem='', $emetteur='', $valide=1, $requeteSQL='', $requeteSQLFrom = '', $requeteWhereListe = '', $categorie_nature='') {
543
function gen_RSS($typeannonce='', $nbitem='', $emetteur='', $valide=1, $requeteSQL='', $requeteSQLFrom = '', $requeteWhereListe = '', $categorie_nature='') {
544
	// generation de la requete MySQL personnalisee
544
	// generation de la requete MySQL personnalisee
545
	$req_where=0;
545
	$req_where=0;
546
	$requete = 'SELECT DISTINCT bf_id_fiche, bf_titre, bf_date_debut_validite_fiche, bf_description,  bn_label_nature, bf_date_creation_fiche '.
546
	$requete = 'SELECT DISTINCT bf_id_fiche, bf_titre, bf_date_debut_validite_fiche, bf_description,  bn_label_nature, bf_date_creation_fiche '.
547
				'FROM bazar_fiche, bazar_nature '.$requeteSQLFrom.' WHERE '.$requeteWhereListe;
547
				'FROM bazar_fiche, bazar_nature '.$requeteSQLFrom.' WHERE '.$requeteWhereListe;
548
	if ($valide!=2) {
548
	if ($valide!=2) {
549
		$requete .= 'bf_statut_fiche='.$valide;
549
		$requete .= 'bf_statut_fiche='.$valide;
550
		$req_where=1;
550
		$req_where=1;
551
	}
551
	}
552
	$nomflux=BAZ_DERNIERE_ACTU;
552
	$nomflux=BAZ_DERNIERE_ACTU;
553
	if (!is_array ($typeannonce) && $typeannonce!='' and $typeannonce!='toutes') {
553
	if (!is_array ($typeannonce) && $typeannonce!='' and $typeannonce!='toutes') {
554
		if ($req_where==1) {$requete .= ' AND ';}
554
		if ($req_where==1) {$requete .= ' AND ';}
555
		$requete .= 'bf_ce_nature='.$typeannonce.' and bf_ce_nature=bn_id_nature ';;
555
		$requete .= 'bf_ce_nature='.$typeannonce.' and bf_ce_nature=bn_id_nature ';;
556
		$req_where=1;
556
		$req_where=1;
557
		//le nom du flux devient le type d'annonce
557
		//le nom du flux devient le type d'annonce
558
		$requete_nom_flux = 'select bn_label_nature from bazar_nature where bn_id_nature = '.$typeannonce;
558
		$requete_nom_flux = 'select bn_label_nature from bazar_nature where bn_id_nature = '.$typeannonce;
559
		$nomflux = $GLOBALS['_BAZAR_']['db']->getOne($requete_nom_flux) ;
559
		$nomflux = $GLOBALS['_BAZAR_']['db']->getOne($requete_nom_flux) ;
560
	}
560
	}
561
	// Cas où il y plusieurs type d annonce demande
561
	// Cas où il y plusieurs type d annonce demande
562
	if (is_array ($typeannonce)) {
562
	if (is_array ($typeannonce)) {
563
		if ($req_where==1) {$requete .= ' AND ';}
563
		if ($req_where==1) {$requete .= ' AND ';}
564
		$requete .= 'bf_ce_nature IN (' ;
564
		$requete .= 'bf_ce_nature IN (' ;
565
		$chaine = '';
565
		$chaine = '';
566
		foreach ($typeannonce as $valeur) $chaine .= '"'.$valeur.'",' ;
566
		foreach ($typeannonce as $valeur) $chaine .= '"'.$valeur.'",' ;
567
		$requete .= substr ($chaine, 0, strlen ($chaine)-1) ; 
567
		$requete .= substr ($chaine, 0, strlen ($chaine)-1) ; 
568
		$requete .= ') ';
568
		$requete .= ') and bf_ce_nature=bn_id_nature ';
569
	}
569
	}
570
	$utilisateur = new Administrateur_bazar ($GLOBALS['AUTH']) ;
570
	$utilisateur = new Administrateur_bazar ($GLOBALS['AUTH']) ;
571
	if ($valide!=0) {
571
	if ($valide!=0) {
572
		
572
		
573
		if ($utilisateur->isSuperAdmin()) {
573
		if ($utilisateur->isSuperAdmin()) {
574
			$req_where=1;
574
			$req_where=1;
575
		} else {
575
		} else {
576
			if ($req_where==1) {
576
			if ($req_where==1) {
577
				$requete .= ' AND ';
577
				$requete .= ' AND ';
578
			}
578
			}
579
			$requete .= '(bf_date_debut_validite_fiche<=NOW() or bf_date_debut_validite_fiche="0000-00-00")'.
579
			$requete .= '(bf_date_debut_validite_fiche<=NOW() or bf_date_debut_validite_fiche="0000-00-00")'.
580
						' AND (bf_date_fin_validite_fiche>=NOW() or bf_date_fin_validite_fiche="0000-00-00") AND bn_id_nature=bf_ce_nature';
580
						' AND (bf_date_fin_validite_fiche>=NOW() or bf_date_fin_validite_fiche="0000-00-00") AND bn_id_nature=bf_ce_nature';
581
		}
581
		}
582
	}
582
	}
583
	else $nomflux .= BAZ_A_MODERER;
583
	else $nomflux .= BAZ_A_MODERER;
584
	if ($emetteur!='' && $emetteur!='tous') {
584
	if ($emetteur!='' && $emetteur!='tous') {
585
		if ($req_where==1) {$requete .= ' AND ';}
585
		if ($req_where==1) {$requete .= ' AND ';}
586
		$requete .= 'bf_ce_utilisateur='.$emetteur;
586
		$requete .= 'bf_ce_utilisateur='.$emetteur;
587
		$req_where=1;
587
		$req_where=1;
588
		//requete pour afficher le nom de la structure
588
		//requete pour afficher le nom de la structure
589
		$requetenom = 'SELECT '.BAZ_CHAMPS_NOM.', '.BAZ_CHAMPS_PRENOM.' FROM '.
589
		$requetenom = 'SELECT '.BAZ_CHAMPS_NOM.', '.BAZ_CHAMPS_PRENOM.' FROM '.
590
						BAZ_ANNUAIRE.' WHERE '.BAZ_CHAMPS_ID.'='.$emetteur;
590
						BAZ_ANNUAIRE.' WHERE '.BAZ_CHAMPS_ID.'='.$emetteur;
591
		$resultat = $GLOBALS['_BAZAR_']['db']->query($requetenom) ;
591
		$resultat = $GLOBALS['_BAZAR_']['db']->query($requetenom) ;
592
		if (DB::isError($resultat)) {
592
		if (DB::isError($resultat)) {
593
			die ($resultat->getMessage().$resultat->getDebugInfo()) ;
593
			die ($resultat->getMessage().$resultat->getDebugInfo()) ;
594
		}
594
		}
595
		$ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC);
595
		$ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC);
596
		$nomflux .= ' ('.$ligne[BAZ_CHAMPS_NOM].' '.$ligne[BAZ_CHAMPS_PRENOM].')';
596
		$nomflux .= ' ('.$ligne[BAZ_CHAMPS_NOM].' '.$ligne[BAZ_CHAMPS_PRENOM].')';
597
	}
597
	}
598
	if ($requeteSQL!='') {
598
	if ($requeteSQL!='') {
599
		if ($req_where==1) {$requete .= ' AND ';}
599
		if ($req_where==1) {$requete .= ' AND ';}
600
		$requete .= '('.$requeteSQL.')';
600
		$requete .= '('.$requeteSQL.')';
601
		$req_where=1;
601
		$req_where=1;
602
	}
602
	}
603
	if ($categorie_nature!='') {
603
	if ($categorie_nature!='') {
604
		if ($req_where==1) {$requete .= ' AND ';}
604
		if ($req_where==1) {$requete .= ' AND ';}
605
		$requete .= 'bn_ce_id_menu IN ('.$categorie_nature.') ';
605
		$requete .= 'bn_ce_id_menu IN ('.$categorie_nature.') and bf_ce_nature=bn_id_nature ';
606
		$req_where=1;
606
		$req_where=1;
607
	}
607
	}
608
	
608
	
609
	$requete .= ' ORDER BY   bf_date_creation_fiche DESC, bf_date_fin_validite_fiche DESC, bf_date_maj_fiche DESC';
609
	$requete .= ' ORDER BY   bf_date_creation_fiche DESC, bf_date_fin_validite_fiche DESC, bf_date_maj_fiche DESC';
610
	if ($nbitem!='') {$requete .= ' LIMIT 0,'.$nbitem;}
610
	if ($nbitem!='') {$requete .= ' LIMIT 0,'.$nbitem;}
611
	$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
611
	$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
612
	if (DB::isError($resultat)) {
612
	if (DB::isError($resultat)) {
613
		die ($resultat->getMessage().$resultat->getDebugInfo()) ;
613
		die ($resultat->getMessage().$resultat->getDebugInfo()) ;
614
	}
614
	}
615
	
615
	
616
	function xmlEntities($s){
616
	function xmlEntities($s){
617
		//build first an assoc. array with the entities we want to match
617
		//build first an assoc. array with the entities we want to match
618
		$table1 = get_html_translation_table(HTML_ENTITIES, ENT_QUOTES);
618
		$table1 = get_html_translation_table(HTML_ENTITIES, ENT_QUOTES);
619
		
619
		
620
		//now build another assoc. array with the entities we want to replace (numeric entities)
620
		//now build another assoc. array with the entities we want to replace (numeric entities)
621
		foreach ($table1 as $k=>$v){
621
		foreach ($table1 as $k=>$v){
622
		  $table1[$k] = "/$v/";
622
		  $table1[$k] = "/$v/";
623
		  $c = htmlentities($k,ENT_QUOTES,"UTF-8");
623
		  $c = htmlentities($k,ENT_QUOTES,"UTF-8");
624
		  $table2[$c] = "&#".ord($k).";";
624
		  $table2[$c] = "&#".ord($k).";";
625
		}
625
		}
626
		
626
		
627
		//now perform a replacement using preg_replace
627
		//now perform a replacement using preg_replace
628
		//each matched value in array 1 will be replaced with the corresponding value in array 2
628
		//each matched value in array 1 will be replaced with the corresponding value in array 2
629
		$s = preg_replace($table1,$table2,$s);
629
		$s = preg_replace($table1,$table2,$s);
630
		return $s;
630
		return $s;
631
	}
631
	}
632
	
632
	
633
	include_once 'XML/Util.php' ;
633
	include_once 'XML/Util.php' ;
634
 
634
 
635
	$xml = XML_Util::getXMLDeclaration('1.0', 'ISO-8859-1', 'no') ; 
635
	$xml = XML_Util::getXMLDeclaration('1.0', 'ISO-8859-1', 'no') ; 
636
	$xml .= XML_Util::createStartElement ('rss', array('version' => '2.0')) ;
636
	$xml .= XML_Util::createStartElement ('rss', array('version' => '2.0')) ;
637
	$xml .= XML_Util::createStartElement ('channel');
637
	$xml .= XML_Util::createStartElement ('channel');
638
	$xml .= XML_Util::createTag ('title', null, $nomflux, null, false);
638
	$xml .= XML_Util::createTag ('title', null, $nomflux, null, false);
639
	$xml .= XML_Util::createTag ('link', null, BAZ_RSS_ADRESSESITE);
639
	$xml .= XML_Util::createTag ('link', null, BAZ_RSS_ADRESSESITE);
640
	$xml .= XML_Util::createTag ('description', null, BAZ_RSS_DESCRIPTIONSITE);
640
	$xml .= XML_Util::createTag ('description', null, BAZ_RSS_DESCRIPTIONSITE);
641
	$xml .= XML_Util::createTag ('language', null, 'fr-FR');
641
	$xml .= XML_Util::createTag ('language', null, 'fr-FR');
642
	$xml .= XML_Util::createTag ('copyright', null, 'Copyright 2005 '.BAZ_RSS_NOMSITE);
642
	$xml .= XML_Util::createTag ('copyright', null, 'Copyright 2005 '.BAZ_RSS_NOMSITE);
643
	$xml .= XML_Util::createTag ('lastBuildDate', null, strftime('%d %b %Y %H:%M:%S GMT'));
643
	$xml .= XML_Util::createTag ('lastBuildDate', null, strftime('%d %b %Y %H:%M:%S GMT'));
644
	$xml .= XML_Util::createTag ('docs', null, 'http://www.stervinou.com/projets/rss/');
644
	$xml .= XML_Util::createTag ('docs', null, 'http://www.stervinou.com/projets/rss/');
645
	$xml .= XML_Util::createTag ('category', null, BAZ_RSS_CATEGORIE);
645
	$xml .= XML_Util::createTag ('category', null, BAZ_RSS_CATEGORIE);
646
	$xml .= XML_Util::createTag ('managingEditor', null, BAZ_RSS_MANAGINGEDITOR);
646
	$xml .= XML_Util::createTag ('managingEditor', null, BAZ_RSS_MANAGINGEDITOR);
647
	$xml .= XML_Util::createTag ('webMaster', null, BAZ_RSS_WEBMASTER);
647
	$xml .= XML_Util::createTag ('webMaster', null, BAZ_RSS_WEBMASTER);
648
	$xml .= XML_Util::createTag ('ttl', null, '60');
648
	$xml .= XML_Util::createTag ('ttl', null, '60');
649
	$xml .= XML_Util::createStartElement ('image');
649
	$xml .= XML_Util::createStartElement ('image');
650
		$xml .= XML_Util::createTag ('title', null, BAZ_RSS_NOMSITE);
650
		$xml .= XML_Util::createTag ('title', null, BAZ_RSS_NOMSITE);
651
		$xml .= XML_Util::createTag ('url', null, BAZ_RSS_LOGOSITE);
651
		$xml .= XML_Util::createTag ('url', null, BAZ_RSS_LOGOSITE);
652
		$xml .= XML_Util::createTag ('link', null, BAZ_RSS_ADRESSESITE);
652
		$xml .= XML_Util::createTag ('link', null, BAZ_RSS_ADRESSESITE);
653
	$xml .= XML_Util::createEndElement ('image');
653
	$xml .= XML_Util::createEndElement ('image');
654
	if ($resultat->numRows()>0) {
654
	if ($resultat->numRows()>0) {
655
		// Creation des items : titre + lien + description + date de publication
655
		// Creation des items : titre + lien + description + date de publication
656
		while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
656
		while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
657
			$xml .= XML_Util::createStartElement ('item');
657
			$xml .= XML_Util::createStartElement ('item');
658
			
-
 
-
 
658
			$caractere = array('/\x92/', '/\x85/', '/\x80/', '/\x97/', '/\x96/');
-
 
659
			$caractere_remplacement = array ('&#8217;', '&#8230;', '&#8364;', '&#8212;', '&#8211;');
659
			$xml .= XML_Util::createTag ('title', null, xmlEntities($ligne['bf_titre']));
660
			$xml .= XML_Util::createTag ('title', null, preg_replace ($caractere, $caractere_remplacement,
660
			
-
 
-
 
661
													XML_Util::replaceEntities($ligne['bf_titre'])));
661
			$lien=$GLOBALS['_BAZAR_']['url'];
662
			$lien=$GLOBALS['_BAZAR_']['url'];
662
			$lien->addQueryString('action', BAZ_VOIR_FICHE);
663
			$lien->addQueryString('action', BAZ_VOIR_FICHE);
663
			$lien->addQueryString('id_fiche', $ligne['bf_id_fiche']);
664
			$lien->addQueryString('id_fiche', $ligne['bf_id_fiche']);
664
			$xml .= XML_Util::createTag ('link', null, $lien->getURL());
665
			$xml .= XML_Util::createTag ('link', null, $lien->getURL());
665
			$xml .= XML_Util::createTag ('guid', null, $lien->getURL());
666
			$xml .= XML_Util::createTag ('guid', null, $lien->getURL());
666
			$xml .= XML_Util::createStartElement ('description');
667
			$xml .= XML_Util::createStartElement ('description');
667
			if ($_GET['action'] != BAZ_VOIR_TOUTES_ANNONCES) {
668
			if ($_GET['action'] != BAZ_VOIR_TOUTES_ANNONCES) {
668
				$xml .= XML_Util::createCDataSection ($ligne['bf_description']);
669
				$xml .= XML_Util::createCDataSection (preg_replace ($caractere, $caractere_remplacement, $ligne['bf_description']));
669
			}
670
			}
670
			$xml .= XML_Util::createEndElement ('description');
671
			$xml .= XML_Util::createEndElement ('description');
671
			if ($ligne['bf_date_debut_validite_fiche'] == '0000-00-00') $date_pub = $ligne[' bf_date_creation_fiche'] ; else 
672
			if ($ligne['bf_date_debut_validite_fiche'] == '0000-00-00') $date_pub = $ligne[' bf_date_creation_fiche'] ; else 
672
					$date_pub =  $ligne['bf_date_debut_validite_fiche'];
673
					$date_pub =  $ligne['bf_date_debut_validite_fiche'];
673
			$xml .= XML_Util::createTag ('pubDate', null, strftime('%d %b %Y %H:%M:%S GMT',strtotime($date_pub)));
674
			$xml .= XML_Util::createTag ('pubDate', null, strftime('%d %b %Y %H:%M:%S GMT',strtotime($date_pub)));
674
			$xml .= XML_Util::createEndElement ('item');
675
			$xml .= XML_Util::createEndElement ('item');
675
		}
676
		}
676
	}
677
	}
677
	else {//pas d'annonces
678
	else {//pas d'annonces
678
		$xml .= XML_Util::createStartElement ('item');
679
		$xml .= XML_Util::createStartElement ('item');
679
		$xml .= XML_Util::createTag ('title', null, BAZ_PAS_D_ANNONCES);
680
		$xml .= XML_Util::createTag ('title', null, BAZ_PAS_D_ANNONCES);
680
		$xml .= XML_Util::createTag ('link', null, '#');
681
		$xml .= XML_Util::createTag ('link', null, '#');
681
		$xml .= XML_Util::createTag ('description', null, BAZ_PAS_D_ANNONCES);
682
		$xml .= XML_Util::createTag ('description', null, BAZ_PAS_D_ANNONCES);
682
		$xml .= XML_Util::createTag ('pubDate', null, strftime('%d %b %Y %H:%M:%S GMT',strtotime('12/12/2004')));
683
		$xml .= XML_Util::createTag ('pubDate', null, strftime('%d %b %Y %H:%M:%S GMT',strtotime('12/12/2004')));
683
		$xml .= XML_Util::createEndElement ('item');
684
		$xml .= XML_Util::createEndElement ('item');
684
		$xml .= '</item>'."\n";
-
 
-
 
685
 
685
	}
686
	}
686
	$xml .= XML_Util::createEndElement ('channel');
687
	$xml .= XML_Util::createEndElement ('channel');
687
	$xml .= XML_Util::createEndElement('rss') ;
688
	$xml .= XML_Util::createEndElement('rss') ;
688
	return $xml;
689
	return $xml;
689
}
690
}
690
 
691
 
691
 
692
 
692
/** baz_liste() Formate la liste de toutes les annonces actuelles
693
/** baz_liste() Formate la liste de toutes les annonces actuelles
693
*
694
*
694
*   @return  string    le code HTML a afficher
695
*   @return  string    le code HTML a afficher
695
*/
696
*/
696
function baz_liste($typeannonce='toutes') {
697
function baz_liste($typeannonce='toutes') {
697
	//creation du lien pour le formulaire de recherche
698
	//creation du lien pour le formulaire de recherche
698
	$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_VOIR_TOUTES_ANNONCES);
699
	$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_VOIR_TOUTES_ANNONCES);
699
	if (isset($_REQUEST['recherche_avancee'])) $GLOBALS['_BAZAR_']['url']->addQueryString ('recherche_avancee', $_REQUEST['recherche_avancee']);
700
	if (isset($_REQUEST['recherche_avancee'])) $GLOBALS['_BAZAR_']['url']->addQueryString ('recherche_avancee', $_REQUEST['recherche_avancee']);
700
	$lien_formulaire = preg_replace ('/&amp;/', '&', $GLOBALS['_BAZAR_']['url']->getURL()) ;
701
	$lien_formulaire = preg_replace ('/&amp;/', '&', $GLOBALS['_BAZAR_']['url']->getURL()) ;
701
	$formtemplate = new HTML_QuickForm('formulaire', 'post', $lien_formulaire) ;
702
	$formtemplate = new HTML_QuickForm('formulaire', 'post', $lien_formulaire) ;
702
	$squelette =& $formtemplate->defaultRenderer();
703
	$squelette =& $formtemplate->defaultRenderer();
703
   	$squelette->setFormTemplate("\n".'<form {attributes}>'."\n".'<table style="border:0;width:100%;">'."\n".'{content}'."\n".'</table>'."\n".'</form>'."\n");
704
   	$squelette->setFormTemplate("\n".'<form {attributes}>'."\n".'<table style="border:0;width:100%;">'."\n".'{content}'."\n".'</table>'."\n".'</form>'."\n");
704
    $squelette->setElementTemplate( '<tr>'."\n".'<td style="font-size:12px;width:120px;text-align:right;">'."\n".'{label}'.
705
    $squelette->setElementTemplate( '<tr>'."\n".'<td style="font-size:12px;width:120px;text-align:right;">'."\n".'{label}'.
705
    		                        '<!-- BEGIN required --><span class="symbole_obligatoire">&nbsp;*</span><!-- END required -->'."\n".
706
    		                        '<!-- BEGIN required --><span class="symbole_obligatoire">&nbsp;*</span><!-- END required -->'."\n".
706
    								' :</td>'."\n".'<td style="text-align:left;padding:5px;"> '."\n".'{element}'."\n".
707
    								' :</td>'."\n".'<td style="text-align:left;padding:5px;"> '."\n".'{element}'."\n".
707
                                    '<!-- BEGIN error --><span class="erreur">{error}</span><!-- END error -->'."\n".
708
                                    '<!-- BEGIN error --><span class="erreur">{error}</span><!-- END error -->'."\n".
708
                                    '</td>'."\n".'</tr>'."\n");
709
                                    '</td>'."\n".'</tr>'."\n");
709
 	$squelette->setElementTemplate( '<tr>'."\n".'<td colspan="2" class="liste_a_cocher"><strong>{label}&nbsp;{element}</strong>'."\n".
710
 	$squelette->setElementTemplate( '<tr>'."\n".'<td colspan="2" class="liste_a_cocher"><strong>{label}&nbsp;{element}</strong>'."\n".
710
                                    '<!-- BEGIN required --><span class="symbole_obligatoire">&nbsp;*</span><!-- END required -->'."\n".'</td>'."\n".'</tr>'."\n", 'accept_condition');
711
                                    '<!-- BEGIN required --><span class="symbole_obligatoire">&nbsp;*</span><!-- END required -->'."\n".'</td>'."\n".'</tr>'."\n", 'accept_condition');
711
  	$squelette->setElementTemplate( '<tr><td colspan="2">{label}{element}</td></tr>'."\n", 'rechercher');
712
  	$squelette->setElementTemplate( '<tr><td colspan="2">{label}{element}</td></tr>'."\n", 'rechercher');
712
  	  	
713
  	  	
713
 	$squelette->setRequiredNoteTemplate("\n".'<tr>'."\n".'<td colspan="2" class="symbole_obligatoire">* {requiredNote}</td></tr>'."\n");
714
 	$squelette->setRequiredNoteTemplate("\n".'<tr>'."\n".'<td colspan="2" class="symbole_obligatoire">* {requiredNote}</td></tr>'."\n");
714
	//Traduction de champs requis
715
	//Traduction de champs requis
715
	$formtemplate->setRequiredNote(BAZ_CHAMPS_REQUIS) ;
716
	$formtemplate->setRequiredNote(BAZ_CHAMPS_REQUIS) ;
716
	$formtemplate->setJsWarnings(BAZ_ERREUR_SAISIE,BAZ_VEUILLEZ_CORRIGER);	
717
	$formtemplate->setJsWarnings(BAZ_ERREUR_SAISIE,BAZ_VEUILLEZ_CORRIGER);	
717
	
718
	
718
		
719
		
719
	//cas du formulaire de recherche proposant de chercher parmis tous les types d'annonces 
720
	//cas du formulaire de recherche proposant de chercher parmis tous les types d'annonces 
720
	//requete pour obtenir l'id et le label des types d'annonces
721
	//requete pour obtenir l'id et le label des types d'annonces
721
	$requete = 'SELECT bn_id_nature, bn_label_nature '.
722
	$requete = 'SELECT bn_id_nature, bn_label_nature '.
722
	           'FROM bazar_nature WHERE bn_ce_id_menu IN ('.$GLOBALS['_BAZAR_']['categorie_nature'].') '.
723
	           'FROM bazar_nature WHERE bn_ce_id_menu IN ('.$GLOBALS['_BAZAR_']['categorie_nature'].') '.
723
			   'ORDER BY bn_label_nature ASC';
724
			   'ORDER BY bn_label_nature ASC';
724
	$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
725
	$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
725
	if (DB::isError($resultat)) {
726
	if (DB::isError($resultat)) {
726
		die ($resultat->getMessage().$resultat->getDebugInfo()) ;
727
		die ($resultat->getMessage().$resultat->getDebugInfo()) ;
727
	}
728
	}
728
	//on récupère le nb de types de fiches, pour plus tard
729
	//on récupère le nb de types de fiches, pour plus tard
729
	$nb_type_de_fiches=$resultat->numRows();
730
	$nb_type_de_fiches=$resultat->numRows();
730
	$type_annonce_select['toutes']=BAZ_TOUS_TYPES_FICHES;
731
	$type_annonce_select['toutes']=BAZ_TOUS_TYPES_FICHES;
731
	while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
732
	while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
732
		$type_annonce_select[$ligne['bn_id_nature']] = $ligne['bn_label_nature'];
733
		$type_annonce_select[$ligne['bn_id_nature']] = $ligne['bn_label_nature'];
733
		$tableau_typeannonces[] = $ligne['bn_id_nature'] ;
734
		$tableau_typeannonces[] = $ligne['bn_id_nature'] ;
734
	}
735
	}
735
	if ($nb_type_de_fiches>1 && $GLOBALS['_BAZAR_']['typeannonce']=='toutes') {
736
	if ($nb_type_de_fiches>1 && $GLOBALS['_BAZAR_']['typeannonce']=='toutes') {
736
		$res= '<h2>'.BAZ_TOUTES_LES_ANNONCES.'</h2><br />'."\n";
737
		$res= '<h2>'.BAZ_TOUTES_LES_ANNONCES.'</h2><br />'."\n";
737
		$option=array('style'=>'border:1px solid #000;width: 200px;font:12px Myriad, Arial, sans-serif;',
738
		$option=array('style'=>'border:1px solid #000;width: 200px;font:12px Myriad, Arial, sans-serif;',
738
						'onchange' => 'javascript:this.form.submit();');
739
						'onchange' => 'javascript:this.form.submit();');
739
		$formtemplate->addElement ('select', 'nature', BAZ_TYPEANNONCE, $type_annonce_select, $option) ;
740
		$formtemplate->addElement ('select', 'nature', BAZ_TYPEANNONCE, $type_annonce_select, $option) ;
740
		if (isset($_REQUEST['nature'])) {
741
		if (isset($_REQUEST['nature'])) {
741
			$defauts=array('nature'=>$_REQUEST['nature']);
742
			$defauts=array('nature'=>$_REQUEST['nature']);
742
			$formtemplate->setDefaults($defauts);
743
			$formtemplate->setDefaults($defauts);
743
		}		
744
		}		
744
	}
745
	}
745
	//cas du type d'annonces prédéfini 
746
	//cas du type d'annonces prédéfini 
746
	else {
747
	else {
747
		if ($nb_type_de_fiches==1) {
748
		if ($nb_type_de_fiches==1) {
748
			$GLOBALS['_BAZAR_']['typeannonce']=end($type_annonce_select);
749
			$GLOBALS['_BAZAR_']['typeannonce']=end($type_annonce_select);
749
			$GLOBALS['_BAZAR_']['id_typeannonce']=key($type_annonce_select);
750
			$GLOBALS['_BAZAR_']['id_typeannonce']=key($type_annonce_select);
750
		}
751
		}
751
		$res = '<h2>'.BAZ_TOUTES_LES_ANNONCES_DE_TYPE.' '.$GLOBALS['_BAZAR_']['typeannonce'].'</h2>'."\n";
752
		$res = '<h2>'.BAZ_TOUTES_LES_ANNONCES_DE_TYPE.' '.$GLOBALS['_BAZAR_']['typeannonce'].'</h2>'."\n";
752
	}
753
	}
753
 
754
 
754
	//requete pour obtenir l'id, le nom et prenom de toutes les personnes ayant depose une fiche
755
	//requete pour obtenir l'id, le nom et prenom de toutes les personnes ayant depose une fiche
755
	// dans le but de construire l'élément de formulaire select avec les noms des émetteurs de fiche	
756
	// dans le but de construire l'élément de formulaire select avec les noms des émetteurs de fiche	
756
	if (BAZ_RECHERCHE_PAR_EMETTEUR) {
757
	if (BAZ_RECHERCHE_PAR_EMETTEUR) {
757
		$requete = 'SELECT '.BAZ_CHAMPS_ID.', '.BAZ_CHAMPS_NOM.', '.BAZ_CHAMPS_PRENOM.' '.
758
		$requete = 'SELECT '.BAZ_CHAMPS_ID.', '.BAZ_CHAMPS_NOM.', '.BAZ_CHAMPS_PRENOM.' '.
758
		           'FROM bazar_fiche,'.BAZ_ANNUAIRE.' WHERE ' ;
759
		           'FROM bazar_fiche,'.BAZ_ANNUAIRE.' WHERE ' ;
759
	
760
	
760
		$requete .= ' bf_date_debut_validite_fiche<=NOW() AND bf_date_fin_validite_fiche>=NOW() and';	
761
		$requete .= ' bf_date_debut_validite_fiche<=NOW() AND bf_date_fin_validite_fiche>=NOW() and';	
761
	
762
	
762
		$requete .= ' bf_ce_utilisateur='.BAZ_CHAMPS_ID.' ';
763
		$requete .= ' bf_ce_utilisateur='.BAZ_CHAMPS_ID.' ';
763
	    if (!isset($_REQUEST['nature'])) {
764
	    if (!isset($_REQUEST['nature'])) {
764
	    		if (isset($GLOBALS['_BAZAR_']['id_typeannonce'])) {
765
	    		if (isset($GLOBALS['_BAZAR_']['id_typeannonce'])) {
765
	    			$requete .= 'AND bf_ce_nature="'.$GLOBALS['_BAZAR_']['id_typeannonce'].'" ';
766
	    			$requete .= 'AND bf_ce_nature="'.$GLOBALS['_BAZAR_']['id_typeannonce'].'" ';
766
	    		} 
767
	    		} 
767
		}
768
		}
768
		else {
769
		else {
769
	    		if ($_REQUEST['nature']!='toutes') {
770
	    		if ($_REQUEST['nature']!='toutes') {
770
	    			$requete .= 'AND bf_ce_nature='.$_REQUEST['nature'].' ';
771
	    			$requete .= 'AND bf_ce_nature='.$_REQUEST['nature'].' ';
771
	    		}
772
	    		}
772
	    }
773
	    }
773
	    
774
	    
774
	    $requete .= 'ORDER BY '.BAZ_CHAMPS_NOM.' ASC';
775
	    $requete .= 'ORDER BY '.BAZ_CHAMPS_NOM.' ASC';
775
		$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
776
		$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
776
		if (DB::isError($resultat)) {
777
		if (DB::isError($resultat)) {
777
			die ($resultat->getMessage().$resultat->getDebugInfo()) ;
778
			die ($resultat->getMessage().$resultat->getDebugInfo()) ;
778
		}
779
		}
779
		$personnes_select['tous']=BAZ_TOUS_LES_EMETTEURS;
780
		$personnes_select['tous']=BAZ_TOUS_LES_EMETTEURS;
780
		while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
781
		while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
781
			$personnes_select[$ligne[BAZ_CHAMPS_ID]] = $ligne[BAZ_CHAMPS_NOM]." ".$ligne[BAZ_CHAMPS_PRENOM] ;
782
			$personnes_select[$ligne[BAZ_CHAMPS_ID]] = $ligne[BAZ_CHAMPS_NOM]." ".$ligne[BAZ_CHAMPS_PRENOM] ;
782
		}
783
		}
783
		$option=array('style'=>'border:1px solid #000;width: 200px;font:12px Myriad, Arial, sans-serif;');
784
		$option=array('style'=>'border:1px solid #000;width: 200px;font:12px Myriad, Arial, sans-serif;');
784
		$formtemplate->addElement ('select', 'personnes', BAZ_EMETTEUR, $personnes_select, $option) ;
785
		$formtemplate->addElement ('select', 'personnes', BAZ_EMETTEUR, $personnes_select, $option) ;
785
	} else {
786
	} else {
786
		$formtemplate->addElement ('hidden', 'personnes', 'tous') ;
787
		$formtemplate->addElement ('hidden', 'personnes', 'tous') ;
787
	}
788
	}
788
	
789
	
789
		//pour les super-administrateurs, on peut voir les annonces non validées
790
		//pour les super-administrateurs, on peut voir les annonces non validées
790
	//on verifie si l'utilisateur est administrateur
791
	//on verifie si l'utilisateur est administrateur
791
	$utilisateur = new Administrateur_bazar($GLOBALS['AUTH']) ;
792
	$utilisateur = new Administrateur_bazar($GLOBALS['AUTH']) ;
792
 
793
 
793
	if ($utilisateur->isSuperAdmin()) {
794
	if ($utilisateur->isSuperAdmin()) {
794
		$option=array('style'=>'border:1px solid #000;width: 200px;font:12px Myriad, Arial, sans-serif;');
795
		$option=array('style'=>'border:1px solid #000;width: 200px;font:12px Myriad, Arial, sans-serif;');
795
		$valide_select[0] = BAZ_FICHES_PAS_VALIDEES;
796
		$valide_select[0] = BAZ_FICHES_PAS_VALIDEES;
796
		$valide_select[1] = BAZ_FICHES_VALIDEES;
797
		$valide_select[1] = BAZ_FICHES_VALIDEES;
797
		$valide_select[2] = BAZ_LES_DEUX;
798
		$valide_select[2] = BAZ_LES_DEUX;
798
		$formtemplate->addElement ('select', 'valides', BAZ_VALIDE, $valide_select, $option) ; 
799
		$formtemplate->addElement ('select', 'valides', BAZ_VALIDE, $valide_select, $option) ; 
799
		$defauts=array('valides'=>1);
800
		$defauts=array('valides'=>1);
800
		$formtemplate->setDefaults($defauts);
801
		$formtemplate->setDefaults($defauts);
801
	}
802
	}
802
	
803
	
803
	//champs texte pour entrer les mots cles
804
	//champs texte pour entrer les mots cles
804
	$option=array('maxlength'=>60,'style'=>'border:1px solid #000;width:200px;font:12px Myriad, Arial, sans-serif;');
805
	$option=array('maxlength'=>60,'style'=>'border:1px solid #000;width:200px;font:12px Myriad, Arial, sans-serif;');
805
	$formtemplate->addElement('text', 'recherche_mots_cles', BAZ_MOT_CLE, $option) ;
806
	$formtemplate->addElement('text', 'recherche_mots_cles', BAZ_MOT_CLE, $option) ;
806
	
807
	
807
	//option cachee pour savoir si le formulaire a ete appele deja 
808
	//option cachee pour savoir si le formulaire a ete appele deja 
808
	$formtemplate->addElement('hidden', 'recherche_effectuee', 1) ;
809
	$formtemplate->addElement('hidden', 'recherche_effectuee', 1) ;
809
	
810
	
810
	// Ajout des options si un type de fiche a ete choisie
811
	// Ajout des options si un type de fiche a ete choisie
811
	if ( (isset($_REQUEST['nature']) && $_REQUEST['nature'] != 'toutes') || (isset($GLOBALS['_BAZAR_']['categorie_nature']) && $nb_type_de_fiches==1)) {
812
	if ( (isset($_REQUEST['nature']) && $_REQUEST['nature'] != 'toutes') || (isset($GLOBALS['_BAZAR_']['categorie_nature']) && $nb_type_de_fiches==1)) {
812
		if ( BAZ_MOTEUR_RECHERCHE_AVANCEE || ( isset($_REQUEST['recherche_avancee'])&&$_REQUEST['recherche_avancee']==1) ) { 
813
		if ( BAZ_MOTEUR_RECHERCHE_AVANCEE || ( isset($_REQUEST['recherche_avancee'])&&$_REQUEST['recherche_avancee']==1) ) { 
813
			if ($GLOBALS['_BAZAR_']['categorie_nature'] != '') {
814
			if ($GLOBALS['_BAZAR_']['categorie_nature'] != '') {
814
				$champs_requete = '' ;
815
				$champs_requete = '' ;
815
				if (!isset($_REQUEST['nature']) || $_REQUEST['nature'] == '') {
816
				if (!isset($_REQUEST['nature']) || $_REQUEST['nature'] == '') {
816
					$_REQUEST['nature'] = $tableau_typeannonces[0];
817
					$_REQUEST['nature'] = $tableau_typeannonces[0];
817
				}
818
				}
818
			}
819
			}
819
			// Récupération du template
820
			// Récupération du template
820
			$requete = 'SELECT bn_template FROM bazar_nature WHERE bn_id_nature = '.$_REQUEST['nature'];
821
			$requete = 'SELECT bn_template FROM bazar_nature WHERE bn_id_nature = '.$_REQUEST['nature'];
821
			$resultat = $GLOBALS['_BAZAR_']['db']->getOne($requete) ;
822
			$resultat = $GLOBALS['_BAZAR_']['db']->getOne($requete) ;
822
			if (DB::isError($resultat)) {
823
			if (DB::isError($resultat)) {
823
				die ($resultat->getMessage().$resultat->getDebugInfo()) ;
824
				die ($resultat->getMessage().$resultat->getDebugInfo()) ;
824
			}
825
			}
825
			
826
			
826
			if (isset($_REQUEST['recherche_avancee']) && $_REQUEST['recherche_avancee']==1) {
827
			if (isset($_REQUEST['recherche_avancee']) && $_REQUEST['recherche_avancee']==1) {
827
				foreach(array_merge($_POST, $_GET) as $cle => $valeur) $GLOBALS['_BAZAR_']['url']->addQueryString($cle, $valeur); 
828
				foreach(array_merge($_POST, $_GET) as $cle => $valeur) $GLOBALS['_BAZAR_']['url']->addQueryString($cle, $valeur); 
828
				$GLOBALS['_BAZAR_']['url']->addQueryString('recherche_avancee', '0');
829
				$GLOBALS['_BAZAR_']['url']->addQueryString('recherche_avancee', '0');
829
				$lien_recherche_de_base = '<a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_RECHERCHE_DE_BASE.'</a><br />';
830
				$lien_recherche_de_base = '<a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_RECHERCHE_DE_BASE.'</a><br />';
830
				//lien recherche de base
831
				//lien recherche de base
831
				labelhtml($formtemplate,'',$lien_recherche_de_base,'','','','','');		
832
				labelhtml($formtemplate,'',$lien_recherche_de_base,'','','','','');		
832
			}
833
			}
833
			
834
			
834
			$tableau = baz_valeurs_template($resultat) ;
835
			$tableau = baz_valeurs_template($resultat) ;
835
			for ($i=0; $i<count($tableau); $i++) {
836
			for ($i=0; $i<count($tableau); $i++) {
836
				if (($tableau[$i]['type'] == 'liste' || $tableau[$i]['type'] == 'checkbox') && $tableau[$i]['recherche'] == 1) {
837
				if (($tableau[$i]['type'] == 'liste' || $tableau[$i]['type'] == 'checkbox') && $tableau[$i]['recherche'] == 1) {
837
					$tableau[$i]['type']($formtemplate, $tableau[$i]['nom_bdd'], $tableau[$i]['label'], $tableau[$i]['limite1'],
838
					$tableau[$i]['type']($formtemplate, $tableau[$i]['nom_bdd'], $tableau[$i]['label'], $tableau[$i]['limite1'],
838
			                         $tableau[$i]['limite2'], $tableau[$i]['defaut'], $tableau[$i]['table_source'], $tableau[$i]['obligatoire'], 1) ;
839
			                         $tableau[$i]['limite2'], $tableau[$i]['defaut'], $tableau[$i]['table_source'], $tableau[$i]['obligatoire'], 1) ;
839
				}
840
				}
840
			}
841
			}
841
			
842
			
842
		}
843
		}
843
		else {
844
		else {
844
			foreach(array_merge($_POST, $_GET) as $cle => $valeur) $GLOBALS['_BAZAR_']['url']->addQueryString($cle, $valeur); 
845
			foreach(array_merge($_POST, $_GET) as $cle => $valeur) $GLOBALS['_BAZAR_']['url']->addQueryString($cle, $valeur); 
845
			$GLOBALS['_BAZAR_']['url']->addQueryString('recherche_avancee', '1');
846
			$GLOBALS['_BAZAR_']['url']->addQueryString('recherche_avancee', '1');
846
			$lien_recherche_avancee = '<a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_RECHERCHE_AVANCEE.'</a><br />';			
847
			$lien_recherche_avancee = '<a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_RECHERCHE_AVANCEE.'</a><br />';			
847
		}		 	
848
		}		 	
848
	}
849
	}
849
	
850
	
850
	//lien recherche avancee
851
	//lien recherche avancee
851
	if (isset($lien_recherche_avancee)) {
852
	if (isset($lien_recherche_avancee)) {
852
		labelhtml($formtemplate,'',$lien_recherche_avancee,'','','','','');
853
		labelhtml($formtemplate,'',$lien_recherche_avancee,'','','','','');
853
	}
854
	}
854
	
855
	
855
	//Bouton de validation du formulaire
856
	//Bouton de validation du formulaire
856
	$option=array('style'=>'border:1px solid #000;width:100px;font:12px Myriad, Arial, sans-serif;');	
857
	$option=array('style'=>'border:1px solid #000;width:100px;font:12px Myriad, Arial, sans-serif;');	
857
	$formtemplate->addElement('submit', 'rechercher', BAZ_RECHERCHER, $option);
858
	$formtemplate->addElement('submit', 'rechercher', BAZ_RECHERCHER, $option);
858
	
859
	
859
	//affichage du formulaire
860
	//affichage du formulaire
860
	$res.=$formtemplate->toHTML()."\n";
861
	$res.=$formtemplate->toHTML()."\n";
861
	
862
	
862
 
863
 
863
	// Ajout de la table bazar_fiche_liste_valeur dans le from de la requete
864
	// Ajout de la table bazar_fiche_liste_valeur dans le from de la requete
864
	$case_coche = false ;
865
	$case_coche = false ;
865
	$nb_jointures=0;
866
	$nb_jointures=0;
866
	$requeteFrom = '' ;
867
	$requeteFrom = '' ;
867
	$requeteWhere = ' bn_ce_id_menu IN ('.$GLOBALS['_BAZAR_']['categorie_nature'].') AND bn_id_nature=bf_ce_nature AND ' ;
868
	$requeteWhere = ' bn_ce_id_menu IN ('.$GLOBALS['_BAZAR_']['categorie_nature'].') AND bn_id_nature=bf_ce_nature AND ' ;
868
	$requeteWhereListe = '' ;
869
	$requeteWhereListe = '' ;
869
	
870
	
870
 	if ( isset($tableau) ) {
871
 	if ( isset($tableau) ) {
871
	 	for ($i = 0; $i < count ($tableau); $i++) {
872
	 	for ($i = 0; $i < count ($tableau); $i++) {
872
			if ($tableau[$i]['type'] == 'checkbox' || $tableau[$i]['type'] == 'liste') {
873
			if ($tableau[$i]['type'] == 'checkbox' || $tableau[$i]['type'] == 'liste') {
873
				$nb_jointures++;
874
				$nb_jointures++;
874
				$nom_liste = $tableau[$i]['type'].$tableau[$i]['nom_bdd'] ;			
875
				$nom_liste = $tableau[$i]['type'].$tableau[$i]['nom_bdd'] ;			
875
				if (isset($_REQUEST[$nom_liste]) && is_array($_REQUEST[$nom_liste])) {
876
				if (isset($_REQUEST[$nom_liste]) && is_array($_REQUEST[$nom_liste])) {
876
					$case_coche = true;
877
					$case_coche = true;
877
					$requeteWhereListe .= ' bfvl'.$nb_jointures.'.bfvl_ce_liste='.$tableau[$i]['nom_bdd'].' AND ' ; // Numéro de la liste
878
					$requeteWhereListe .= ' bfvl'.$nb_jointures.'.bfvl_ce_liste='.$tableau[$i]['nom_bdd'].' AND ' ; // Numéro de la liste
878
					$requeteWhereListe .= ' bfvl'.$nb_jointures.'.bfvl_valeur IN (' ;
879
					$requeteWhereListe .= ' bfvl'.$nb_jointures.'.bfvl_valeur IN (' ;
879
					$chaine = '';
880
					$chaine = '';
880
					//var_dump($_REQUEST[$nom_liste]);
881
					//var_dump($_REQUEST[$nom_liste]);
881
					foreach ($_REQUEST[$nom_liste] as $cle =>$valeur) {
882
					foreach ($_REQUEST[$nom_liste] as $cle =>$valeur) {
882
						if ($valeur == 1) {						
883
						if ($valeur == 1) {						
883
							$chaine .= '"'.$cle.'",' ;
884
							$chaine .= '"'.$cle.'",' ;
884
						}
885
						}
885
					}	
886
					}	
886
					$requeteWhereListe .= substr ($chaine, 0, strlen ($chaine)-1) ;
887
					$requeteWhereListe .= substr ($chaine, 0, strlen ($chaine)-1) ;
887
					$requeteWhereListe .= ') AND ';									
888
					$requeteWhereListe .= ') AND ';									
888
				} else {
889
				} else {
889
					if (isset ($_REQUEST[$nom_liste]) && $_REQUEST[$nom_liste]!=0) {
890
					if (isset ($_REQUEST[$nom_liste]) && $_REQUEST[$nom_liste]!=0) {
890
						$requeteWhereListe .= ' bfvl'.$nb_jointures.'.bfvl_ce_liste='.$tableau[$i]['nom_bdd'].' AND ' ; // Numéro de la liste
891
						$requeteWhereListe .= ' bfvl'.$nb_jointures.'.bfvl_ce_liste='.$tableau[$i]['nom_bdd'].' AND ' ; // Numéro de la liste
891
						$requeteWhereListe .= ' bfvl'.$nb_jointures.'.bfvl_valeur='.$_REQUEST[$nom_liste].' AND ';
892
						$requeteWhereListe .= ' bfvl'.$nb_jointures.'.bfvl_valeur='.$_REQUEST[$nom_liste].' AND ';
892
						$case_coche = true;
893
						$case_coche = true;
893
					}
894
					}
894
				}
895
				}
895
			}
896
			}
896
		}
897
		}
897
 	}
898
 	}
898
	if ($case_coche) {
899
	if ($case_coche) {
899
		for ($i = 0; $i < $nb_jointures ; $i++) {			
900
		for ($i = 0; $i < $nb_jointures ; $i++) {			
900
			$requeteFrom .= ', bazar_fiche_valeur_liste  as bfvl'.($i+1) ;
901
			$requeteFrom .= ', bazar_fiche_valeur_liste  as bfvl'.($i+1) ;
901
			$requeteWhere .= ' bfvl'.($i+1).'.bfvl_ce_fiche=bf_id_fiche AND ';
902
			$requeteWhere .= ' bfvl'.($i+1).'.bfvl_ce_fiche=bf_id_fiche AND ';
902
		}
903
		}
903
		 $requeteWhere .= $requeteWhereListe;
904
		 $requeteWhere .= $requeteWhereListe;
904
	}
905
	}
905
	if (isset($_REQUEST['nature']) && $_REQUEST['nature']!='' && $_REQUEST['nature']!='toutes') {
906
	if (isset($_REQUEST['nature']) && $_REQUEST['nature']!='' && $_REQUEST['nature']!='toutes') {
906
		$requeteWhere = 'bf_ce_nature="'.$_REQUEST['nature'].'" AND '.$requeteWhere;
907
		$requeteWhere = 'bf_ce_nature="'.$_REQUEST['nature'].'" AND '.$requeteWhere;
907
	}
908
	}
908
	
909
	
909
	//affichage des resultats de la recherche si le formulaire a ete envoye
910
	//affichage des resultats de la recherche si le formulaire a ete envoye
910
	$requeteSQL='';
911
	$requeteSQL='';
911
	if (isset($_REQUEST['recherche_effectuee'])) {
912
	if (isset($_REQUEST['recherche_effectuee'])) {
912
		//preparation de la requete pour trouver les mots cles
913
		//preparation de la requete pour trouver les mots cles
913
		if (($_REQUEST['recherche_mots_cles']!='')and($_REQUEST['recherche_mots_cles']!=BAZ_MOT_CLE)) {
914
		if (($_REQUEST['recherche_mots_cles']!='')and($_REQUEST['recherche_mots_cles']!=BAZ_MOT_CLE)) {
914
			//decoupage des mots cles
915
			//decoupage des mots cles
915
			$recherche = split(' ', $_REQUEST['recherche_mots_cles']) ;
916
			$recherche = split(' ', $_REQUEST['recherche_mots_cles']) ;
916
			$nbmots=count($recherche);
917
			$nbmots=count($recherche);
917
			$requeteSQL=''; 
918
			$requeteSQL=''; 
918
			for ($i=0; $i<$nbmots; $i++) {
919
			for ($i=0; $i<$nbmots; $i++) {
919
				if ($i>0) $requeteSQL.=' OR ';
920
				if ($i>0) $requeteSQL.=' OR ';
920
				$requeteSQL.='bf_titre LIKE "%'.$recherche[$i].'%" OR bf_description LIKE "%'.$recherche[$i].'%" ';
921
				$requeteSQL.='bf_titre LIKE "%'.$recherche[$i].'%" OR bf_description LIKE "%'.$recherche[$i].'%" ';
921
			}
922
			}
922
		}
923
		}
923
		if (!isset($_REQUEST['nature'])) {
924
		if (!isset($_REQUEST['nature'])) {
924
			if (!isset ($GLOBALS['_BAZAR_']['id_nature'])) $typedefiches = $tableau_typeannonces;
925
			if (!isset ($GLOBALS['_BAZAR_']['id_nature'])) $typedefiches = $tableau_typeannonces;
925
			else $typedefiches = $GLOBALS['_BAZAR_']['id_nature'] ; 
926
			else $typedefiches = $GLOBALS['_BAZAR_']['id_nature'] ; 
926
		} else {
927
		} else {
927
			$typedefiches = $_REQUEST['nature'] ;
928
			$typedefiches = $_REQUEST['nature'] ;
928
			if ($typedefiches == 'toutes') $typedefiches = $tableau_typeannonces ;
929
			if ($typedefiches == 'toutes') $typedefiches = $tableau_typeannonces ;
929
		}
930
		}
930
		if ($typeannonce!='toutes') $typedefiches=$typeannonce;
931
		if ($typeannonce!='toutes') $typedefiches=$typeannonce;
931
		if (isset($_REQUEST['valides'])) {$valides=$_REQUEST['valides'];}
932
		if (isset($_REQUEST['valides'])) {$valides=$_REQUEST['valides'];}
932
		else {$valides=1;}
933
		else {$valides=1;}
933
		//generation de la liste de flux a afficher
934
		//generation de la liste de flux a afficher
934
		if (!isset($_REQUEST['personne'])) $_REQUEST['personne']='tous';
935
		if (!isset($_REQUEST['personne'])) $_REQUEST['personne']='tous';
935
		$res .= baz_liste_pagine_HTML($typedefiches, '', $_REQUEST['personne'], $valides, $requeteSQL, $requeteFrom, $requeteWhere);		
936
		$res .= baz_liste_pagine_HTML($typedefiches, '', $_REQUEST['personne'], $valides, $requeteSQL, $requeteFrom, $requeteWhere);		
936
	}
937
	}
937
	else {
938
	else {
938
		//on affiche toutes les annonces
939
		//on affiche toutes les annonces
939
		$res .= '<br /><p class="zone_info">'."\n".BAZ_ENTRER_VOS_CRITERES_DE_RECHERCHE.'</p>'."\n";
940
		$res .= '<br /><p class="zone_info">'."\n".BAZ_ENTRER_VOS_CRITERES_DE_RECHERCHE.'</p>'."\n";
940
		$GLOBALS['_BAZAR_']['url']->removeQueryString('action');
941
		$GLOBALS['_BAZAR_']['url']->removeQueryString('action');
941
		$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_VOIR_FLUX_RSS);
942
		$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_VOIR_FLUX_RSS);
942
		$GLOBALS['_BAZAR_']['url']->addQueryString('annonce', $typeannonce);
943
		$GLOBALS['_BAZAR_']['url']->addQueryString('annonce', $typeannonce);
943
		$GLOBALS['_BAZAR_']['url']->addQueryString('categorie_nature', $GLOBALS['_BAZAR_']['categorie_nature']);
944
		$GLOBALS['_BAZAR_']['url']->addQueryString('categorie_nature', $GLOBALS['_BAZAR_']['categorie_nature']);
944
		$res .= '{{Syndication titre="'.BAZ_DERNIERES_FICHES.'" url="'.preg_replace ('/&amp;/', '&', $GLOBALS['_BAZAR_']['url']->getURL()).
945
		$res .= '{{Syndication titre="'.BAZ_DERNIERES_FICHES.'" url="'.preg_replace ('/&amp;/', '&', $GLOBALS['_BAZAR_']['url']->getURL()).
945
                '" nb=10 nouvellefenetre=0 formatdate="'.BAZ_TYPE_AFFICHAGE_LISTE.'"}}';
946
                '" nb=10 nouvellefenetre=0 formatdate="'.BAZ_TYPE_AFFICHAGE_LISTE.'"}}';
946
	}
947
	}
947
	return $res;
948
	return $res;
948
}
949
}
949
 
950
 
950
/**
951
/**
951
 * Cette fonction renvoie du HTML
952
 * Cette fonction renvoie du HTML
952
 */
953
 */
953
function baz_liste_pagine_HTML($typeannonce, $nbitem, $emetteur, $valide, $requeteSQL = '', $requeteFrom = '', $requeteWhere = '') {	
954
function baz_liste_pagine_HTML($typeannonce, $nbitem, $emetteur, $valide, $requeteSQL = '', $requeteFrom = '', $requeteWhere = '') {	
954
	// generation de la requete MySQL personnalisee
955
	// generation de la requete MySQL personnalisee
955
	$req_where=0;
956
	$req_where=0;
956
	$requete = 'SELECT DISTINCT bf_id_fiche, bf_titre, bf_ce_utilisateur, bf_date_debut_validite_fiche '.
957
	$requete = 'SELECT DISTINCT bf_id_fiche, bf_titre, bf_ce_utilisateur, bf_date_debut_validite_fiche '.
957
				'FROM bazar_fiche, bazar_nature '.$requeteFrom.' WHERE '.$requeteWhere;
958
				'FROM bazar_fiche, bazar_nature '.$requeteFrom.' WHERE '.$requeteWhere;
958
	if ($valide!=2) {
959
	if ($valide!=2) {
959
		if ($req_where==1) {$requete .= ' AND ';}
960
		if ($req_where==1) {$requete .= ' AND ';}
960
		$req_where=1;
961
		$req_where=1;
961
		$requete .= 'bf_statut_fiche='.$valide;		
962
		$requete .= 'bf_statut_fiche='.$valide;		
962
	} else {
963
	} else {
963
		$requete .= '1 ' ;
964
		$requete .= '1 ' ;
964
	}
965
	}
965
	
966
	
966
	$utilisateur = new Administrateur_bazar ($GLOBALS['AUTH']) ;
967
	$utilisateur = new Administrateur_bazar ($GLOBALS['AUTH']) ;
967
	if ($valide!=0) {
968
	if ($valide!=0) {
968
		if ($utilisateur->isSuperAdmin()) {
969
		if ($utilisateur->isSuperAdmin()) {
969
			$req_where=1;
970
			$req_where=1;
970
		} else {
971
		} else {
971
			if ($req_where==1) {$requete .= ' AND ';}
972
			if ($req_where==1) {$requete .= ' AND ';}
972
			$requete .= '(bf_date_debut_validite_fiche<=NOW() or bf_date_debut_validite_fiche="0000-00-00")'.
973
			$requete .= '(bf_date_debut_validite_fiche<=NOW() or bf_date_debut_validite_fiche="0000-00-00")'.
973
						' AND (bf_date_fin_validite_fiche>=NOW() or bf_date_fin_validite_fiche="0000-00-00") AND bn_id_nature=bf_ce_nature';
974
						' AND (bf_date_fin_validite_fiche>=NOW() or bf_date_fin_validite_fiche="0000-00-00") AND bn_id_nature=bf_ce_nature';
974
			$req_where=1;
975
			$req_where=1;
975
		}
976
		}
976
	}
977
	}
977
	if ($emetteur!='' && $emetteur!='tous') {
978
	if ($emetteur!='' && $emetteur!='tous') {
978
		if ($req_where==1) {$requete .= ' AND ';}
979
		if ($req_where==1) {$requete .= ' AND ';}
979
		$requete .= 'bf_ce_utilisateur='.$emetteur;
980
		$requete .= 'bf_ce_utilisateur='.$emetteur;
980
		$req_where=1;
981
		$req_where=1;
981
		//requete pour afficher le nom de la structure
982
		//requete pour afficher le nom de la structure
982
		$requetenom = 'SELECT '.BAZ_CHAMPS_NOM.', '.BAZ_CHAMPS_PRENOM.' FROM '.
983
		$requetenom = 'SELECT '.BAZ_CHAMPS_NOM.', '.BAZ_CHAMPS_PRENOM.' FROM '.
983
						BAZ_ANNUAIRE.' WHERE '.BAZ_CHAMPS_ID.'='.$emetteur;
984
						BAZ_ANNUAIRE.' WHERE '.BAZ_CHAMPS_ID.'='.$emetteur;
984
		$resultat = $GLOBALS['_BAZAR_']['db']->query($requetenom) ;
985
		$resultat = $GLOBALS['_BAZAR_']['db']->query($requetenom) ;
985
		if (DB::isError($resultat)) {
986
		if (DB::isError($resultat)) {
986
			die ($resultat->getMessage().$resultat->getDebugInfo()) ;
987
			die ($resultat->getMessage().$resultat->getDebugInfo()) ;
987
		}
988
		}
988
		$ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC);
989
		$ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC);
989
		$nomflux .= ' ('.$ligne[BAZ_CHAMPS_NOM].' '.$ligne[BAZ_CHAMPS_PRENOM].')';
990
		$nomflux .= ' ('.$ligne[BAZ_CHAMPS_NOM].' '.$ligne[BAZ_CHAMPS_PRENOM].')';
990
	}
991
	}
991
	if ($requeteSQL!='') {
992
	if ($requeteSQL!='') {
992
		if ($req_where==1) {$requete .= ' AND ';}
993
		if ($req_where==1) {$requete .= ' AND ';}
993
		$requete .= '('.$requeteSQL.')';
994
		$requete .= '('.$requeteSQL.')';
994
		$req_where=1;
995
		$req_where=1;
995
	}
996
	}
996
	$requete .= ' ORDER BY  bf_date_debut_validite_fiche DESC, bf_date_fin_validite_fiche DESC, bf_date_maj_fiche DESC';
997
	$requete .= ' ORDER BY  bf_date_debut_validite_fiche DESC, bf_date_fin_validite_fiche DESC, bf_date_maj_fiche DESC';
997
	if ($nbitem!='') {$requete .= ' LIMIT 0,'.$nbitem;}
998
	if ($nbitem!='') {$requete .= ' LIMIT 0,'.$nbitem;}
998
	
999
	
999
	$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
1000
	$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
1000
	if (DB::isError($resultat)) {
1001
	if (DB::isError($resultat)) {
1001
		die ($resultat->getMessage().$resultat->getDebugInfo()) ;
1002
		die ($resultat->getMessage().$resultat->getDebugInfo()) ;
1002
	}
1003
	}
1003
	$res = '<br /><h4>'.BAZ_IL_Y_A.($resultat->numRows()).' '.BAZ_FICHES_CORRESPONDANTES.'</h4><br />'."\n";
1004
	$res = '<br /><h4>'.BAZ_IL_Y_A.($resultat->numRows()).' '.BAZ_FICHES_CORRESPONDANTES.'</h4><br />'."\n";
1004
	$res .= '<ul>' ;
1005
	$res .= '<ul>' ;
1005
	$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_VOIR_FICHE);
1006
	$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_VOIR_FICHE);
1006
	
1007
	
1007
	$donnees = array();
1008
	$donnees = array();
1008
	while ($ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT)) {
1009
	while ($ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT)) {
1009
		$GLOBALS['_BAZAR_']['url']->addQueryString('id_fiche', $ligne->bf_id_fiche) ;
1010
		$GLOBALS['_BAZAR_']['url']->addQueryString('id_fiche', $ligne->bf_id_fiche) ;
1010
		array_push ($donnees, array ($ligne->bf_id_fiche,$ligne->bf_titre,$ligne->bf_ce_utilisateur));		
1011
		array_push ($donnees, array ($ligne->bf_id_fiche,$ligne->bf_titre,$ligne->bf_ce_utilisateur));		
1011
	}
1012
	}
1012
	// Mise en place du Pager
1013
	// Mise en place du Pager
1013
	include_once PAP_CHEMIN_API_PEAR.'Pager/Pager.php';
1014
	include_once PAP_CHEMIN_API_PEAR.'Pager/Pager.php';
1014
	$params = array(
1015
	$params = array(
1015
    'mode'       => BAZ_MODE_DIVISION,
1016
    'mode'       => BAZ_MODE_DIVISION,
1016
    'perPage'    => BAZ_NOMBRE_RES_PAR_PAGE,
1017
    'perPage'    => BAZ_NOMBRE_RES_PAR_PAGE,
1017
    'delta'      => BAZ_DELTA,
1018
    'delta'      => BAZ_DELTA,
1018
    'httpMethod' => 'GET',
1019
    'httpMethod' => 'GET',
1019
    'extraVars' => array_merge($_POST, $_GET),
1020
    'extraVars' => array_merge($_POST, $_GET),
1020
    'altNext' => BAZ_SUIVANT,
1021
    'altNext' => BAZ_SUIVANT,
1021
    'altPrev' => BAZ_PRECEDENT,
1022
    'altPrev' => BAZ_PRECEDENT,
1022
    'nextImg' => BAZ_SUIVANT,
1023
    'nextImg' => BAZ_SUIVANT,
1023
    'prevImg' => BAZ_PRECEDENT,
1024
    'prevImg' => BAZ_PRECEDENT,
1024
    'itemData'   => $donnees
1025
    'itemData'   => $donnees
1025
	);
1026
	);
1026
	$pager = & Pager::factory($params);
1027
	$pager = & Pager::factory($params);
1027
	$data  = $pager->getPageData();
1028
	$data  = $pager->getPageData();
1028
	$links = $pager->getLinks();
1029
	$links = $pager->getLinks();
1029
    $res .= '<div class="bazar_numero">'.$pager->links.'</div>'."\n";
1030
    $res .= '<div class="bazar_numero">'.$pager->links.'</div>'."\n";
1030
	foreach ($data as $valeur) {
1031
	foreach ($data as $valeur) {
1031
		$GLOBALS['_BAZAR_']['url']->addQueryString('id_fiche', $valeur[0]) ;
1032
		$GLOBALS['_BAZAR_']['url']->addQueryString('id_fiche', $valeur[0]) ;
1032
		$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_VOIR_FICHE) ;
1033
		$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_VOIR_FICHE) ;
1033
		$res .= '<li><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.$valeur[1].'</a>'."\n" ;
1034
		$res .= '<li><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.$valeur[1].'</a>'."\n" ;
1034
		if ($utilisateur->isSuperAdmin() || $GLOBALS['id_user']==$valeur[2]) {
1035
		if ($utilisateur->isSuperAdmin() || $GLOBALS['id_user']==$valeur[2]) {
1035
			$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_ACTION_MODIFIER);
1036
			$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_ACTION_MODIFIER);
1036
			$GLOBALS['_BAZAR_']['url']->addQueryString('typeannonce', $GLOBALS['_BAZAR_']['id_typeannonce']);
1037
			$GLOBALS['_BAZAR_']['url']->addQueryString('typeannonce', $GLOBALS['_BAZAR_']['id_typeannonce']);
1037
			$GLOBALS['_BAZAR_']['url']->removeQueryString('personnes');
1038
			$GLOBALS['_BAZAR_']['url']->removeQueryString('personnes');
1038
			$GLOBALS['_BAZAR_']['url']->removeQueryString('recherche_effectuee');
1039
			$GLOBALS['_BAZAR_']['url']->removeQueryString('recherche_effectuee');
1039
			$res .= '<a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">('.BAZ_MODIFIER.')</a>&nbsp;' ;
1040
			$res .= '<a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">('.BAZ_MODIFIER.')</a>&nbsp;' ;
1040
			$GLOBALS['_BAZAR_']['url']->removeQueryString('action');
1041
			$GLOBALS['_BAZAR_']['url']->removeQueryString('action');
1041
			$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_ACTION_SUPPRESSION);
1042
			$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_ACTION_SUPPRESSION);
1042
			$res .= '<a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'" onclick="javascript:return confirm(\''.BAZ_SUPPRIMER.'\');">('.BAZ_SUPPRIMER.')</a>' ;
1043
			$res .= '<a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'" onclick="javascript:return confirm(\''.BAZ_SUPPRIMER.'\');">('.BAZ_SUPPRIMER.')</a>' ;
1043
			$GLOBALS['_BAZAR_']['url']->removeQueryString('action');
1044
			$GLOBALS['_BAZAR_']['url']->removeQueryString('action');
1044
		}
1045
		}
1045
		$res .= '</li>';
1046
		$res .= '</li>';
1046
	}
1047
	}
1047
	$res .= '</ul>';
1048
	$res .= '</ul>';
1048
	$res .= '<div class="bazar_numero">'.$pager->links.'</div>'."\n";
1049
	$res .= '<div class="bazar_numero">'.$pager->links.'</div>'."\n";
1049
 
1050
 
1050
	return $res ;
1051
	return $res ;
1051
}
1052
}
1052
 
1053
 
1053
/* +--Fin du code ----------------------------------------------------------------------------------------+
1054
/* +--Fin du code ----------------------------------------------------------------------------------------+
1054
*
1055
*
1055
* $Log: not supported by cvs2svn $
1056
* $Log: not supported by cvs2svn $
-
 
1057
* Revision 1.60.2.9  2007/02/27 15:32:40  alexandre_tb
-
 
1058
* utilisation de la fonction xmlEntities pour transformer les &amp; en &#...;
-
 
1059
* fixe les plantages des flux rss lorsque des guillemets ou des esperluettes étaient présents
-
 
1060
*
1056
* Revision 1.60.2.8  2007/02/27 15:11:00  alexandre_tb
1061
* Revision 1.60.2.8  2007/02/27 15:11:00  alexandre_tb
1057
* correction d une jointure dans la requete pour les flux rss
1062
* correction d une jointure dans la requete pour les flux rss
1058
* utilisation de la librairie XML_Util de pear pour generer le flux RSS -> plus clair
1063
* utilisation de la librairie XML_Util de pear pour generer le flux RSS -> plus clair
1059
*
1064
*
1060
* Revision 1.60.2.7  2007/02/15 17:39:00  jp_milcent
1065
* Revision 1.60.2.7  2007/02/15 17:39:00  jp_milcent
1061
* Remise dans le code d'un bogue...
1066
* Remise dans le code d'un bogue...
1062
* A corriger!
1067
* A corriger!
1063
*
1068
*
1064
* Revision 1.60.2.6  2007/02/15 13:42:16  jp_milcent
1069
* Revision 1.60.2.6  2007/02/15 13:42:16  jp_milcent
1065
* Utilisation de IN à la place du = dans les requêtes traitant les catégories de fiches.
1070
* Utilisation de IN à la place du = dans les requêtes traitant les catégories de fiches.
1066
* Permet d'utiliser la syntaxe 1,2,3 dans la configuration de categorie_nature.
1071
* Permet d'utiliser la syntaxe 1,2,3 dans la configuration de categorie_nature.
1067
*
1072
*
1068
* Revision 1.60.2.5  2007/02/02 13:46:54  alexandre_tb
1073
* Revision 1.60.2.5  2007/02/02 13:46:54  alexandre_tb
1069
* correction bug sur une date
1074
* correction bug sur une date
1070
*
1075
*
1071
* Revision 1.60.2.4  2007/01/30 15:45:01  alexandre_tb
1076
* Revision 1.60.2.4  2007/01/30 15:45:01  alexandre_tb
1072
* affichage de la date de création e la fiche lorsque la date de début de validité n'est plus bonne
1077
* affichage de la date de création e la fiche lorsque la date de début de validité n'est plus bonne
1073
*
1078
*
1074
* Revision 1.60.2.3  2007/01/29 10:53:46  alexandre_tb
1079
* Revision 1.60.2.3  2007/01/29 10:53:46  alexandre_tb
1075
* Mise en place de la constante BAZ_DERNIERES_FICHES pour remplacer le label en francais dans baz_liste
1080
* Mise en place de la constante BAZ_DERNIERES_FICHES pour remplacer le label en francais dans baz_liste
1076
*
1081
*
1077
* Revision 1.60.2.2  2007/01/17 16:01:27  alexandre_tb
1082
* Revision 1.60.2.2  2007/01/17 16:01:27  alexandre_tb
1078
* les dates ne s'affichent pas si elles sont vides.
1083
* les dates ne s'affichent pas si elles sont vides.
1079
* les champs dates propose 4 années avant l'année actuelle
1084
* les champs dates propose 4 années avant l'année actuelle
1080
*
1085
*
1081
* Revision 1.60.2.1  2007/01/05 14:41:49  alexandre_tb
1086
* Revision 1.60.2.1  2007/01/05 14:41:49  alexandre_tb
1082
* backport ordre d affichage des dernieres news et suppression de la taille des images uploadees
1087
* backport ordre d affichage des dernieres news et suppression de la taille des images uploadees
1083
*
1088
*
1084
* Revision 1.60  2006/10/05 08:53:50  florian
1089
* Revision 1.60  2006/10/05 08:53:50  florian
1085
* amelioration moteur de recherche, correction de bugs
1090
* amelioration moteur de recherche, correction de bugs
1086
*
1091
*
1087
* Revision 1.59  2006/09/21 14:19:39  florian
1092
* Revision 1.59  2006/09/21 14:19:39  florian
1088
* amélioration des fonctions liés au wikini
1093
* amélioration des fonctions liés au wikini
1089
*
1094
*
1090
* Revision 1.58  2006/09/15 12:31:40  alexandre_tb
1095
* Revision 1.58  2006/09/15 12:31:40  alexandre_tb
1091
* correction du nom du flux RSS.
1096
* correction du nom du flux RSS.
1092
*
1097
*
1093
* Revision 1.57  2006/07/25 13:22:27  alexandre_tb
1098
* Revision 1.57  2006/07/25 13:22:27  alexandre_tb
1094
* réorganisation du code, sans grand changement
1099
* réorganisation du code, sans grand changement
1095
*
1100
*
1096
* Revision 1.56  2006/07/18 14:13:35  alexandre_tb
1101
* Revision 1.56  2006/07/18 14:13:35  alexandre_tb
1097
* Ajout d identifiant HTML
1102
* Ajout d identifiant HTML
1098
*
1103
*
1099
* Revision 1.55  2006/07/04 14:29:18  alexandre_tb
1104
* Revision 1.55  2006/07/04 14:29:18  alexandre_tb
1100
* Ajout du bouton supprimer pour les administrateurs
1105
* Ajout du bouton supprimer pour les administrateurs
1101
*
1106
*
1102
* Revision 1.54  2006/07/03 09:51:21  alexandre_tb
1107
* Revision 1.54  2006/07/03 09:51:21  alexandre_tb
1103
* correction du bug recherche sur fiches validés et invalidés.
1108
* correction du bug recherche sur fiches validés et invalidés.
1104
*
1109
*
1105
* Revision 1.53  2006/06/29 10:29:51  florian
1110
* Revision 1.53  2006/06/29 10:29:51  florian
1106
* correction bug moteur de recherche
1111
* correction bug moteur de recherche
1107
*
1112
*
1108
* Revision 1.52  2006/06/02 09:29:07  florian
1113
* Revision 1.52  2006/06/02 09:29:07  florian
1109
* debut d'integration de wikini
1114
* debut d'integration de wikini
1110
*
1115
*
1111
* Revision 1.51  2006/05/23 15:41:27  alexandre_tb
1116
* Revision 1.51  2006/05/23 15:41:27  alexandre_tb
1112
* ajout de la numérotation des pages en haut et en bas ds résultats et ajout d'une div class=bazar_numero pour les entourer
1117
* ajout de la numérotation des pages en haut et en bas ds résultats et ajout d'une div class=bazar_numero pour les entourer
1113
*
1118
*
1114
* Revision 1.50  2006/05/22 09:55:12  alexandre_tb
1119
* Revision 1.50  2006/05/22 09:55:12  alexandre_tb
1115
* ajout de la variable recherche_avancee dans l'action du formulaire
1120
* ajout de la variable recherche_avancee dans l'action du formulaire
1116
*
1121
*
1117
* Revision 1.49  2006/05/19 13:54:11  florian
1122
* Revision 1.49  2006/05/19 13:54:11  florian
1118
* stabilisation du moteur de recherche, corrections bugs, lien recherche avancee
1123
* stabilisation du moteur de recherche, corrections bugs, lien recherche avancee
1119
*
1124
*
1120
* Revision 1.48  2006/05/17 09:50:13  alexandre_tb
1125
* Revision 1.48  2006/05/17 09:50:13  alexandre_tb
1121
* Ajout du moteur de recherche évolué et du découpage par page
1126
* Ajout du moteur de recherche évolué et du découpage par page
1122
*
1127
*
1123
* +-- Fin du code ----------------------------------------------------------------------------------------+
1128
* +-- Fin du code ----------------------------------------------------------------------------------------+
1124
*/
1129
*/
1125
?>
1130
?>