Subversion Repositories Applications.bazar

Rev

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

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