Subversion Repositories Applications.bazar

Rev

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

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