Line 17... |
Line 17... |
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.18 2005-12-02 10:57:03 florian Exp $
|
22 |
// CVS : $Id: bazar.php,v 1.19 2006-01-03 10:19:31 florian Exp $
|
23 |
/**
|
23 |
/**
|
24 |
*
|
24 |
*
|
25 |
*@package bazar
|
25 |
*@package bazar
|
26 |
//Auteur original :
|
26 |
//Auteur original :
|
27 |
*@author Alexandre GRANIER <alexandre@tela-botanica.org>
|
27 |
*@author Alexandre GRANIER <alexandre@tela-botanica.org>
|
28 |
*@author Florian Schmitt <florian@ecole-et-nature.org>
|
28 |
*@author Florian Schmitt <florian@ecole-et-nature.org>
|
29 |
//Autres auteurs :
|
29 |
//Autres auteurs :
|
30 |
*@copyright Tela-Botanica 2000-2004
|
30 |
*@copyright Tela-Botanica 2000-2004
|
31 |
*@version $Revision: 1.18 $ $Date: 2005-12-02 10:57:03 $
|
31 |
*@version $Revision: 1.19 $ $Date: 2006-01-03 10:19:31 $
|
32 |
// +------------------------------------------------------------------------------------------------------+
|
32 |
// +------------------------------------------------------------------------------------------------------+
|
33 |
*/
|
33 |
*/
|
Line 34... |
Line 34... |
34 |
|
34 |
|
35 |
// +------------------------------------------------------------------------------------------------------+
|
35 |
// +------------------------------------------------------------------------------------------------------+
|
36 |
// | LES CONSTANTES DES ACTIONS DE BAZAR |
|
36 |
// | LES CONSTANTES DES ACTIONS DE BAZAR |
|
Line 37... |
Line -... |
37 |
// +------------------------------------------------------------------------------------------------------+
|
- |
|
38 |
|
37 |
// +------------------------------------------------------------------------------------------------------+
|
39 |
define ('BAZ_VOIR_VOS_ANNONCES', 0);
|
- |
|
40 |
define ('BAZ_VOIR_TOUTES_ANNONCES', 1) ;
|
38 |
|
41 |
define ('BAZ_RECHERCHER_ANNONCE', 2) ;
|
39 |
define ('BAZ_VOIR_TOUTES_ANNONCES', 1) ;
|
42 |
define ('BAZ_DEPOSER_ANNONCE', 3) ;
|
40 |
define ('BAZ_DEPOSER_ANNONCE', 3) ;
|
43 |
define ('BAZ_ANNONCES_A_VALIDER', 4) ;
|
41 |
define ('BAZ_ANNONCES_A_VALIDER', 4) ;
|
44 |
define ('BAZ_GERER_DROITS', 5) ;
|
42 |
define ('BAZ_GERER_DROITS', 5) ;
|
Line 68... |
Line 66... |
68 |
require_once 'bibliotheque/bazar.fonct.php'; //fichier des fonctions de Bazar
|
66 |
require_once 'bibliotheque/bazar.fonct.php'; //fichier des fonctions de Bazar
|
Line 69... |
Line 67... |
69 |
|
67 |
|
70 |
if (defined('PAP_VERSION')) { //si on est dans Papyrus
|
68 |
if (defined('PAP_VERSION')) { //si on est dans Papyrus
|
71 |
GEN_stockerStyleExterne( 'bazar_interne', 'client/bazar/bazar.interne.css');
|
69 |
GEN_stockerStyleExterne( 'bazar_interne', 'client/bazar/bazar.interne.css');
|
- |
|
70 |
}
|
- |
|
71 |
//initialisation de l'id user
|
- |
|
72 |
$GLOBALS['id_user']=$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID);
|
- |
|
73 |
|
- |
|
74 |
//si un parametre est précisé dans le gestionnaire de menus papyrus, on le prends en compte
|
- |
|
75 |
//parametre action pour lancer directement l'action indiquée
|
- |
|
76 |
if (!isset($_GET['action'])and(isset($GLOBALS['_GEN_commun']['info_application']->action))) {
|
- |
|
77 |
$_GET['action']=$GLOBALS['_GEN_commun']['info_application']->action;
|
- |
|
78 |
}
|
- |
|
79 |
//parametre voir_menu pour afficher le menu ou pas (par défaut, il l'affiche)
|
- |
|
80 |
if ((isset($GLOBALS['_GEN_commun']['info_application']->voir_menu))and($GLOBALS['_GEN_commun']['info_application']->voir_menu==0)) {
|
- |
|
81 |
$GLOBALS['_BAZAR_']['affiche_menu']=0;
|
- |
|
82 |
}
|
- |
|
83 |
else $GLOBALS['_BAZAR_']['affiche_menu']=1;
|
- |
|
84 |
//parametre categorie_nature pour préciser quels types de fiches sont montrees (par défaut, il affiche les id_menu=0)
|
- |
|
85 |
if (isset($GLOBALS['_GEN_commun']['info_application']->categorie_nature)) {
|
- |
|
86 |
$GLOBALS['_BAZAR_']['categorie_nature']=$GLOBALS['_GEN_commun']['info_application']->categorie_nature;
|
- |
|
87 |
}
|
- |
|
88 |
else $GLOBALS['_BAZAR_']['categorie_nature']=0;
|
- |
|
89 |
//parametre id_nature pour afficher un certain type de fiche (par défaut, tous les types de fiches)
|
- |
|
90 |
if (isset($GLOBALS['_GEN_commun']['info_application']->id_nature)) {
|
- |
|
91 |
$GLOBALS['_BAZAR_']['id_nature']=$GLOBALS['_GEN_commun']['info_application']->id_nature;
|
- |
|
92 |
}
|
Line 72... |
Line 93... |
72 |
}
|
93 |
else $GLOBALS['_BAZAR_']['id_nature']='toutes';
|
73 |
|
94 |
|
74 |
// +------------------------------------------------------------------------------------------------------+
|
95 |
// +------------------------------------------------------------------------------------------------------+
|
75 |
// | LISTE de FONCTIONS |
|
- |
|
76 |
// +------------------------------------------------------------------------------------------------------+
|
96 |
// | LISTE de FONCTIONS |
|
77 |
|
- |
|
78 |
function afficherContenuCorps() {
|
- |
|
79 |
|
- |
|
80 |
$GLOBALS['id_user']=$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID);
|
- |
|
81 |
|
- |
|
82 |
$res = '';
|
- |
|
83 |
|
- |
|
84 |
//---------------l'entête de l'appli-----------
|
- |
|
85 |
$res.='<div id="BAZ_hautdepage">'."\n";
|
- |
|
86 |
$res.='<h1>'.$GLOBALS['_GEN_commun']['info_menu']->gm_titre.'</h1>'."\n";
|
- |
|
87 |
$res.='</div>'."\n";
|
97 |
// +------------------------------------------------------------------------------------------------------+
|
88 |
|
98 |
if ($GLOBALS['_BAZAR_']['affiche_menu']) {
|
89 |
//---------------le menu de l'appli-----------
|
99 |
//---------------le menu de l'appli-----------
|
90 |
$res.='<div id="BAZ_menu">'."\n";
|
100 |
function afficherContenuNavigation () {
|
91 |
$res .='<ul>'."\n";
|
101 |
$res .='<ul>'."\n";
|
92 |
$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_VOIR_TOUTES_ANNONCES);
|
102 |
$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_VOIR_TOUTES_ANNONCES);
|
93 |
$GLOBALS['_BAZAR_']['url']->addQueryString('nature', 'toutes');
|
103 |
$GLOBALS['_BAZAR_']['url']->addQueryString('nature', 'toutes');
|
94 |
//partie consultation d'annonces
|
104 |
//partie consultation d'annonces
|
95 |
$res .= '<li><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_CONSULTER.'</a>'."\n".'</li>'."\n";
|
105 |
$res .= '<li><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_CONSULTER.'</a>'."\n".'</li>'."\n";
|
96 |
$GLOBALS['_BAZAR_']['url']->removeQueryString('nature');
|
106 |
$GLOBALS['_BAZAR_']['url']->removeQueryString('nature');
|
97 |
|
107 |
|
98 |
//partie abonnement aux annonces
|
108 |
//partie abonnement aux annonces
|
99 |
$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_S_INSCRIRE);
|
- |
|
100 |
$res .= '<li><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_S_ABONNER.'</a></li>'."\n" ;
|
- |
|
101 |
$GLOBALS['_BAZAR_']['url']->removeQueryString('action');
|
- |
|
102 |
|
- |
|
103 |
//partie saisie d'annonces
|
- |
|
104 |
$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_DEPOSER_ANNONCE);
|
- |
|
105 |
$res .= '<li><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_SAISIR.'</a>'."\n".'<ul>'."\n";
|
- |
|
106 |
$res .= '<li><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_DEPOSE_UNE_NOUVELLE_ANNONCE.'</a></li>'."\n" ;
|
- |
|
107 |
$GLOBALS['_BAZAR_']['url']->removeQueryString('action');
|
- |
|
108 |
|
- |
|
109 |
//annonces propres
|
- |
|
110 |
$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_VOIR_VOS_ANNONCES);
|
- |
|
111 |
$res .='<li><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_VOS_ANNONCES.'</a></li>'."\n";
|
- |
|
112 |
$GLOBALS['_BAZAR_']['url']->removeQueryString('action');
|
- |
|
113 |
$res .='</ul></li>'."\n";
|
- |
|
114 |
|
- |
|
115 |
//choix des administrateurs
|
- |
|
116 |
$est_admin=0;
|
- |
|
117 |
if ($GLOBALS['AUTH']->getAuth()) {
|
- |
|
118 |
$requete='SELECT bn_id_nature FROM bazar_nature';
|
- |
|
119 |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
|
- |
|
120 |
if (DB::isError($resultat)) {
|
- |
|
121 |
die ($resultat->getMessage().$resultat->getDebugInfo()) ;
|
- |
|
122 |
}
|
- |
|
123 |
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
|
- |
|
124 |
if ((niveau_droit($ligne['bn_id_nature'],$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID)))=='administrateur') {
|
- |
|
125 |
$est_admin=1;
|
- |
|
126 |
}
|
- |
|
127 |
}
|
- |
|
128 |
if (($est_admin)or(niveau_droit($id_nature_offre='0',$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID))=='superadministrateur')) {
|
- |
|
129 |
//partie administrer
|
- |
|
130 |
$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_ANNONCES_A_VALIDER);
|
- |
|
131 |
$res .= '<li><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_ADMINISTRER.'</a><ul>'."\n";
|
109 |
$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_S_INSCRIRE);
|
132 |
$res .= '<li><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_ANNONCES_A_ADMINISTRER.'</a></li>'."\n" ;
|
- |
|
133 |
$GLOBALS['_BAZAR_']['url']->removeQueryString('action');
|
- |
|
134 |
|
- |
|
135 |
if (niveau_droit($id_nature_offre='0',$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID))=='superadministrateur') {
|
- |
|
136 |
$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_GERER_DROITS);
|
- |
|
Line -... |
Line 110... |
- |
|
110 |
$res .= '<li><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_S_ABONNER.'</a></li>'."\n" ;
|
137 |
$res .= '<li><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_GESTION_DES_DROITS.'</a></li>'."\n" ;
|
111 |
$GLOBALS['_BAZAR_']['url']->removeQueryString('action');
|
138 |
$GLOBALS['_BAZAR_']['url']->removeQueryString('action');
|
112 |
|
139 |
|
113 |
//partie saisie d'annonces
|
140 |
$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_ADMINISTRER_ANNONCES);
|
114 |
$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_DEPOSER_ANNONCE);
|
141 |
$res .= '<li><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_ADMIN_ANNONCES.'</a></li>'."\n" ;
|
115 |
$res .= '<li><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_SAISIR.'</a>'."\n".'</li>'."\n";
|
142 |
$GLOBALS['_BAZAR_']['url']->removeQueryString('action');
|
116 |
$GLOBALS['_BAZAR_']['url']->removeQueryString('action');
|
- |
|
117 |
|
- |
|
118 |
//choix des administrateurs
|
- |
|
119 |
$est_admin=0;
|
- |
|
120 |
if ($GLOBALS['AUTH']->getAuth()) {
|
- |
|
121 |
$requete='SELECT bn_id_nature FROM bazar_nature';
|
143 |
}
|
122 |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
|
- |
|
123 |
if (DB::isError($resultat)) {
|
- |
|
124 |
die ($resultat->getMessage().$resultat->getDebugInfo()) ;
|
144 |
$res .= '</ul></li>'."\n";
|
125 |
}
|
145 |
}
|
126 |
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
|
146 |
}
|
127 |
if ((niveau_droit($ligne['bn_id_nature'],$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID)))=='administrateur') {
|
- |
|
128 |
$est_admin=1;
|
147 |
$res.= '</ul>'."\n";
|
129 |
}
|
- |
|
130 |
}
|
- |
|
131 |
if (($est_admin)or(niveau_droit($id_nature_offre='0',$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID))=='superadministrateur')) {
|
148 |
$res.='</div>'."\n";
|
132 |
//partie administrer
|
149 |
|
133 |
$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_ANNONCES_A_VALIDER);
|
150 |
//le corps de l'appli
|
134 |
$res .= '<li><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_ADMINISTRER.'</a></li>'."\n";
|
- |
|
135 |
$GLOBALS['_BAZAR_']['url']->removeQueryString('action');
|
151 |
$res.='<div id="BAZ_corps">'."\n";
|
136 |
|
152 |
|
137 |
if (niveau_droit($id_nature_offre='0',$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID))=='superadministrateur') {
|
- |
|
138 |
$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_GERER_DROITS);
|
- |
|
139 |
$res .= '<li><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_GESTION_DES_DROITS.'</a></li>'."\n" ;
|
- |
|
140 |
$GLOBALS['_BAZAR_']['url']->removeQueryString('action');
|
- |
|
141 |
}
|
- |
|
142 |
}
|
153 |
//si un parametre est précisé dans le gestionnaire de menus papyrus, on le prends en compte
|
143 |
}
|
- |
|
144 |
$res.= '</ul>'."\n";
|
- |
|
145 |
return $res ;
|
- |
|
146 |
}
|
- |
|
147 |
}
|
- |
|
148 |
|
- |
|
149 |
function afficherContenuCorps() {
|
154 |
if (!isset($_GET['action'])and(isset($GLOBALS['_GEN_commun']['info_application']->action))) {
|
150 |
$res = '';
|
155 |
$_GET['action']=$GLOBALS['_GEN_commun']['info_application']->action;
|
151 |
$res.='<h1>'.$GLOBALS['_GEN_commun']['info_menu']->gm_titre.'</h1>'."\n";
|
156 |
}
|
152 |
|
157 |
if (isset($_GET['action'])) {
|
153 |
if (isset($_GET['action'])) {
|
158 |
switch ($_GET['action']) {
|
- |
|
159 |
case BAZ_VOIR_VOS_ANNONCES : $res .= mes_fiches(); break;
|
154 |
switch ($_GET['action']) {
|
160 |
case BAZ_VOIR_TOUTES_ANNONCES : $res .= baz_liste($_REQUEST['nature'],'',''); break;
|
155 |
case BAZ_VOIR_VOS_ANNONCES : $res .= mes_fiches(); break;
|
161 |
case BAZ_RECHERCHER_ANNONCE : $res .= baz_rechercher(); break;
|
156 |
case BAZ_VOIR_TOUTES_ANNONCES : $res .= baz_liste($GLOBALS['_BAZAR_']['id_nature']); break;
|
162 |
case BAZ_DEPOSER_ANNONCE : $res .= baz_formulaire(BAZ_DEPOSER_ANNONCE); break;
|
157 |
case BAZ_DEPOSER_ANNONCE : $res .= baz_formulaire(BAZ_DEPOSER_ANNONCE); break;
|
163 |
case BAZ_ANNONCES_A_VALIDER : $res .= fiches_a_valider(); break;
|
158 |
case BAZ_ANNONCES_A_VALIDER : $res .= fiches_a_valider(); break;
|
Line 177... |
Line 172... |
177 |
case BAZ_VOIR_FLUX_RSS : header('Content-type: text/xml; charset=ISO-8859-1');include("bazarRSS.php");exit(0);break;
|
172 |
case BAZ_VOIR_FLUX_RSS : header('Content-type: text/xml; charset=ISO-8859-1');include("bazarRSS.php");exit(0);break;
|
178 |
default : $res .= accueil() ;
|
173 |
default : $res .= accueil() ;
|
179 |
}
|
174 |
}
|
180 |
}
|
175 |
}
|
181 |
else {
|
176 |
else {
|
182 |
$res .= baz_liste('toutes','','');
|
177 |
$res .= baz_liste($GLOBALS['_BAZAR_']['id_nature']);
|
183 |
}
|
178 |
}
|
184 |
$res.='</div>'."\n";
|
- |
|
185 |
return $res ;
|
179 |
return $res ;
|
186 |
}
|
180 |
}
|
Line 187... |
Line 181... |
187 |
|
181 |
|
188 |
|
182 |
|
189 |
/* +--Fin du code ----------------------------------------------------------------------------------------+
|
183 |
/* +--Fin du code ----------------------------------------------------------------------------------------+
|
- |
|
184 |
*
|
- |
|
185 |
* $Log: not supported by cvs2svn $
|
- |
|
186 |
* Revision 1.18 2005/12/02 10:57:03 florian
|
190 |
*
|
187 |
* MAJ pour paramétrage dans gestion de menus papyrus
|
191 |
* $Log: not supported by cvs2svn $
|
188 |
*
|
192 |
* Revision 1.17 2005/12/01 16:05:41 florian
|
189 |
* Revision 1.17 2005/12/01 16:05:41 florian
|
193 |
* changement des chemins pour appli Pear
|
190 |
* changement des chemins pour appli Pear
|
194 |
*
|
191 |
*
|