/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.38 2006-01-30 10:27:04 florian Exp $ |
// CVS : $Id: bazar.fonct.php,v 1.39 2006-01-30 17:25:38 alexandre_tb 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.38 $ $Date: 2006-01-30 10:27:04 $ |
*@version $Revision: 1.39 $ $Date: 2006-01-30 17:25:38 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
436,7 → 436,10 |
$lien_formulaire->addQueryString('action', BAZ_ACTION_MODIFIER_V); |
$lien_formulaire->addQueryString('id_fiche', $GLOBALS['_BAZAR_']['id_fiche']); |
} |
if (!isset($GLOBALS['_BAZAR_']['id_typeannonce'])) $lien_formulaire->addQueryString('action', BAZ_ACTION_NOUVEAU); |
if (isset($GLOBALS['_BAZAR_']['id_typeannonce']) && ($GLOBALS['_BAZAR_']['id_typeannonce'] != 'toutes')) { |
$lien_formulaire->addQueryString('action', BAZ_ACTION_NOUVEAU); |
$mode = BAZ_ACTION_NOUVEAU ; |
} |
//contruction du squelette du formulaire |
$formtemplate = new HTML_QuickForm('formulaire', 'post', preg_replace ('/&/', '&', $lien_formulaire->getURL()) ); |
479,7 → 482,10 |
} else { |
$titre='<h3>'.constant($ligne['bn_label_nature']).' : </h3>'."\n"; |
} |
$formtemplate->addElement('radio', 'typeannonce', '', $titre.$ligne['bn_description'].'<br /><br />'."\n", $ligne['bn_id_nature'], array("id" => 'select'.$ligne['bn_id_nature'], "style" => 'float:left;')); |
$formtemplate->addElement('radio', 'typeannonce', '', |
$titre.$ligne['bn_description'].'<br /><br />'."\n", |
$ligne['bn_id_nature'], array("id" => 'select'.$ligne['bn_id_nature'], |
"style" => 'float:left;')); |
} |
} |
$squelette->setElementTemplate( '<div class="listechoix">'."\n".'{element}'."\n".'</div>'."\n"); |
1291,6 → 1297,10 |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: not supported by cvs2svn $ |
* Revision 1.38 2006/01/30 10:27:04 florian |
* - ajout des entrées de formulaire fichier, url, et image |
* - correction bug d'affichage du mode de saisie |
* |
* Revision 1.37 2006/01/24 14:11:11 alexandre_tb |
* correction de bug sur l'ajout d'une image et d'un fichier |
* |
/trunk/bibliotheque/bazar.fonct.rss.php |
---|
122,7 → 122,7 |
} |
} |
//affiche le titre sous forme d'image |
if ($GLOBALS['_BAZAR_']['image_titre']!='') { |
if (isset ($GLOBALS['_BAZAR_']['image_titre']) && $GLOBALS['_BAZAR_']['image_titre']!='') { |
$res .= '<img id="BAZ_img_titre" src="client/bazar/images/'.$GLOBALS['_BAZAR_']['image_titre'].'" alt="'.$GLOBALS['_BAZAR_']['typeannonce'].'" />'.'<br />'."\n"; |
} |
//affiche le texte sinon |
139,7 → 139,7 |
die ($resultat->getMessage().'<br />'.$resultat->getDebugInfo()) ; |
} |
$ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC) ; |
$GLOBALS['_BAZAR_']['annonceur'] = $ligne['bf_ce_utilisateur'] ; |
//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'); |
154,7 → 154,7 |
$res .= '</div>'."\n"; |
} |
//cas d'une image par défaut |
elseif ($GLOBALS['_BAZAR_']['image_logo']!='') { |
elseif (isset ($GLOBALS['_BAZAR_']['image_logo']) && $GLOBALS['_BAZAR_']['image_logo']!='') { |
$res .= '<div id="fiche_image">'."\n"; |
$res .= '<img src="client/bazar/images/'.$GLOBALS['_BAZAR_']['image_logo'].'" border=0 alt="'.BAZ_TEXTE_IMG_ALTERNATIF.'" width="130" height="130" />'."\n"; |
$res .= '</div>'."\n"; |
164,12 → 164,12 |
$tableau=baz_valeurs_template($GLOBALS['_BAZAR_']['template']); |
for ($i=0; $i<count($tableau); $i++) { |
if (isset($ligne[$tableau[$i]['nom_bdd']])) { |
$val=$ligne[$tableau[$i]['nom_bdd']]; |
$val=$tableau[$i]['nom_bdd']; |
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="description"> '.$val.'</span>'."\n".'<br />'."\n"; |
$res .= '<span class="description"> '.$ligne[$val].'</span>'."\n".'<br />'."\n"; |
} |
} |
} |
253,7 → 253,8 |
$res .= '<span class="rubrique">'.BAZ_DATE_CREATION.' :</span> '.strftime('%d.%m.%Y à %H:%M',strtotime($ligne['bf_date_creation_fiche'])).'<br />'."\n"; |
$res .= '<span class="rubrique">'.BAZ_DATE_MAJ.' :</span> '.strftime('%d.%m.%Y à %H:%M',strtotime($ligne['bf_date_maj_fiche'])).'<br />'."\n"; |
if (($est_admin)or($GLOBALS['_BAZAR_']['annonceur']==$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID))) { |
if ($est_admin or |
$GLOBALS['_BAZAR_']['annonceur']==$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID)) { |
$lien_modifier=$GLOBALS['_BAZAR_']['url']; |
$lien_modifier->addQueryString('action', BAZ_ACTION_MODIFIER); |
$lien_modifier->addQueryString('id_fiche', $GLOBALS['_BAZAR_']['id_fiche']); |
519,7 → 520,11 |
$lien->addQueryString('action', BAZ_VOIR_FICHE); |
$lien->addQueryString('id_fiche', $ligne['bf_id_fiche']); |
$xml .= '<link>'.str_replace ('&', '&', $lien->getURL()).'</link>'."\n"; |
$xml .= '<description>'."\n".'<![CDATA['.baz_voir_fiche(0,$ligne['bf_id_fiche']).']]>'."\n".'</description>'."\n"; |
$xml .= '<description>'."\n".'<![CDATA[' ; |
if ($_GET['action'] != BAZ_VOIR_TOUTES_ANNONCES) { |
$xml .= baz_voir_fiche(0,$ligne['bf_id_fiche']) ; |
} |
$xml .= ']]>'."\n".'</description>'."\n"; |
$xml .= '<pubDate>'.strftime('%d %b %Y %H:%M:%S GMT',strtotime($ligne['bf_date_debut_validite_fiche'])).'</pubDate>'."\n"; |
$xml .= '</item>'."\n"; |
} |
583,7 → 588,7 |
$requete .= ' bf_ce_utilisateur='.BAZ_CHAMPS_ID.' '; |
if (!isset($_REQUEST['nature'])) { |
if (isset($GLOBALS['_BAZAR_']['id_typeannonce'])) { |
$requete .= 'AND bf_ce_nature='.$GLOBALS['_BAZAR_']['id_typeannonce'].' '; |
$requete .= 'AND bf_ce_nature="'.$GLOBALS['_BAZAR_']['id_typeannonce'].'" '; |
} |
} |
else { |
641,6 → 646,7 |
$res.=$formtemplate->toHTML()."\n"; |
//affichage des resultats de la recherche si le formulaire a ete envoye |
$requeteSQL=''; |
if (isset($_REQUEST['recherche_effectuee'])) { |
//preparation de la requete pour trouver les mots cles |
if (($_POST['recherche_mots_cles']!='')and($_POST['recherche_mots_cles']!=BAZ_MOT_CLE)) { |
660,7 → 666,8 |
else {$valides=1;} |
//generation de la liste de flux a afficher |
$res.=RSSversHTML(gen_RSS($typedefiches, '', $_POST['personnes'], $valides, $requeteSQL), 0, BAZ_TYPE_AFFICHAGE_LISTE, 1) ; |
$res .= RSSversHTML(gen_RSS($typedefiches, '', $_POST['personnes'], $valides, $requeteSQL), |
0, '', 1) ; |
} |
else { |
//on affiche toutes les annonces |
/trunk/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.24 2006-01-26 11:06:43 alexandre_tb Exp $ |
// CVS : $Id: bazar.php,v 1.25 2006-01-30 17:25:38 alexandre_tb 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.24 $ $Date: 2006-01-26 11:06:43 $ |
*@version $Revision: 1.25 $ $Date: 2006-01-30 17:25:38 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
127,11 → 127,10 |
$GLOBALS['_BAZAR_']['template']=$ligne['bn_template']; |
$GLOBALS['_BAZAR_']['commentaire']=$ligne['bn_commentaire']; |
$GLOBALS['_BAZAR_']['appropriation']=$ligne['bn_appropriation']; |
$GLOBALS['_BAZAR_']['nb_consultations']=$ligne['bf_nb_consultations']; |
$GLOBALS['_BAZAR_']['image_titre']=$ligne['bn_image_titre']; |
$GLOBALS['_BAZAR_']['image_logo']=$ligne['bn_image_logo']; |
} |
if (!isset($GLOBALS['_BAZAR_']['id_typeannonce'])) $GLOBALS['_BAZAR_']['id_typeannonce'] = 'toutes' ; |
// +------------------------------------------------------------------------------------------------------+ |
// | LISTE de FONCTIONS | |
// +------------------------------------------------------------------------------------------------------+ |
194,7 → 193,7 |
if (($_GET['action']!=BAZ_ACTION_NOUVEAU_V)and($_GET['action']!=BAZ_ACTION_MODIFIER_V)) unset($_SESSION['formulaire_annonce_valide']); |
switch ($_GET['action']) { |
case BAZ_VOIR_VOS_ANNONCES : $res .= mes_fiches(); break; |
case BAZ_VOIR_TOUTES_ANNONCES : $res .= baz_liste($GLOBALS['_BAZAR_']['id_nature']); break; |
case BAZ_VOIR_TOUTES_ANNONCES : $res .= baz_liste($GLOBALS['_BAZAR_']['id_typeannonce']); break; |
case BAZ_DEPOSER_ANNONCE : $res .= baz_formulaire(BAZ_DEPOSER_ANNONCE); break; |
case BAZ_ANNONCES_A_VALIDER : $res .= fiches_a_valider().baz_liste(); break; |
case BAZ_ADMINISTRER_ANNONCES : $res .= baz_administrer_annonces(); break; |
224,6 → 223,9 |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: not supported by cvs2svn $ |
* Revision 1.24 2006/01/26 11:06:43 alexandre_tb |
* ajout d'une requete pour recupere l'id_nature si un id_fiche est passé dans l'url |
* |
* Revision 1.23 2006/01/17 10:07:36 alexandre_tb |
* en cours |
* |