Subversion Repositories Applications.bazar

Rev

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

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