Subversion Repositories Applications.bazar

Rev

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

Rev 145 Rev 154
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.php,v 1.34 2006-09-04 15:25:12 alexandre_tb Exp $
22
// CVS : $Id: bazar.php,v 1.35 2006-10-05 08:53:50 florian 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-2004
30
*@copyright     Tela-Botanica 2000-2004
31
*@version       $Revision: 1.34 $ $Date: 2006-09-04 15:25:12 $
31
*@version       $Revision: 1.35 $ $Date: 2006-10-05 08:53:50 $
32
// +------------------------------------------------------------------------------------------------------+
32
// +------------------------------------------------------------------------------------------------------+
33
*/
33
*/
34
 
34
 
35
// +------------------------------------------------------------------------------------------------------+
35
// +------------------------------------------------------------------------------------------------------+
36
// |                                            ENTETE du PROGRAMME                                       |
36
// |                                            ENTETE du PROGRAMME                                       |
37
// +------------------------------------------------------------------------------------------------------+
37
// +------------------------------------------------------------------------------------------------------+
38
 
38
 
39
error_reporting(E_ALL);
39
error_reporting(E_ALL);
40
require_once PAP_CHEMIN_API_PEAR.'DB.php' ;
40
require_once PAP_CHEMIN_API_PEAR.'DB.php' ;
41
require_once PAP_CHEMIN_API_PEAR.'Auth.php' ;
41
require_once PAP_CHEMIN_API_PEAR.'Auth.php' ;
42
require_once 'configuration/baz_config.inc.php'; //fichier de configuration de Bazar
42
require_once 'configuration/baz_config.inc.php'; //fichier de configuration de Bazar
43
require_once 'bibliotheque/bazar.class.php';
43
require_once 'bibliotheque/bazar.class.php';
44
require_once 'bibliotheque/bazar.fonct.php'; //fichier des fonctions de Bazar
44
require_once 'bibliotheque/bazar.fonct.php'; //fichier des fonctions de Bazar
45
 
45
 
46
if (defined('PAP_VERSION')) { //si on est dans Papyrus
46
if (defined('PAP_VERSION')) { //si on est dans Papyrus
47
	GEN_stockerStyleExterne( 'bazar_interne', 'client/bazar/bazar.interne.css');
47
	GEN_stockerStyleExterne( 'bazar_interne', 'client/bazar/bazar.interne.css');
48
}
48
}
49
 
49
 
50
//**********************************************************************************************************
50
//**********************************************************************************************************
51
//initialisation des paramêtres papyrus
51
//initialisation des paramêtres papyrus
52
//**********************************************************************************************************
52
//**********************************************************************************************************
53
//si un parametre est précisé dans le gestionnaire de menus papyrus, on le prends en compte
53
//si un parametre est précisé dans le gestionnaire de menus papyrus, on le prends en compte
-
 
54
 
54
//parametre action pour lancer directement l'action indiquée  
55
//parametre action pour lancer directement l'action indiquée  
55
if (!isset($_GET['action'])and(isset($GLOBALS['_GEN_commun']['info_application']->action))) {
56
if (!isset($_GET['action'])and(isset($GLOBALS['_GEN_commun']['info_application']->action))) {
56
	$_GET['action']=$GLOBALS['_GEN_commun']['info_application']->action;
57
	$_GET['action']=$GLOBALS['_GEN_commun']['info_application']->action;
57
}
58
}
-
 
59
 
58
//parametre voir_menu pour afficher le menu ou pas (par défaut, il l'affiche)
60
//parametre voir_menu pour afficher le menu ou pas (par défaut, il l'affiche)
59
if ((isset($GLOBALS['_GEN_commun']['info_application']->voir_menu))and($GLOBALS['_GEN_commun']['info_application']->voir_menu==0)) {
61
if ((isset($GLOBALS['_GEN_commun']['info_application']->voir_menu))and($GLOBALS['_GEN_commun']['info_application']->voir_menu==0)) {
60
	$GLOBALS['_BAZAR_']['affiche_menu']=0;
62
	$GLOBALS['_BAZAR_']['affiche_menu']=0;
61
}
63
}
62
else $GLOBALS['_BAZAR_']['affiche_menu']=1;
64
else $GLOBALS['_BAZAR_']['affiche_menu']=1;
-
 
65
 
63
//parametre categorie_nature pour préciser quels types de fiches sont montrees (par défaut, il affiche les id_menu=0)
66
//parametre categorie_nature pour préciser quels types de fiches sont montrees (par défaut, il affiche les id_menu=0)
64
if (isset($GLOBALS['_GEN_commun']['info_application']->categorie_nature)) {
67
if (isset($GLOBALS['_GEN_commun']['info_application']->categorie_nature)) {
65
	$GLOBALS['_BAZAR_']['categorie_nature']=$GLOBALS['_GEN_commun']['info_application']->categorie_nature;
68
	$GLOBALS['_BAZAR_']['categorie_nature']=$GLOBALS['_GEN_commun']['info_application']->categorie_nature;
66
}
69
}
67
elseif (isset($_REQUEST['categorie_nature'])) {
70
elseif (isset($_REQUEST['categorie_nature'])) {
68
	$GLOBALS['_BAZAR_']['categorie_nature']=$_REQUEST['categorie_nature'];
71
	$GLOBALS['_BAZAR_']['categorie_nature']=$_REQUEST['categorie_nature'];
69
}
72
}
70
else $GLOBALS['_BAZAR_']['categorie_nature']=0;
73
else $GLOBALS['_BAZAR_']['categorie_nature']=0;
-
 
74
 
71
//parametre id_nature pour afficher un certain type de fiche (par défaut, tous les types de fiches)
75
//parametre id_nature pour afficher un certain type de fiche (par défaut, tous les types de fiches)
72
if (isset($GLOBALS['_GEN_commun']['info_application']->id_nature)) {
76
if (isset($GLOBALS['_GEN_commun']['info_application']->id_nature)) {
73
	$GLOBALS['_BAZAR_']['id_typeannonce']=$GLOBALS['_GEN_commun']['info_application']->id_nature;
77
	$GLOBALS['_BAZAR_']['id_typeannonce']=$GLOBALS['_GEN_commun']['info_application']->id_nature;
74
}
78
}
75
elseif (!isset($GLOBALS['_BAZAR_']['typeannonce'])) $GLOBALS['_BAZAR_']['typeannonce']='toutes';
79
elseif (!isset($GLOBALS['_BAZAR_']['typeannonce'])) $GLOBALS['_BAZAR_']['typeannonce']='toutes';
76
 
80
 
77
//**********************************************************************************************************
81
//**********************************************************************************************************
78
//initialisation de la variable globale de bazar
82
//initialisation de la variable globale de bazar
79
//**********************************************************************************************************
83
//**********************************************************************************************************
80
$GLOBALS['id_user']=$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID);
84
$GLOBALS['id_user']=$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID);
81
 
85
 
82
//Recuperer les eventuelles variables passees en GET ou en POST
86
//Recuperer les eventuelles variables passees en GET ou en POST
83
if (isset($_REQUEST['id_fiche'])) {
87
if (isset($_REQUEST['id_fiche'])) {
84
	$GLOBALS['_BAZAR_']['id_fiche']=$_REQUEST['id_fiche'];
88
	$GLOBALS['_BAZAR_']['id_fiche']=$_REQUEST['id_fiche'];
85
	// récupération du type d'annonce à partir de la fiche
89
	// récupération du type d'annonce à partir de la fiche
86
	$requete = 'select bf_ce_nature from bazar_fiche where bf_id_fiche='.$GLOBALS['_BAZAR_']['id_fiche'] ;
90
	$requete = 'select bf_ce_nature from bazar_fiche where bf_id_fiche='.$GLOBALS['_BAZAR_']['id_fiche'] ;
87
	$resultat = $GLOBALS['_BAZAR_']['db']->query ($requete) ;
91
	$resultat = $GLOBALS['_BAZAR_']['db']->query ($requete) ;
88
	if (DB::isError($resultat)) {
92
	if (DB::isError($resultat)) {
89
		echo $resultat->getMessage().'<br />'.$resultat->getInfoDebug();	
93
		echo $resultat->getMessage().'<br />'.$resultat->getInfoDebug();	
90
	}
94
	}
91
	$ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT) ;
95
	$ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT) ;
92
	$GLOBALS['_BAZAR_']['id_typeannonce'] = $ligne->bf_ce_nature ;
96
	$GLOBALS['_BAZAR_']['id_typeannonce'] = $ligne->bf_ce_nature ;
93
	$resultat->free();
97
	$resultat->free();
94
}		
98
}		
95
if (isset($_REQUEST['typeannonce'])) {
99
if (isset($_REQUEST['typeannonce'])) {
96
	$GLOBALS['_BAZAR_']['id_typeannonce']=$_REQUEST['typeannonce'];
100
	$GLOBALS['_BAZAR_']['id_typeannonce']=$_REQUEST['typeannonce'];
97
}
101
}
98
 
102
 
99
if ((isset($GLOBALS['_BAZAR_']['id_typeannonce']))and($GLOBALS['_BAZAR_']['id_typeannonce']!='toutes')) {
103
if ((isset($GLOBALS['_BAZAR_']['id_typeannonce']))and($GLOBALS['_BAZAR_']['id_typeannonce']!='toutes')) {
100
	$requete = 'SELECT bn_label_nature, bn_condition, bn_template, bn_commentaire, bn_appropriation, bn_image_titre, bn_image_logo FROM bazar_nature WHERE bn_id_nature='.$GLOBALS['_BAZAR_']['id_typeannonce'];
104
	$requete = 'SELECT bn_label_nature, bn_condition, bn_template, bn_commentaire, bn_appropriation, bn_image_titre, bn_image_logo FROM bazar_nature WHERE bn_id_nature='.$GLOBALS['_BAZAR_']['id_typeannonce'];
101
	$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
105
	$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
102
	if (DB::isError($resultat)) {
106
	if (DB::isError($resultat)) {
103
		die ($resultat->getMessage().$resultat->getDebugInfo()) ;
107
		die ($resultat->getMessage().$resultat->getDebugInfo()) ;
104
	}
108
	}
105
	$ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC);
109
	$ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC);
106
	$GLOBALS['_BAZAR_']['typeannonce']=$ligne['bn_label_nature'];
110
	$GLOBALS['_BAZAR_']['typeannonce']=$ligne['bn_label_nature'];
107
	$GLOBALS['_BAZAR_']['condition']=$ligne['bn_condition'];
111
	$GLOBALS['_BAZAR_']['condition']=$ligne['bn_condition'];
108
    $GLOBALS['_BAZAR_']['template']=$ligne['bn_template'];
112
    $GLOBALS['_BAZAR_']['template']=$ligne['bn_template'];
109
	$GLOBALS['_BAZAR_']['commentaire']=$ligne['bn_commentaire'];
113
	$GLOBALS['_BAZAR_']['commentaire']=$ligne['bn_commentaire'];
110
	$GLOBALS['_BAZAR_']['appropriation']=$ligne['bn_appropriation'];
114
	$GLOBALS['_BAZAR_']['appropriation']=$ligne['bn_appropriation'];
111
	$GLOBALS['_BAZAR_']['image_titre']=$ligne['bn_image_titre'];
115
	$GLOBALS['_BAZAR_']['image_titre']=$ligne['bn_image_titre'];
112
	$GLOBALS['_BAZAR_']['image_logo']=$ligne['bn_image_logo'];	
116
	$GLOBALS['_BAZAR_']['image_logo']=$ligne['bn_image_logo'];	
113
}
117
}
114
if (!isset($GLOBALS['_BAZAR_']['id_typeannonce'])) $GLOBALS['_BAZAR_']['id_typeannonce'] = 'toutes' ;
118
if (!isset($GLOBALS['_BAZAR_']['id_typeannonce'])) $GLOBALS['_BAZAR_']['id_typeannonce'] = 'toutes' ;
115
// +------------------------------------------------------------------------------------------------------+
119
// +------------------------------------------------------------------------------------------------------+
116
// |                                           LISTE de FONCTIONS                                         |
120
// |                                           LISTE de FONCTIONS                                         |
117
// +------------------------------------------------------------------------------------------------------+
121
// +------------------------------------------------------------------------------------------------------+
118
if ($GLOBALS['_BAZAR_']['affiche_menu']) {
122
if ($GLOBALS['_BAZAR_']['affiche_menu']) {
119
	//---------------le menu de l'appli-----------
123
	//---------------le menu de l'appli-----------
120
	function afficherContenuNavigation () {
124
	function afficherContenuNavigation () {
121
		$res ='<ul id="BAZ_menu">'."\n";
125
		$res ='<ul id="BAZ_menu">'."\n";
122
		$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_VOIR_TOUTES_ANNONCES);
-
 
123
		//partie consultation d'annonces
126
		//partie consultation d'annonces
-
 
127
		$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_VOIR_TOUTES_ANNONCES);
-
 
128
		$res .= '<li id="consulter"';
-
 
129
		if (!isset($_GET['action']) || (isset($_GET['action']) && ($_GET['action']==BAZ_VOIR_TOUTES_ANNONCES || $_GET['action']==BAZ_VOIR_FICHE))) $res .=' class="onglet_actif" ';
124
		$res .= '<li id="consulter"><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_CONSULTER.'</a>'."\n".'</li>'."\n";
130
		$res .='><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_CONSULTER.'</a>'."\n".'</li>'."\n";
125
		$GLOBALS['_BAZAR_']['url']->removeQueryString('nature');
131
		$GLOBALS['_BAZAR_']['url']->removeQueryString('nature');
126
	
132
	
127
		// Mes fiches
133
		// Mes fiches
128
		$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_ACTION_VOIR_VOS_ANNONCES);
134
		$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_ACTION_VOIR_VOS_ANNONCES);
-
 
135
		$res .= '<li id="consulter"';
-
 
136
		if (isset($_GET['action']) && $_GET['action']==BAZ_ACTION_VOIR_VOS_ANNONCES) $res .=' class="onglet_actif" ';
129
		$res .= '<li id="consulter"><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_VOIR_VOS_ANNONCES.'</a>'."\n".'</li>'."\n";
137
		$res .= '><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_VOIR_VOS_ANNONCES.'</a>'."\n".'</li>'."\n";
130
		$GLOBALS['_BAZAR_']['url']->removeQueryString('nature');
138
		$GLOBALS['_BAZAR_']['url']->removeQueryString('nature');
131
		
139
		
132
		//partie abonnement aux annonces
140
		//partie abonnement aux annonces
133
		$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_S_INSCRIRE);
141
		$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_S_INSCRIRE);
-
 
142
		$res .= '<li id="inscrire"';
-
 
143
		if (isset($_GET['action']) && $_GET['action']==BAZ_S_INSCRIRE) $res .=' class="onglet_actif" ';
134
		$res .= '<li id="inscrire"><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_S_ABONNER.'</a></li>'."\n" ;
144
		$res .= '><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_S_ABONNER.'</a></li>'."\n" ;
135
		$GLOBALS['_BAZAR_']['url']->removeQueryString('action');
145
		$GLOBALS['_BAZAR_']['url']->removeQueryString('action');
136
			
146
			
137
		//partie saisie d'annonces
147
		//partie saisie d'annonces
138
		$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_DEPOSER_ANNONCE);
148
		$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_DEPOSER_ANNONCE);
-
 
149
		$res .= '<li id="deposer"';
-
 
150
		if (isset($_GET['action']) && ($_GET['action']==BAZ_DEPOSER_ANNONCE || $_GET['action']==BAZ_ACTION_NOUVEAU_V || $_GET['action']==BAZ_ACTION_MODIFIER)) $res .=' class="onglet_actif" ';
139
		$res .= '<li id="deposer"><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_SAISIR.'</a>'."\n".'</li>'."\n";
151
		$res .='><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_SAISIR.'</a>'."\n".'</li>'."\n";
140
		$GLOBALS['_BAZAR_']['url']->removeQueryString('action');
152
		$GLOBALS['_BAZAR_']['url']->removeQueryString('action');
141
			
153
			
142
		//choix des administrateurs	
154
		//choix des administrateurs	
143
		$utilisateur = new Administrateur_bazar($GLOBALS['AUTH']) ;
155
		$utilisateur = new Administrateur_bazar($GLOBALS['AUTH']) ;
144
		$est_admin=0;
156
		$est_admin=0;
145
		if ($GLOBALS['AUTH']->getAuth()) {
157
		if ($GLOBALS['AUTH']->getAuth()) {
146
			$requete='SELECT bn_id_nature FROM bazar_nature';
158
			$requete='SELECT bn_id_nature FROM bazar_nature';
147
			$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
159
			$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
148
			if (DB::isError($resultat)) {
160
			if (DB::isError($resultat)) {
149
				die ($resultat->getMessage().$resultat->getDebugInfo()) ;
161
				die ($resultat->getMessage().$resultat->getDebugInfo()) ;
150
			}
162
			}
151
			while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
163
			while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
152
				if ($utilisateur->isAdmin ($ligne['bn_id_nature'])) {
164
				if ($utilisateur->isAdmin ($ligne['bn_id_nature'])) {
153
					$est_admin=1;
165
					$est_admin=1;
154
			    }
166
			    }
155
			}
167
			}
156
			if ($est_admin || $utilisateur->isSuperAdmin()) {
168
			if ($est_admin || $utilisateur->isSuperAdmin()) {
157
				//partie administrer
169
				//partie administrer
158
				$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_ANNONCES_A_VALIDER);
170
				$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_ANNONCES_A_VALIDER);
-
 
171
				$res .= '<li id="administrer"';
-
 
172
				if (isset($_GET['action']) && $_GET['action']==BAZ_ANNONCES_A_VALIDER) $res .=' class="onglet_actif" ';
159
				$res .= '<li id="administrer"><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_ADMINISTRER.'</a></li>'."\n";
173
				$res .='><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_ADMINISTRER.'</a></li>'."\n";
160
				$GLOBALS['_BAZAR_']['url']->removeQueryString('action');
174
				$GLOBALS['_BAZAR_']['url']->removeQueryString('action');
161
				
175
				
162
				if ($utilisateur->isSuperAdmin()) {
176
				if ($utilisateur->isSuperAdmin()) {
163
					$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_GERER_DROITS);
177
					$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_GERER_DROITS);
-
 
178
					$res .= '<li id="gerer"';
-
 
179
					if (isset($_GET['action']) && $_GET['action']==BAZ_GERER_DROITS) $res .=' class="onglet_actif" ';
164
					$res .= '<li id="gerer"><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_GESTION_DES_DROITS.'</a></li>'."\n" ;
180
					$res .='><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_GESTION_DES_DROITS.'</a></li>'."\n" ;
165
					$GLOBALS['_BAZAR_']['url']->removeQueryString('action');
181
					$GLOBALS['_BAZAR_']['url']->removeQueryString('action');
166
				}
182
				}
167
			}
183
			}
168
		}	
184
		}	
169
		$res.= '</ul>'."\n";
185
		$res.= '</ul>'."\n";
170
	    return $res ;
186
	    return $res ;
171
	}
187
	}
172
}
188
}
173
    
189
    
174
function afficherContenuCorps() {	
190
function afficherContenuCorps() {	
175
	$res = '';
191
	$res = '';
176
	$res.='<h1 id="titre_bazar">'.$GLOBALS['_GEN_commun']['info_menu']->gm_titre.'</h1>'."\n";
192
	$res.='<h1 id="titre_bazar">'.$GLOBALS['_GEN_commun']['info_menu']->gm_titre.'</h1>'."\n";
177
 
193
 
178
	if (isset($_GET['action'])) {
194
	if (isset($_GET['action'])) {
179
		if (($_GET['action']!=BAZ_ACTION_NOUVEAU_V)and($_GET['action']!=BAZ_ACTION_MODIFIER_V)) unset($_SESSION['formulaire_annonce_valide']);
195
		if (($_GET['action']!=BAZ_ACTION_NOUVEAU_V)and($_GET['action']!=BAZ_ACTION_MODIFIER_V)) unset($_SESSION['formulaire_annonce_valide']);
180
		switch ($_GET['action']) {
196
		switch ($_GET['action']) {
181
			case BAZ_ACTION_VOIR_VOS_ANNONCES : $res .= mes_fiches(); break;
197
			case BAZ_ACTION_VOIR_VOS_ANNONCES : $res .= mes_fiches(); break;
182
			case BAZ_VOIR_TOUTES_ANNONCES : $res .= baz_liste($GLOBALS['_BAZAR_']['id_typeannonce']); break;
198
			case BAZ_VOIR_TOUTES_ANNONCES : $res .= baz_liste($GLOBALS['_BAZAR_']['id_typeannonce']); break;
183
			case BAZ_DEPOSER_ANNONCE : $res .= baz_formulaire(BAZ_DEPOSER_ANNONCE); break;
199
			case BAZ_DEPOSER_ANNONCE : $res .= baz_formulaire(BAZ_DEPOSER_ANNONCE); break;
184
			case BAZ_ANNONCES_A_VALIDER : $res .= fiches_a_valider().baz_liste(); break;
200
			case BAZ_ANNONCES_A_VALIDER : $res .= fiches_a_valider(); break;
185
			case BAZ_ADMINISTRER_ANNONCES : $res .= baz_administrer_annonces(); break;
201
			case BAZ_ADMINISTRER_ANNONCES : $res .= baz_administrer_annonces(); break;
186
			case BAZ_MODIFIER_FICHE : $res .= baz_formulaire(BAZ_ACTION_MODIFIER); break;
202
			case BAZ_MODIFIER_FICHE : $res .= baz_formulaire(BAZ_ACTION_MODIFIER); break;
187
			case BAZ_SUPPRIMER_FICHE : $res .= baz_suppression().baz_liste('',$GLOBALS['id_user'],''); break;
203
			case BAZ_SUPPRIMER_FICHE : $res .= baz_suppression().baz_liste('',$GLOBALS['id_user'],''); break;
188
			case BAZ_VOIR_FICHE : $res .= baz_voir_fiche(1); break;
204
			case BAZ_VOIR_FICHE : $res .= baz_voir_fiche(1); break;
189
			case BAZ_ACTION_NOUVEAU : $res .= baz_formulaire(BAZ_ACTION_NOUVEAU); break;
205
			case BAZ_ACTION_NOUVEAU : $res .= baz_formulaire(BAZ_ACTION_NOUVEAU); break;
190
			case BAZ_ACTION_NOUVEAU_V : $res .= baz_formulaire(BAZ_ACTION_NOUVEAU_V).mes_fiches(); break;
206
			case BAZ_ACTION_NOUVEAU_V : $res .= baz_formulaire(BAZ_ACTION_NOUVEAU_V).mes_fiches(); break;
191
			case BAZ_ACTION_MODIFIER : $res .= baz_formulaire(BAZ_ACTION_MODIFIER); break;
207
			case BAZ_ACTION_MODIFIER : $res .= baz_formulaire(BAZ_ACTION_MODIFIER); break;
192
			case BAZ_ACTION_MODIFIER_V : $res .= baz_formulaire(BAZ_ACTION_MODIFIER_V).mes_fiches(); break;
208
			case BAZ_ACTION_MODIFIER_V : $res .= baz_formulaire(BAZ_ACTION_MODIFIER_V).mes_fiches(); break;
193
			case BAZ_ACTION_SUPPRESSION : $res .= baz_suppression().mes_fiches(); break;
209
			case BAZ_ACTION_SUPPRESSION : $res .= baz_suppression().mes_fiches(); break;
194
			case BAZ_ACTION_PUBLIER : publier_fiche(1) ;$res .= fiches_a_valider(); break;
210
			case BAZ_ACTION_PUBLIER : publier_fiche(1) ;$res .= fiches_a_valider(); break;
195
			case BAZ_ACTION_PAS_PUBLIER : publier_fiche(0) ;$res .= fiches_a_valider(); break;
211
			case BAZ_ACTION_PAS_PUBLIER : publier_fiche(0) ;$res .= fiches_a_valider(); break;
196
			case BAZ_GERER_DROITS : $res .= baz_gestion_droits(); break;
212
			case BAZ_GERER_DROITS : $res .= baz_gestion_droits(); break;
197
			case BAZ_S_INSCRIRE : $res .= baz_s_inscrire(); break;
213
			case BAZ_S_INSCRIRE : $res .= baz_s_inscrire(); break;
198
			case BAZ_VOIR_FLUX_RSS : header('Content-type: text/xml; charset=ISO-8859-1');include("bazarRSS.php");exit(0);break;
214
			case BAZ_VOIR_FLUX_RSS : header('Content-type: text/xml; charset=ISO-8859-1');include("bazarRSS.php");exit(0);break;
199
			default : $res .= baz_liste($GLOBALS['_BAZAR_']['id_typeannonce']) ;
215
			default : $res .= baz_liste($GLOBALS['_BAZAR_']['id_typeannonce']) ;
200
		}
216
		}
201
	}
217
	}
202
	else {
218
	else {
203
		$res .= baz_liste($GLOBALS['_BAZAR_']['id_typeannonce']);
219
		$res .= baz_liste($GLOBALS['_BAZAR_']['id_typeannonce']);
204
	}
220
	}
205
	return $res ;
221
	return $res ;
206
}
222
}
207
 
223
 
208
 
224
 
209
/* +--Fin du code ----------------------------------------------------------------------------------------+
225
/* +--Fin du code ----------------------------------------------------------------------------------------+
210
*
226
*
211
* $Log: not supported by cvs2svn $
227
* $Log: not supported by cvs2svn $
-
 
228
* Revision 1.34  2006/09/04 15:25:12  alexandre_tb
-
 
229
* ajout d'un id dans la balise HTML du titre
-
 
230
*
212
* Revision 1.33  2006/06/21 15:41:42  alexandre_tb
231
* Revision 1.33  2006/06/21 15:41:42  alexandre_tb
213
* rétablissement du menu mes fiches
232
* rétablissement du menu mes fiches
214
*
233
*
215
* Revision 1.32  2006/06/21 15:40:15  alexandre_tb
234
* Revision 1.32  2006/06/21 15:40:15  alexandre_tb
216
* rétablissement du menu mes fiches
235
* rétablissement du menu mes fiches
217
*
236
*
218
* Revision 1.31  2006/05/19 13:54:32  florian
237
* Revision 1.31  2006/05/19 13:54:32  florian
219
* stabilisation du moteur de recherche, corrections bugs, lien recherche avancee
238
* stabilisation du moteur de recherche, corrections bugs, lien recherche avancee
220
*
239
*
221
* Revision 1.30  2006/04/28 12:46:14  florian
240
* Revision 1.30  2006/04/28 12:46:14  florian
222
* integration des liens vers annuaire
241
* integration des liens vers annuaire
223
*
242
*
224
* Revision 1.29  2006/04/24 10:16:22  alexandre_tb
243
* Revision 1.29  2006/04/24 10:16:22  alexandre_tb
225
* ajout de la globale filtre.
244
* ajout de la globale filtre.
226
* elle remplace (à terme) catégorie nature
245
* elle remplace (à terme) catégorie nature
227
*
246
*
228
* Revision 1.28  2006/03/29 13:05:41  alexandre_tb
247
* Revision 1.28  2006/03/29 13:05:41  alexandre_tb
229
* utilisation de la classe Administrateur_bazar
248
* utilisation de la classe Administrateur_bazar
230
*
249
*
231
* Revision 1.27  2006/02/07 11:08:36  alexandre_tb
250
* Revision 1.27  2006/02/07 11:08:36  alexandre_tb
232
* utilisation de la classe Utilisateur_bazar pour la vérification des droits
251
* utilisation de la classe Utilisateur_bazar pour la vérification des droits
233
*
252
*
234
* Revision 1.26  2006/02/06 09:33:53  alexandre_tb
253
* Revision 1.26  2006/02/06 09:33:53  alexandre_tb
235
* modification de l'affichage lors de la saisie de fiche
254
* modification de l'affichage lors de la saisie de fiche
236
*
255
*
237
* Revision 1.25  2006/01/30 17:25:38  alexandre_tb
256
* Revision 1.25  2006/01/30 17:25:38  alexandre_tb
238
* correction de bugs
257
* correction de bugs
239
*
258
*
240
* Revision 1.24  2006/01/26 11:06:43  alexandre_tb
259
* Revision 1.24  2006/01/26 11:06:43  alexandre_tb
241
* ajout d'une requete pour recupere l'id_nature si un id_fiche est passé dans l'url
260
* ajout d'une requete pour recupere l'id_nature si un id_fiche est passé dans l'url
242
*
261
*
243
* Revision 1.23  2006/01/17 10:07:36  alexandre_tb
262
* Revision 1.23  2006/01/17 10:07:36  alexandre_tb
244
* en cours
263
* en cours
245
*
264
*
246
* Revision 1.22  2006/01/16 15:11:28  alexandre_tb
265
* Revision 1.22  2006/01/16 15:11:28  alexandre_tb
247
* simplification code
266
* simplification code
248
*
267
*
249
* Revision 1.21  2006/01/13 14:12:52  florian
268
* Revision 1.21  2006/01/13 14:12:52  florian
250
* utilisation des temlates dans la table bazar_nature
269
* utilisation des temlates dans la table bazar_nature
251
*
270
*
252
* Revision 1.20  2006/01/05 16:28:25  alexandre_tb
271
* Revision 1.20  2006/01/05 16:28:25  alexandre_tb
253
* prise en chage des checkbox, reste la mise à jour à gérer
272
* prise en chage des checkbox, reste la mise à jour à gérer
254
*
273
*
255
* Revision 1.19  2006/01/03 10:19:31  florian
274
* Revision 1.19  2006/01/03 10:19:31  florian
256
* Mise à jour pour accepter des parametres dans papyrus: faire apparaitre ou non le menu, afficher qu'un type de fiches, définir l'action par défaut...
275
* Mise à jour pour accepter des parametres dans papyrus: faire apparaitre ou non le menu, afficher qu'un type de fiches, définir l'action par défaut...
257
*
276
*
258
* Revision 1.18  2005/12/02 10:57:03  florian
277
* Revision 1.18  2005/12/02 10:57:03  florian
259
* MAJ pour paramétrage dans gestion de menus papyrus
278
* MAJ pour paramétrage dans gestion de menus papyrus
260
*
279
*
261
* Revision 1.17  2005/12/01 16:05:41  florian
280
* Revision 1.17  2005/12/01 16:05:41  florian
262
* changement des chemins pour appli Pear
281
* changement des chemins pour appli Pear
263
*
282
*
264
* Revision 1.16  2005/12/01 15:31:30  florian
283
* Revision 1.16  2005/12/01 15:31:30  florian
265
* correction bug modifs et saisies
284
* correction bug modifs et saisies
266
*
285
*
267
* Revision 1.15  2005/11/30 13:58:45  florian
286
* Revision 1.15  2005/11/30 13:58:45  florian
268
* ajouts graphisme (logos, boutons), changement structure SQL bazar_fiche
287
* ajouts graphisme (logos, boutons), changement structure SQL bazar_fiche
269
*
288
*
270
* Revision 1.14  2005/11/24 16:17:13  florian
289
* Revision 1.14  2005/11/24 16:17:13  florian
271
* corrections bugs, ajout des cases à cocher
290
* corrections bugs, ajout des cases à cocher
272
*
291
*
273
* Revision 1.13  2005/11/14 16:04:54  florian
292
* Revision 1.13  2005/11/14 16:04:54  florian
274
* maj bug affichage flux
293
* maj bug affichage flux
275
*
294
*
276
* Revision 1.12  2005/11/07 17:05:46  florian
295
* Revision 1.12  2005/11/07 17:05:46  florian
277
* amélioration validation conditions de saisie, ajout des règles spécifiques de saisie des formulaires
296
* amélioration validation conditions de saisie, ajout des règles spécifiques de saisie des formulaires
278
*
297
*
279
* Revision 1.11  2005/10/21 16:15:04  florian
298
* Revision 1.11  2005/10/21 16:15:04  florian
280
* mise a jour appropriation
299
* mise a jour appropriation
281
*
300
*
282
* Revision 1.10  2005/10/12 17:20:33  ddelon
301
* Revision 1.10  2005/10/12 17:20:33  ddelon
283
* Reorganisation calendrier + applette
302
* Reorganisation calendrier + applette
284
*
303
*
285
* Revision 1.9  2005/10/12 13:35:07  florian
304
* Revision 1.9  2005/10/12 13:35:07  florian
286
* amélioration de l'interface de bazar, de manière a simplifier les consultations, et à harmoniser par rapport aux Ressources
305
* amélioration de l'interface de bazar, de manière a simplifier les consultations, et à harmoniser par rapport aux Ressources
287
*
306
*
288
* Revision 1.8  2005/09/30 13:00:05  ddelon
307
* Revision 1.8  2005/09/30 13:00:05  ddelon
289
* Fiche bazar generique
308
* Fiche bazar generique
290
*
309
*
291
* Revision 1.7  2005/09/30 12:34:44  ddelon
310
* Revision 1.7  2005/09/30 12:34:44  ddelon
292
* petite modification pour integration bazar dans papyrus
311
* petite modification pour integration bazar dans papyrus
293
*
312
*
294
* Revision 1.6  2005/09/30 12:22:54  florian
313
* Revision 1.6  2005/09/30 12:22:54  florian
295
* Ajouts commentaires pour fiche, modifications graphiques, maj SQL
314
* Ajouts commentaires pour fiche, modifications graphiques, maj SQL
296
*
315
*
297
* Revision 1.4  2005/07/21 19:03:12  florian
316
* Revision 1.4  2005/07/21 19:03:12  florian
298
* nouveautés bazar: templates fiches, correction de bugs, ...
317
* nouveautés bazar: templates fiches, correction de bugs, ...
299
*
318
*
300
* Revision 1.2  2005/02/22 15:33:32  florian
319
* Revision 1.2  2005/02/22 15:33:32  florian
301
* integration dans Papyrus
320
* integration dans Papyrus
302
*
321
*
303
* Revision 1.1.1.1  2005/02/17 18:05:11  florian
322
* Revision 1.1.1.1  2005/02/17 18:05:11  florian
304
* Import initial de Bazar
323
* Import initial de Bazar
305
*
324
*
306
* Revision 1.1.1.1  2005/02/17 11:09:50  florian
325
* Revision 1.1.1.1  2005/02/17 11:09:50  florian
307
* Import initial
326
* Import initial
308
*
327
*
309
* Revision 1.1.1.1  2005/02/16 18:06:35  florian
328
* Revision 1.1.1.1  2005/02/16 18:06:35  florian
310
* import de la nouvelle version
329
* import de la nouvelle version
311
*
330
*
312
* Revision 1.3  2004/07/05 15:10:14  florian
331
* Revision 1.3  2004/07/05 15:10:14  florian
313
* changement interface de saisie
332
* changement interface de saisie
314
*
333
*
315
* Revision 1.2  2004/07/01 10:13:41  florian
334
* Revision 1.2  2004/07/01 10:13:41  florian
316
* modif Florian
335
* modif Florian
317
*
336
*
318
* Revision 1.1  2004/06/23 09:58:32  alex
337
* Revision 1.1  2004/06/23 09:58:32  alex
319
* version initiale
338
* version initiale
320
*
339
*
321
* Revision 1.1  2004/06/18 09:00:07  alex
340
* Revision 1.1  2004/06/18 09:00:07  alex
322
* version initiale
341
* version initiale
323
*
342
*
324
*
343
*
325
* +-- Fin du code ----------------------------------------------------------------------------------------+
344
* +-- Fin du code ----------------------------------------------------------------------------------------+
326
*/
345
*/
327
?>
346
?>