Subversion Repositories Applications.bazar

Compare Revisions

Ignore whitespace Rev 54 → Rev 55

/trunk/bibliotheque/bazar.fonct.rss.php
59,6 → 59,7
* @return string HTML
*/
function baz_voir_fiche($danslappli, $idfiche='') {
$res='';
if (isset($_GET['id_fiche'])) $GLOBALS['_BAZAR_']['id_fiche']=$_GET['id_fiche'];
if ($idfiche!='') $GLOBALS['_BAZAR_']['id_fiche']=$idfiche;
91,7 → 92,7
}
//on cherche le type d'annonce, l'annonceur et les stats
$requete = 'SELECT bn_label_nature, bn_commentaire, bn_appropriation, bf_ce_utilisateur,bf_nb_consultations FROM bazar_fiche, bazar_nature WHERE bn_id_nature=bf_ce_nature AND bf_id_fiche='.$GLOBALS['_BAZAR_']['id_fiche'];
$requete = 'SELECT bn_label_nature, bn_commentaire, bn_appropriation, bn_image_titre, bn_image_logo, bf_ce_utilisateur,bf_nb_consultations FROM bazar_fiche, bazar_nature WHERE bn_id_nature=bf_ce_nature AND bf_id_fiche='.$GLOBALS['_BAZAR_']['id_fiche'];
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
if (DB::isError($resultat)) {
die ($resultat->getMessage().$resultat->getDebugInfo()) ;
102,6 → 103,8
$GLOBALS['_BAZAR_']['appropriation']=$ligne['bn_appropriation'];
$GLOBALS['_BAZAR_']['annonceur']=$ligne['bf_ce_utilisateur'];
$GLOBALS['_BAZAR_']['nb_consultations']=$ligne['bf_nb_consultations'];
$GLOBALS['_BAZAR_']['image_titre']=$ligne['bn_image_titre'];
$GLOBALS['_BAZAR_']['image_logo']=$ligne['bn_image_logo'];
}
//on verifie si l'utilisateur est administrateur
119,41 → 122,47
$est_admin=1;
}
}
$res = '<div class="BAZ_cadre_fiche">'."\n";
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 .= '<div class="BAZ_cadre_fiche">'."\n";
$res .= '<div class="BAZ_cadre_fiche_haut">'."\n";
$res .= '&nbsp;</div>'."\n";
$res .= '<div class="BAZ_cadre_fiche_corps">'."\n";
$requete = 'SELECT * FROM bazar_fiche WHERE bf_id_fiche='.$GLOBALS['_BAZAR_']['id_fiche'];
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
if (DB::isError ($resultat)) {
die ($resultat->getMessage().'<br />'.$resultat->getDebugInfo()) ;
}
$ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC) ;
//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']);
$res .=genere_fiche($ligne);
}
//on affiche ligne par ligne sinon
else {
$requete = 'SELECT * FROM bazar_fiche WHERE bf_id_fiche='.$GLOBALS['_BAZAR_']['id_fiche'];
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
if (DB::isError ($resultat)) {
die ($resultat->getMessage().'<br />'.$resultat->getDebugInfo()) ;
}
$ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC) ;
//cas d'une image personalisée
if (isset($ligne['bf_url_image'])) {
$res .= '<div id="fiche_image">'."\n";
$res .= '<img src="'.'http://'.$_SERVER['HTTP_HOST'].'/client/bazar/images/'.$ligne['bf_url_image'].'" border=0 alt="'.BAZ_TEXTE_IMG_ALTERNATIF.'" />'."\n";
$res .= '<img src="client/bazar/images/'.$ligne['bf_url_image'].'" border=0 alt="'.BAZ_TEXTE_IMG_ALTERNATIF.'" />'."\n";
$res .= '</div>'."\n";
$res .= '<div id="fiche_titre_image">'.$ligne['bf_titre'];
}
else {
$res .= '<div id="fiche_titre">'.$ligne['bf_titre'];
//cas d'une image par défaut
elseif ($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.'" />'."\n";
$res .= '</div>'."\n";
}
$res .= '</div>'."\n";
$res .= '<h1 id="fiche_titre">'.$ligne['bf_titre'].'</h1>'."\n";
$res .= '<div id="BAZ_description">'.$ligne['bf_description'].'</div>'."\n";
$tableau=baz_valeurs_template($GLOBALS['_BAZAR_']['typeannonce'].'.tpl');
for ($i=0; $i<count($tableau); $i++) {
if (isset($ligne[$tableau[$i]['nom_bdd']])) {
//pour les champs renseignés par une liste, on va chercher le label de la liste, plutot que l'id
//pour les champs renseignes par une liste, on va chercher le label de la liste, plutot que l'id
if ($tableau[$i]['type']=='liste') {
$requete = 'SELECT '.$tableau[$i]['table_source'].'.* FROM bazar_fiche, '.$tableau[$i]['table_source'].
' WHERE '.$tableau[$i]['nom_bdd'].'='.$tableau[$i]['id_source'].' AND bf_id_fiche='.$GLOBALS['_BAZAR_']['id_fiche'];
161,15 → 170,15
if (DB::isError ($resultat)) {
die ($resultat->getMessage().'<br />'.$resultat->getDebugInfo()) ;
}
while ($tab = $resultat->fetchRow()) {
$val=$tab[1];
while ($tab = $resultat->fetchRow()) {
$val=$tab[1];
}
}
else {
$val=$ligne[$tableau[$i]['nom_bdd']];
}
if (($tableau[$i]['nom_bdd']!='bf_titre')and($tableau[$i]['nom_bdd']!='bf_description')) {
if ($val!='') {
if (($tableau[$i]['nom_bdd']!='bf_titre')and($tableau[$i]['nom_bdd']!='bf_description')and($tableau[$i]['nom_bdd']!='bf_date_debut_validite_fiche')and($tableau[$i]['nom_bdd']!='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";
}
176,7 → 185,6
}
}
}
}
//afficher les liens pour l'annonce
$requete = 'SELECT bu_url, bu_descriptif_url FROM bazar_url WHERE bu_ce_fiche='.$GLOBALS['_BAZAR_']['id_fiche'];
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
224,19 → 232,20
$res .= '</div>'."\n";
$res .= '<div class="bulle_bas">&nbsp;</div>'."\n";
$res .= '<div id="BAZ_bas_page">';
}
//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";
if ($ligne['bf_statut_fiche']==1) {
$res .= '<span class="rubrique">'.BAZ_PUBLIEE.':</span> '.BAZ_OUI.'<br />'."\n";
$res .= '<span class="rubrique">'.BAZ_PUBLIEE.':</span> '.BAZ_DU.' '.strftime('%d.%m.%Y',strtotime($ligne['bf_date_debut_validite_fiche'])).' '.BAZ_AU.' '.strftime('%d.%m.%Y',strtotime($ligne['bf_date_fin_validite_fiche'])).'<br />'."\n";
}
else {
$res .= '<span class="rubrique">'.BAZ_PUBLIEE.':</span> '.BAZ_NON.'<br />'."\n";
}
$res .= '<span class="rubrique">'.BAZ_DATE_CREATION.':</span> '.strftime('%d.%m.%Y &agrave; %H:%M',strtotime($ligne['bf_date_creation_fiche'])).'<br />'."\n";
$res .= '<span class="rubrique">'.BAZ_DATE_MAJ.':</span> '.strftime('%d.%m.%Y &agrave; %H:%M',strtotime($ligne['bf_date_maj_fiche']));
$res .= '<span class="rubrique">'.BAZ_DATE_CREATION.' :</span> '.strftime('%d.%m.%Y &agrave; %H:%M',strtotime($ligne['bf_date_creation_fiche'])).'<br />'."\n";
$res .= '<span class="rubrique">'.BAZ_DATE_MAJ.' :</span> '.strftime('%d.%m.%Y &agrave; %H:%M',strtotime($ligne['bf_date_maj_fiche'])).'<br />'."\n";
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);
/trunk/bibliotheque/bazar.fonct.cal.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.cal.php,v 1.4 2005-10-31 17:10:56 ddelon Exp $
// CVS : $Id: bazar.fonct.cal.php,v 1.5 2005-11-30 13:58:45 florian Exp $
/**
*
* Fonctions calendrier du module bazar
29,7 → 29,7
*@author David Delon <david.delon@clapas.net>
//Autres auteurs :
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.4 $ $Date: 2005-10-31 17:10:56 $
*@version $Revision: 1.5 $ $Date: 2005-11-30 13:58:45 $
// +------------------------------------------------------------------------------------------------------+
*/
 
37,9 → 37,9
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
require_once 'Calendar/Month/Weekdays.php';
require_once 'Calendar/Day.php';
require_once 'Calendar/Decorator.php';
require_once PAP_CHEMIN_RACINE.'api/pear/Calendar/Month/Weekdays.php';
require_once PAP_CHEMIN_RACINE.'api/pear/Calendar/Day.php';
require_once PAP_CHEMIN_RACINE.'api/pear/Calendar/Decorator.php';
 
 
// +------------------------------------------------------------------------------------------------------+
/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.19 2005-11-24 16:17:13 florian Exp $
// CVS : $Id: bazar.fonct.php,v 1.20 2005-11-30 13:58: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.19 $ $Date: 2005-11-24 16:17:13 $
*@version $Revision: 1.20 $ $Date: 2005-11-30 13:58:45 $
// +------------------------------------------------------------------------------------------------------+
*/
 
778,7 → 778,12
}
//cas des checkbox
elseif ($tableau[$i]['type']=='checkbox') {
$val=implode('**', array_keys($valeur[$tableau[$i]['nom_bdd']]));
if (isset($valeur[$tableau[$i]['nom_bdd']])) {
$val=implode('**', array_keys($valeur[$tableau[$i]['nom_bdd']]));
} else {
$val=BAZ_NON_PRECISE;
}
}
//cas des champs texte et textarea
else {
1340,6 → 1345,9
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.19 2005/11/24 16:17:13 florian
* corrections bugs, ajout des cases à cocher
*
* Revision 1.18 2005/11/18 16:03:23 florian
* correction bug html entites
*