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.20 2006-01-05 16:28:25 alexandre_tb Exp $
|
22 |
// CVS : $Id: bazar.php,v 1.21 2006-01-13 14:12:52 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.20 $ $Date: 2006-01-05 16:28:25 $
|
31 |
*@version $Revision: 1.21 $ $Date: 2006-01-13 14:12:52 $
|
32 |
// +------------------------------------------------------------------------------------------------------+
|
32 |
// +------------------------------------------------------------------------------------------------------+
|
33 |
*/
|
33 |
*/
|
Line 34... |
Line 34... |
34 |
|
34 |
|
35 |
// +------------------------------------------------------------------------------------------------------+
|
35 |
// +------------------------------------------------------------------------------------------------------+
|
Line 66... |
Line 66... |
66 |
require_once 'bibliotheque/bazar.fonct.php'; //fichier des fonctions de Bazar
|
66 |
require_once 'bibliotheque/bazar.fonct.php'; //fichier des fonctions de Bazar
|
Line 67... |
Line 67... |
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 |
}
|
- |
|
71 |
//initialisation de l'id user
|
- |
|
Line -... |
Line 70... |
- |
|
70 |
}
|
- |
|
71 |
|
- |
|
72 |
//**********************************************************************************************************
|
72 |
$GLOBALS['id_user']=$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID);
|
73 |
//initialisation des paramêtres papyrus
|
73 |
|
74 |
//**********************************************************************************************************
|
74 |
//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
|
75 |
//parametre action pour lancer directement l'action indiquée
|
76 |
//parametre action pour lancer directement l'action indiquée
|
76 |
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))) {
|
Line 86... |
Line 87... |
86 |
$GLOBALS['_BAZAR_']['categorie_nature']=$GLOBALS['_GEN_commun']['info_application']->categorie_nature;
|
87 |
$GLOBALS['_BAZAR_']['categorie_nature']=$GLOBALS['_GEN_commun']['info_application']->categorie_nature;
|
87 |
}
|
88 |
}
|
88 |
else $GLOBALS['_BAZAR_']['categorie_nature']=0;
|
89 |
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 |
//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 |
if (isset($GLOBALS['_GEN_commun']['info_application']->id_nature)) {
|
91 |
$GLOBALS['_BAZAR_']['id_nature']=$GLOBALS['_GEN_commun']['info_application']->id_nature;
|
92 |
$GLOBALS['_BAZAR_']['id_typeannonce']=$GLOBALS['_GEN_commun']['info_application']->id_nature;
|
- |
|
93 |
}
|
- |
|
94 |
elseif (!isset($GLOBALS['_BAZAR_']['typeannonce'])) $GLOBALS['_BAZAR_']['typeannonce']='toutes';
|
- |
|
95 |
|
- |
|
96 |
//**********************************************************************************************************
|
- |
|
97 |
//initialisation de la variable globale de bazar
|
- |
|
98 |
//**********************************************************************************************************
|
- |
|
99 |
$GLOBALS['id_user']=$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID);
|
- |
|
100 |
|
- |
|
101 |
//Recuperer les eventuelles variables passees en GET ou en POST
|
- |
|
102 |
if (isset($_REQUEST['id_fiche'])) $GLOBALS['_BAZAR_']['id_fiche']=$_REQUEST['id_fiche'];
|
- |
|
103 |
if (isset($_REQUEST['typeannonce'])) {
|
- |
|
104 |
$GLOBALS['_BAZAR_']['id_typeannonce']=$_REQUEST['typeannonce'];
|
- |
|
105 |
}
|
- |
|
106 |
|
- |
|
107 |
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'];
|
- |
|
109 |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
|
- |
|
110 |
if (DB::isError($resultat)) {
|
- |
|
111 |
die ($resultat->getMessage().$resultat->getDebugInfo()) ;
|
- |
|
112 |
}
|
- |
|
113 |
$ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC);
|
- |
|
114 |
$GLOBALS['_BAZAR_']['typeannonce']=$ligne['bn_label_nature'];
|
- |
|
115 |
$GLOBALS['_BAZAR_']['condition']=$ligne['bn_condition'];
|
- |
|
116 |
$GLOBALS['_BAZAR_']['template']=$ligne['bn_template'];
|
- |
|
117 |
$GLOBALS['_BAZAR_']['commentaire']=$ligne['bn_commentaire'];
|
- |
|
118 |
$GLOBALS['_BAZAR_']['appropriation']=$ligne['bn_appropriation'];
|
- |
|
119 |
$GLOBALS['_BAZAR_']['nb_consultations']=$ligne['bf_nb_consultations'];
|
- |
|
120 |
$GLOBALS['_BAZAR_']['image_titre']=$ligne['bn_image_titre'];
|
- |
|
121 |
$GLOBALS['_BAZAR_']['image_logo']=$ligne['bn_image_logo'];
|
92 |
}
|
122 |
}
|
93 |
else $GLOBALS['_BAZAR_']['id_nature']='toutes';
|
- |
|
Line 94... |
Line 123... |
94 |
|
123 |
|
95 |
// +------------------------------------------------------------------------------------------------------+
|
124 |
// +------------------------------------------------------------------------------------------------------+
|
96 |
// | LISTE de FONCTIONS |
|
125 |
// | LISTE de FONCTIONS |
|
97 |
// +------------------------------------------------------------------------------------------------------+
|
126 |
// +------------------------------------------------------------------------------------------------------+
|
Line 149... |
Line 178... |
149 |
function afficherContenuCorps() {
|
178 |
function afficherContenuCorps() {
|
150 |
$res = '';
|
179 |
$res = '';
|
151 |
$res.='<h1>'.$GLOBALS['_GEN_commun']['info_menu']->gm_titre.'</h1>'."\n";
|
180 |
$res.='<h1>'.$GLOBALS['_GEN_commun']['info_menu']->gm_titre.'</h1>'."\n";
|
Line 152... |
Line 181... |
152 |
|
181 |
|
- |
|
182 |
if (isset($_GET['action'])) {
|
153 |
if (isset($_GET['action'])) {
|
183 |
if (($_GET['action']!=BAZ_ACTION_NOUVEAU_V)and($_GET['action']!=BAZ_ACTION_MODIFIER_V)) unset($_SESSION['formulaire_annonce_valide']);
|
154 |
switch ($_GET['action']) {
|
184 |
switch ($_GET['action']) {
|
155 |
case BAZ_VOIR_VOS_ANNONCES : $res .= mes_fiches(); break;
|
185 |
case BAZ_VOIR_VOS_ANNONCES : $res .= mes_fiches(); break;
|
156 |
case BAZ_VOIR_TOUTES_ANNONCES : $res .= baz_liste($GLOBALS['_BAZAR_']['id_nature']); break;
|
186 |
case BAZ_VOIR_TOUTES_ANNONCES : $res .= baz_liste($GLOBALS['_BAZAR_']['id_nature']); break;
|
157 |
case BAZ_DEPOSER_ANNONCE : $res .= baz_formulaire(BAZ_DEPOSER_ANNONCE); break;
|
187 |
case BAZ_DEPOSER_ANNONCE : $res .= baz_formulaire(BAZ_DEPOSER_ANNONCE); break;
|
158 |
case BAZ_ANNONCES_A_VALIDER : $res .= fiches_a_valider(); break;
|
188 |
case BAZ_ANNONCES_A_VALIDER : $res .= fiches_a_valider(); break;
|
159 |
case BAZ_ADMINISTRER_ANNONCES : $res .= baz_administrer_annonces(); break;
|
189 |
case BAZ_ADMINISTRER_ANNONCES : $res .= baz_administrer_annonces(); break;
|
160 |
case BAZ_MODIFIER_FICHE : $res .= baz_formulaire(BAZ_ACTION_MODIFIER); break;
|
190 |
case BAZ_MODIFIER_FICHE : $res .= baz_formulaire(BAZ_ACTION_MODIFIER); break;
|
161 |
case BAZ_SUPPRIMER_FICHE : $res .= baz_suppression().baz_liste('',$GLOBALS['id_user'],''); break;
|
191 |
case BAZ_SUPPRIMER_FICHE : $res .= baz_suppression().baz_liste('',$GLOBALS['id_user'],''); break;
|
162 |
case BAZ_VOIR_FICHE : $res .= baz_voir_fiche(1); break;
|
192 |
case BAZ_VOIR_FICHE : $res .= baz_voir_fiche(1); break;
|
163 |
case BAZ_ACTION_NOUVEAU : $res .= baz_formulaire(BAZ_ACTION_NOUVEAU); break;
|
193 |
case BAZ_ACTION_NOUVEAU : $res .= baz_formulaire(BAZ_ACTION_NOUVEAU); break;
|
164 |
case BAZ_ACTION_NOUVEAU_V : $res .= baz_formulaire(BAZ_ACTION_NOUVEAU_V).mes_fiches(); break;
|
194 |
case BAZ_ACTION_NOUVEAU_V : $res .= baz_formulaire(BAZ_ACTION_NOUVEAU_V).baz_formulaire(BAZ_DEPOSER_ANNONCE); break;
|
165 |
case BAZ_ACTION_MODIFIER : $res .= baz_formulaire(BAZ_ACTION_MODIFIER); break;
|
195 |
case BAZ_ACTION_MODIFIER : $res .= baz_formulaire(BAZ_ACTION_MODIFIER); break;
|
166 |
case BAZ_ACTION_MODIFIER_V : $res .= baz_formulaire(BAZ_ACTION_MODIFIER_V).mes_fiches(); break;
|
196 |
case BAZ_ACTION_MODIFIER_V : $res .= baz_formulaire(BAZ_ACTION_MODIFIER_V).baz_formulaire(BAZ_DEPOSER_ANNONCE); break;
|
167 |
case BAZ_ACTION_SUPPRESSION : $res .= baz_suppression().mes_fiches(); break;
|
197 |
case BAZ_ACTION_SUPPRESSION : $res .= baz_suppression().baz_formulaire(BAZ_DEPOSER_ANNONCE); break;
|
168 |
case BAZ_ACTION_PUBLIER : publier_fiche(1) ;$res .= fiches_a_valider(); break;
|
198 |
case BAZ_ACTION_PUBLIER : publier_fiche(1) ;$res .= fiches_a_valider(); break;
|
169 |
case BAZ_ACTION_PAS_PUBLIER : publier_fiche(0) ;$res .= fiches_a_valider(); break;
|
199 |
case BAZ_ACTION_PAS_PUBLIER : publier_fiche(0) ;$res .= fiches_a_valider(); break;
|
170 |
case BAZ_GERER_DROITS : $res .= baz_formulaire(BAZ_GERER_DROITS); break;
|
200 |
case BAZ_GERER_DROITS : $res .= baz_gestion_droits(); break;
|
171 |
case BAZ_S_INSCRIRE : $res .= baz_s_inscrire(); break;
|
201 |
case BAZ_S_INSCRIRE : $res .= baz_s_inscrire(); break;
|
172 |
case BAZ_VOIR_FLUX_RSS : header('Content-type: text/xml; charset=ISO-8859-1');include("bazarRSS.php");exit(0);break;
|
202 |
case BAZ_VOIR_FLUX_RSS : header('Content-type: text/xml; charset=ISO-8859-1');include("bazarRSS.php");exit(0);break;
|
173 |
default : $res .= accueil() ;
|
203 |
default : $res .= accueil() ;
|
174 |
}
|
204 |
}
|
Line 181... |
Line 211... |
181 |
|
211 |
|
182 |
|
212 |
|
183 |
/* +--Fin du code ----------------------------------------------------------------------------------------+
|
213 |
/* +--Fin du code ----------------------------------------------------------------------------------------+
|
- |
|
214 |
*
|
- |
|
215 |
* $Log: not supported by cvs2svn $
|
- |
|
216 |
* Revision 1.20 2006/01/05 16:28:25 alexandre_tb
|
184 |
*
|
217 |
* prise en chage des checkbox, reste la mise à jour à gérer
|
185 |
* $Log: not supported by cvs2svn $
|
218 |
*
|
186 |
* Revision 1.19 2006/01/03 10:19:31 florian
|
219 |
* Revision 1.19 2006/01/03 10:19:31 florian
|
187 |
* 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...
|
220 |
* 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...
|
188 |
*
|
221 |
*
|