Line 17... |
Line 17... |
17 |
// | |
|
17 |
// | |
|
18 |
// | You should have received a copy of the GNU Lesser General Public |
|
18 |
// | You should have received a copy of the GNU Lesser General Public |
|
19 |
// | License along with this library; if not, write to the Free Software |
|
19 |
// | License along with this library; if not, write to the Free Software |
|
20 |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
20 |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
21 |
// +------------------------------------------------------------------------------------------------------+
|
21 |
// +------------------------------------------------------------------------------------------------------+
|
22 |
// CVS : $Id: bazar.fonct.rss.php,v 1.100 2007-11-30 14:17:31 jp_milcent Exp $
|
22 |
// CVS : $Id: bazar.fonct.rss.php,v 1.101 2007-12-03 15:18:44 jp_milcent Exp $
|
23 |
/**
|
23 |
/**
|
24 |
*
|
24 |
*
|
25 |
*@package bazar
|
25 |
*@package bazar
|
26 |
//Auteur original :
|
26 |
//Auteur original :
|
27 |
*@author Alexandre GRANIER <alexandre@tela-botanica.org>
|
27 |
*@author Alexandre GRANIER <alexandre@tela-botanica.org>
|
28 |
*@author Florian Schmitt <florian@ecole-et-nature.org>
|
28 |
*@author Florian Schmitt <florian@ecole-et-nature.org>
|
29 |
//Autres auteurs :
|
29 |
//Autres auteurs :
|
30 |
*@copyright Tela-Botanica 2000-2006
|
30 |
*@copyright Tela-Botanica 2000-2006
|
31 |
*@version $Revision: 1.100 $
|
31 |
*@version $Revision: 1.101 $
|
32 |
// +------------------------------------------------------------------------------------------------------+
|
32 |
// +------------------------------------------------------------------------------------------------------+
|
33 |
*/
|
33 |
*/
|
Line 34... |
Line 34... |
34 |
|
34 |
|
35 |
// +------------------------------------------------------------------------------------------------------+
|
35 |
// +------------------------------------------------------------------------------------------------------+
|
Line 160... |
Line 160... |
160 |
$requete = 'UPDATE bazar_fiche SET bf_nb_consultations=bf_nb_consultations+1 WHERE bf_id_fiche='.$GLOBALS['_BAZAR_']['id_fiche'];
|
160 |
$requete = 'UPDATE bazar_fiche SET bf_nb_consultations=bf_nb_consultations+1 WHERE bf_id_fiche='.$GLOBALS['_BAZAR_']['id_fiche'];
|
161 |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
|
161 |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
|
162 |
}
|
162 |
}
|
163 |
}
|
163 |
}
|
164 |
}
|
164 |
}
|
165 |
$requete = 'SELECT *,bn_label_nature FROM bazar_fiche,bazar_nature WHERE bf_ce_nature=bn_id_nature and bf_id_fiche='.$GLOBALS['_BAZAR_']['id_fiche'];
|
165 |
$requete = 'SELECT * FROM bazar_fiche,bazar_nature WHERE bf_ce_nature=bn_id_nature and bf_id_fiche='.$GLOBALS['_BAZAR_']['id_fiche'];
|
- |
|
166 |
|
166 |
if (isset($GLOBALS['_BAZAR_']['langue'])) $requete .= ' and bn_ce_i18n like "'.$GLOBALS['_BAZAR_']['langue'].'"';
|
167 |
if (isset($GLOBALS['_BAZAR_']['langue'])) $requete .= ' and bn_ce_i18n like "'.$GLOBALS['_BAZAR_']['langue'].'"';
|
167 |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
|
168 |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
|
168 |
(DB::isError($resultat)) ? die (BOG_afficherErreurSql(__FILE__, __LINE__, $resultat->getMessage(), $requete))
|
169 |
(DB::isError($resultat)) ? die (BOG_afficherErreurSql(__FILE__, __LINE__, $resultat->getMessage(), $requete))
|
169 |
: '';
|
170 |
: '';
|
Line 176... |
Line 177... |
176 |
|
177 |
|
177 |
// Si on vient de l applette calendrier, $GLOBALS['_BAZAR_']['id_typeannonce'] est vide ...
|
178 |
// Si on vient de l applette calendrier, $GLOBALS['_BAZAR_']['id_typeannonce'] est vide ...
|
178 |
// mais on dispose de la constante BAZ_NUM_ANNONCE_CALENDRIER
|
179 |
// mais on dispose de la constante BAZ_NUM_ANNONCE_CALENDRIER
|
Line 179... |
Line -... |
179 |
if (!isset($GLOBALS['_BAZAR_']['id_typeannonce']) && defined('BAZ_NUM_ANNONCE_CALENDRIER')) $GLOBALS['_BAZAR_']['id_typeannonce'] = BAZ_NUM_ANNONCE_CALENDRIER;
|
- |
|
180 |
|
- |
|
181 |
$requete='SELECT bn_id_nature, bn_template, bn_commentaire, bn_label_class,bn_label_nature FROM bazar_nature where 1';
|
- |
|
182 |
if ($GLOBALS['_BAZAR_']['id_typeannonce'] != 'toutes') $requete .= ' and bn_id_nature in ('.$GLOBALS['_BAZAR_']['id_typeannonce'].')';
|
- |
|
183 |
if (isset($GLOBALS['_BAZAR_']['langue'])) $requete .= ' and bn_ce_i18n like "'.$GLOBALS['_BAZAR_']['langue'].'"';
|
- |
|
184 |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
|
- |
|
185 |
if (DB::isError($resultat)) {
|
- |
|
186 |
return ($resultat->getMessage().$resultat->getDebugInfo()) ;
|
- |
|
187 |
}
|
- |
|
188 |
$result = $resultat->fetchRow(DB_FETCHMODE_ASSOC);
|
180 |
if (!isset($GLOBALS['_BAZAR_']['id_typeannonce']) && defined('BAZ_NUM_ANNONCE_CALENDRIER')) $GLOBALS['_BAZAR_']['id_typeannonce'] = BAZ_NUM_ANNONCE_CALENDRIER;
|
189 |
$id_nature = $result['bn_id_nature'];
|
181 |
|
190 |
if (!isset($GLOBALS['_BAZAR_']['template'])) $GLOBALS['_BAZAR_']['template'] = $result['bn_template'];
|
182 |
if (!isset($GLOBALS['_BAZAR_']['template'])) $GLOBALS['_BAZAR_']['template'] = $ligne['bn_template'];
|
Line 191... |
Line 183... |
191 |
if (!isset($GLOBALS['_BAZAR_']['commentaire'])) $GLOBALS['_BAZAR_']['commentaire'] = $result['bn_commentaire'];
|
183 |
if (!isset($GLOBALS['_BAZAR_']['commentaire'])) $GLOBALS['_BAZAR_']['commentaire'] = $ligne['bn_commentaire'];
|
192 |
if (!isset($GLOBALS['_BAZAR_']['class'])) $GLOBALS['_BAZAR_']['class'] = $result['bn_label_class'];
|
184 |
if (!isset($GLOBALS['_BAZAR_']['class'])) $GLOBALS['_BAZAR_']['class'] = $ligne['bn_label_class'];
|
193 |
|
185 |
|
194 |
$utilisateur = new Administrateur_bazar ($GLOBALS['AUTH']);
|
186 |
$utilisateur = new Administrateur_bazar ($GLOBALS['AUTH']);
|
Line 195... |
Line 187... |
195 |
if ($utilisateur->isAdmin($result['bn_id_nature']) || $utilisateur->isSuperAdmin()) {
|
187 |
if ($utilisateur->isAdmin($ligne['bn_id_nature']) || $utilisateur->isSuperAdmin()) {
|
196 |
$est_admin=1;
|
188 |
$est_admin=1;
|
197 |
}
|
189 |
}
|
198 |
|
190 |
|
199 |
//debut de la fiche
|
191 |
//debut de la fiche
|
200 |
$res .= '<div class="BAZ_cadre_fiche BAZ_cadre_fiche_'.$GLOBALS['_BAZAR_']['class'].'">'."\n";
|
192 |
$res .= '<div class="BAZ_cadre_fiche BAZ_cadre_fiche_'.$GLOBALS['_BAZAR_']['class'].'">'."\n";
|
201 |
//affiche le titre sous forme d'image
|
193 |
//affiche le titre sous forme d'image
|
202 |
if (isset ($GLOBALS['_BAZAR_']['image_titre']) && $GLOBALS['_BAZAR_']['image_titre']!='') {
|
194 |
if (isset ($GLOBALS['_BAZAR_']['image_titre']) && $GLOBALS['_BAZAR_']['image_titre']!='') {
|
203 |
$res .= '<img class="BAZ_img_titre" src="client/bazar/images/'.$GLOBALS['_BAZAR_']['image_titre'].'" alt="'.$result['bn_label_nature'].'" />'.'<br />'."\n";
|
195 |
$res .= '<img class="BAZ_img_titre" src="client/bazar/images/'.$GLOBALS['_BAZAR_']['image_titre'].'" alt="'.$ligne['bn_label_nature'].'" />'.'<br />'."\n";
|
204 |
}
|
196 |
}
|
205 |
//affiche le texte sinon
|
197 |
//affiche le texte sinon
|
206 |
else {
|
198 |
else {
|
207 |
$res .= '<h2 class="BAZ_titre BAZ_titre_'.$GLOBALS['_BAZAR_']['class'].'">'.$result['bn_label_nature'].'</h2>'."\n";
|
199 |
$res .= '<h2 class="BAZ_titre BAZ_titre_'.$GLOBALS['_BAZAR_']['class'].'">'.$ligne['bn_label_nature'].'</h2>'."\n";
|
208 |
}
|
200 |
}
|
Line 402... |
Line 394... |
402 |
}
|
394 |
}
|
403 |
$res .= '</div>'."\n";
|
395 |
$res .= '</div>'."\n";
|
404 |
$res .= '</div>'."\n";
|
396 |
$res .= '</div>'."\n";
|
405 |
}
|
397 |
}
|
Line 406... |
Line 398... |
406 |
|
398 |
|
- |
|
399 |
// Nous vérifions comment est appelé la fonction
|
407 |
// ATTENTION : vérifier que le div ci-dessous est bien inutile dans tous les cas! Il n'y a pas dans cette fonction de div ouvrant correspondant.
|
400 |
if ($danslappli == 0) {
|
- |
|
401 |
$res .= '</div>'."\n";
|
408 |
// $res .= '</div>'."\n";
|
402 |
} else if ($danslappli == 1 ) {
|
409 |
|
403 |
|
410 |
//on ajoute les appropriations, s'il le faut
|
404 |
// Ajout des appropriations, s'il le faut
|
411 |
if (($danslappli==1)and($GLOBALS['_BAZAR_']['appropriation']==1)) {
|
405 |
if ($GLOBALS['_BAZAR_']['appropriation'] == 1) {
|
412 |
$res .= '<br />'."\n".'<div class="BAZ_cadre_fiche BAZ_cadre_fiche_'.$GLOBALS['_BAZAR_']['class'].'">'."\n";
|
406 |
$res .= '<br />'."\n".'<div class="BAZ_cadre_fiche BAZ_cadre_fiche_'.$GLOBALS['_BAZAR_']['class'].'">'."\n";
|
413 |
$res .= '<h2 class="BAZ_titre BAZ_titre_'.$GLOBALS['_BAZAR_']['class'].'">'.BAZ_LES_STRUCTURES_POSSEDANT_UNE_RESSOURCE.'</h2>'."\n";
|
407 |
$res .= '<h2 class="BAZ_titre BAZ_titre_'.$GLOBALS['_BAZAR_']['class'].'">'.BAZ_LES_STRUCTURES_POSSEDANT_UNE_RESSOURCE.'</h2>'."\n";
|
414 |
$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';
|
408 |
$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';
|
415 |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
|
409 |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
|
416 |
if (DB::isError ($resultat)) {
|
410 |
if (DB::isError ($resultat)) {
|
417 |
die ($resultat->getMessage().'<br />'.$resultat->getDebugInfo()) ;
|
411 |
return $resultat->getMessage().'<br />'.$resultat->getDebugInfo();
|
418 |
}
|
412 |
}
|
419 |
$possede_ressource=0;
|
413 |
$possede_ressource=0;
|
420 |
if ($resultat->numRows()>0) {
|
414 |
if ($resultat->numRows()>0) {
|
421 |
$res .= BAZ_IL_Y_A.$resultat->numRows().' ';
|
415 |
$res .= BAZ_IL_Y_A.$resultat->numRows().' ';
|
422 |
if ($resultat->numRows()==1) $res .= BAZ_STRUCTURE_POSSEDANT.'<br />'."\n";
|
416 |
if ($resultat->numRows()==1) $res .= BAZ_STRUCTURE_POSSEDANT.'<br />'."\n";
|
423 |
else $res .= BAZ_STRUCTURES_POSSEDANT.'<br />'."\n";
|
417 |
else $res .= BAZ_STRUCTURES_POSSEDANT.'<br />'."\n";
|
424 |
$res .= '<ul>'."\n";
|
418 |
$res .= '<ul>'."\n";
|
425 |
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
|
419 |
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
|
426 |
$res .= '<li><a href="'.BAZ_URL_ANNUAIRE.'&voir_fiche='.$ligne[BAZ_CHAMPS_ID].'" onclick="javascript:window.open(this.href);return false;">'.$ligne[BAZ_CHAMPS_NOM].'</a></li>'."\n";
|
420 |
$res .= '<li><a href="'.BAZ_URL_ANNUAIRE.'&voir_fiche='.$ligne[BAZ_CHAMPS_ID].'" onclick="javascript:window.open(this.href);return false;">'.$ligne[BAZ_CHAMPS_NOM].'</a></li>'."\n";
|
427 |
if ($GLOBALS['AUTH']->getAuth() && $GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID)==$ligne[BAZ_CHAMPS_ID]) $possede_ressource=1;
|
- |
|
428 |
}
|
- |
|
429 |
$res .= '</ul><br />'."\n";
|
- |
|
430 |
}
|
- |
|
431 |
else $res .= BAZ_PAS_D_APPROPRIATION.'<br /><br />'."\n";
|
- |
|
432 |
$res .='<p class="BAZ_bulle_corps BAZ_bulle_corps_'.$GLOBALS['_BAZAR_']['class'].'">'."\n";
|
- |
|
433 |
$lien_appropriation = $GLOBALS['_BAZAR_']['url'];
|
- |
|
434 |
$lien_appropriation->addQueryString('action', BAZ_VOIR_FICHE);
|
- |
|
435 |
$lien_appropriation->addQueryString('id_fiche', $GLOBALS['_BAZAR_']['id_fiche']);
|
- |
|
436 |
if ($possede_ressource) {
|
- |
|
437 |
$lien_appropriation->addQueryString('appropriation', 0);
|
- |
|
438 |
$res .= BAZ_POSSEDE_DEJA_RESSOURCE.'<br />'."\n".'<a href="'.$lien_appropriation->getURL().'">'.BAZ_CLIQUER_POUR_VOUS_ENLEVER.'</a>'."\n";
|
- |
|
439 |
$lien_appropriation->removeQueryString('appropriation');
|
- |
|
440 |
}
|
- |
|
441 |
elseif ($GLOBALS['AUTH']->getAuth() && $GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_EST_STRUCTURE)) {
|
- |
|
442 |
$lien_appropriation->addQueryString('appropriation', 1);
|
- |
|
443 |
$res .= BAZ_SI_POSSEDE_RESSOURCE.'<br />'."\n".'<a href="'.$lien_appropriation->getURL().'">'.BAZ_CLIQUER_POUR_APPARAITRE.'</a>'."\n";
|
- |
|
444 |
$lien_appropriation->removeQueryString('appropriation');
|
- |
|
445 |
}
|
- |
|
446 |
elseif ($GLOBALS['AUTH']->getAuth() && !$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_EST_STRUCTURE)) {
|
- |
|
447 |
$res .= BAZ_IL_FAUT_ETRE_STRUCTURE."\n";
|
- |
|
448 |
}
|
- |
|
449 |
elseif (!$GLOBALS['AUTH']->getAuth()) {
|
- |
|
450 |
$res .= BAZ_IL_FAUT_ETRE_IDENTIFIE_STRUCTURE."\n";
|
- |
|
451 |
}
|
- |
|
452 |
$res .='</p>'."\n";
|
- |
|
453 |
$res .= '</div>'."\n";
|
- |
|
454 |
}
|
- |
|
455 |
|
- |
|
456 |
//on ajoute les commentaires, s'il le faut
|
- |
|
457 |
if (($danslappli==1)and($GLOBALS['_BAZAR_']['commentaire']==1)) {
|
- |
|
458 |
$res .= '<br />'."\n".'<div class="BAZ_cadre_fiche BAZ_cadre_fiche_'.$GLOBALS['_BAZAR_']['class'].'">'."\n";
|
- |
|
459 |
$res .= '<h2 class="BAZ_titre BAZ_titre_'.$GLOBALS['_BAZAR_']['class'].'">'.BAZ_LES_COMMENTAIRES.'</h2>'."\n";
|
- |
|
460 |
$requete = 'SELECT * FROM bazar_commentaires WHERE bc_ce_id_fiche='.$GLOBALS['_BAZAR_']['id_fiche'].' ORDER BY bc_date ASC';
|
- |
|
461 |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
|
- |
|
462 |
if (DB::isError ($resultat)) {
|
- |
|
463 |
die ($resultat->getMessage().'<br />'.$resultat->getDebugInfo()) ;
|
- |
|
464 |
}
|
- |
|
465 |
if ($resultat->numRows()>0) {
|
- |
|
466 |
$res .= BAZ_IL_Y_A.$resultat->numRows().' ';
|
- |
|
467 |
if ($resultat->numRows()==1) $res .= BAZ_COMMENTAIRE.'<br />'."\n";
|
- |
|
468 |
else $res .= BAZ_COMMENTAIRES.'<br />'."\n";
|
- |
|
469 |
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
|
- |
|
470 |
$res .= '<div class="BAZ_bulle_corps BAZ_bulle_corps_'.$GLOBALS['_BAZAR_']['class'].'">'."\n";
|
- |
|
471 |
//affichage du commentaire
|
- |
|
472 |
$res .= $ligne['bc_commentaire'].'<br />'."\n";
|
- |
|
473 |
$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']));
|
- |
|
474 |
//pour les identifies seulement, administrateurs de la rubrique ou superadmins
|
- |
|
475 |
if ($est_admin==1) {
|
- |
|
476 |
$url_comment= $GLOBALS['_BAZAR_']['url'];
|
- |
|
477 |
$url_comment->addQueryString('action', BAZ_VOIR_FICHE);
|
- |
|
478 |
$url_comment->addQueryString('id_fiche', $GLOBALS['_BAZAR_']['id_fiche']);
|
- |
|
479 |
$url_comment->addQueryString('id_commentaire', $ligne['bc_id_commentaire']);
|
- |
|
480 |
$res .= ' <a href="'.$url_comment->getURL().'">'.BAZ_SUPPRIMER.'</a>'."\n";
|
421 |
if ($GLOBALS['AUTH']->getAuth() && $GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID)==$ligne[BAZ_CHAMPS_ID]) $possede_ressource=1;
|
481 |
}
|
422 |
}
|
- |
|
423 |
$res .= '</ul><br />'."\n";
|
- |
|
424 |
}
|
- |
|
425 |
else $res .= BAZ_PAS_D_APPROPRIATION.'<br /><br />'."\n";
|
- |
|
426 |
$res .='<p class="BAZ_bulle_corps BAZ_bulle_corps_'.$GLOBALS['_BAZAR_']['class'].'">'."\n";
|
- |
|
427 |
$lien_appropriation = $GLOBALS['_BAZAR_']['url'];
|
- |
|
428 |
$lien_appropriation->addQueryString('action', BAZ_VOIR_FICHE);
|
- |
|
429 |
$lien_appropriation->addQueryString('id_fiche', $GLOBALS['_BAZAR_']['id_fiche']);
|
- |
|
430 |
if ($possede_ressource) {
|
- |
|
431 |
$lien_appropriation->addQueryString('appropriation', 0);
|
- |
|
432 |
$res .= BAZ_POSSEDE_DEJA_RESSOURCE.'<br />'."\n".'<a href="'.$lien_appropriation->getURL().'">'.BAZ_CLIQUER_POUR_VOUS_ENLEVER.'</a>'."\n";
|
- |
|
433 |
$lien_appropriation->removeQueryString('appropriation');
|
- |
|
434 |
}
|
- |
|
435 |
elseif ($GLOBALS['AUTH']->getAuth() && $GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_EST_STRUCTURE)) {
|
- |
|
436 |
$lien_appropriation->addQueryString('appropriation', 1);
|
- |
|
437 |
$res .= BAZ_SI_POSSEDE_RESSOURCE.'<br />'."\n".'<a href="'.$lien_appropriation->getURL().'">'.BAZ_CLIQUER_POUR_APPARAITRE.'</a>'."\n";
|
- |
|
438 |
$lien_appropriation->removeQueryString('appropriation');
|
- |
|
439 |
}
|
482 |
$res .= '</div>'."\n";
|
440 |
elseif ($GLOBALS['AUTH']->getAuth() && !$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_EST_STRUCTURE)) {
|
483 |
$res .= '</div>'."\n";
|
441 |
$res .= BAZ_IL_FAUT_ETRE_STRUCTURE."\n";
|
- |
|
442 |
}
|
- |
|
443 |
elseif (!$GLOBALS['AUTH']->getAuth()) {
|
- |
|
444 |
$res .= BAZ_IL_FAUT_ETRE_IDENTIFIE_STRUCTURE."\n";
|
- |
|
445 |
}
|
- |
|
446 |
$res .='</p>'."\n";
|
484 |
}
|
447 |
$res .= '</div>'."\n";
|
485 |
}
|
- |
|
Line -... |
Line 448... |
- |
|
448 |
}
|
- |
|
449 |
|
- |
|
450 |
// Ajout des commentaires, s'il le faut
|
- |
|
451 |
if ($GLOBALS['_BAZAR_']['commentaire'] == 1) {
|
- |
|
452 |
$res .= '<br />'."\n".'<div class="BAZ_cadre_fiche BAZ_cadre_fiche_'.$GLOBALS['_BAZAR_']['class'].'">'."\n";
|
- |
|
453 |
$res .= '<h2 class="BAZ_titre BAZ_titre_'.$GLOBALS['_BAZAR_']['class'].'">'.BAZ_LES_COMMENTAIRES.'</h2>'."\n";
|
- |
|
454 |
$requete = 'SELECT * FROM bazar_commentaires WHERE bc_ce_id_fiche='.$GLOBALS['_BAZAR_']['id_fiche'].' ORDER BY bc_date ASC';
|
- |
|
455 |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
|
- |
|
456 |
if (DB::isError ($resultat)) {
|
- |
|
457 |
return $resultat->getMessage().'<br />'.$resultat->getDebugInfo();
|
- |
|
458 |
}
|
- |
|
459 |
if ($resultat->numRows()>0) {
|
- |
|
460 |
$res .= BAZ_IL_Y_A.$resultat->numRows().' ';
|
- |
|
461 |
if ($resultat->numRows()==1) $res .= BAZ_COMMENTAIRE.'<br />'."\n";
|
- |
|
462 |
else $res .= BAZ_COMMENTAIRES.'<br />'."\n";
|
- |
|
463 |
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
|
- |
|
464 |
$res .= '<div class="BAZ_bulle_corps BAZ_bulle_corps_'.$GLOBALS['_BAZAR_']['class'].'">'."\n";
|
- |
|
465 |
//affichage du commentaire
|
- |
|
466 |
$res .= $ligne['bc_commentaire'].'<br />'."\n";
|
- |
|
467 |
$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']));
|
- |
|
468 |
//pour les identifies seulement, administrateurs de la rubrique ou superadmins
|
- |
|
469 |
if ($est_admin==1) {
|
- |
|
470 |
$url_comment= $GLOBALS['_BAZAR_']['url'];
|
- |
|
471 |
$url_comment->addQueryString('action', BAZ_VOIR_FICHE);
|
- |
|
472 |
$url_comment->addQueryString('id_fiche', $GLOBALS['_BAZAR_']['id_fiche']);
|
- |
|
473 |
$url_comment->addQueryString('id_commentaire', $ligne['bc_id_commentaire']);
|
- |
|
474 |
$res .= ' <a href="'.$url_comment->getURL().'">'.BAZ_SUPPRIMER.'</a>'."\n";
|
- |
|
475 |
}
|
- |
|
476 |
$res .= '</div>'."\n";
|
- |
|
477 |
$res .= '</div>'."\n";
|
- |
|
478 |
}
|
- |
|
479 |
}
|
486 |
else $res .= BAZ_PAS_DE_COMMENTAIRES.'<br /><br />'."\n";
|
480 |
else $res .= BAZ_PAS_DE_COMMENTAIRES.'<br /><br />'."\n";
|
487 |
|
481 |
|
488 |
//formulaire des commentaires
|
482 |
//formulaire des commentaires
|
489 |
$form_commentaire = new HTML_QuickForm('bazar_commentaire', 'post', $url);
|
483 |
$form_commentaire = new HTML_QuickForm('bazar_commentaire', 'post', $url);
|
490 |
$squelette =& $form_commentaire->defaultRenderer();
|
484 |
$squelette =& $form_commentaire->defaultRenderer();
|
491 |
$squelette->setFormTemplate("\n".'<form {attributes}>'."\n".'{content}'."\n".'</form>'."\n");
|
485 |
$squelette->setFormTemplate("\n".'<form {attributes}>'."\n".'{content}'."\n".'</form>'."\n");
|
492 |
$squelette->setElementTemplate( '<label style="width:200px;">{label}'.
|
486 |
$squelette->setElementTemplate( '<label style="width:200px;">{label}'.
|
493 |
'<!-- BEGIN required --><span class="symbole_obligatoire"> *</span><!-- END required -->'."\n".
|
487 |
'<!-- BEGIN required --><span class="symbole_obligatoire"> *</span><!-- END required -->'."\n".
|
494 |
'</label><br />'."\n".'{element}<br />'."\n");
|
488 |
'</label><br />'."\n".'{element}<br />'."\n");
|
495 |
$squelette->setRequiredNoteTemplate("\n".'<span class="symbole_obligatoire"> *{requiredNote}</span>'."\n");
|
489 |
$squelette->setRequiredNoteTemplate("\n".'<span class="symbole_obligatoire"> *{requiredNote}</span>'."\n");
|
496 |
$option=array('style'=>'width:300px;border:1px solid #000;', 'maxlength'=>100);
|
490 |
$option=array('style'=>'width:300px;border:1px solid #000;', 'maxlength'=>100);
|
497 |
$form_commentaire->addElement('text', 'Nom', BAZ_ENTREZ_VOTRE_NOM, $option);
|
491 |
$form_commentaire->addElement('text', 'Nom', BAZ_ENTREZ_VOTRE_NOM, $option);
|
498 |
$option=array('style'=>'width:95%;height:100px;white-space: pre;padding:3px;border:1px solid #000;');
|
492 |
$option=array('style'=>'width:95%;height:100px;white-space: pre;padding:3px;border:1px solid #000;');
|
499 |
require_once PAP_CHEMIN_API_PEAR.'HTML/QuickForm/textarea.php';
|
493 |
require_once PAP_CHEMIN_API_PEAR.'HTML/QuickForm/textarea.php';
|
500 |
$formtexte= new HTML_QuickForm_textarea('Commentaire', BAZ_ENTREZ_VOTRE_COMMENTAIRE, $option);
|
494 |
$formtexte= new HTML_QuickForm_textarea('Commentaire', BAZ_ENTREZ_VOTRE_COMMENTAIRE, $option);
|
501 |
$form_commentaire->addElement($formtexte) ;
|
495 |
$form_commentaire->addElement($formtexte) ;
|
502 |
$option=array('style'=>'border:1px solid #000;');
|
496 |
$option=array('style'=>'border:1px solid #000;');
|
503 |
$form_commentaire->addElement('submit', 'Envoyer', BAZ_ENVOYER, $option);
|
497 |
$form_commentaire->addElement('submit', 'Envoyer', BAZ_ENVOYER, $option);
|
504 |
$form_commentaire->addRule('Nom', BAZ_NOM_REQUIS, 'required', '', 'client') ;
|
498 |
$form_commentaire->addRule('Nom', BAZ_NOM_REQUIS, 'required', '', 'client') ;
|
505 |
$form_commentaire->addRule('Commentaire', BAZ_COMMENTAIRE_REQUIS, 'required', '', 'client') ;
|
499 |
$form_commentaire->addRule('Commentaire', BAZ_COMMENTAIRE_REQUIS, 'required', '', 'client') ;
|
506 |
$form_commentaire->setRequiredNote(BAZ_CHAMPS_REQUIS) ;
|
500 |
$form_commentaire->setRequiredNote(BAZ_CHAMPS_REQUIS) ;
|
- |
|
501 |
$res .= $form_commentaire->toHTML();
|
507 |
$res .= $form_commentaire->toHTML();
|
502 |
$res .= '</div>'."\n";
|
Line 508... |
Line 503... |
508 |
$res .= '</div>'."\n";
|
503 |
}
|
509 |
}
|
504 |
}
|
510 |
|
505 |
|
Line 1247... |
Line 1242... |
1247 |
}
|
1242 |
}
|
Line 1248... |
Line 1243... |
1248 |
|
1243 |
|
1249 |
/* +--Fin du code ----------------------------------------------------------------------------------------+
|
1244 |
/* +--Fin du code ----------------------------------------------------------------------------------------+
|
1250 |
*
|
1245 |
*
|
- |
|
1246 |
* $Log: not supported by cvs2svn $
|
- |
|
1247 |
* Revision 1.99.2.3 2007-12-03 15:16:21 jp_milcent
|
- |
|
1248 |
* Correction problème de la div mystère!
|
- |
|
1249 |
*
|
- |
|
1250 |
* Revision 1.99.2.2 2007-11-30 15:02:50 alexandre_tb
|
- |
|
1251 |
* simplification du code et correction du bug (les fiches de la carto n affichent pas la bonne nature
|
- |
|
1252 |
*
|
- |
|
1253 |
* Revision 1.100 2007-11-30 14:17:31 jp_milcent
|
- |
|
1254 |
* Fusion avec la livraison AHA : 30 novembre 2007
|
1251 |
* $Log: not supported by cvs2svn $
|
1255 |
*
|
1252 |
* Revision 1.99.2.1 2007-11-30 14:14:36 jp_milcent
|
1256 |
* Revision 1.99.2.1 2007-11-30 14:14:36 jp_milcent
|
1253 |
* Ajout d'un décodage des apostrophes de type RIGHT SINGLE QUOTATION MARK.
|
1257 |
* Ajout d'un décodage des apostrophes de type RIGHT SINGLE QUOTATION MARK.
|
1254 |
*
|
1258 |
*
|
1255 |
* Revision 1.99 2007-11-05 10:17:19 alexandre_tb
|
1259 |
* Revision 1.99 2007-11-05 10:17:19 alexandre_tb
|