Subversion Repositories Applications.bazar

Rev

Rev 72 | Rev 87 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

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