Subversion Repositories Applications.bazar

Rev

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

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