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.99.2.2 2007-11-30 15:02:50 alexandre_tb Exp $ |
// CVS : $Id: bazar.fonct.rss.php,v 1.99.2.3 2007-12-03 15:16:21 jp_milcent 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.99.2.2 $ |
*@version $Revision: 1.99.2.3 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
|
396,108 → 396,111 |
$res .= '</div>'."\n"; |
} |
|
// 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. |
// $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 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)) { |
die ($resultat->getMessage().'<br />'.$resultat->getDebugInfo()) ; |
// Nous vérifions comment est appelé la fonction |
if ($danslappli == 0) { |
$res .= '</div>'."\n"; |
} else if ($danslappli == 1 ) { |
|
// Ajout des appropriations, s'il le faut |
if ($GLOBALS['_BAZAR_']['appropriation'] == 1) { |
$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)) { |
return $resultat->getMessage().'<br />'.$resultat->getDebugInfo(); |
} |
$possede_ressource=0; |
if ($resultat->numRows()>0) { |
$res .= BAZ_IL_Y_A.$resultat->numRows().' '; |
if ($resultat->numRows()==1) $res .= BAZ_STRUCTURE_POSSEDANT.'<br />'."\n"; |
else $res .= BAZ_STRUCTURES_POSSEDANT.'<br />'."\n"; |
$res .= '<ul>'."\n"; |
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) { |
$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"; |
if ($GLOBALS['AUTH']->getAuth() && $GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID)==$ligne[BAZ_CHAMPS_ID]) $possede_ressource=1; |
} |
$res .= '</ul><br />'."\n"; |
} |
else $res .= BAZ_PAS_D_APPROPRIATION.'<br /><br />'."\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']); |
if ($possede_ressource) { |
$lien_appropriation->addQueryString('appropriation', 0); |
$res .= BAZ_POSSEDE_DEJA_RESSOURCE.'<br />'."\n".'<a href="'.$lien_appropriation->getURL().'">'.BAZ_CLIQUER_POUR_VOUS_ENLEVER.'</a>'."\n"; |
$lien_appropriation->removeQueryString('appropriation'); |
} |
elseif ($GLOBALS['AUTH']->getAuth() && $GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_EST_STRUCTURE)) { |
$lien_appropriation->addQueryString('appropriation', 1); |
$res .= BAZ_SI_POSSEDE_RESSOURCE.'<br />'."\n".'<a href="'.$lien_appropriation->getURL().'">'.BAZ_CLIQUER_POUR_APPARAITRE.'</a>'."\n"; |
$lien_appropriation->removeQueryString('appropriation'); |
} |
elseif ($GLOBALS['AUTH']->getAuth() && !$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_EST_STRUCTURE)) { |
$res .= BAZ_IL_FAUT_ETRE_STRUCTURE."\n"; |
} |
elseif (!$GLOBALS['AUTH']->getAuth()) { |
$res .= BAZ_IL_FAUT_ETRE_IDENTIFIE_STRUCTURE."\n"; |
} |
$res .='</p>'."\n"; |
$res .= '</div>'."\n"; |
} |
$possede_ressource=0; |
if ($resultat->numRows()>0) { |
$res .= BAZ_IL_Y_A.$resultat->numRows().' '; |
if ($resultat->numRows()==1) $res .= BAZ_STRUCTURE_POSSEDANT.'<br />'."\n"; |
else $res .= BAZ_STRUCTURES_POSSEDANT.'<br />'."\n"; |
$res .= '<ul>'."\n"; |
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) { |
$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"; |
if ($GLOBALS['AUTH']->getAuth() && $GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID)==$ligne[BAZ_CHAMPS_ID]) $possede_ressource=1; |
|
// Ajout des commentaires, s'il le faut |
if ($GLOBALS['_BAZAR_']['commentaire'] == 1) { |
$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)) { |
return $resultat->getMessage().'<br />'.$resultat->getDebugInfo(); |
} |
$res .= '</ul><br />'."\n"; |
} |
else $res .= BAZ_PAS_D_APPROPRIATION.'<br /><br />'."\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']); |
if ($possede_ressource) { |
$lien_appropriation->addQueryString('appropriation', 0); |
$res .= BAZ_POSSEDE_DEJA_RESSOURCE.'<br />'."\n".'<a href="'.$lien_appropriation->getURL().'">'.BAZ_CLIQUER_POUR_VOUS_ENLEVER.'</a>'."\n"; |
$lien_appropriation->removeQueryString('appropriation'); |
} |
elseif ($GLOBALS['AUTH']->getAuth() && $GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_EST_STRUCTURE)) { |
$lien_appropriation->addQueryString('appropriation', 1); |
$res .= BAZ_SI_POSSEDE_RESSOURCE.'<br />'."\n".'<a href="'.$lien_appropriation->getURL().'">'.BAZ_CLIQUER_POUR_APPARAITRE.'</a>'."\n"; |
$lien_appropriation->removeQueryString('appropriation'); |
} |
elseif ($GLOBALS['AUTH']->getAuth() && !$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_EST_STRUCTURE)) { |
$res .= BAZ_IL_FAUT_ETRE_STRUCTURE."\n"; |
} |
elseif (!$GLOBALS['AUTH']->getAuth()) { |
$res .= BAZ_IL_FAUT_ETRE_IDENTIFIE_STRUCTURE."\n"; |
} |
$res .='</p>'."\n"; |
$res .= '</div>'."\n"; |
} |
|
//on ajoute les commentaires, s'il le faut |
if (($danslappli==1)and($GLOBALS['_BAZAR_']['commentaire']==1)) { |
$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)) { |
die ($resultat->getMessage().'<br />'.$resultat->getDebugInfo()) ; |
} |
if ($resultat->numRows()>0) { |
$res .= BAZ_IL_Y_A.$resultat->numRows().' '; |
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="BAZ_bulle_corps BAZ_bulle_corps_'.$GLOBALS['_BAZAR_']['class'].'">'."\n"; |
//affichage du commentaire |
$res .= $ligne['bc_commentaire'].'<br />'."\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']; |
$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().'">'.BAZ_SUPPRIMER.'</a>'."\n"; |
if ($resultat->numRows()>0) { |
$res .= BAZ_IL_Y_A.$resultat->numRows().' '; |
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="BAZ_bulle_corps BAZ_bulle_corps_'.$GLOBALS['_BAZAR_']['class'].'">'."\n"; |
//affichage du commentaire |
$res .= $ligne['bc_commentaire'].'<br />'."\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']; |
$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().'">'.BAZ_SUPPRIMER.'</a>'."\n"; |
} |
$res .= '</div>'."\n"; |
$res .= '</div>'."\n"; |
} |
$res .= '</div>'."\n"; |
$res .= '</div>'."\n"; |
} |
else $res .= BAZ_PAS_DE_COMMENTAIRES.'<br /><br />'."\n"; |
|
//formulaire des commentaires |
$form_commentaire = new HTML_QuickForm('bazar_commentaire', 'post', $url); |
$squelette =& $form_commentaire->defaultRenderer(); |
$squelette->setFormTemplate("\n".'<form {attributes}>'."\n".'{content}'."\n".'</form>'."\n"); |
$squelette->setElementTemplate( '<label style="width:200px;">{label}'. |
'<!-- BEGIN required --><span class="symbole_obligatoire"> *</span><!-- END required -->'."\n". |
'</label><br />'."\n".'{element}<br />'."\n"); |
$squelette->setRequiredNoteTemplate("\n".'<span class="symbole_obligatoire"> *{requiredNote}</span>'."\n"); |
$option=array('style'=>'width:300px;border:1px solid #000;', 'maxlength'=>100); |
$form_commentaire->addElement('text', 'Nom', BAZ_ENTREZ_VOTRE_NOM, $option); |
$option=array('style'=>'width:95%;height:100px;white-space: pre;padding:3px;border:1px solid #000;'); |
require_once PAP_CHEMIN_API_PEAR.'HTML/QuickForm/textarea.php'; |
$formtexte= new HTML_QuickForm_textarea('Commentaire', BAZ_ENTREZ_VOTRE_COMMENTAIRE, $option); |
$form_commentaire->addElement($formtexte) ; |
$option=array('style'=>'border:1px solid #000;'); |
$form_commentaire->addElement('submit', 'Envoyer', BAZ_ENVOYER, $option); |
$form_commentaire->addRule('Nom', BAZ_NOM_REQUIS, 'required', '', 'client') ; |
$form_commentaire->addRule('Commentaire', BAZ_COMMENTAIRE_REQUIS, 'required', '', 'client') ; |
$form_commentaire->setRequiredNote(BAZ_CHAMPS_REQUIS) ; |
$res .= $form_commentaire->toHTML(); |
$res .= '</div>'."\n"; |
} |
else $res .= BAZ_PAS_DE_COMMENTAIRES.'<br /><br />'."\n"; |
|
//formulaire des commentaires |
$form_commentaire = new HTML_QuickForm('bazar_commentaire', 'post', $url); |
$squelette =& $form_commentaire->defaultRenderer(); |
$squelette->setFormTemplate("\n".'<form {attributes}>'."\n".'{content}'."\n".'</form>'."\n"); |
$squelette->setElementTemplate( '<label style="width:200px;">{label}'. |
'<!-- BEGIN required --><span class="symbole_obligatoire"> *</span><!-- END required -->'."\n". |
'</label><br />'."\n".'{element}<br />'."\n"); |
$squelette->setRequiredNoteTemplate("\n".'<span class="symbole_obligatoire"> *{requiredNote}</span>'."\n"); |
$option=array('style'=>'width:300px;border:1px solid #000;', 'maxlength'=>100); |
$form_commentaire->addElement('text', 'Nom', BAZ_ENTREZ_VOTRE_NOM, $option); |
$option=array('style'=>'width:95%;height:100px;white-space: pre;padding:3px;border:1px solid #000;'); |
require_once PAP_CHEMIN_API_PEAR.'HTML/QuickForm/textarea.php'; |
$formtexte= new HTML_QuickForm_textarea('Commentaire', BAZ_ENTREZ_VOTRE_COMMENTAIRE, $option); |
$form_commentaire->addElement($formtexte) ; |
$option=array('style'=>'border:1px solid #000;'); |
$form_commentaire->addElement('submit', 'Envoyer', BAZ_ENVOYER, $option); |
$form_commentaire->addRule('Nom', BAZ_NOM_REQUIS, 'required', '', 'client') ; |
$form_commentaire->addRule('Commentaire', BAZ_COMMENTAIRE_REQUIS, 'required', '', 'client') ; |
$form_commentaire->setRequiredNote(BAZ_CHAMPS_REQUIS) ; |
$res .= $form_commentaire->toHTML(); |
$res .= '</div>'."\n"; |
} |
|
// Nettoyage de l'url |
1241,6 → 1244,9 |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: not supported by cvs2svn $ |
* Revision 1.99.2.2 2007-11-30 15:02:50 alexandre_tb |
* simplification du code et correction du bug (les fiches de la carto n affichent pas la bonne nature |
* |
* Revision 1.99.2.1 2007-11-30 14:14:36 jp_milcent |
* Ajout d'un décodage des apostrophes de type RIGHT SINGLE QUOTATION MARK. |
* |