| 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.39 2006-01-30 17:25:38 alexandre_tb Exp $
|
22 |
// CVS : $Id: bazar.fonct.php,v 1.40 2006-02-06 09:33:00 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.39 $ $Date: 2006-01-30 17:25:38 $
|
34 |
*@version $Revision: 1.40 $ $Date: 2006-02-06 09:33:00 $
|
| 35 |
// +------------------------------------------------------------------------------------------------------+
|
35 |
// +------------------------------------------------------------------------------------------------------+
|
| 36 |
*/
|
36 |
*/
|
| Line 37... |
Line 37... |
| 37 |
|
37 |
|
| 38 |
// +------------------------------------------------------------------------------------------------------+
|
38 |
// +------------------------------------------------------------------------------------------------------+
|
| Line 195... |
Line 195... |
| 195 |
$lien_supprimer->addQueryString('id_fiche', $ligne['bf_id_fiche']);
|
195 |
$lien_supprimer->addQueryString('id_fiche', $ligne['bf_id_fiche']);
|
| 196 |
$lien_supprimer->addQueryString('typeannonce', $ligne['bn_id_nature']);
|
196 |
$lien_supprimer->addQueryString('typeannonce', $ligne['bn_id_nature']);
|
| 197 |
$lien_supprimer_url=$lien_supprimer->getURL();
|
197 |
$lien_supprimer_url=$lien_supprimer->getURL();
|
| Line 198... |
Line 198... |
| 198 |
|
198 |
|
| 199 |
$table->addRow (array(
|
199 |
$table->addRow (array(
|
| 200 |
'<a href="'.$lien_voir_url.'">'.$ligne['bf_titre'].'</a>'."\n", // col 1 : le nom
|
200 |
'<a href="'.$lien_voir_url.'">'.$ligne['bf_titre'].'</a>'."\n", // col 1 : le nom
|
| 201 |
constant($ligne['bn_label_nature'])."\n", // col 2: type annonce
|
201 |
constant($ligne['bn_label_nature'])."\n", // col 2: type annonce
|
| 202 |
$publiee."\n", // col 3 : publiee ou non
|
202 |
$publiee."\n", // col 3 : publiee ou non
|
| 203 |
'<a href="'.$lien_modifier_url.'">'.BAZ_MODIFIER.'</a>'."\n", // col 4 : modifier
|
203 |
'<a href="'.$lien_modifier_url.'">'.BAZ_MODIFIER.'</a>'."\n", // col 4 : modifier
|
| 204 |
'<a href="'.$lien_supprimer_url.'" onclick="javascript:return
|
204 |
'<a href="'.$lien_supprimer_url.'" onclick="javascript:return '.
|
| 205 |
confirm('.BAZ_CONFIRMATION_SUPPRESSION.');" >'.BAZ_SUPPRIMER.'</a>'."\n")) ; // col 5 : supprimer
|
205 |
'confirm(\''.BAZ_CONFIRMATION_SUPPRESSION.'\');" >'.BAZ_SUPPRIMER.'</a>'."\n")) ; // col 5 : supprimer
|
| 206 |
}
|
206 |
}
|
| 207 |
$table->altRowAttributes(1, array("class" => "ligne_impaire"), array("class" => "ligne_paire"));
|
207 |
$table->altRowAttributes(1, array("class" => "ligne_impaire"), array("class" => "ligne_paire"));
|
| 208 |
$table->updateColAttributes(1, array("align" => "center"));
|
208 |
$table->updateColAttributes(1, array("align" => "center"));
|
| 209 |
$table->updateColAttributes(2, array("align" => "center"));
|
209 |
$table->updateColAttributes(2, array("align" => "center"));
|
| Line 414... |
Line 414... |
| 414 |
function baz_formulaire($mode) {
|
414 |
function baz_formulaire($mode) {
|
| 415 |
if ($GLOBALS['AUTH']->getAuth()) {
|
415 |
if ($GLOBALS['AUTH']->getAuth()) {
|
| 416 |
$lien_formulaire=$GLOBALS['_BAZAR_']['url'];
|
416 |
$lien_formulaire=$GLOBALS['_BAZAR_']['url'];
|
| Line 417... |
Line 417... |
| 417 |
|
417 |
|
| - |
|
418 |
//Definir le lien du formulaire en fonction du mode de formulaire choisi
|
| 418 |
//Definir le lien du formulaire en fonction du mode de formulaire choisi
|
419 |
if ($mode == BAZ_DEPOSER_ANNONCE) {
|
| - |
|
420 |
$lien_formulaire->addQueryString('action', BAZ_ACTION_NOUVEAU);
|
| 419 |
if ($mode == BAZ_DEPOSER_ANNONCE) $lien_formulaire->addQueryString('action', BAZ_DEPOSER_ANNONCE);
|
421 |
}
|
| 420 |
if ($mode == BAZ_ACTION_NOUVEAU) {
|
422 |
if ($mode == BAZ_ACTION_NOUVEAU) {
|
| 421 |
if ((!isset($_POST['accept_condition']))and($GLOBALS['_BAZAR_']['condition']!=NULL)) {
|
423 |
if ((!isset($_POST['accept_condition']))and($GLOBALS['_BAZAR_']['condition']!=NULL)) {
|
| 422 |
$lien_formulaire->addQueryString('action', BAZ_ACTION_NOUVEAU);
|
424 |
$lien_formulaire->addQueryString('action', BAZ_ACTION_NOUVEAU);
|
| 423 |
} else {
|
425 |
} else {
|
| Line 434... |
Line 436... |
| 434 |
}
|
436 |
}
|
| 435 |
if ($mode == BAZ_ACTION_MODIFIER_V) {
|
437 |
if ($mode == BAZ_ACTION_MODIFIER_V) {
|
| 436 |
$lien_formulaire->addQueryString('action', BAZ_ACTION_MODIFIER_V);
|
438 |
$lien_formulaire->addQueryString('action', BAZ_ACTION_MODIFIER_V);
|
| 437 |
$lien_formulaire->addQueryString('id_fiche', $GLOBALS['_BAZAR_']['id_fiche']);
|
439 |
$lien_formulaire->addQueryString('id_fiche', $GLOBALS['_BAZAR_']['id_fiche']);
|
| 438 |
}
|
440 |
}
|
| 439 |
if (isset($GLOBALS['_BAZAR_']['id_typeannonce']) && ($GLOBALS['_BAZAR_']['id_typeannonce'] != 'toutes')) {
|
- |
|
| 440 |
$lien_formulaire->addQueryString('action', BAZ_ACTION_NOUVEAU);
|
- |
|
| 441 |
$mode = BAZ_ACTION_NOUVEAU ;
|
- |
|
| 442 |
}
|
- |
|
| Line 443... |
Line 441... |
| 443 |
|
441 |
|
| 444 |
//contruction du squelette du formulaire
|
442 |
//contruction du squelette du formulaire
|
| 445 |
$formtemplate = new HTML_QuickForm('formulaire', 'post', preg_replace ('/&/', '&', $lien_formulaire->getURL()) );
|
443 |
$formtemplate = new HTML_QuickForm('formulaire', 'post', preg_replace ('/&/', '&', $lien_formulaire->getURL()) );
|
| 446 |
$squelette =& $formtemplate->defaultRenderer();
|
444 |
$squelette =& $formtemplate->defaultRenderer();
|
| 447 |
$squelette->setFormTemplate("\n".'<form {attributes}>'."\n".'<table style="border:0;">'."\n".'{content}'."\n".'</table>'."\n".'</form>'."\n");
|
445 |
$squelette->setFormTemplate("\n".'<form {attributes}>'."\n".'<table style="border:0;">'."\n".'{content}'."\n".'</table>'."\n".'</form>'."\n");
|
| 448 |
$squelette->setElementTemplate( '<tr>'."\n".'<td style="font-size:12px;width:150px;text-align:right;">'."\n".'{label} :</td>'."\n".'<td style="text-align:left;padding:5px;"> '."\n".'{element}'."\n".
|
446 |
$squelette->setElementTemplate( '<tr>'."\n".'<td style="font-size:12px;width:150px;text-align:right;">'."\n".'{label} :</td>'."\n".'<td style="text-align:left;padding:5px;"> '."\n".'{element}'."\n".
|
| 449 |
'<!-- BEGIN required --><span class="symbole_obligatoire">*</span><!-- END required -->'."\n".
|
447 |
'<!-- BEGIN required --><span class="symbole_obligatoire">*</span><!-- END required -->'."\n".
|
| 450 |
'<!-- BEGIN error --><span class="erreur">{error}</span><!-- END error -->'."\n".
|
448 |
'<!-- BEGIN error --><span class="erreur">{error}</span><!-- END error -->'."\n".
|
| 451 |
'</td>'."\n".'</tr>'."\n");
|
449 |
'</td>'."\n".'</tr>'."\n");
|
| 452 |
$squelette->setElementTemplate( '<tr>'."\n".'<td colspan="2" class="liste_a_cocher"><strong>{label} {element}</strong>'."\n".
|
450 |
$squelette->setElementTemplate( '<tr>'."\n".'<td colspan="2" class="liste_a_cocher"><strong>{label} {element}</strong>'."\n".
|
| 453 |
'<!-- BEGIN required --><span class="symbole_obligatoire"> *</span><!-- END required -->'."\n".'</td>'."\n".'</tr>'."\n", 'accept_condition');
|
451 |
'<!-- BEGIN required --><span class="symbole_obligatoire"> *</span><!-- END required -->'."\n".'</td>'."\n".'</tr>'."\n", 'accept_condition');
|
| 454 |
$squelette->setElementTemplate( '<tr><td colspan="2" class="bouton">{label}{element}</td></tr>'."\n", 'valider');
|
452 |
$squelette->setElementTemplate( '<tr><td colspan="2" class="bouton">{label}{element}</td></tr>'."\n", 'valider');
|
| 455 |
$squelette->setRequiredNoteTemplate("\n".'<tr>'."\n".'<td colspan="2" class="symbole_obligatoire">* {requiredNote}</td></tr>'."\n");
|
453 |
$squelette->setRequiredNoteTemplate("\n".'<tr>'."\n".'<td colspan="2" class="symbole_obligatoire">* {requiredNote}</td></tr>'."\n");
|
| 456 |
//Traduction de champs requis
|
454 |
//Traduction de champs requis
|
| 457 |
$formtemplate->setRequiredNote(BAZ_CHAMPS_REQUIS) ;
|
455 |
$formtemplate->setRequiredNote(BAZ_CHAMPS_REQUIS) ;
|
| Line 458... |
Line 456... |
| 458 |
$formtemplate->setJsWarnings(BAZ_ERREUR_SAISIE,BAZ_VEUILLEZ_CORRIGER);
|
456 |
$formtemplate->setJsWarnings(BAZ_ERREUR_SAISIE,BAZ_VEUILLEZ_CORRIGER);
|
| Line 502... |
Line 500... |
| 502 |
|
500 |
|
| 503 |
//------------------------------------------------------------------------------------------------
|
501 |
//------------------------------------------------------------------------------------------------
|
| 504 |
//AFFICHAGE DU FORMULAIRE CORRESPONDANT AU TYPE DE L'ANNONCE CHOISI PAR L'UTILISATEUR
|
502 |
//AFFICHAGE DU FORMULAIRE CORRESPONDANT AU TYPE DE L'ANNONCE CHOISI PAR L'UTILISATEUR
|
| 505 |
//------------------------------------------------------------------------------------------------
|
503 |
//------------------------------------------------------------------------------------------------
|
| - |
|
504 |
if ($mode == BAZ_ACTION_NOUVEAU) {
|
| 506 |
if ($mode == BAZ_ACTION_NOUVEAU) {
|
505 |
unset ($_SESSION['formulaire_annonce_valide']) ;
|
| 507 |
$res=baz_afficher_formulaire_annonce('insertion',$formtemplate);
|
506 |
$res = baz_afficher_formulaire_annonce('insertion',$formtemplate);
|
| Line 508... |
Line 507... |
| 508 |
}
|
507 |
}
|
| 509 |
|
508 |
|
| 510 |
//------------------------------------------------------------------------------------------------
|
509 |
//------------------------------------------------------------------------------------------------
|
| Line 533... |
Line 532... |
| 533 |
$formtemplate->process('baz_mise_a_jour', false) ;
|
532 |
$formtemplate->process('baz_mise_a_jour', false) ;
|
| 534 |
return ;
|
533 |
return ;
|
| 535 |
}
|
534 |
}
|
| 536 |
}
|
535 |
}
|
| 537 |
}
|
536 |
}
|
| 538 |
else $res=BAZ_IDENTIFIEZ_VOUS_POUR_SAISIR;
|
537 |
else return BAZ_IDENTIFIEZ_VOUS_POUR_SAISIR;
|
| 539 |
return $res;
|
538 |
return $res;
|
| 540 |
}
|
539 |
}
|
| Line 541... |
Line 540... |
| 541 |
|
540 |
|
| Line 1295... |
Line 1294... |
| 1295 |
}
|
1294 |
}
|
| Line 1296... |
Line 1295... |
| 1296 |
|
1295 |
|
| 1297 |
/* +--Fin du code ----------------------------------------------------------------------------------------+
|
1296 |
/* +--Fin du code ----------------------------------------------------------------------------------------+
|
| 1298 |
*
|
1297 |
*
|
| - |
|
1298 |
* $Log: not supported by cvs2svn $
|
| - |
|
1299 |
* Revision 1.39 2006/01/30 17:25:38 alexandre_tb
|
| - |
|
1300 |
* correction de bugs
|
| 1299 |
* $Log: not supported by cvs2svn $
|
1301 |
*
|
| 1300 |
* Revision 1.38 2006/01/30 10:27:04 florian
|
1302 |
* Revision 1.38 2006/01/30 10:27:04 florian
|
| 1301 |
* - ajout des entrées de formulaire fichier, url, et image
|
1303 |
* - ajout des entrées de formulaire fichier, url, et image
|
| 1302 |
* - correction bug d'affichage du mode de saisie
|
1304 |
* - correction bug d'affichage du mode de saisie
|
| 1303 |
*
|
1305 |
*
|