Subversion Repositories Applications.papyrus

Compare Revisions

Regard whitespace Rev 626 → Rev 627

/trunk/client/bazar/bazar.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.php,v 1.15 2005-11-30 13:58:45 florian Exp $
// CVS : $Id: bazar.php,v 1.16 2005-12-01 15:31:30 florian Exp $
/**
*
*@package bazar
28,7 → 28,7
*@author Florian Schmitt <florian@ecole-et-nature.org>
//Autres auteurs :
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.15 $ $Date: 2005-11-30 13:58:45 $
*@version $Revision: 1.16 $ $Date: 2005-12-01 15:31:30 $
// +------------------------------------------------------------------------------------------------------+
*/
 
161,7 → 161,7
case BAZ_SUPPRIMER_FICHE : $res .= baz_suppression().baz_liste('',$GLOBALS['id_user'],''); break;
case BAZ_VOIR_FICHE : $res .= baz_voir_fiche(1); break;
case BAZ_ACTION_NOUVEAU : $res .= baz_formulaire(BAZ_ACTION_NOUVEAU); break;
case BAZ_ACTION_NOUVEAU_V : $res .= baz_formulaire().mes_fiches(); break;
case BAZ_ACTION_NOUVEAU_V : $res .= baz_formulaire(BAZ_ACTION_NOUVEAU_V).mes_fiches(); break;
case BAZ_ACTION_MODIFIER : $res .= baz_formulaire(BAZ_ACTION_MODIFIER); break;
case BAZ_ACTION_MODIFIER_V : $res .= baz_formulaire(BAZ_ACTION_MODIFIER_V).mes_fiches(); break;
case BAZ_ACTION_SUPPRESSION : $res .= baz_suppression().mes_fiches(); break;
184,6 → 184,9
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.15 2005/11/30 13:58:45 florian
* ajouts graphisme (logos, boutons), changement structure SQL bazar_fiche
*
* Revision 1.14 2005/11/24 16:17:13 florian
* corrections bugs, ajout des cases à cocher
*
/trunk/client/bazar/documentation/bazar.sql
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/client/bazar/bibliotheque/bazar.fonct.rss.php
122,11 → 122,14
$est_admin=1;
}
}
//affiche le titre sous forme d'image'
if ($GLOBALS['_BAZAR_']['image_titre']!='') {
$res .= '<img src="client/bazar/images/'.$GLOBALS['_BAZAR_']['image_titre'].'" alt="'.$GLOBALS['_BAZAR_']['typeannonce'].'" />'.'<br />'."\n";
} else {
$res .= '<h1>'.$GLOBALS['_BAZAR_']['typeannonce'].'</h1>'."\n";
$res .= '<img id="BAZ_img_titre" src="client/bazar/images/'.$GLOBALS['_BAZAR_']['image_titre'].'" alt="'.$GLOBALS['_BAZAR_']['typeannonce'].'" />'.'<br />'."\n";
}
//affiche le texte sinon
else {
$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";
$res .= '&nbsp;</div>'."\n";
/trunk/client/bazar/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.20 2005-11-30 13:58:45 florian Exp $
// CVS : $Id: bazar.fonct.php,v 1.21 2005-12-01 15:31:30 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.20 $ $Date: 2005-11-30 13:58:45 $
*@version $Revision: 1.21 $ $Date: 2005-12-01 15:31:30 $
// +------------------------------------------------------------------------------------------------------+
*/
 
242,13 → 242,12
$GLOBALS['_BAZAR_']['typeannonce']=$_REQUEST['typeannonce'];
// Pour éviter qu'un formulaire soit revalidé si l'utilisateur
// Clique sur son bouton précédent
if ($mode == BAZ_ACTION_NOUVEAU) unset($_SESSION['formulaire_annonce_valide']) ;
}
//requete pour obtenir l'id du type d'annonce
if (isset($GLOBALS['_BAZAR_']['typeannonce'])) {
$requete = 'SELECT bn_id_nature FROM bazar_nature WHERE bn_label_nature="'.$GLOBALS['_BAZAR_']['typeannonce'].'"' ;
$requete = 'SELECT bn_id_nature, 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()) ;
255,14 → 254,16
}
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
$GLOBALS['_BAZAR_']['id_typeannonce']=$ligne['bn_id_nature'];
$conditions=$ligne['bn_condition'];
}
}
$lien_formulaire=$GLOBALS['_BAZAR_']['url'];
//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) {
if (!isset($_POST['accept_condition'])) {
if ((!isset($_POST['accept_condition']))and($conditions!=NULL)) {
$lien_formulaire->addQueryString('action', BAZ_ACTION_NOUVEAU);
} else {
$lien_formulaire->addQueryString('action', BAZ_ACTION_NOUVEAU_V);
269,7 → 270,7
}
}
if ($mode == BAZ_ACTION_MODIFIER) {
if (!isset($_POST['accept_condition'])) {
if (!isset($_POST['accept_condition'])and($conditions!=NULL)) {
$lien_formulaire->addQueryString('action', BAZ_ACTION_MODIFIER);
} else {
$lien_formulaire->addQueryString('action', BAZ_ACTION_MODIFIER_V);
322,9 → 323,7
$formtemplate->addElement('radio', 'typeannonce', '', '<strong>'.$ligne['bn_label_nature'].
':</strong><br />'.$ligne['bn_description'], $ligne['bn_label_nature'], array("id" => 'select'.$ligne['bn_id_nature'], "style" => 'float:left;'));
}
}
$squelette->setElementTemplate( '<div class="listechoix">'."\n".'{element}'."\n".'</div>'."\n");
//Mettre les annonces en choix par defaut
342,7 → 341,6
//------------------------------------------------------------------------------------------------
if ($mode == BAZ_ACTION_NOUVEAU) {
$res=baz_afficher_formulaire_annonce('insertion',$formtemplate);
}
//------------------------------------------------------------------------------------------------
355,7 → 353,7
//------------------------------------------------------------------------------------------------
//CAS DE L'INSCRIPTION D'UNE ANNONCE
//------------------------------------------------------------------------------------------------
if ($mode == 'inscription') {
if (($mode == 'inscription')or($mode == BAZ_ACTION_NOUVEAU_V)) {
if ($formtemplate->validate() && !isset($_SESSION['formulaire_annonce_valide'])) {
$formtemplate->process('baz_insertion', false) ;
$_SESSION['formulaire_annonce_valide'] = 1;
613,19 → 611,19
$image=$ligne->bf_url_image;
}
if ($image!=NULL) {
$html='<tr><td colspan="2" width="600px"><hr /><img src="client/bazar/images/'.$image.'" border=0 alt="'.BAZ_TEXTE_IMG_ALTERNATIF.'" />'."\n";
$html='<hr /><img src="client/bazar/images/'.$image.'" border=0 alt="'.BAZ_TEXTE_IMG_ALTERNATIF.'" />'."\n";
$lien_supprimer=$GLOBALS['_BAZAR_']['url'];
$lien_supprimer->addQueryString('action', $_GET['action']);
$lien_supprimer->addQueryString('id_fiche', $GLOBALS['_BAZAR_']["id_fiche"]);
$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";
$html.= '<a href="'.$lien_supprimer->getURL().'" onclick="javascript:return confirm(\''.BAZ_CONFIRMATION_SUPPRESSION.'\');" >'.BAZ_SUPPRIMER.'</a>'."\n";
$formimage = new HTML_QuickForm('formulaire', 'post', preg_replace ('/&amp;/', '&', $lien_formulaire->getURL()) ) ;
$formimage->addElement('html', $html) ;
}
else {
$formimage = new HTML_QuickForm('formulaire', 'post', preg_replace ('/&amp;/', '&', $lien_formulaire->getURL()) ) ;
$formimage->addElement('html', '<tr><td colspan="2" width="600px"><hr /><h3>'.BAZ_AJOUTER_IMAGE.'</h3></td></tr>') ;
$formimage->addElement('html', '<hr /><h3>'.BAZ_AJOUTER_IMAGE.'</h3>') ;
$formimage->addElement('file', 'image', BAZ_IMAGE) ;
$formimage->addRule('image', BAZ_IMAGE_VALIDE_REQUIS, '', '', 'client') ; //a completer pour checker l'image
$formimage->setMaxFileSize(BAZ_TAILLE_MAX_FICHIER);
634,7 → 632,7
}
else {
$formimage = new HTML_QuickForm('formulaire', 'post', preg_replace ('/&amp;/', '&', $lien_formulaire->getURL()) ) ;
$formimage->addElement('html', '<tr><td colspan="2" width="600px"><hr /><h3>'.BAZ_AJOUTER_IMAGE.'</h3></td></tr>') ;
$formimage->addElement('html', '<hr /><h3>'.BAZ_AJOUTER_IMAGE.'</h3>'."\n") ;
$formimage->addElement('file', 'image', BAZ_IMAGE) ;
$formimage->addRule('image', BAZ_IMAGE_VALIDE_REQUIS, '', '', 'client') ; //a completer pour checker l'image
$formimage->setMaxFileSize(BAZ_TAILLE_MAX_FICHIER);
649,7 → 647,7
die ($GLOBALS['_BAZAR_']['db']->getMessage().$GLOBALS['_BAZAR_']['db']->getDebugInfo()) ;
}
if ($resultat->numRows()>0) {
$html= '<tr><td colspan="2" width="600px"><hr /><h3>'.BAZ_LISTE_URL.'</h3>'."\n";
$html= '<hr /><h3>'.BAZ_LISTE_URL.'</h3>'."\n";
$tableAttr = array("id" => "table_bazar") ;
$table = new HTML_Table($tableAttr) ;
$entete = array (BAZ_LIEN , BAZ_SUPPRIMER) ;
671,12 → 669,12
}
$table->altRowAttributes(1, array("class" => "ligne_impaire"), array("class" => "ligne_paire"));
$table->updateColAttributes(1, array("align" => "center"));
$html.= $table->toHTML().'</td></tr>' ;
$html.= $table->toHTML()."\n" ;
}
else {
$html= '<tr><td colspan="2" width="600px"><hr /><h3>'.BAZ_PAS_URL.'</h3></td></tr>'."\n";
$html= '<hr /><h3>'.BAZ_PAS_URL.'</h3>'."\n";
}
$html.='<tr><td colspan="2" width="600px"><h4>'.BAZ_AJOUTER_URL.'</h4>'."\n";
$html.='<h4>'.BAZ_AJOUTER_URL.'</h4>'."\n";
$lien_formulaire=$GLOBALS['_BAZAR_']['url'];
$lien_formulaire->addQueryString('action', $_GET['action']);
$lien_formulaire->addQueryString('id_fiche', $GLOBALS['_BAZAR_']["id_fiche"]);
697,7 → 695,7
}
if ($resultat->numRows()>0) {
$html= '<tr><td colspan="2" width="600px"><hr /><h3>'.BAZ_LISTE_FICHIERS_JOINTS.'</h3>'."\n";
$html= '<hr /><h3>'.BAZ_LISTE_FICHIERS_JOINTS.'</h3>'."\n";
$tableAttr = array("id" => "table_bazar") ;
$table = new HTML_Table($tableAttr) ;
$entete = array (BAZ_FICHIER , BAZ_SUPPRIMER) ;
718,12 → 716,12
}
$table->altRowAttributes(1, array("class" => "ligne_impaire"), array("class" => "ligne_paire"));
$table->updateColAttributes(1, array("align" => "center"));
$html.= $table->toHTML().'</td></tr>' ;
$html.= $table->toHTML()."\n" ;
}
else {
$html= '<tr><td colspan="2"><hr /><h3>'.BAZ_PAS_DE_FICHIERS_JOINTS.'</h3></td></tr>'."\n";
$html= '<hr /><h3>'.BAZ_PAS_DE_FICHIERS_JOINTS.'</h3>'."\n";
}
$html.='<tr><td colspan="2" width="600px"><h4>'.BAZ_AJOUTER_FICHIER_JOINT.'</h4>'.'</td></tr>'."\n";
$html.='<h4>'.BAZ_AJOUTER_FICHIER_JOINT.'</h4>'."\n";
$lien_formulaire=$GLOBALS['_BAZAR_']['url'];
$lien_formulaire->addQueryString('action', $_GET['action']);
$lien_formulaire->addQueryString('id_fiche', $GLOBALS['_BAZAR_']['id_fiche']);
1248,7 → 1246,7
if ($_POST['type_annonce']!='toutes') {
$tableau=baz_valeurs_template($_POST['type_annonce'].'.tpl');
$nbvaleurs=count($tableau);
$html='<tr><td colspan="2" width="600px"><h3>'.BAZ_RECHERCHE_AVANCEE.'</h3></td></tr>'."\n";
$html='<h3>'.BAZ_RECHERCHE_AVANCEE.'</h3>'."\n";
$formtemplate->addElement('html', $html) ;
for ($i=0; $i<$nbvaleurs; $i++) {
if (($tableau[$i]['type']=='liste')or($tableau[$i]['type']=='listedatedeb')or($tableau[$i]['type']=='listedatefin')) {
1305,7 → 1303,7
// création du mail
$mail_object =& Mail::factory('mail');
if (!mail ($headers['To'], $headers['Subject'], $body)) {
return "<tr><td>Une erreur s'est produite:<br></td></tr>\n" ;
return "Une erreur s'est produite:<br />\n" ;
}
$body .= INS_MAIL_INSCRIPTION_2;
1313,7 → 1311,7
// création du mail
if (mail($headers['To'], $headers['Subject'], INS_MAIL_INSCRIPTION_1.$body)) {
return "<tr><td>Une erreur s'est produite<br></td></tr>\n" ;
return "Une erreur s'est produite<br />\n" ;
}
return;
}
1345,6 → 1343,9
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.20 2005/11/30 13:58:45 florian
* ajouts graphisme (logos, boutons), changement structure SQL bazar_fiche
*
* Revision 1.19 2005/11/24 16:17:13 florian
* corrections bugs, ajout des cases à cocher
*