/trunk/services/modules/0.1/syndication/SyndicationVotesParProtocole.php |
---|
63,7 → 63,6 |
* */ |
public function verifierConfiguration() { |
$erreurs = array(); |
$tableauImages = $this->conteneur->getParametre('mapping_masque'); |
if (empty($this->mappingFiltre)) { |
$erreurs[] = '- le fichier de configuration ne contient pas le tableau [mapping_masque] ou celui-ci est vide ;'; |
138,16 → 137,7 |
* Générer le lien du flux RSS |
* */ |
private function creerUrlService() { |
$url_service = $this->conteneur->getParametre('url_service'); |
$url_service .= '/'.$this->type_rss; |
//$url_service = ''; |
if (count($_GET) > 0) { |
$parametres_get = array(); |
foreach ($_GET as $cle => $valeur) { |
$parametres_get[] = $cle.'='.$valeur; |
} |
$url_service .= '?'.implode('&', $parametres_get); |
} |
$url_service = 'http://'.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']; |
return $url_service; |
} |
167,7 → 157,7 |
$item['categorie'] = $this->creerCategorie($item); |
$item['description'] = $this->creerDescription($info, $item); |
$item['description_encodee'] = htmlspecialchars($this->creerDescription($info, $item)); |
$item['modifie_par'] = $this->creerAuteur($info); |
$item['modifie_par'] = $this->creerVotant($info); |
return $item; |
} |
190,12 → 180,10 |
private function creerTitre($element) { |
$noteVote = $element['valeur']; |
$nomSci = htmlspecialchars($element['nom_sel']); |
$votant = array('prenom' => $element['votant_prenom'], 'nom' => $element['votant_nom']); |
$votantTxt = htmlspecialchars($this->creerAuteur($votant)); |
$observateur = array('prenom' => $element['observateur_prenom'], 'nom' => $element['observateur_nom']); |
$observateurTxt = htmlspecialchars($this->creerAuteur($observateur)); |
$votant = htmlspecialchars($this->creerVotant($element)); |
$observateur = htmlspecialchars($this->creerObservateur($element)); |
$titre = "Vote $noteVote par $votantTxt pour $nomSci de $observateurTxt"; |
$titre = "Vote $noteVote par $votant pour $nomSci de $observateur"; |
return $titre; |
} |
204,28 → 192,40 |
$idObs = htmlspecialchars($donnees['id_observation']); |
$idImg = htmlspecialchars($donnees['ce_image']); |
$urlImg = $this->getUrlImage($donnees['ce_image']); |
$miniatureUrl = $this->getUrlImage($donnees['ce_image'], 'CRX2S'); |
$proposition = htmlspecialchars($donnees['nom_sel']); |
$miniatureUrl = $this->getUrlImage($donnees['ce_image'], 'CRS'); |
$nomSelActuel = htmlspecialchars($donnees['nom_sel']); |
$dateObs = htmlspecialchars(str_replace(' 00:00:00', '', $donnees['date_observation'])); |
$lieuObs = htmlspecialchars($donnees['zone_geo']); |
$protocole = htmlspecialchars($donnees['intitule']); |
$votant = array('prenom' => $donnees['votant_prenom'], 'nom' => $donnees['votant_nom']); |
$votantTxt = htmlspecialchars($this->creerAuteur($votant)); |
$observateur = array('prenom' => $donnees['observateur_prenom'], 'nom' => $donnees['observateur_nom']); |
$observateurTxt = htmlspecialchars($this->creerAuteur($observateur)); |
$votant = htmlspecialchars($this->creerVotant($donnees)); |
$dateVote = htmlspecialchars(strftime('%A %d %B %Y à %H:%M', strtotime($donnees['date_vote']))); |
$observateur = htmlspecialchars($this->creerObservateur($donnees)); |
$description = '<ul>'. |
"<li>Vote pictoFlora #$idVote</li>". |
'<li>'. |
$description = '<style>.champ{color:grey} .gauche{float:left;padding:0 20px 0 0;} ul{list-style-type:none;padding:0;}</style>'. |
'<h2>'."Vote pictoFlora #$idVote pour l'image #$idImg de l'observation #$idObs".'</h2>'. |
'<div class="gauche">'. |
' <a href="'.$urlImg.'">'. |
' <img src="'.$miniatureUrl.'" alt="Img #'.$idImg.'"/>'. |
' Image #'.$idImg. |
' </a>'. |
'</li>'. |
"<li>Auteur de l'image : $observateurTxt</li>". |
"<li>Observation #$idObs : <em>$proposition</em></li>". |
"<li>Protocole : $protocole</li>". |
'<li>Valeur : <strong>'.$donnees['valeur'].'</strong>/5</li>'. |
'<li>Votant : '.$votantTxt.'</li>'. |
'</ul>'; |
'</div>'. |
'<div class="gauche">'. |
" <h3>Image #$idImg de l'observation #$idObs</h3>". |
' <ul>'. |
' <li><span class="champ">'."Auteur de l'image :</span> $observateur</li>". |
' <li><span class="champ">'."Nom saisi actuel :</span> <em>$nomSelActuel</em></li>". |
' <li><span class="champ">'."Lieu :</span> $lieuObs</li>". |
' <li><span class="champ">'."Date :</span> $dateObs</li>". |
' </ul>'. |
'</div>'. |
'<div class="gauche">'. |
" <h3>Vote #$idVote</h3>". |
' <ul>'. |
' <li><span class="champ">'."Protocole :</span> <strong>$protocole</strong></li>". |
' <li><span class="champ">'."Valeur :</span> <strong>{$donnees['valeur']}</strong>/5</li>". |
' <li><span class="champ">'."Votant :</span> $votant</li>". |
' <li><span class="champ">'."À voté le :</span> $dateVote</li>". |
' </ul>'. |
'</div>'; |
return $description; |
} |
236,14 → 236,22 |
return $url; |
} |
private function creerAuteur($info) { |
$intitule = 'Anonyme'; |
if (isset($info['prenom']) && isset($info['nom'])) { |
$intitule = $info['prenom'].' '.$info['nom']; |
private function creerVotant($info) { |
$votant = 'Anonyme'; |
if (isset($info['votant_prenom']) && isset($info['votant_nom'])) { |
$votant = $info['votant_prenom'].' '.$info['votant_nom']; |
} |
return $intitule; |
return $votant; |
} |
private function creerObservateur($info) { |
$observateur = 'Anonyme'; |
if ($info['observateur_prenom'] != '' && $info['observateur_nom'] != '') { |
$observateur = $info['observateur_prenom'].' '.$info['observateur_nom']; |
} |
return $observateur; |
} |
/** |
* Retrouver les derniers votes image |
* */ |
251,7 → 259,7 |
$requete = 'SELECT DISTINCT id_vote, ce_image, valeur, divo.date AS date_vote, '. |
' duo.prenom AS observateur_prenom, duo.nom AS observateur_nom, '. |
' duv.prenom AS votant_prenom, duv.nom AS votant_nom, '. |
' do.id_observation, do.nom_sel, dip.intitule '. |
' do.id_observation, do.nom_sel, do.zone_geo, do.date_observation, dip.intitule '. |
'FROM del_image_vote AS divo '. |
' INNER JOIN del_obs_image AS doi '. |
' ON divo.ce_image = doi.id_image '. |
/trunk/services/modules/0.1/syndication/SyndicationCommentaires.php |
---|
49,9 → 49,7 |
* Vérifier que le service est bien configuré |
* */ |
public function verifierConfiguration() { |
$erreurs = array(); |
$tableauImages = $this->conteneur->getParametre('mapping_masque'); |
if (empty($this->mappingFiltre)) { |
$erreurs[] = '- le fichier de configuration ne contient pas le tableau [mapping_masque] ou celui-ci est vide ;'; |
94,24 → 92,6 |
return $donnees; |
} |
private function creerCategorie($element) { |
$categorie = 'Commentaires'; |
$categorie = htmlentities($categorie); |
return $categorie; |
} |
private function creerUrlService() { |
$url_service = ''; |
if (count($_GET) > 0) { |
$parametres_get = array(); |
foreach ($_GET as $cle => $valeur) { |
$parametres_get[] = $cle.'='.$valeur; |
} |
$url_service .= '?'.implode('&', $parametres_get); |
} |
return $url_service; |
} |
private function construireDonneesCommunesAuFlux($infos) { |
$donnees = array(); |
$donnees['guid'] = ''; |
131,6 → 111,11 |
return $donnees; |
} |
private function creerUrlService() { |
$url_service = 'http://'.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']; |
return $url_service; |
} |
private function construireDonneesCommunesAuxItems($info) { |
$item = array(); |
$date_modification_timestamp = strtotime($info['date']); |
148,16 → 133,6 |
return $item; |
} |
private function creerGuidItem($element) { |
$guid = sprintf($this->conteneur->getParametre('guidObsTpl'), $element['id_commentaire']); |
return $guid; |
} |
private function creerLienItem($element) { |
$lien = sprintf($this->conteneur->getParametre('delFicheObsTpl'), $element['dob_id_observation']); |
return $lien; |
} |
private function creerTitre($element) { |
$nomPropose = htmlspecialchars($element['nom_sel']); |
$intitule = ($element['nom_sel'] != '') ? "Proposition $nomPropose" : 'Commentaire'; |
170,46 → 145,93 |
return $titre; |
} |
private function creerAuteur($info) { |
return $info['utilisateur_prenom'].' '.$info['utilisateur_nom']; |
} |
private function creerGuidItem($element) { |
$guid = sprintf($this->conteneur->getParametre('guidObsTpl'), $element['id_commentaire']); |
return $guid; |
} |
private function creerLienItem($element) { |
$lien = sprintf($this->conteneur->getParametre('delFicheObsTpl'), $element['dob_id_observation']); |
return $lien; |
} |
private function creerCategorie($element) { |
$categorie = 'Commentaires'; |
$categorie = htmlentities($categorie); |
return $categorie; |
} |
private function creerDescription($donnees, $item) { |
$idCommentaire = $donnees['id_commentaire']; |
$idObs = $donnees['dob_id_observation']; |
$nomPropose = ($donnees['nom_sel'] != '') ? htmlspecialchars($donnees['nom_sel']) : ''; |
$dateCommentaire = htmlspecialchars(strftime('%A %d %B %Y à %H:%M', strtotime($donnees['date']))); |
$nomSelActuel = htmlspecialchars($donnees['dob_nom_sel']); |
$etreProposition = ($nomPropose != '') ? true : false; |
$intitule = ($etreProposition) ? 'Proposition' : 'Commentaire'; |
$txt = ($donnees['texte'] != '') ? htmlspecialchars($donnees['texte']) : ''; |
$auteur = htmlspecialchars($this->creerAuteur($donnees)). |
($this->fluxAdminDemande() ? ' ('.$donnees['utilisateur_courriel'].')' : ''); |
$zoneGeo = htmlspecialchars((($donnees['dob_zone_geo'] != '') ? $donnees['dob_zone_geo'] : '?')); |
$dateObs = htmlspecialchars(strftime('%d %B %Y', strtotime($donnees['dob_date_observation']))); |
$lieuObs = htmlspecialchars((($donnees['dob_zone_geo'] != '') ? $donnees['dob_zone_geo'] : '?')); |
$dateObs = htmlspecialchars(str_replace(' 00:00:00', '', $donnees['dob_date_observation'])); |
$observateur = htmlspecialchars($this->creerObservateur($donnees)); |
$contenu = "<li>Observation #$idObs : <em>$nomSelActuel</em></li>". |
"<li>Lieu observation : $zoneGeo</li>". |
"<li>Date observation : $dateObs</li>"; |
$contenuCommentaire = ''; |
if ($etreProposition) { |
$contenu .= "<li>Proposition #$idCommentaire : <em>$nomPropose</em></li>". |
((!empty($txt)) ? "<li>Argumentaire : $txt</li>" : ''). |
"<li>Auteur de la proposition : $auteur</li>"; |
$contenuCommentaire = |
'<li><span class="champ">'."Nom proposé :</span> <em>$nomPropose</em></li>". |
((!empty($txt)) ? '<li><span class="champ">'."Argumentaire :</span> $txt</li>" : ''). |
'<li><span class="champ">'."Auteur de la proposition :</span> $auteur</li>". |
'<li><span class="champ">'."Proposé le :</span> $dateCommentaire</li>"; |
} else { |
$contenu .= "<li>Commentaire #$idCommentaire : <pre>$txt</pre></li>". |
"<li>Auteur du commentaire : $auteur</li>"; |
$contenuCommentaire = |
'<li><span class="champ">'."Commentaire #$idCommentaire :</span> <pre>$txt</pre></li>". |
'<li><span class="champ">'."Auteur du commentaire :</span> $auteur</li>". |
'<li><span class="champ">'."Commenté le :</span> $dateCommentaire</li>"; |
} |
$description = "<ul>$contenu</ul>"; |
$description = '<style>.champ{color:grey} .gauche{float:left;padding:0 20px 0 0;} ul{list-style-type:none;padding:0;}</style>'. |
'<h2>'."$intitule identiPlante #$idCommentaire pour l'observation #$idObs".'</h2>'. |
'<div class="gauche">'. |
" <h3>Observation #$idObs</h3>". |
' <ul>'. |
' <li><span class="champ">'."Nom saisi actuel :</span> <em>$nomSelActuel</em></li>". |
' <li><span class="champ">'."Lieu :</span> $lieuObs</li>". |
' <li><span class="champ">'."Date :</span> $dateObs</li>". |
' <li><span class="champ">'."Auteur :</span> $observateur</li>". |
' </ul>'. |
'</div>'. |
'<div class="gauche">'. |
" <h3>$intitule #$idCommentaire</h3>". |
" <ul>$contenuCommentaire</ul>". |
'</div>'; |
return $description; |
} |
private function creerAuteur($info) { |
return $info['utilisateur_prenom'].' '.$info['utilisateur_nom']; |
private function creerObservateur($info) { |
$observateur = 'Anonyme'; |
if ($info['observateur_prenom'] != '' && $info['observateur_nom'] != '') { |
$observateur = $info['observateur_prenom'].' '.$info['observateur_nom']; |
} |
return $observateur; |
} |
private function getDerniersCommentaires() { |
$requete = 'SELECT DISTINCT dc.*, '. |
' dob.id_observation AS dob_id_observation, dob.ce_zone_geo AS dob_ce_zone_geo, '. |
' dob.zone_geo AS dob_zone_geo, dob.date_observation AS dob_date_observation, dob.nom_sel AS dob_nom_sel '. |
' dob.zone_geo AS dob_zone_geo, dob.date_observation AS dob_date_observation, dob.nom_sel AS dob_nom_sel, '. |
' duo.prenom AS observateur_prenom, duo.nom AS observateur_nom, duo.courriel AS observateur_courriel '. |
'FROM del_commentaire AS dc '. |
' INNER JOIN del_observation AS dob '. |
' ON dob.id_observation = dc.ce_observation '. |
' LEFT JOIN del_utilisateur AS duo '. |
' ON dob.ce_utilisateur = duo.id_utilisateur '. |
'WHERE ((dob.ce_utilisateur = dc.ce_utilisateur AND dob.nom_sel != dc.nom_sel) '. |
' OR (dob.ce_utilisateur != dc.ce_utilisateur)) '. |
' OR (dob.ce_utilisateur != dc.ce_utilisateur)) '.// Evite d'afficher les proposition initiale |
$this->chargerClauseWhere().' '. |
'ORDER BY dc.date DESC '. |
'LIMIT '.$this->navigation->getDepart().','.$this->navigation->getLimite().' '; |
/trunk/services/modules/0.1/syndication/SyndicationTagsParProtocole.php |
---|
64,7 → 64,6 |
* */ |
public function verifierConfiguration() { |
$erreurs = array(); |
$tableauImages = $this->conteneur->getParametre('mapping_masque'); |
if (empty($this->mappingFiltre)) { |
$erreurs[] = '- le fichier de configuration ne contient pas le tableau [mapping_masque] ou celui-ci est vide ;'; |
139,16 → 138,7 |
* Générer le lien du flux RSS |
* */ |
private function creerUrlService() { |
$url_service = $this->conteneur->getParametre('url_service'); |
$url_service .= '/'.$this->type_rss; |
//$url_service = ''; |
if (count($_GET) > 0) { |
$parametres_get = array(); |
foreach ($_GET as $cle => $valeur) { |
$parametres_get[] = $cle.'='.$valeur; |
} |
$url_service .= '?'.implode('&', $parametres_get); |
} |
$url_service = 'http://'.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']; |
return $url_service; |
} |
202,28 → 192,39 |
$idObs = htmlspecialchars($donnees['id_observation']); |
$idImg = htmlspecialchars($donnees['id_image']); |
$urlImg = $this->getUrlImage($donnees['id_image']); |
$miniatureUrl = $this->getUrlImage($donnees['id_image'], 'CRX2S'); |
$proposition = htmlspecialchars($donnees['nom_sel']); |
//$protocole = htmlspecialchars($donnees['intitule']); |
$tag = $donnees['tag']; |
$auteur = htmlspecialchars($this->creerAuteurImg($donnees)); |
$miniatureUrl = $this->getUrlImage($donnees['id_image'], 'CRS'); |
$nomSelActuel = htmlspecialchars($donnees['nom_sel']); |
$dateObs = htmlspecialchars(str_replace(' 00:00:00', '', $donnees['date_observation'])); |
$lieuObs = htmlspecialchars($donnees['zone_geo']); |
$tag = htmlspecialchars($donnees['tag']); |
$dateTag = htmlspecialchars(strftime('%A %d %B %Y à %H:%M', strtotime($donnees['date']))); |
$auteurImg = htmlspecialchars($this->creerAuteurImg($donnees)); |
$tagueur = htmlspecialchars($this->creerTagueur($donnees)); |
$description = |
'<ul>'. |
"<li>Tag pictoFlora #$idTag</li>". |
'<li>'. |
' <a href="'.$urlImg.'">'. |
' <img src="'.$miniatureUrl.'" alt="Img #'.$idImg.'"/>'. |
' Image #'.$idImg. |
' </a>'. |
'</li>'. |
"<li>Auteur de l'image : $auteur</li>". |
"<li>Observation #$idObs : <em>$proposition</em></li>". |
// TODO : ajouter le protocole ? "<li>Protocole : $protocole</li>". |
"<li>Tag : <strong>$tag</strong></li>". |
"<li>Auteur du tag : $tagueur</li>". |
'</ul>'; |
$description = '<style>.champ{color:grey} .gauche{float:left;padding:0 20px 0 0;} ul{list-style-type:none;padding:0;}</style>'. |
'<h2>'."Tag pictoFlora #$idTag pour l'image #$idImg de l'observation #$idObs".'</h2>'. |
'<div class="gauche">'. |
' <a href="'.$urlImg.'">'. |
' <img src="'.$miniatureUrl.'" alt="Img #'.$idImg.'"/>'. |
' </a>'. |
'</div>'. |
'<div class="gauche">'. |
" <h3>Image #$idImg de l'observation #$idObs</h3>". |
' <ul>'. |
' <li><span class="champ">'."Auteur de l'image :</span> $auteurImg</li>". |
' <li><span class="champ">'."Nom saisi actuel :</span> <em>$nomSelActuel</em></li>". |
' <li><span class="champ">'."Lieu :</span> $lieuObs</li>". |
' <li><span class="champ">'."Date :</span> $dateObs</li>". |
' </ul>'. |
'</div>'. |
'<div class="gauche">'. |
" <h3>Tag #$idTag</h3>". |
' <ul>'. |
' <li><span class="champ">'."Tag :</span> <strong>$tag</strong></li>". |
' <li><span class="champ">'."Auteur :</span> $tagueur</li>". |
' <li><span class="champ">'."Taguée le :</span> $dateTag</li>". |
' </ul>'. |
'</div>'; |
return $description; |
} |
261,7 → 262,8 |
* Retrouver les derniers votes image |
* */ |
private function getDerniersVotesImage() { |
$requete = 'SELECT DISTINCT id_tag, tag, date, do.id_observation, do.nom_sel, doi.id_image, '. |
$requete = 'SELECT DISTINCT id_tag, tag, date, '. |
' do.id_observation, do.nom_sel, do.zone_geo, do.date_observation, doi.id_image, '. |
' duo.prenom AS tagueur_prenom, duo.nom AS tagueur_nom, duo.courriel AS tagueur_courriel, '. |
' du.prenom AS auteur_prenom, du.nom AS auteur_nom, du.courriel AS auteur_courriel '. |
'FROM del_image_tag AS dit '. |