Subversion Repositories Applications.bazar

Compare Revisions

Ignore whitespace Rev 104 → Rev 105

/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.42 2006-03-01 16:23:22 florian Exp $
// CVS : $Id: bazar.fonct.php,v 1.43 2006-03-02 20:36:52 florian Exp $
/**
*
* Fonctions du module bazar
31,7 → 31,7
*@author Florian Schmitt <florian@ecole-et-nature.org>
//Autres auteurs :
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.42 $ $Date: 2006-03-01 16:23:22 $
*@version $Revision: 1.43 $ $Date: 2006-03-02 20:36:52 $
// +------------------------------------------------------------------------------------------------------+
*/
 
198,7 → 198,7
$table->addRow (array(
'<a href="'.$lien_voir_url.'">'.$ligne['bf_titre'].'</a>'."\n", // col 1 : le nom
constant($ligne['bn_label_nature'])."\n", // col 2: type annonce
$ligne['bn_label_nature']."\n", // col 2: type annonce
$publiee."\n", // col 3 : publiee ou non
'<a href="'.$lien_modifier_url.'">'.BAZ_MODIFIER.'</a>'."\n", // col 4 : modifier
'<a href="'.$lien_supprimer_url.'" onclick="javascript:return '.
478,7 → 478,7
$titre='&nbsp;<img src="client/bazar/images/'.$ligne['bn_image_titre'].'" alt="'.
constant($ligne['bn_label_nature']).'" />'.'<br />'."\n";
} else {
$titre='<h3>'.constant($ligne['bn_label_nature']).' : </h3>'."\n";
$titre='<h3>'.$ligne['bn_label_nature'].' : </h3>'."\n";
}
$formtemplate->addElement('radio', 'typeannonce', '',
$titre.$ligne['bn_description'].'<br /><br />'."\n",
562,7 → 562,7
}
//titre de la rubrique
$res= '<h2>'.BAZ_TITRE_SAISIE_ANNONCE.'&nbsp;'.constant($GLOBALS['_BAZAR_']['typeannonce']).'</h2><br />'."\n";
$res= '<h2>'.BAZ_TITRE_SAISIE_ANNONCE.'&nbsp;'.$GLOBALS['_BAZAR_']['typeannonce'].'</h2><br />'."\n";
if (($GLOBALS['_BAZAR_']['condition']!='')AND(!isset($_POST['accept_condition']))AND(!isset($_GET['url'])OR(!isset($_GET['fichier']))OR(!isset($_GET['image'])))) {
require_once 'HTML/QuickForm/html.php';
$conditions= new HTML_QuickForm_html('<tr><td colspan="2" style="padding:5px; margin:5px; width: 90%; background: #C1CBA7;">'.$GLOBALS['_BAZAR_']['condition'].'</td>'."\n".'</tr>'."\n");
807,7 → 807,7
//cas des fichiers
elseif ($tableau[$i]['type']=='fichier') {
baz_insertion_fichier($valeur['texte_fichier'.$tableau[$i]['nom_bdd']], $GLOBALS['_BAZAR_']['id_fiche'], 'fichier'.$tableau[$i]['nom_bdd']);
}
}
//cas des urls
elseif ($tableau[$i]['type']=='url') {
baz_insertion_url($valeur['url_texte'.$tableau[$i]['nom_bdd']], $valeur['url_lien'.$tableau[$i]['nom_bdd']], $GLOBALS['_BAZAR_']['id_fiche']);
1304,6 → 1304,9
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.42 2006/03/01 16:23:22 florian
* modifs textes fr et correction bug "undefined index"
*
* Revision 1.41 2006/03/01 16:05:51 florian
* ajout des fichiers joints
*
/trunk/bibliotheque/bazar.fonct.formulaire.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.formulaire.php,v 1.18 2006-03-01 16:01:46 florian Exp $
// CVS : $Id: bazar.fonct.formulaire.php,v 1.19 2006-03-02 20:36:52 florian Exp $
/**
* Formulaire
*
31,7 → 31,7
//Autres auteurs :
*@author Aleandre GRANIER <alexandre@tela-botanica.org>
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.18 $ $Date: 2006-03-01 16:01:46 $
*@version $Revision: 1.19 $ $Date: 2006-03-02 20:36:52 $
// +------------------------------------------------------------------------------------------------------+
*/
 
62,14 → 62,14
}
$option=array('style'=>'width: '.$limite1.'px;');
require_once 'HTML/QuickForm/select.php';
$select= new HTML_QuickForm_select('liste'.$id_liste, constant($label), $select, $option);
$select= new HTML_QuickForm_select('liste'.$id_liste, $label, $select, $option);
$select->setSize($limite2);
$select->setMultiple(0);
$select->setSelected($defaut);
$formtemplate->addElement($select) ;
if (isset($obligatoire)and($obligatoire==1)) {
$formtemplate->addRule('liste'.$id_liste, BAZ_CHOISIR_OBLIGATOIRE.' '.constant($label) , 'nonzero', '', 'client') ;
$formtemplate->addRule('liste'.$id_liste, constant($label.'_REQUIS'), 'required', '', 'client') ;}
$formtemplate->addRule('liste'.$id_liste, BAZ_CHOISIR_OBLIGATOIRE.' '.$label , 'nonzero', '', 'client') ;
$formtemplate->addRule('liste'.$id_liste, $label.' obligatoire', 'required', '', 'client') ;}
}
 
 
95,7 → 95,7
$i=0;
if (isset($defaut)) $tab=split(', ', $defaut);
while ($ligne = $resultat->fetchRow()) {
if ($i==0) $labelchkbox=constant($label) ; else $labelchkbox='&nbsp;' ;
if ($i==0) $labelchkbox=$label ; else $labelchkbox='&nbsp;' ;
$checkbox[$i]= & HTML_Quickform::createElement('checkbox', $ligne[1], $labelchkbox, $ligne[2],
array ('style'=>'display:inline;margin-left:2px;')) ;
foreach ($tab as $val) {
103,9 → 103,9
}
$i++;
}
$formtemplate->addGroup($checkbox, 'checkbox'.$id_liste, constant($label), '<br />'."\n");
$formtemplate->addGroup($checkbox, 'checkbox'.$id_liste, $label, '<br />'."\n");
if (isset($obligatoire)and($obligatoire==1)) {
$formtemplate->addGroupRule('checkbox'.$id_liste, constant($label.'_REQUIS'), 'required', null, 1, 'client');
$formtemplate->addGroupRule('checkbox'.$id_liste, $label.' obligatoire', 'required', null, 1, 'client');
}
}
 
129,7 → 129,7
'format' => 'd m Y',
'addEmptyOption' => true,
);
$formtemplate->addElement('date', $nom_bdd, constant($label), $optiondate) ;
$formtemplate->addElement('date', $nom_bdd, $label, $optiondate) ;
//gestion des valeurs par défaut (date du jour)
if (isset($defaut)) $formtemplate->setDefaults(array($nom_bdd => $defaut));
else {
137,7 → 137,7
$formtemplate->setDefaults($defauts);
}
//gestion du champs obligatoire
if (isset($obligatoire)and($obligatoire==1)) {$formtemplate->addRule($nom_bdd, constant($label.'_REQUIS'), 'required', '', 'client') ;}
if (isset($obligatoire)and($obligatoire==1)) {$formtemplate->addRule($nom_bdd, $label.' obligatoire', 'required', '', 'client') ;}
}
 
/** listedatefin() - Ajoute un élément de type date sous forme de liste au formulaire pour designer une date de fin
171,13 → 171,13
*/
function texte(&$formtemplate, $nom_bdd , $label, $limite1, $limite2, $defaut, $source, $obligatoire) {
$option=array('size'=>$limite1,'maxlength'=>$limite2);
$formtemplate->addElement('text', $nom_bdd, constant($label), $option) ;
$formtemplate->addElement('text', $nom_bdd, $label, $option) ;
//gestion des valeurs par défaut
$defauts=array($nom_bdd=>$defaut);
$formtemplate->setDefaults($defauts);
$formtemplate->applyFilter($nom_bdd, 'addslashes') ;
//gestion du champs obligatoire
if (isset($obligatoire)and($obligatoire==1)) {$formtemplate->addRule($nom_bdd, constant($label.'_REQUIS'), 'required', '', 'client') ;}
if (isset($obligatoire)and($obligatoire==1)) {$formtemplate->addRule($nom_bdd, $label.' obligatoire', 'required', '', 'client') ;}
}
 
 
194,7 → 194,7
* @return void
*/
function textelong(&$formtemplate, $nom_bdd , $label, $limite1, $limite2, $defaut, $source, $obligatoire) {
$formtexte= new HTML_QuickForm_textarea($nom_bdd, constant($label), array('style'=>'white-space: normal;'));
$formtexte= new HTML_QuickForm_textarea($nom_bdd, $label, array('style'=>'white-space: normal;'));
$formtexte->setCols($limite1);
$formtexte->setRows($limite2);
$formtemplate->addElement($formtexte) ;
203,7 → 203,7
$formtemplate->setDefaults($defauts);
$formtemplate->applyFilter($nom_bdd, 'addslashes') ;
//gestion du champs obligatoire
if (isset($obligatoire)and($obligatoire==1)) {$formtemplate->addRule($nom_bdd, constant($label.'_REQUIS'), 'required', '', 'client') ;}
if (isset($obligatoire)and($obligatoire==1)) {$formtemplate->addRule($nom_bdd, $label.' obligatoire', 'required', '', 'client') ;}
}
 
/** url() - Ajoute un élément de type url internet au formulaire
269,7 → 269,7
* @return void
*/
function image(&$formtemplate, $nom_bdd , $label, $limite1, $limite2, $defaut, $source, $obligatoire) {
$html.='<tr>'."\n".'<td colspan="2">'."\n".'<h4>'.$label.'</h4>'."\n".'</td>'."\n".'</tr>'."\n";
$html ='<tr>'."\n".'<td colspan="2">'."\n".'<h4>'.$label.'</h4>'."\n".'</td>'."\n".'</tr>'."\n";
$formtemplate->addElement('html', $html) ;
$formtemplate->addElement('file', 'image'.$nom_bdd, BAZ_IMAGE) ;
//TODO: controler si c'est une image
303,6 → 303,9
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.18 2006/03/01 16:01:46 florian
* correction bug déclaration variable $html
*
* Revision 1.17 2006/01/30 10:27:03 florian
* - ajout des entrées de formulaire fichier, url, et image
* - correction bug d'affichage du mode de saisie
/trunk/bibliotheque/bazar.fonct.rss.php
127,7 → 127,7
}
//affiche le texte sinon
else {
$res .= '<h1 class="BAZ_titre">'.constant ($GLOBALS['_BAZAR_']['typeannonce']).'</h1>'."\n";
$res .= '<h1 class="BAZ_titre">'.$GLOBALS['_BAZAR_']['typeannonce'].'</h1>'."\n";
}
$res .= '<div class="BAZ_cadre_fiche">'."\n";
$res .= '<div class="BAZ_cadre_fiche_haut">'."\n";
168,7 → 168,7
if (!in_array($val, array ('bf_titre', 'bf_description', 'bf_date_debut_validite_fiche',
'bf_date_fin_validite_fiche'))) {
if ($val != '' and $val != BAZ_CHOISIR and $val != BAZ_NON_PRECISE) {
$res .= '<span class="rubrique">'.constant($tableau[$i]['label']).':</span>'."\n";
$res .= '<span class="rubrique">'.$tableau[$i]['label'].':</span>'."\n";
$res .= '<span class="description"> '.$ligne[$val].'</span>'."\n".'<br />'."\n";
}
}
187,7 → 187,7
$val .= $tab[0];
$nb++;
}
$res .= '<span class="rubrique">'.constant($tableau[$i]['label']).':</span>'."\n";
$res .= '<span class="rubrique">'.$tableau[$i]['label'].':</span>'."\n";
$res .= '<span class="description"> '.$val.'</span>'."\n".'<br />'."\n";
}
}
577,18 → 577,17
}
$type_annonce_select['toutes']=BAZ_TOUS_TYPES_FICHES;
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
$type_annonce_select[$ligne['bn_id_nature']] = constant($ligne['bn_label_nature']);
$type_annonce_select[$ligne['bn_id_nature']] = $ligne['bn_label_nature'];
$tableau_typeannonces[] = $ligne['bn_id_nature'] ;
}
if ($GLOBALS['_BAZAR_']['typeannonce']=='toutes') {
$res= '<h2>'.BAZ_TOUTES_LES_ANNONCES.'</h2><br />'."\n";
$option=array('style'=>'border:1px solid #000;width: 140px;font:12px Myriad, Arial, sans-serif;');
$formtemplate->addElement ('select', 'nature', BAZ_TYPEANNONCE, $type_annonce_select, $option) ;
}
//cas du type d'annonces prédéfini
else {
$res = '<h2>'.BAZ_TOUTES_LES_ANNONCES_DE_TYPE.' '.constant($GLOBALS['_BAZAR_']['typeannonce']).'</h2>'."\n";
$res = '<h2>'.BAZ_TOUTES_LES_ANNONCES_DE_TYPE.' '.$GLOBALS['_BAZAR_']['typeannonce'].'</h2>'."\n";
}