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.rss.php,v 1.74 2007-03-28 15:54:32 florian Exp $ |
// CVS : $Id: bazar.fonct.rss.php,v 1.75 2007-04-04 08:51:01 florian Exp $ |
/** |
* |
*@package bazar |
28,7 → 28,7 |
*@author Florian Schmitt <florian@ecole-et-nature.org> |
//Autres auteurs : |
*@copyright Tela-Botanica 2000-2006 |
*@version $Revision: 1.74 $ |
*@version $Revision: 1.75 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
|
123,7 → 123,7 |
$url->addQueryString('id_fiche', $GLOBALS['_BAZAR_']['id_fiche']); |
$url = preg_replace ('/&/', '&', $url->getURL()) ; |
|
//cas ou la fiche a été validee |
//cas ou la fiche a ete validee |
if (isset($_GET['publiee'])) { |
publier_fiche($_GET['publiee']); |
} |
140,7 → 140,7 |
} |
} |
|
//cas ou un commentaire a été entre |
//cas ou un commentaire a ete entre |
if (isset($_POST['Nom'])) { |
$requete = 'INSERT INTO bazar_commentaires VALUES ('. |
baz_nextid('bazar_commentaires', 'bc_id_commentaire', $GLOBALS['_BAZAR_']['db']). |
170,10 → 170,10 |
|
$ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC) ; |
if (!isset($GLOBALS['_BAZAR_']['typeannonce'])) $GLOBALS['_BAZAR_']['typeannonce'] = $ligne['bf_ce_nature']; |
|
if (!isset($GLOBALS['_BAZAR_']['fiche_valide'])) $GLOBALS['_BAZAR_']['fiche_valide'] = $ligne['bf_statut_fiche']; |
//on verifie si l'utilisateur est administrateur |
$est_admin=0; |
$requete='SELECT bn_id_nature, bn_template, bn_commentaire FROM bazar_nature WHERE bn_id_nature="'.$GLOBALS['_BAZAR_']['typeannonce'].'"'; |
$requete='SELECT bn_id_nature, bn_template, bn_commentaire, bn_label_class FROM bazar_nature WHERE bn_id_nature='.$GLOBALS['_BAZAR_']['id_typeannonce']; |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ; |
if (DB::isError($resultat)) { |
die ($resultat->getMessage().$resultat->getDebugInfo()) ; |
182,6 → 182,7 |
$id_nature = $result['bn_id_nature']; |
if (!isset($GLOBALS['_BAZAR_']['template'])) $GLOBALS['_BAZAR_']['template'] = $result['bn_template']; |
if (!isset($GLOBALS['_BAZAR_']['commentaire'])) $GLOBALS['_BAZAR_']['commentaire'] = $result['bn_commentaire']; |
if (!isset($GLOBALS['_BAZAR_']['class'])) $GLOBALS['_BAZAR_']['class'] = $result['bn_label_class']; |
if ($GLOBALS['AUTH']->getAuth()) { |
if ((niveau_droit($result['bn_id_nature'],$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID))=='administrateur') |
or(niveau_droit('0',$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID))=='superadministrateur')) |
189,16 → 190,16 |
$est_admin=1; |
} |
} |
//debut de la fiche |
$res .= '<div class="BAZ_cadre_fiche BAZ_cadre_fiche_'.$GLOBALS['_BAZAR_']['class'].'">'."\n"; |
//affiche le titre sous forme d'image |
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="'.$result['bn_label_nature'].'" />'.'<br />'."\n"; |
$res .= '<img class="BAZ_img_titre" src="client/bazar/images/'.$GLOBALS['_BAZAR_']['image_titre'].'" alt="'.$result['bn_label_nature'].'" />'.'<br />'."\n"; |
} |
//affiche le texte sinon |
else { |
//$res .= '<h2 class="BAZ_titre">'.$GLOBALS['_BAZAR_']['typeannonce'].'</h2>'."\n"; |
$res .= '<h2 class="BAZ_titre BAZ_titre_'.$GLOBALS['_BAZAR_']['class'].'">'.$GLOBALS['_BAZAR_']['typeannonce'].'</h2>'."\n"; |
} |
$res .= '<div class="BAZ_cadre_fiche">'."\n"; |
|
$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'))) { |
207,20 → 208,20 |
} |
//on affiche ligne par ligne sinon |
else { |
//cas d'une image personnalisée |
//cas d'une image personalisee |
if (isset($ligne['bf_url_image'])) { |
$res .= '<div id="fiche_image">'."\n"; |
$res .= '<div class="BAZ_fiche_image BAZ_fiche_image_'.$GLOBALS['_BAZAR_']['class'].'">'."\n"; |
$res .= '<img src="client/bazar/upload/'.$ligne['bf_url_image'].'" border=0 alt="'.BAZ_TEXTE_IMG_ALTERNATIF.'" />'."\n"; |
$res .= '</div>'."\n"; |
} |
//cas d'une image par défaut |
//cas d'une image par defaut |
elseif (isset ($GLOBALS['_BAZAR_']['image_logo']) && $GLOBALS['_BAZAR_']['image_logo']!='') { |
$res .= '<div id="fiche_image">'."\n"; |
$res .= '<div class="BAZ_fiche_image BAZ_fiche_image_'.$GLOBALS['_BAZAR_']['class'].'">'."\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"; |
} |
$res .= '<h1 id="fiche_titre">'.$ligne['bf_titre'].'</h1>'."\n"; |
$res .= '<div id="BAZ_description">'.nl2br($ligne['bf_description']).'</div>'."\n"; |
$res .= '<h1 class="BAZ_fiche_titre BAZ_fiche_titre_'.$GLOBALS['_BAZAR_']['class'].'">'.$ligne['bf_titre'].'</h1>'."\n"; |
$res .= '<div class="BAZ_description BAZ_description_'.$GLOBALS['_BAZAR_']['class'].'">'.nl2br($ligne['bf_description']).'</div>'."\n"; |
$tableau=baz_valeurs_template($GLOBALS['_BAZAR_']['template']); |
for ($i=0; $i<count($tableau); $i++) { |
if (isset($ligne[$tableau[$i]['nom_bdd']]) && ( $tableau[$i]['type']=='texte' || $tableau[$i]['type']=='textelong' ) ) { |
227,8 → 228,8 |
$val=$tableau[$i]['nom_bdd']; |
if (!in_array($val, array ('bf_titre', 'bf_description'))) { |
if ($ligne[$val] != '' and $ligne[$val] != BAZ_CHOISIR and $ligne[$val] != BAZ_NON_PRECISE) { |
$res .= '<span class="rubrique" id="'.$tableau[$i]['nom_bdd'].'_rubrique">'.$tableau[$i]['label'].':</span>'."\n"; |
$res .= '<span class="description" id="'.$tableau[$i]['nom_bdd'].'_description"> '.nl2br($ligne[$val]).'</span>'."\n".'<br />'."\n"; |
$res .= '<div class="BAZ_rubrique BAZ_rubrique_'.$GLOBALS['_BAZAR_']['class'].'">'."\n".'<span class="BAZ_label" id="'.$tableau[$i]['nom_bdd'].'_rubrique">'.$tableau[$i]['label'].':</span>'."\n"; |
$res .= '<span class="BAZ_texte BAZ_texte_'.$GLOBALS['_BAZAR_']['class'].'" id="'.$tableau[$i]['nom_bdd'].'_description"> '.nl2br($ligne[$val]).'</span>'."\n".'</div>'."\n"; |
} |
} |
} |
247,8 → 248,8 |
$nb++; |
} |
if ($val != '' and $val != BAZ_CHOISIR and $val != BAZ_NON_PRECISE) { |
$res .= '<span class="rubrique" id="rubrique_'.$tableau[$i]['nom_bdd'].'">'.$tableau[$i]['label'].':</span>'."\n"; |
$res .= '<span class="description" id="description_'.$tableau[$i]['nom_bdd'].'"> '.$val.'</span>'."\n".'<br />'."\n"; |
$res .= '<div class="BAZ_rubrique BAZ_rubrique_'.$GLOBALS['_BAZAR_']['class'].'">'."\n".'<span class="BAZ_label" id="rubrique_'.$tableau[$i]['nom_bdd'].'">'.$tableau[$i]['label'].':</span>'."\n"; |
$res .= '<span class="BAZ_texte BAZ_texte_'.$GLOBALS['_BAZAR_']['class'].'" id="description_'.$tableau[$i]['nom_bdd'].'"> '.$val.'</span>'."\n".'</div>'."\n"; |
} |
} |
elseif ( $tableau[$i]['type']=='listedatedeb' || $tableau[$i]['type']=='listedatefin' ) { |
255,13 → 256,13 |
$val=$tableau[$i]['nom_bdd']; |
if (!in_array($val, array ('bf_date_debut_validite_fiche', 'bf_date_fin_validite_fiche'))) { |
if ($ligne[$val] != '' && $ligne[$val] != '0000-00-00') { |
$res .= '<span class="rubrique" id="'.$tableau[$i]['nom_bdd'].'_rubrique">'.$tableau[$i]['label'].':</span>'."\n"; |
$res .= '<span class="description" id="'.$tableau[$i]['nom_bdd'].'_description"> '.strftime('%d.%m.%Y',strtotime($ligne[$val])).'</span>'."\n".'<br />'."\n"; |
$res .= '<div class="BAZ_rubrique BAZ_rubrique_'.$GLOBALS['_BAZAR_']['class'].'">'."\n".'<span class="BAZ_label" id="'.$tableau[$i]['nom_bdd'].'_rubrique">'.$tableau[$i]['label'].':</span>'."\n"; |
$res .= '<span class="BAZ_texte BAZ_texte_'.$GLOBALS['_BAZAR_']['class'].'" id="'.$tableau[$i]['nom_bdd'].'_description"> '.strftime('%d.%m.%Y',strtotime($ligne[$val])).'</span>'."\n".'</div>'."\n"; |
} |
} |
} |
elseif ( $tableau[$i]['type']=='wikini' ) { |
$res .= '<div class="lien_wikini"><a href="wikini/'.baz_titre_wiki($ligne["bf_titre"]).'">'.BAZ_ENTRER_PROJET.'</a></div>'."\n"; |
$res .= '<div class="BAZ_lien_wikini BAZ_lien_wikini_'.$GLOBALS['_BAZAR_']['class'].'"><a href="wikini/'.baz_titre_wiki($ligne["bf_titre"]).'">'.BAZ_ENTRER_PROJET.'</a></div>'."\n"; |
} |
} |
//afficher les liens pour l'annonce |
271,11 → 272,11 |
die ($resultat->getMessage().$resultat->getDebugInfo()) ; |
} |
if ($resultat->numRows()>0) { |
$res .= '<span class="rubrique">'.BAZ_LIEN_INTERNET.':</span>'."\n"; |
$res .= '<span class="description">'."\n"; |
$res .= '<ul>'."\n"; |
$res .= '<span class="BAZ_label BAZ_label_'.$GLOBALS['_BAZAR_']['class'].'">'.BAZ_LIEN_INTERNET.':</span>'."\n"; |
$res .= '<span class="BAZ_description BAZ_description_'.$GLOBALS['_BAZAR_']['class'].'">'."\n"; |
$res .= '<ul class="BAZ_liste BAZ_liste_'.$GLOBALS['_BAZAR_']['class'].'">'."\n"; |
while ($ligne1 = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) { |
$res .= '<li><a href="'.$ligne1['bu_url'].'" target="_blank">'.$ligne1['bu_descriptif_url'].'</a></li>'."\n"; |
$res .= '<li class="BAZ_liste_lien BAZ_liste_lien_'.$GLOBALS['_BAZAR_']['class'].'"><a href="'.$ligne1['bu_url'].'" class="BAZ_lien" target="_blank">'.$ligne1['bu_descriptif_url'].'</a></li>'."\n"; |
} |
$res .= '</ul></span>'."\n"; |
} |
287,8 → 288,8 |
die ($resultat->getMessage().$resultat->getDebugInfo()) ; |
} |
if ($resultat->numRows()>0) { |
$res .= '<span class="rubrique">'.BAZ_LISTE_FICHIERS_JOINTS.':</span>'."\n"; |
$res .= '<span class="description">'."\n"; |
$res .= '<span class="BAZ_rubrique BAZ_rubrique_'.$GLOBALS['_BAZAR_']['class'].'">'.BAZ_LISTE_FICHIERS_JOINTS.':</span>'."\n"; |
$res .= '<span class="BAZ_description BAZ_description_'.$GLOBALS['_BAZAR_']['class'].'">'."\n"; |
$res .= '<ul>'."\n"; |
while ($ligne2 = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) { |
$res .= '<li><a href="client/bazar/upload/'.$ligne2['bfj_fichier'].'">'.$ligne2['bfj_description'].'</a></li>'."\n"; |
295,9 → 296,9 |
} |
$res .= '</ul></span>'."\n"; |
} |
$res .= '<div class="bulle_haut"> </div>'."\n"; |
$res .= '<div class="bulle_corps">'."\n"; |
|
$res .= '<div class="BAZ_bulle_corps BAZ_bulle_corps_'.$GLOBALS['_BAZAR_']['class'].'">'."\n"; |
$res .= '<div class="BAZ_infos_fiche BAZ_infos_fiche_'.$GLOBALS['_BAZAR_']['class'].'">'."\n"; |
$res .= '<span class="BAZ_nb_vues BAZ_nb_vues_'.$GLOBALS['_BAZAR_']['class'].'">'.BAZ_NB_VUS.$ligne['bf_nb_consultations'].BAZ_FOIS.'</span><br />'."\n"; |
//affichage du redacteur de la fiche |
$requete = 'SELECT '.BAZ_CHAMPS_NOM.', '.BAZ_CHAMPS_PRENOM.', '.BAZ_CHAMPS_EMAIL. |
' FROM '.BAZ_ANNUAIRE.' WHERE '.BAZ_CHAMPS_ID.'='.$ligne['bf_ce_utilisateur']; |
306,62 → 307,70 |
die ($resultat->getMessage().$resultat->getDebugInfo()) ; |
} |
while ($redacteur = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) { |
$res .= BAZ_FICHE_ECRITE.'<a href="mailto:'.$redacteur[BAZ_CHAMPS_EMAIL].'">'.$redacteur[BAZ_CHAMPS_PRENOM].' '.$redacteur[BAZ_CHAMPS_NOM].'</a><br />'."\n"; |
$res .= BAZ_FICHE_NUMERO.$GLOBALS['_BAZAR_']['id_fiche'].BAZ_ECRITE.'<a href="mailto:'.$redacteur[BAZ_CHAMPS_EMAIL].'">'.$redacteur[BAZ_CHAMPS_PRENOM].' '.$redacteur[BAZ_CHAMPS_NOM].'</a><br />'."\n"; |
} |
$res .= BAZ_NB_VUS.'<strong>'.$ligne['bf_nb_consultations'].'</strong>'.BAZ_FOIS.'<br />'."\n"; |
$res .= '</div>'."\n"; |
$res .= '<div class="bulle_bas"> </div>'."\n"; |
$res .= '<div id="BAZ_bas_page">'; |
} |
|
//informations complementaires (id fiche, etat publication,... ) |
if ($danslappli==1) { |
if ($ligne['bf_statut_fiche']==1 && $GLOBALS['_BAZAR_']['appropriation']!=1) { |
if ($GLOBALS['_BAZAR_']['fiche_valide']==1 && $GLOBALS['_BAZAR_']['appropriation']!=1) { |
if ($ligne['bf_date_debut_validite_fiche'] != '0000-00-00' && $ligne['bf_date_fin_validite_fiche'] != '0000-00-00') { |
$res .= '<span class="rubrique">'.BAZ_PUBLIEE.':</span> '.BAZ_DU. |
$res .= '<span class="BAZ_rubrique BAZ_rubrique_'.$GLOBALS['_BAZAR_']['class'].'">'.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"; |
} |
} |
elseif ($GLOBALS['_BAZAR_']['appropriation']!=1 || $ligne['bf_statut_fiche']!=1) { |
$res .= '<span class="rubrique">'.BAZ_PUBLIEE.':</span> '.BAZ_NON; |
elseif ($GLOBALS['_BAZAR_']['appropriation']!=1 || $GLOBALS['_BAZAR_']['fiche_valide']!=1) { |
$res .= '<span class="BAZ_rubrique BAZ_rubrique_'.$GLOBALS['_BAZAR_']['class'].'">'.BAZ_PUBLIEE.':</span> '.BAZ_NON.'<br />'."\n"; |
} |
//affichage des infos et du lien pour la mise a jour de la fiche |
if ( $est_admin || $GLOBALS['_BAZAR_']['annonceur']==$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID) ) { |
$res .= '<span class="BAZ_rubrique BAZ_rubrique_'.$GLOBALS['_BAZAR_']['class'].'" id="date_creation">'.BAZ_DATE_CREATION.'</span> '.strftime('%d.%m.%Y %H:%M',strtotime($ligne['bf_date_creation_fiche']))."\n"; |
$res .= '<span class="BAZ_rubrique BAZ_rubrique_'.$GLOBALS['_BAZAR_']['class'].'" id="date_mise_a_jour">'.BAZ_DATE_MAJ.'</span> '.strftime('%d.%m.%Y %H:%M',strtotime($ligne['bf_date_maj_fiche']))."\n"; |
} |
$res .= '</div>'."\n"; |
if ( $est_admin || $GLOBALS['_BAZAR_']['annonceur']==$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID) ) { |
$res .='<div class="BAZ_actions_fiche BAZ_actions_fiche_'.$GLOBALS['_BAZAR_']['class'].'">'."\n"; |
if ( $est_admin ) { |
$res .= ' <strong>'.BAZ_VALIDER_PUBLICATION.' : </strong>'."\n"; |
$res .= '<ul>'."\n"; |
$lien_publie = &$GLOBALS['_BAZAR_']['url']; |
$lien_publie->addQueryString('action', BAZ_VOIR_FICHE); |
$lien_publie->addQueryString('id_fiche', $GLOBALS['_BAZAR_']['id_fiche']); |
$lien_publie->addQueryString('typeannonce', $ligne['bf_ce_nature']); |
$lien_publie->addQueryString('publiee', 1); |
$res .= '<a href="'.$lien_publie->getURL().'">'.BAZ_OUI.'</a> / '; |
if ($GLOBALS['_BAZAR_']['fiche_valide']==0||$GLOBALS['_BAZAR_']['fiche_valide']==2) { |
$lien_publie->addQueryString('publiee', 1); |
$label_publie=BAZ_VALIDER_LA_FICHE; |
$class_publie='_valider'; |
} elseif ($GLOBALS['_BAZAR_']['fiche_valide']==1) { |
$lien_publie->addQueryString('publiee', 0); |
$label_publie=BAZ_INVALIDER_LA_FICHE; |
$class_publie='_invalider'; |
} |
$res .= '<li class="BAZ_liste'.$class_publie.'"><a href="'.$lien_publie->getURL().'">'.$label_publie.'</a></li>'."\n"; |
$lien_publie->removeQueryString('publiee'); |
$lien_publie->addQueryString('publiee', 0); |
$res .='<a href="'.$lien_publie->getURL().'">'.BAZ_NON.'</a>'."\n"; |
$lien_publie->removeQueryString('publiee'); |
} |
$res .= '<br />'."\n"; |
} |
//affichage des infos pouvant interesser les admins |
if ( $est_admin ) { |
$res .= '<span class="rubrique" id="numero_fiche">'.BAZ_NUM_FICHE.':</span> '.$GLOBALS['_BAZAR_']['id_fiche'].'<br />'."\n"; |
$res .= '<span class="rubrique" id="date_creation">'.BAZ_DATE_CREATION.' :</span> '.strftime('%d.%m.%Y à %H:%M',strtotime($ligne['bf_date_creation_fiche'])).'<br />'."\n"; |
} |
//affichage des infos et du lien pour la mise a jour de la fiche |
if ( $est_admin || $GLOBALS['_BAZAR_']['annonceur']==$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID) ) { |
$res .= '<span class="rubrique" id="date_mise_a_jour">'.BAZ_DATE_MAJ.' :</span> '.strftime('%d.%m.%Y à %H:%M',strtotime($ligne['bf_date_maj_fiche']))."\n"; |
$lien_modifier=$GLOBALS['_BAZAR_']['url']; |
$lien_modifier->addQueryString('action', BAZ_ACTION_MODIFIER); |
$lien_modifier->addQueryString('id_fiche', $GLOBALS['_BAZAR_']['id_fiche']); |
$lien_modifier->addQueryString('typeannonce', $ligne['bf_ce_nature']); |
$res .= ' <a href="'.$lien_modifier->getURL().'" id="modifier_fiche">'.BAZ_MODIFIER_LA_FICHE.'</a>'."\n"; |
$res .= '<li class="BAZ_liste_modifier"><a href="'.$lien_modifier->getURL().'" id="modifier_fiche">'.BAZ_MODIFIER_LA_FICHE.'</a></li>'."\n"; |
$lien_supprimer=$GLOBALS['_BAZAR_']['url']; |
$lien_supprimer->addQueryString('action', BAZ_ACTION_SUPPRESSION); |
$lien_supprimer->addQueryString('id_fiche', $GLOBALS['_BAZAR_']['id_fiche']); |
$lien_supprimer->addQueryString('typeannonce', $ligne['bf_ce_nature']); |
$res .= '<li class="BAZ_liste_supprimer"><a href="'.$lien_supprimer->getURL().'" id="supprimer_fiche">'.BAZ_SUPPRIMER_LA_FICHE.'</a></li>'."\n"; |
$res .= '</ul>'."\n"; |
$res .= '</div>'."\n"; |
} |
} |
|
$res .= '</div>'."\n"; |
} |
$res .= '</div>'."\n"; |
|
//on ajoute les appropriations, s'il le faut |
if (($danslappli==1)and($GLOBALS['_BAZAR_']['appropriation']==1)) { |
$res .= '<br />'."\n".'<div class="BAZ_cadre_fiche">'."\n"; |
$res .= '<h3>'.BAZ_LES_STRUCTURES_POSSEDANT_UNE_RESSOURCE.'</h3>'."\n"; |
$res .= '<br />'."\n".'<div class="BAZ_cadre_fiche BAZ_cadre_fiche_'.$GLOBALS['_BAZAR_']['class'].'">'."\n"; |
$res .= '<h2 class="BAZ_titre BAZ_titre_'.$GLOBALS['_BAZAR_']['class'].'">'.BAZ_LES_STRUCTURES_POSSEDANT_UNE_RESSOURCE.'</h2>'."\n"; |
$requete = 'SELECT '.BAZ_CHAMPS_ID.', '.BAZ_CHAMPS_NOM.' FROM bazar_appropriation,'.BAZ_ANNUAIRE.' WHERE ba_ce_id_fiche='.$GLOBALS['_BAZAR_']['id_fiche'].' AND ba_ce_id_structure='.BAZ_CHAMPS_ID.' ORDER BY '.BAZ_CHAMPS_NOM.' ASC'; |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ; |
if (DB::isError ($resultat)) { |
380,7 → 389,7 |
$res .= '</ul><br />'."\n"; |
} |
else $res .= BAZ_PAS_D_APPROPRIATION.'<br /><br />'."\n"; |
$res .='<p class="bulle_corps">'."\n"; |
$res .='<p class="BAZ_bulle_corps BAZ_bulle_corps_'.$GLOBALS['_BAZAR_']['class'].'">'."\n"; |
$lien_appropriation = $GLOBALS['_BAZAR_']['url']; |
$lien_appropriation->addQueryString('action', BAZ_VOIR_FICHE); |
$lien_appropriation->addQueryString('id_fiche', $GLOBALS['_BAZAR_']['id_fiche']); |
406,8 → 415,8 |
|
//on ajoute les commentaires, s'il le faut |
if (($danslappli==1)and($GLOBALS['_BAZAR_']['commentaire']==1)) { |
$res .= '<br />'."\n".'<div class="BAZ_cadre_fiche">'."\n"; |
$res .= '<h3>'.BAZ_LES_COMMENTAIRES.'</h3>'."\n"; |
$res .= '<br />'."\n".'<div class="BAZ_cadre_fiche BAZ_cadre_fiche_'.$GLOBALS['_BAZAR_']['class'].'">'."\n"; |
$res .= '<h2 class="BAZ_titre BAZ_titre_'.$GLOBALS['_BAZAR_']['class'].'">'.BAZ_LES_COMMENTAIRES.'</h2>'."\n"; |
$requete = 'SELECT * FROM bazar_commentaires WHERE bc_ce_id_fiche='.$GLOBALS['_BAZAR_']['id_fiche'].' ORDER BY bc_date ASC'; |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ; |
if (DB::isError ($resultat)) { |
418,13 → 427,10 |
if ($resultat->numRows()==1) $res .= BAZ_COMMENTAIRE.'<br />'."\n"; |
else $res .= BAZ_COMMENTAIRES.'<br />'."\n"; |
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) { |
$res .= '<div class="bulle_haut"> </div>'."\n"; |
$res .= '<div class="bulle_corps">'."\n"; |
$res .= '<div class="BAZ_bulle_corps BAZ_bulle_corps_'.$GLOBALS['_BAZAR_']['class'].'">'."\n"; |
//affichage du commentaire |
$res .= $ligne['bc_commentaire'].'<br />'."\n"; |
$res .= '</div>'."\n"; |
$res .= '<div class="bulle_bas">'."\n"; |
$res .= '<div style="font-size:9px;margin-left:10px;">'.BAZ_PAR.' : <strong>'.$ligne['bc_nom'].'</strong>'.BAZ_ECRIT_LE.$ligne['bc_date'].'</div>'."\n"; |
$res .= '<div class="BAZ_commentaire_admin">'.BAZ_PAR.' : <strong>'.$ligne['bc_nom'].'</strong>'.BAZ_ECRIT_LE.strftime('%d.%m.%Y %H:%M',strtotime($ligne['bc_date'])); |
//pour les identifies seulement, administrateurs de la rubrique ou superadmins |
if ($est_admin==1) { |
$url_comment= $GLOBALS['_BAZAR_']['url']; |
431,9 → 437,10 |
$url_comment->addQueryString('action', BAZ_VOIR_FICHE); |
$url_comment->addQueryString('id_fiche', $GLOBALS['_BAZAR_']['id_fiche']); |
$url_comment->addQueryString('id_commentaire', $ligne['bc_id_commentaire']); |
$res .= '<a href="'.$url_comment->getURL().'" style="font-size:9px;float:right;">'.BAZ_SUPPRIMER.'</a>'."\n"; |
$res .= ' <a href="'.$url_comment->getURL().'">'.BAZ_SUPPRIMER.'</a>'."\n"; |
} |
$res .= '</div>'."\n"; |
$res .= '</div>'."\n"; |
} |
} |
else $res .= BAZ_PAS_DE_COMMENTAIRES.'<br /><br />'."\n"; |
762,7 → 769,7 |
if (DB::isError($resultat)) { |
die ($resultat->getMessage().$resultat->getDebugInfo()) ; |
} |
//on récupère le nb de types de fiches, pour plus tard |
//on recupere le nb de types de fiches, pour plus tard |
$nb_type_de_fiches=$resultat->numRows(); |
$type_annonce_select['toutes']=BAZ_TOUS_TYPES_FICHES; |
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) { |
779,7 → 786,7 |
$formtemplate->setDefaults($defauts); |
} |
} |
//cas du type d'annonces prédéfini |
//cas du type d'annonces predefini |
else { |
if ($nb_type_de_fiches==1) { |
$GLOBALS['_BAZAR_']['typeannonce']=end($type_annonce_select); |
789,9 → 796,9 |
} |
|
//requete pour obtenir l'id, le nom et prenom de toutes les personnes ayant depose une fiche |
// dans le but de construire l'élément de formulaire select avec les noms des émetteurs de fiche |
// dans le but de construire l'element de formulaire select avec les noms des emetteurs de fiche |
if (BAZ_RECHERCHE_PAR_EMETTEUR) { |
$requete = 'SELECT '.BAZ_CHAMPS_ID.', '.BAZ_CHAMPS_NOM.', '.BAZ_CHAMPS_PRENOM.' '. |
$requete = 'SELECT DISTINCT '.BAZ_CHAMPS_ID.', '.BAZ_CHAMPS_NOM.', '.BAZ_CHAMPS_PRENOM.' '. |
'FROM bazar_fiche,'.BAZ_ANNUAIRE.' WHERE ' ; |
|
$requete .= ' bf_date_debut_validite_fiche<=NOW() AND bf_date_fin_validite_fiche>=NOW() and'; |
823,7 → 830,7 |
$formtemplate->addElement ('hidden', 'personnes', 'tous') ; |
} |
|
//pour les super-administrateurs, on peut voir les annonces non validées |
//pour les super-administrateurs, on peut voir les annonces non validees |
//on verifie si l'utilisateur est administrateur |
$utilisateur = new Administrateur_bazar($GLOBALS['AUTH']) ; |
|
902,7 → 909,7 |
$case_coche = false ; |
$nb_jointures=0; |
$requeteFrom = '' ; |
$requeteWhere = ' bn_ce_id_menu IN ('.$GLOBALS['_BAZAR_']['categorie_nature'].') AND bn_id_nature=bf_ce_nature AND ' ; |
$requeteWhere = ' bn_ce_id_menu IN ('.$GLOBALS['_BAZAR_']['categorie_nature'].') AND bn_id_nature='.$GLOBALS['_BAZAR_']['id_typeannonce'].' AND bn_id_nature=bf_ce_nature AND ' ; |
$requeteWhereListe = '' ; |
|
if ( isset($tableau) ) { |
993,8 → 1000,8 |
if (isset($_REQUEST['valides'])) {$valides=$_REQUEST['valides'];} |
else {$valides=1;} |
//generation de la liste de flux a afficher |
if (!isset($_REQUEST['personne'])) $_REQUEST['personne']='tous'; |
$res .= baz_liste_pagine_HTML($typedefiches, '', $_REQUEST['personne'], $valides, $requeteSQL, $requeteFrom, $requeteWhere); |
if (!isset($_REQUEST['personnes'])) $_REQUEST['personnes']='tous'; |
$res .= baz_liste_pagine_HTML($typedefiches, '', $_REQUEST['personnes'], $valides, $requeteSQL, $requeteFrom, $requeteWhere); |
} |
|
// Nettoyage de l'url |
1037,15 → 1044,6 |
if ($req_where==1) {$requete .= ' AND ';} |
$requete .= 'bf_ce_utilisateur='.$emetteur; |
$req_where=1; |
//requete pour afficher le nom de la structure |
$requetenom = 'SELECT '.BAZ_CHAMPS_NOM.', '.BAZ_CHAMPS_PRENOM.' FROM '. |
BAZ_ANNUAIRE.' WHERE '.BAZ_CHAMPS_ID.'='.$emetteur; |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requetenom) ; |
if (DB::isError($resultat)) { |
die ($resultat->getMessage().$resultat->getDebugInfo()) ; |
} |
$ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC); |
$nomflux .= ' ('.$ligne[BAZ_CHAMPS_NOM].' '.$ligne[BAZ_CHAMPS_PRENOM].')'; |
} |
if ($requeteSQL!='') { |
if ($req_where==1) {$requete .= ' AND ';} |
1054,12 → 1052,12 |
} |
$requete .= ' ORDER BY bf_date_debut_validite_fiche DESC, bf_date_fin_validite_fiche DESC, bf_date_maj_fiche DESC'; |
if ($nbitem!='') {$requete .= ' LIMIT 0,'.$nbitem;} |
|
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ; |
if (DB::isError($resultat)) { |
return $resultat->getMessage().'<br /><br />'.$resultat->getDebugInfo() ; |
} |
$res = '<br /><h4>'.BAZ_IL_Y_A.($resultat->numRows()).' '.BAZ_FICHES_CORRESPONDANTES.'</h4><br />'."\n"; |
//$res .= 'requete: '. $requete. '<br />'; |
$res .= '<ul>' ; |
$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_VOIR_FICHE); |
|
1099,20 → 1097,22 |
} else { |
$res .= '<div class="bazar_numero">'.$pager->links.'</div>'."\n"; |
foreach ($data as $valeur) { |
$res .='<li class="BAZ_'.$valeur['bn_label_class'].'">'."\n"; |
$GLOBALS['_BAZAR_']['url']->addQueryString('id_fiche', $valeur['bf_id_fiche']) ; |
$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_VOIR_FICHE) ; |
$res .='<li><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.$valeur['bf_titre'].'</a>'."\n"; |
if ($utilisateur->isSuperAdmin() || $GLOBALS['id_user']==$valeur['bf_ce_utilisateur']) { |
$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_ACTION_MODIFIER); |
$GLOBALS['_BAZAR_']['url']->addQueryString('typeannonce', $GLOBALS['_BAZAR_']['id_typeannonce']); |
$GLOBALS['_BAZAR_']['url']->removeQueryString('personnes'); |
$GLOBALS['_BAZAR_']['url']->removeQueryString('recherche_effectuee'); |
$res .= '<a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">('.BAZ_MODIFIER.')</a> '; |
$res .= '<a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">('.BAZ_MODIFIER.')</a> '."\n"; |
$GLOBALS['_BAZAR_']['url']->removeQueryString('action'); |
$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_ACTION_SUPPRESSION); |
$res .='<a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'" onclick="javascript:return confirm(\''.BAZ_SUPPRIMER.'\');">('.BAZ_SUPPRIMER.')</a>'; |
$res .='<a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'" onclick="javascript:return confirm(\''.BAZ_SUPPRIMER.'\');">('.BAZ_SUPPRIMER.')</a> '."\n"; |
$GLOBALS['_BAZAR_']['url']->removeQueryString('action'); |
} |
$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_VOIR_FICHE) ; |
$res .= '<a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.$valeur['bf_titre'].'</a>'."\n"; |
$res .='</li>'."\n"; |
} |
$res .= '</ul>'."\n".'<div class="bazar_numero">'.$pager->links.'</div>'."\n"; |
} |
1130,6 → 1130,9 |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: not supported by cvs2svn $ |
* Revision 1.74 2007/03/28 15:54:32 florian |
* correction de bugs |
* |
* Revision 1.73 2007/03/28 10:01:47 florian |
* ajout de la constante BAZ_UTILISE_TEMPLATE, pour utiliser ou non les templates pour l'affichage du moteur de recherche |
* |