Subversion Repositories Applications.bazar

Compare Revisions

Ignore whitespace Rev 44 → Rev 45

/trunk/bazar.php
20,7 → 20,7
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: bazar.php,v 1.11 2005-10-21 16:15:04 florian Exp $
// CVS : $Id: bazar.php,v 1.12 2005-11-07 17:05:46 florian Exp $
/**
*
*@package bazar
29,7 → 29,7
*@author Florian Schmitt <florian@ecole-et-nature.org>
//Autres auteurs :
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.11 $ $Date: 2005-10-21 16:15:04 $
*@version $Revision: 1.12 $ $Date: 2005-11-07 17:05:46 $
// +------------------------------------------------------------------------------------------------------+
*/
 
94,79 → 94,55
//partie consultation d'annonces
$res .= '<li><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_CONSULTER.'</a>'."\n".'</li>'."\n";
$GLOBALS['_BAZAR_']['url']->removeQueryString('nature');
/*$requete = 'SELECT bn_id_nature, bn_label_nature FROM bazar_nature WHERE bn_ce_id_menu='.$GLOBALS['_GEN_commun']['info_menu']->gm_id_menu.' or bn_ce_id_menu=0';
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
if (DB::isError($resultat)) {
die ($resultat->getMessage().$resultat->getDebugInfo()) ;
}
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
$GLOBALS['_BAZAR_']['url']->addQueryString('nature', $ligne['bn_label_nature']);
$res .='<li><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.$ligne['bn_label_nature'].'</a></li>'."\n";
$GLOBALS['_BAZAR_']['url']->removeQueryString('nature');
}
$GLOBALS['_BAZAR_']['url']->addQueryString('nature', 'toutes');
$res .='<li><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_TOUTES_LES_ANNONCES.'</a></li></ul></li>'."\n";
$GLOBALS['_BAZAR_']['url']->removeQueryString('nature');
 
//partie abonnement aux annonces
$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_S_INSCRIRE);
$res .= '<li><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_S_ABONNER.'</a></li>'."\n" ;
$GLOBALS['_BAZAR_']['url']->removeQueryString('action');
//partie recherche d'annonces
$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_RECHERCHER_ANNONCE);
$res .='<li><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_RECHERCHER.'</a></li>'."\n";
//partie saisie d'annonces
$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_DEPOSER_ANNONCE);
$res .= '<li><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_SAISIR.'</a>'."\n".'<ul>'."\n";
$res .= '<li><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_DEPOSE_UNE_NOUVELLE_ANNONCE.'</a></li>'."\n" ;
$GLOBALS['_BAZAR_']['url']->removeQueryString('action');
//pour les identifiés seulement
if ($GLOBALS['AUTH']->getAuth()) {*/
//partie abonnement aux annonces
$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_S_INSCRIRE);
$res .= '<li><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_S_ABONNER.'</a></li>'."\n" ;
$GLOBALS['_BAZAR_']['url']->removeQueryString('action');
 
//annonces propres
$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_VOIR_VOS_ANNONCES);
$res .='<li><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_VOS_ANNONCES.'</a></li>'."\n";
$GLOBALS['_BAZAR_']['url']->removeQueryString('action');
$res .='</ul></li>'."\n";
//partie saisie d'annonces
$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_DEPOSER_ANNONCE);
$res .= '<li><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_SAISIR.'</a>'."\n".'<ul>'."\n";
$res .= '<li><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_DEPOSE_UNE_NOUVELLE_ANNONCE.'</a></li>'."\n" ;
//choix des administrateurs
$est_admin=0;
if ($GLOBALS['AUTH']->getAuth()) {
$requete='SELECT bn_id_nature FROM bazar_nature';
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
if (DB::isError($resultat)) {
die ($resultat->getMessage().$resultat->getDebugInfo()) ;
}
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
if ((niveau_droit($ligne['bn_id_nature'],$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID)))=='administrateur') {
$est_admin=1;
}
}
if (($est_admin)or(niveau_droit($id_nature_offre='0',$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID))=='superadministrateur')) {
//partie administrer
$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_ANNONCES_A_VALIDER);
$res .= '<li><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_ADMINISTRER.'</a><ul>'."\n";
$res .= '<li><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_ANNONCES_A_ADMINISTRER.'</a></li>'."\n" ;
$GLOBALS['_BAZAR_']['url']->removeQueryString('action');
//annonces propres
$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_VOIR_VOS_ANNONCES);
$res .='<li><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_VOS_ANNONCES.'</a></li>'."\n";
$GLOBALS['_BAZAR_']['url']->removeQueryString('action');
$res .='</ul></li>'."\n";
//choix des administrateurs
$est_admin=0;
if ($GLOBALS['AUTH']->getAuth()) {
$requete='SELECT bn_id_nature FROM bazar_nature';
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
if (DB::isError($resultat)) {
die ($resultat->getMessage().$resultat->getDebugInfo()) ;
}
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
if ((niveau_droit($ligne['bn_id_nature'],$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID)))=='administrateur') {
$est_admin=1;
}
}
if (($est_admin)or(niveau_droit($id_nature_offre='0',$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID))=='superadministrateur')) {
//partie administrer
$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_ANNONCES_A_VALIDER);
$res .= '<li><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_ADMINISTRER.'</a><ul>'."\n";
$res .= '<li><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_ANNONCES_A_ADMINISTRER.'</a></li>'."\n" ;
if (niveau_droit($id_nature_offre='0',$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID))=='superadministrateur') {
$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_GERER_DROITS);
$res .= '<li><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_GESTION_DES_DROITS.'</a></li>'."\n" ;
$GLOBALS['_BAZAR_']['url']->removeQueryString('action');
if (niveau_droit($id_nature_offre='0',$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID))=='superadministrateur') {
$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_GERER_DROITS);
$res .= '<li><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_GESTION_DES_DROITS.'</a></li>'."\n" ;
$GLOBALS['_BAZAR_']['url']->removeQueryString('action');
$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_ADMINISTRER_ANNONCES);
$res .= '<li><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_ADMIN_ANNONCES.'</a></li>'."\n" ;
$GLOBALS['_BAZAR_']['url']->removeQueryString('action');
}
$res .= '</ul></li>'."\n";
}
$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_ADMINISTRER_ANNONCES);
$res .= '<li><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_ADMIN_ANNONCES.'</a></li>'."\n" ;
$GLOBALS['_BAZAR_']['url']->removeQueryString('action');
}
$res .= '</ul></li>'."\n";
}
}
$res.= '</ul>'."\n";
$res.='</div>'."\n";
208,6 → 184,9
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.11 2005/10/21 16:15:04 florian
* mise a jour appropriation
*
* Revision 1.10 2005/10/12 17:20:33 ddelon
* Reorganisation calendrier + applette
*
/trunk/bibliotheque/bazar.fonct.formulaire.php
19,9 → 19,9
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: bazar.fonct.formulaire.php,v 1.4 2005-10-25 13:53:02 alexandre_tb Exp $
// CVS : $Id: bazar.fonct.formulaire.php,v 1.5 2005-11-07 17:05:45 florian Exp $
/**
* Inscription
* Formulaire
*
* Les fonctions de mise en page des formulaire
*
31,10 → 31,12
//Autres auteurs :
*@author Aleandre GRANIER <alexandre@tela-botanica.org>
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.4 $ $Date: 2005-10-25 13:53:02 $
*@version $Revision: 1.5 $ $Date: 2005-11-07 17:05:45 $
// +------------------------------------------------------------------------------------------------------+
*/
 
require_once 'bazar.fonct.formulaire.controles.php';
 
//-------------------FONCTIONS DE MISE EN PAGE DES FORMULAIRES
 
/** liste() - Ajoute un élément de type liste au formulaire
63,12 → 65,13
$select= new HTML_QuickForm_select($nom_bdd, constant($label), $select, $option);
$select->setSize($limite2);
$select->setMultiple(0);
$select->setSelected($defaut);
$formtemplate->addElement($select) ;
//gestion des valeurs par défaut
$defauts=array($nom_bdd=>$defaut);
$formtemplate->setDefaults($defauts);
//gestion du champs obligatoire
$formtemplate->addRule('titre', BAZ_TITRE_REQUIS, 'required', '', 'client') ;
//gestion des champs obligatoire
$formtemplate->registerRule('saisir_liste','function','liste_choisir');
$formtemplate->addRule($nom_bdd, BAZ_CHOISIR_OBLIGATOIRE, 'saisir_liste');
print_r($formtemplate->getRegisteredRules());
if (isset($obligatoire)and($obligatoire==1)) {$formtemplate->addRule($nom_bdd, constant($label.'_REQUIS'), 'required', '', 'client') ;}
}
 
184,6 → 187,9
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.4 2005/10/25 13:53:02 alexandre_tb
* ajout d'un filtre dans les formulaire texte et textelong
*
* Revision 1.3 2005/07/21 19:03:12 florian
* nouveautés bazar: templates fiches, correction de bugs, ...
*
/trunk/bibliotheque/bazar.fonct.rss.php
74,7 → 74,7
'", NOW() )';
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
}
//cas ou un commentaire va être supprimé
//cas ou un commentaire va être supprime
elseif (isset($_GET['id_commentaire'])) {
$requete = 'DELETE FROM bazar_commentaires WHERE bc_id_commentaire='.$_GET['id_commentaire'].' LIMIT 1';
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
103,7 → 103,7
$GLOBALS['_BAZAR_']['nb_consultations']=$ligne['bf_nb_consultations'];
}
//on vérifie si l'utilisateur est administrateur
//on verifie si l'utilisateur est administrateur
$est_admin=0;
if ($GLOBALS['AUTH']->getAuth()) {
$requete='SELECT bn_id_nature FROM bazar_nature WHERE bn_label_nature="'.$GLOBALS['_BAZAR_']['typeannonce'].'"';
124,7 → 124,7
$res .= '&nbsp;</div>'."\n";
$res .= '<div class="BAZ_cadre_fiche_corps">'."\n";
//si le template existe, on génère le template
//si le template existe, on genere le template
if ((file_exists(BAZ_CHEMIN_APPLI.'templates/'.$GLOBALS['_BAZAR_']['typeannonce'].'-fiche.php'))) {
include_once(BAZ_CHEMIN_APPLI.'templates/'.$GLOBALS['_BAZAR_']['typeannonce'].'-fiche.php');
$res .=genere_fiche($GLOBALS['_BAZAR_']['id_fiche']);
210,7 → 210,7
$res .= '<div class="bulle_haut">&nbsp;</div>'."\n";
$res .= '<div class="bulle_corps">'."\n";
//affichage du rédacteur de la fiche
//affichage du redacteur de la fiche
$requete = 'SELECT '.BAZ_CHAMPS_NOM.', '.BAZ_CHAMPS_PRENOM.', '.BAZ_CHAMPS_EMAIL.' FROM '.BAZ_ANNUAIRE.' WHERE '.BAZ_CHAMPS_ID.'='.$GLOBALS['_BAZAR_']['annonceur'];
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
if (DB::isError($resultat)) {
224,7 → 224,7
$res .= '<div class="bulle_bas">&nbsp;</div>'."\n";
$res .= '<div id="BAZ_bas_page">';
//informations complémentaires (id fiche, état publication,... )
//informations complementaires (id fiche, etat publication,... )
if ($danslappli==1) {
$res .= '<span class="rubrique">'.BAZ_NUM_FICHE.':</span> '.$GLOBALS['_BAZAR_']['id_fiche'].'<br />'."\n";
$res .= '<span class="rubrique">'.BAZ_NATURE.':</span> '.$GLOBALS['_BAZAR_']['typeannonce'].'<br />'."\n";
483,7 → 483,7
if ($typeannonce=='toutes') $res= '<h2>'.BAZ_TOUTES_LES_ANNONCES.'</h2>'."\n";
else $res = '<h2>'.BAZ_TOUTES_LES_ANNONCES_DE_TYPE.$typeannonce.'</h2>'."\n";
//création du lien pour le formulaire de recherche
//creation du lien pour le formulaire de recherche
$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_VOIR_TOUTES_ANNONCES);
$lien_formulaire=preg_replace ('/&amp;/', '&', $GLOBALS['_BAZAR_']['url']->getURL()) ;
$formtemplate = new HTML_QuickForm('formulaire', 'post', $lien_formulaire) ;
502,7 → 502,7
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
$type_annonce_select[$ligne['bn_label_nature']] = $ligne['bn_label_nature'];
}
$option=array('style'=>'width: 160px;', 'onchange'=>'this.form.submit();');
$option=array('style'=>'width: 160px;');
$formtemplate->addElement ('select', 'nature', BAZ_TYPEANNONCE, $type_annonce_select, $option) ;
//requete pour obtenir l'id, le nom et prénom de toutes les personnes ayant une fiche publiée actuellement
518,7 → 518,7
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
$personnes_select[$ligne[BAZ_CHAMPS_ID]] = $ligne[BAZ_CHAMPS_NOM]." ".$ligne[BAZ_CHAMPS_PRENOM] ;
}
$option=array('style'=>'width: 160px;', 'onchange'=>'this.form.submit();');
$option=array('style'=>'width: 160px;');
$formtemplate->addElement ('select', 'personnes', BAZ_EMETTEUR, $personnes_select, $option) ;
//champs texte pour entrer les mots clés
/trunk/bibliotheque/bazar.fonct.formulaire.controles.php
New file
0,0 → 1,51
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU Lesser General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | Lesser General Public License for more details. |
// | |
// | You should have received a copy of the GNU Lesser General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: bazar.fonct.formulaire.controles.php,v 1.1 2005-11-07 17:05:45 florian Exp $
/**
* Formulaire controles
*
* Les fonctions de controles de saisie des formulaires
*
*@package bazar
//Auteur original :
*@author Florian SCHMITT <florian@ecole-et-nature.org>
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.1 $ $Date: 2005-11-07 17:05:45 $
// +------------------------------------------------------------------------------------------------------+
*/
 
//-------------------FONCTIONS DE MISE EN PAGE DES FORMULAIRES
 
/** liste_choisir() - Teste si une valeur à été choisie pour une liste
*
*
*/
function liste_choisir($element_name,$element_value) {
if ($element_value == 0) {
return false;
}
else {
return true;
}
}
 
?>
/trunk/bibliotheque/bazar.fonct.php
19,7 → 19,7
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: bazar.fonct.php,v 1.14 2005-11-07 08:48:02 florian Exp $
// CVS : $Id: bazar.fonct.php,v 1.15 2005-11-07 17:05:45 florian Exp $
/**
*
* Fonctions du module bazar
30,7 → 30,7
*@author Florian Schmitt <florian@ecole-et-nature.org>
//Autres auteurs :
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.14 $ $Date: 2005-11-07 08:48:02 $
*@version $Revision: 1.15 $ $Date: 2005-11-07 17:05:45 $
// +------------------------------------------------------------------------------------------------------+
*/
 
243,7 → 243,7
* @return string code HTML avec formulaire
*/
function baz_afficher_formulaire_annonce($mode='insertion',$formtemplate) {
//vérification de la modification des fichiers, des url ou des images
//verification de la modification des fichiers, des url ou des images
if (isset($_GET['url'])) {
if ($_GET['url']==1) baz_insertion_url($_POST['url_lien'],$_POST['url_texte'],$GLOBALS['_BAZAR_']['id_fiche']);
if ($_GET['url']==2) baz_suppression_url($_GET['id_url']);
259,50 → 259,49
//titre de la rubrique
$res= '<h2>'.BAZ_TITRE_SAISIE_ANNONCE.$GLOBALS['_BAZAR_']['typeannonce'].'</h2>';
//Ajout des boutons
$bouton[] = &HTML_QuickForm::createElement('submit', 'valider', BAZ_VALIDER, '&nbsp;');
//Traduction de champs requis
$formtemplate->setRequiredNote(BAZ_CHAMPS_REQUIS) ;
//Parcours du fichier de templates, pour mettre les champs spécifiques
//ajout d'une page sur les conditions pour l'annonce si elles existent
$requete = 'SELECT bn_condition FROM bazar_nature WHERE bn_label_nature="'.$GLOBALS['_BAZAR_']['typeannonce'].'"';
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete);
if (DB::isError($resultat)) {
die ($resultat->getMessage().$resultat->getDebugInfo()) ;
}
$ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC);
if (($ligne['bn_condition']!='')AND(!isset($_POST['accept_condition']))AND(!isset($_GET['url'])OR(!isset($_GET['fichier']))OR(!isset($_GET['image'])))) {
$lien_formulaire=$GLOBALS['_BAZAR_']['url'];
$lien_formulaire->addQueryString('action', $_REQUEST['action']);
$formtemplate = new HTML_QuickForm('formulaire', 'post', preg_replace ('/&amp;/', '&', $lien_formulaire->getURL()) );
require_once 'HTML/QuickForm/html.php';
$conditions= new HTML_QuickForm_html('<tr><td colspan="2"><p style="padding:4px; margin:5px; width: 100%; background: #C1CBA7;">'.$ligne['bn_condition'].'</p></td></tr>');
$formtemplate->addElement('hidden','typeannonce', $_REQUEST['typeannonce']);
if (isset($_REQUEST['id_fiche'])) $formtemplate->addElement('hidden','id_fiche', $_REQUEST['id_fiche']);
$formtemplate->addElement($conditions);
$formtemplate->addElement('checkbox', 'accept_condition',BAZ_ACCEPTE_CONDITIONS) ;
$formtemplate->addRule('accept_condition', BAZ_ACCEPTE_CONDITIONS_REQUIS, 'required', '', 'client') ;
$formtemplate->addGroup($bouton, null, null, '&nbsp;');
}
//affichage du formulaire si conditions acceptées
else {
//Parcours du fichier de templates, pour mettre les champs specifiques
$tableau=baz_valeurs_template($GLOBALS['_BAZAR_']['typeannonce'].'.tpl');
for ($i=0; $i<count($tableau); $i++) {
$tableau[$i]['type']($formtemplate, $tableau[$i]['nom_bdd'], $tableau[$i]['label'], $tableau[$i]['limite1'],
$tableau[$i]['limite2'], $tableau[$i]['defaut'], $tableau[$i]['table_source'], $tableau[$i]['obligatoire']) ;
}
//ajout des conditions pour l'annonce si elles existent
$requete = 'SELECT bn_condition FROM bazar_nature WHERE bn_label_nature="'.$GLOBALS['_BAZAR_']['typeannonce'].'"';
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
if (DB::isError($resultat)) {
die ($resultat->getMessage().$resultat->getDebugInfo()) ;
}
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
if ($ligne['bn_condition']!='') {
require_once 'HTML/QuickForm/html.php';
$conditions= new HTML_QuickForm_html('<tr><td colspan="2"><p style="padding:4px; margin:5px; width: 100%; background: #C1CBA7;">'.$ligne['bn_condition'].'</p></td></tr>');
$formtemplate->addElement($conditions);
$formtemplate->addElement('checkbox', 'accept_condition',BAZ_ACCEPTE_CONDITIONS) ;
$formtemplate->addRule('accept_condition', BAZ_ACCEPTE_CONDITIONS_REQUIS, 'required', '', 'client') ;
}
}
//Ajout des boutons
$bouton[] = &HTML_QuickForm::createElement('submit', 'valider', BAZ_VALIDER, '&nbsp;');
$formtemplate->addGroup($bouton, null, null, '&nbsp;');
//Traduction de champs requis
$formtemplate->setRequiredNote(BAZ_CHAMPS_REQUIS) ;
if ($mode=='modification') {
//Ajout des valeurs par défaut
$formtemplate->setDefaults(baz_valeurs_fiche($GLOBALS['_BAZAR_']['id_fiche'])) ;
}
//Affichage à l'écran
$res.= $formtemplate->toHTML()."\n";
if ($mode=='modification') {
//initialisation de la variable globale id_fiche
if ($mode=='modification') $GLOBALS['_BAZAR_']['id_fiche'] = $_GET['id_fiche'];
$GLOBALS['_BAZAR_']['id_fiche'] = $_REQUEST['id_fiche'];
//préparation des formulaires supplémentaires
//Ajout des valeurs par defaut
$formtemplate->setDefaults(baz_valeurs_fiche($GLOBALS['_BAZAR_']['id_fiche'])) ;
//preparation des formulaires supplementaires
//AJOUTER UNE IMAGE
$lien_formulaire=$GLOBALS['_BAZAR_']['url'];
$lien_formulaire->addQueryString('action', BAZ_ACTION_MODIFIER);
325,7 → 324,7
$lien_supprimer=$GLOBALS['_BAZAR_']['url'];
$lien_supprimer->addQueryString('action', $_GET['action']);
$lien_supprimer->addQueryString('id_fiche', $GLOBALS['_BAZAR_']["id_fiche"]);
$lien_supprimer->addQueryString('typeannonce', $_GET['typeannonce']);
$lien_supprimer->addQueryString('typeannonce', $_REQUEST['typeannonce']);
$lien_supprimer->addQueryString('image', '2');
$html.= '<a href="'.$lien_supprimer->getURL().'" onclick="javascript:return confirm(\''.BAZ_CONFIRMATION_SUPPRESSION.'\');" >'.BAZ_SUPPRIMER.'</a></td></tr>'."\n";
$formimage = new HTML_QuickForm('formulaire', 'post', preg_replace ('/&amp;/', '&', $lien_formulaire->getURL()) ) ;
367,7 → 366,7
$lien_supprimer=$GLOBALS['_BAZAR_']['url'];
$lien_supprimer->addQueryString('action', $_GET['action']);
$lien_supprimer->addQueryString('id_fiche', $GLOBALS['_BAZAR_']["id_fiche"]);
$lien_supprimer->addQueryString('typeannonce', $_GET['typeannonce']);
$lien_supprimer->addQueryString('typeannonce', $_REQUEST['typeannonce']);
$lien_supprimer->addQueryString('url', '2');
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT)) {
415,7 → 414,7
$lien_supprimer=$GLOBALS['_BAZAR_']['url'];
$lien_supprimer->addQueryString('action', $_GET['action']);
$lien_supprimer->addQueryString('id_fiche', $GLOBALS['_BAZAR_']["id_fiche"]);
$lien_supprimer->addQueryString('typeannonce', $_GET['typeannonce']);
$lien_supprimer->addQueryString('typeannonce', $_REQUEST['typeannonce']);
$lien_supprimer->addQueryString('fichier', '2');
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT)) {
$lien_supprimer->addQueryString('id_fichier', $ligne->bfj_id_fichier);
448,14 → 447,15
//Ajout de 'http://' comme valeur par default d'une url
$formurl->setDefaults(array('url_lien'=>'http://'));
//Bouton de validation du formulaire
$formurl->addGroup($bouton, null, null, '');
$formfichiers->addGroup($bouton, null, null, '');
//Affichage à l'écran
$res .= $formimage->toHTML()."\n".$formurl->toHTML()."\n".$formfichiers->toHTML()."\n";
}
}
//Affichage a l'ecran
$res .= $formtemplate->toHTML()."\n";
if (isset($formimage)) $res .= $formimage->toHTML()."\n".$formurl->toHTML()."\n".$formfichiers->toHTML()."\n";
return $res;
}
 
468,8 → 468,8
*/
function baz_formulaire($mode = 'inscription') {
if ($GLOBALS['AUTH']->getAuth()) {
//Récupérer les éventuelles variables passées en GET ou en POST
if (isset($_GET['id_fiche'])) $GLOBALS['_BAZAR_']['id_fiche']=$_GET['id_fiche'];
//Recuperer les eventuelles variables passees en GET ou en POST
if (isset($_REQUEST['id_fiche'])) $GLOBALS['_BAZAR_']['id_fiche']=$_REQUEST['id_fiche'];
if (isset($_REQUEST['typeannonce'])) {
$GLOBALS['_BAZAR_']['typeannonce']=$_REQUEST['typeannonce'];
// Pour éviter qu'un formulaire soit revalidé si l'utilisateur
490,7 → 490,7
}
}
$lien_formulaire=$GLOBALS['_BAZAR_']['url'];
//Définir le lien du formulaire en fonction du mode de formulaire choisi
//Definir le lien du formulaire en fonction du mode de formulaire choisi
if ($mode == 'inscription') $lien_formulaire->addQueryString('action', BAZ_ACTION_NOUVEAU_V);
if ($mode == BAZ_DEPOSER_ANNONCE) $lien_formulaire->addQueryString('action', BAZ_DEPOSER_ANNONCE);
if ($mode == BAZ_ACTION_NOUVEAU) $lien_formulaire->addQueryString('action', BAZ_ACTION_NOUVEAU_V);
1333,6 → 1333,9
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.14 2005/11/07 08:48:02 florian
* correction pb guillemets pour saisie et modif de fiche
*
* Revision 1.13 2005/10/21 16:15:04 florian
* mise a jour appropriation
*
/trunk/langues/baz_langue_fr.inc.php
19,7 → 19,7
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: baz_langue_fr.inc.php,v 1.20 2005-11-04 17:13:49 florian Exp $
// CVS : $Id: baz_langue_fr.inc.php,v 1.21 2005-11-07 17:05:46 florian Exp $
/**
* Fichier de traduction en français de l'application Bazar
*
30,7 → 30,7
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.20 $ $Date: 2005-11-04 17:13:49 $
*@version $Revision: 1.21 $ $Date: 2005-11-07 17:05:46 $
// +------------------------------------------------------------------------------------------------------+
*/
define ('BAZ_TITREAPPLI','Gestionnaire d\'annonces et de ressources (Bazar) ');
296,9 → 296,10
define ('BAZ_ACTIVITES_DOMINANTES_REQUIS', 'Activit&eacute;s dominantes requises');
define ('BAZ_PRECISION_PRIX', 'Pr&eacute;cision sur le prix');
define ('BAZ_PRECISION_PRIX_REQUIS', 'Pr&eacute;cision sur le prix requise');
define ('BAZ_VOYAGE_COMPRIS', 'Voyage requis');
define ('BAZ_VOYAGE_COMPRIS', 'Voyage compris');
define ('BAZ_VOYAGE_COMPRIS_REQUIS', 'Voyage compris requis');
define ('BAZ_AIDES_POSSIBLES', 'Aides possibles');
define ('BAZ_CHOISIR_OBLIGATOIRE', 'Il faut choisir une option dans la liste!');
 
define ('BAZ_COORDONNEES','Coordonn&eacute;es');
define ('BAZ_ANNEE_PARUTION','Ann&eacute;e de parution');
367,6 → 368,9
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.20 2005/11/04 17:13:49 florian
* ajout des textes et du formulaire pour les annonces
*
* Revision 1.19 2005/10/31 17:10:56 ddelon
* Reintegration des commits mysterieusement disparus
*