| 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.fonct.php,v 1.70 2007-10-10 13:26:36 alexandre_tb Exp $
|
22 |
// CVS : $Id: bazar.fonct.php,v 1.71 2007-10-22 09:18:39 alexandre_tb Exp $
|
| 23 |
/**
|
23 |
/**
|
| 24 |
*
|
24 |
*
|
| 25 |
* Fonctions du module bazar
|
25 |
* Fonctions du module bazar
|
| 26 |
*
|
26 |
*
|
| 27 |
*
|
27 |
*
|
| Line 29... |
Line 29... |
| 29 |
//Auteur original :
|
29 |
//Auteur original :
|
| 30 |
*@author Alexandre Granier <alexandre@tela-botanica.org>
|
30 |
*@author Alexandre Granier <alexandre@tela-botanica.org>
|
| 31 |
*@author Florian Schmitt <florian@ecole-et-nature.org>
|
31 |
*@author Florian Schmitt <florian@ecole-et-nature.org>
|
| 32 |
//Autres auteurs :
|
32 |
//Autres auteurs :
|
| 33 |
*@copyright Tela-Botanica 2000-2004
|
33 |
*@copyright Tela-Botanica 2000-2004
|
| 34 |
*@version $Revision: 1.70 $ $Date: 2007-10-10 13:26:36 $
|
34 |
*@version $Revision: 1.71 $ $Date: 2007-10-22 09:18:39 $
|
| 35 |
// +------------------------------------------------------------------------------------------------------+
|
35 |
// +------------------------------------------------------------------------------------------------------+
|
| 36 |
*/
|
36 |
*/
|
| Line 37... |
Line 37... |
| 37 |
|
37 |
|
| 38 |
// +------------------------------------------------------------------------------------------------------+
|
38 |
// +------------------------------------------------------------------------------------------------------+
|
| Line 54... |
Line 54... |
| 54 |
// Pour les administrateurs d'une rubrique, on affiche les fiches a valider de cette rubrique
|
54 |
// Pour les administrateurs d'une rubrique, on affiche les fiches a valider de cette rubrique
|
| 55 |
// On effectue une requete sur le bazar pour voir les fiches a administrer
|
55 |
// On effectue une requete sur le bazar pour voir les fiches a administrer
|
| 56 |
$GLOBALS['_BAZAR_']['url']->addQueryString(BAZ_VARIABLE_VOIR, BAZ_VOIR_ADMIN);
|
56 |
$GLOBALS['_BAZAR_']['url']->addQueryString(BAZ_VARIABLE_VOIR, BAZ_VOIR_ADMIN);
|
| 57 |
$res= '<h2>'.BAZ_ANNONCES_A_ADMINISTRER.'</h2><br />'."\n";
|
57 |
$res= '<h2>'.BAZ_ANNONCES_A_ADMINISTRER.'</h2><br />'."\n";
|
| 58 |
$requete = 'SELECT * FROM bazar_fiche, bazar_nature WHERE bf_statut_fiche=0 AND ' .
|
58 |
$requete = 'SELECT * FROM bazar_fiche, bazar_nature WHERE bf_statut_fiche=0 AND ' .
|
| 59 |
'bn_id_nature=bf_ce_nature AND bn_ce_id_menu IN ('.$GLOBALS['_BAZAR_']['categorie_nature'].') ' .
|
59 |
'bn_id_nature=bf_ce_nature AND bn_ce_id_menu IN ('.$GLOBALS['_BAZAR_']['categorie_nature'].') ' ;
|
| - |
|
60 |
if (isset($GLOBALS['_BAZAR_']['langue'])) {
|
| - |
|
61 |
$requete .= ' and bn_ce_i18n like "'.$GLOBALS['_BAZAR_']['langue'].'%" ';
|
| - |
|
62 |
}
|
| 60 |
'ORDER BY bf_date_maj_fiche DESC' ;
|
63 |
$requete .= 'ORDER BY bf_date_maj_fiche DESC' ;
|
| 61 |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
|
64 |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
|
| 62 |
if (DB::isError($resultat)) {
|
65 |
if (DB::isError($resultat)) {
|
| 63 |
die ('Echec de la requete<br />'.$resultat->getMessage().'<br />'.$resultat->getDebugInfo()) ;
|
66 |
die ('Echec de la requete<br />'.$resultat->getMessage().'<br />'.$resultat->getDebugInfo()) ;
|
| 64 |
}
|
67 |
}
|
| 65 |
if ($resultat->numRows() != 0) {
|
68 |
if ($resultat->numRows() != 0) {
|
| Line 145... |
Line 148... |
| 145 |
$GLOBALS['_BAZAR_']['url']->removeQueryString('typeannonce');
|
148 |
$GLOBALS['_BAZAR_']['url']->removeQueryString('typeannonce');
|
| Line 146... |
Line 149... |
| 146 |
|
149 |
|
| 147 |
// Les autres fiches, deja validees
|
150 |
// Les autres fiches, deja validees
|
| 148 |
$res .= '<h2>'.BAZ_TOUTES_LES_FICHES.'</h2>'."\n";
|
151 |
$res .= '<h2>'.BAZ_TOUTES_LES_FICHES.'</h2>'."\n";
|
| 149 |
$requete = 'SELECT * FROM bazar_fiche, bazar_nature WHERE bf_statut_fiche=1 AND ' .
|
152 |
$requete = 'SELECT * FROM bazar_fiche, bazar_nature WHERE bf_statut_fiche=1 AND ' .
|
| - |
|
153 |
'bn_id_nature=bf_ce_nature AND bn_ce_id_menu IN ('.$GLOBALS['_BAZAR_']['categorie_nature'].') ';
|
| - |
|
154 |
if (isset($GLOBALS['_BAZAR_']['langue'])) {
|
| - |
|
155 |
$requete .= ' and bn_ce_i18n like "'.$GLOBALS['_BAZAR_']['langue'].'%" ';
|
| 150 |
'bn_id_nature=bf_ce_nature AND bn_ce_id_menu IN ('.$GLOBALS['_BAZAR_']['categorie_nature'].') ' .
|
156 |
}
|
| 151 |
'ORDER BY bf_date_maj_fiche DESC' ;
|
157 |
$requete .= 'ORDER BY bf_date_maj_fiche DESC' ;
|
| 152 |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
|
158 |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
|
| 153 |
if (DB::isError($resultat)) {
|
159 |
if (DB::isError($resultat)) {
|
| 154 |
die ('Echec de la requete<br />'.$resultat->getMessage().'<br />'.$resultat->getDebugInfo()) ;
|
160 |
die ('Echec de la requete<br />'.$resultat->getMessage().'<br />'.$resultat->getDebugInfo()) ;
|
| 155 |
}
|
161 |
}
|
| Line 235... |
Line 241... |
| 235 |
function mes_fiches() {
|
241 |
function mes_fiches() {
|
| 236 |
$res= '<h2>'.BAZ_VOS_ANNONCES.'</h2><br />'."\n";
|
242 |
$res= '<h2>'.BAZ_VOS_ANNONCES.'</h2><br />'."\n";
|
| 237 |
if ($GLOBALS['AUTH']->getAuth()) {
|
243 |
if ($GLOBALS['AUTH']->getAuth()) {
|
| 238 |
// requete pour voir si l'utilisateur a des fiches a son nom, classees par date de MAJ et nature d'annonce
|
244 |
// requete pour voir si l'utilisateur a des fiches a son nom, classees par date de MAJ et nature d'annonce
|
| 239 |
$requete = 'SELECT * FROM bazar_fiche, bazar_nature WHERE bf_ce_utilisateur='. $GLOBALS['id_user'].
|
245 |
$requete = 'SELECT * FROM bazar_fiche, bazar_nature WHERE bf_ce_utilisateur='. $GLOBALS['id_user'].
|
| 240 |
' AND bn_id_nature=bf_ce_nature AND bn_ce_id_menu IN ('.$GLOBALS['_BAZAR_']['categorie_nature'].') ORDER BY bf_date_maj_fiche DESC,bf_ce_nature ASC';
|
246 |
' AND bn_id_nature=bf_ce_nature AND bn_ce_id_menu IN ('.$GLOBALS['_BAZAR_']['categorie_nature'].') ';
|
| - |
|
247 |
if (isset($GLOBALS['_BAZAR_']['langue'])) $requete .= ' and bn_ce_i18n like "'.$GLOBALS['_BAZAR_']['langue'].'%" ';
|
| - |
|
248 |
$requete .= ' ORDER BY bf_date_maj_fiche DESC,bf_ce_nature ASC';
|
| - |
|
249 |
|
| 241 |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
|
250 |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
|
| 242 |
if (DB::isError($resultat)) {
|
251 |
if (DB::isError($resultat)) {
|
| 243 |
die ('Echec de la requete<br />'.$resultat->getMessage().'<br />'.$resultat->getDebugInfo()) ;
|
252 |
die ('Echec de la requete<br />'.$resultat->getMessage().'<br />'.$resultat->getDebugInfo()) ;
|
| 244 |
}
|
253 |
}
|
| 245 |
if ($resultat->numRows() != 0) {
|
254 |
if ($resultat->numRows() != 0) {
|
| Line 294... |
Line 303... |
| 294 |
$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_DEPOSER_ANNONCE);
|
303 |
$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_DEPOSER_ANNONCE);
|
| 295 |
$res .= '<br /><ul id="liste_liens"><li id="lien_saisir"><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'" title="'.BAZ_SAISIR_UNE_NOUVELLE_FICHE.'">'.BAZ_SAISIR_UNE_NOUVELLE_FICHE.'</a></li></ul>';
|
304 |
$res .= '<br /><ul id="liste_liens"><li id="lien_saisir"><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'" title="'.BAZ_SAISIR_UNE_NOUVELLE_FICHE.'">'.BAZ_SAISIR_UNE_NOUVELLE_FICHE.'</a></li></ul>';
|
| 296 |
$GLOBALS['_BAZAR_']['url']->removeQueryString('action');
|
305 |
$GLOBALS['_BAZAR_']['url']->removeQueryString('action');
|
| 297 |
}
|
306 |
}
|
| 298 |
else {
|
307 |
else {
|
| 299 |
/* $res .= '<p class="zone_info">'.BAZ_IDENTIFIEZ_VOUS_POUR_SAISIR.'</p>'."\n" ;
|
- |
|
| 300 |
$res .= '<form id="form_connexion" class="form_identification" action="' ;
|
- |
|
| 301 |
$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_ACTION_VOIR_VOS_ANNONCES);
|
- |
|
| 302 |
$res .= $GLOBALS['_BAZAR_']['url']->getURL();
|
- |
|
| 303 |
$res .= '" method="post">
|
- |
|
| 304 |
<fieldset>
|
- |
|
| 305 |
<legend>Identifiez vous</legend>
|
- |
|
| 306 |
<label for="username">Courriel : </label>
|
- |
|
| 307 |
<input type="text" id="username" name="username" maxlength="80" tabindex="1" value="courriel" />
|
- |
|
| 308 |
<label for="password">Mot de passe : </label>
|
- |
|
| 309 |
<input type="password" id="password" name="password" maxlength="80" tabindex="2" value="mot de passe" />
|
- |
|
| 310 |
<input type="submit" id="connexion" name="connexion" tabindex="3" value="ok" />
|
- |
|
| 311 |
</fieldset>
|
- |
|
| 312 |
</form>';
|
- |
|
| 313 |
}
|
308 |
|
| 314 |
// Nettoyage de l'url
|
- |
|
| 315 |
$GLOBALS['_BAZAR_']['url']->removeQueryString('action');
|
- |
|
| 316 |
$GLOBALS['_BAZAR_']['url']->removeQueryString('id_fiche');
|
- |
|
| 317 |
$GLOBALS['_BAZAR_']['url']->removeQueryString('typeannonce');*/
|
- |
|
| 318 |
include_once BAZ_CHEMIN_APPLI.'bibliotheque/bazarTemplate.class.php';
|
309 |
include_once BAZ_CHEMIN_APPLI.'bibliotheque/bazarTemplate.class.php';
|
| 319 |
$modele = new bazarTemplate($GLOBALS['_BAZAR_']['db']);
|
310 |
$modele = new bazarTemplate($GLOBALS['_BAZAR_']['db']);
|
| 320 |
$res .= $modele->getTemplate(BAZ_TEMPLATE_MESSAGE_LOGIN, $GLOBALS['_BAZAR_']['langue']);
|
311 |
$res .= $modele->getTemplate(BAZ_TEMPLATE_MESSAGE_LOGIN, $GLOBALS['_BAZAR_']['langue']);
|
| 321 |
}
|
312 |
}
|
| 322 |
return $res;
|
313 |
return $res;
|
| Line 431... |
Line 422... |
| 431 |
$lien_passer_superadmin->addQueryString('droits', 'superadmin');
|
422 |
$lien_passer_superadmin->addQueryString('droits', 'superadmin');
|
| 432 |
$res.= '<a href='.$lien_passer_superadmin->getURL().'>'.BAZ_PASSER_SUPERADMINISTRATEUR.'</a><br />'."\n";
|
423 |
$res.= '<a href='.$lien_passer_superadmin->getURL().'>'.BAZ_PASSER_SUPERADMINISTRATEUR.'</a><br />'."\n";
|
| Line 433... |
Line 424... |
| 433 |
|
424 |
|
| 434 |
//on cherche les differentes rubriques d'annonces
|
425 |
//on cherche les differentes rubriques d'annonces
|
| - |
|
426 |
$requete = 'SELECT bn_id_nature, bn_label_nature, bn_image_titre FROM bazar_nature';
|
| 435 |
$requete = 'SELECT bn_id_nature, bn_label_nature, bn_image_titre FROM bazar_nature';
|
427 |
if (isset($GLOBALS['_BAZAR_']['langue'])) $requete .= ' where bn_ce_i18n like "'.$GLOBALS['_BAZAR_']['langue'].'%"';
|
| 436 |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
|
428 |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
|
| 437 |
if (DB::isError($resultat)) {
|
429 |
if (DB::isError($resultat)) {
|
| 438 |
die ($resultat->getMessage().$resultat->getDebugInfo()) ;
|
430 |
die ($resultat->getMessage().$resultat->getDebugInfo()) ;
|
| 439 |
}
|
431 |
}
|
| Line 560... |
Line 552... |
| 560 |
'<!-- BEGIN required --><span class="symbole_obligatoire"> *</span><!-- END required -->'."\n".'</td>'."\n".'</tr>'."\n", 'accept_condition');
|
552 |
'<!-- BEGIN required --><span class="symbole_obligatoire"> *</span><!-- END required -->'."\n".'</td>'."\n".'</tr>'."\n", 'accept_condition');
|
| 561 |
$squelette->setElementTemplate( '<tr><td colspan="2" class="bouton">{label}{element}</td></tr>'."\n", 'valider');
|
553 |
$squelette->setElementTemplate( '<tr><td colspan="2" class="bouton">{label}{element}</td></tr>'."\n", 'valider');
|
| Line 562... |
Line 554... |
| 562 |
|
554 |
|
| 563 |
$squelette->setRequiredNoteTemplate("\n".'<tr>'."\n".'<td colspan="2" class="symbole_obligatoire">* {requiredNote}</td></tr>'."\n");
|
555 |
$squelette->setRequiredNoteTemplate("\n".'<tr>'."\n".'<td colspan="2" class="symbole_obligatoire">* {requiredNote}</td></tr>'."\n");
|
| 564 |
//Traduction de champs requis
|
556 |
//Traduction de champs requis
|
| 565 |
$formtemplate->setRequiredNote(BAZ_CHAMPS_REQUIS) ;
|
557 |
//$formtemplate->setRequiredNote(BAZ_CHAMPS_REQUIS) ;
|
| Line 566... |
Line 558... |
| 566 |
$formtemplate->setJsWarnings(BAZ_ERREUR_SAISIE,BAZ_VEUILLEZ_CORRIGER);
|
558 |
//$formtemplate->setJsWarnings(BAZ_ERREUR_SAISIE,BAZ_VEUILLEZ_CORRIGER);
|
| 567 |
|
559 |
|
| 568 |
//------------------------------------------------------------------------------------------------
|
560 |
//------------------------------------------------------------------------------------------------
|
| 569 |
//AFFICHAGE DU FORMULAIRE GENERAL DE CHOIX DU TYPE D'ANNONCE
|
561 |
//AFFICHAGE DU FORMULAIRE GENERAL DE CHOIX DU TYPE D'ANNONCE
|
| 570 |
//------------------------------------------------------------------------------------------------
|
562 |
//------------------------------------------------------------------------------------------------
|
| 571 |
if ($mode == BAZ_DEPOSER_ANNONCE) {
|
563 |
if ($mode == BAZ_DEPOSER_ANNONCE) {
|
| 572 |
$res = '';
|
564 |
$res = '';
|
| - |
|
565 |
//requete pour obtenir le nom et la description des types d'annonce
|
| - |
|
566 |
$requete = 'SELECT * FROM bazar_nature WHERE bn_ce_id_menu IN ('.$GLOBALS['_BAZAR_']['categorie_nature'].') ';
|
| - |
|
567 |
if (isset($GLOBALS['_BAZAR_']['langue'])) {
|
| - |
|
568 |
$requete .= ' and bn_ce_i18n like "'.$GLOBALS['_BAZAR_']['langue'].'%" ';
|
| 573 |
//requete pour obtenir le nom et la description des types d'annonce
|
569 |
}
|
| 574 |
$requete = 'SELECT * FROM bazar_nature WHERE bn_ce_id_menu IN ('.$GLOBALS['_BAZAR_']['categorie_nature'].') ORDER BY bn_label_nature ASC';
|
570 |
$requete .= 'ORDER BY bn_label_nature ASC';
|
| 575 |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
|
571 |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
|
| 576 |
if (DB::isError($resultat)) {
|
572 |
if (DB::isError($resultat)) {
|
| 577 |
return ($resultat->getMessage().$resultat->getDebugInfo()) ;
|
573 |
return ($resultat->getMessage().$resultat->getDebugInfo()) ;
|
| Line 679... |
Line 675... |
| 679 |
return ;
|
675 |
return ;
|
| 680 |
}
|
676 |
}
|
| 681 |
}
|
677 |
}
|
| 682 |
}
|
678 |
}
|
| 683 |
else {
|
679 |
else {
|
| 684 |
/*
|
680 |
|
| 685 |
$res .= '<h2>'.BAZ_DEPOSE_UNE_NOUVELLE_ANNONCE.'</h2><br />'."\n";
|
- |
|
| 686 |
$res .= '<p class="zone_info">'.BAZ_IDENTIFIEZ_VOUS_POUR_SAISIR.'</p>'."\n" ;
|
- |
|
| 687 |
$res .= '<form id="form_connexion" class="form_identification" action="' ;
|
- |
|
| 688 |
$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_DEPOSER_ANNONCE);
|
- |
|
| 689 |
$res .= $GLOBALS['_BAZAR_']['url']->getURL();
|
- |
|
| 690 |
$res .= '" method="post">
|
- |
|
| 691 |
<fieldset>
|
- |
|
| 692 |
<legend>Identifiez vous</legend>
|
- |
|
| 693 |
<label for="username">Courriel : </label>
|
- |
|
| 694 |
<input type="text" id="username" name="username" maxlength="80" tabindex="1" value="courriel" />
|
- |
|
| 695 |
<label for="password">Mot de passe : </label>
|
- |
|
| 696 |
<input type="password" id="password" name="password" maxlength="80" tabindex="2" value="mot de passe" />
|
- |
|
| 697 |
<input type="submit" id="connexion" name="connexion" tabindex="3" value="ok" />
|
- |
|
| 698 |
</fieldset>
|
- |
|
| 699 |
</form>';*/
|
- |
|
| 700 |
include_once BAZ_CHEMIN_APPLI.'bibliotheque/bazarTemplate.class.php';
|
681 |
include_once BAZ_CHEMIN_APPLI.'bibliotheque/bazarTemplate.class.php';
|
| 701 |
$modele = new bazarTemplate($GLOBALS['_BAZAR_']['db']);
|
682 |
$modele = new bazarTemplate($GLOBALS['_BAZAR_']['db']);
|
| 702 |
$res .= $modele->getTemplate(BAZ_TEMPLATE_MESSAGE_LOGIN, $GLOBALS['_BAZAR_']['langue']);
|
683 |
$res .= $modele->getTemplate(BAZ_TEMPLATE_MESSAGE_LOGIN, $GLOBALS['_BAZAR_']['langue']);
|
| 703 |
}
|
684 |
}
|
| Line 1393... |
Line 1374... |
| 1393 |
}
|
1374 |
}
|
| Line 1394... |
Line 1375... |
| 1394 |
|
1375 |
|
| 1395 |
/* +--Fin du code ----------------------------------------------------------------------------------------+
|
1376 |
/* +--Fin du code ----------------------------------------------------------------------------------------+
|
| 1396 |
*
|
1377 |
*
|
| - |
|
1378 |
* $Log: not supported by cvs2svn $
|
| - |
|
1379 |
* Revision 1.70 2007-10-10 13:26:36 alexandre_tb
|
| - |
|
1380 |
* utilisation de la classe Administrateur_bazar a la place de niveau_droit
|
| - |
|
1381 |
* suppression de fonction niveau_droit
|
| 1397 |
* $Log: not supported by cvs2svn $
|
1382 |
*
|
| 1398 |
* Revision 1.69 2007-09-18 07:39:42 alexandre_tb
|
1383 |
* Revision 1.69 2007-09-18 07:39:42 alexandre_tb
|
| 1399 |
* correction d un bug lors d une insertion
|
1384 |
* correction d un bug lors d une insertion
|
| 1400 |
*
|
1385 |
*
|
| 1401 |
* Revision 1.68 2007-08-27 12:31:31 alexandre_tb
|
1386 |
* Revision 1.68 2007-08-27 12:31:31 alexandre_tb
|