/trunk/jrest/bibliotheque/Cel.php |
---|
558,7 → 558,7 |
protected function convertirCodeZoneGeoVersDepartement($code_zone_geo) { |
$code_departement = ''; |
if ($this->estUnCodeInseeDepartement($code_zone_geo)) { |
if (self::estUnCodeInseeDepartement($code_zone_geo)) { |
$code_departement = substr(ltrim($code_zone_geo,'INSEE-C:'),0,2); |
} |
return $code_departement; |
570,7 → 570,7 |
protected function convertirCodeZoneGeoVersCodeInsee($code_zone_geo) { |
$code_departement = ''; |
if ($this->estUnCodeInseeDepartement($code_zone_geo)) { |
if (self::estUnCodeInseeDepartement($code_zone_geo)) { |
$code_departement = ltrim($code_zone_geo,'INSEE-C:'); |
} |
return $code_departement; |
591,6 → 591,18 |
} |
return $infos; |
} |
public static function formaterZoneGeoEtCodePourAffichage($obs) { |
$code_lieu = self::convertirCodeZoneGeoVersCodeInsee($obs['ce_zone_geo']); |
if(empty($code_lieu) && !empty($obs['pays'])) { |
$code_lieu = $obs['pays']; |
} |
if(!empty(trim($obs['zone_geo'])) && !empty(trim($code_lieu))) { |
$code_lieu = ' ('.$code_lieu.') '; |
} |
return $obs['zone_geo'].$code_lieu; |
} |
protected function encoderMotCle($mot_cle) { |
return md5(mb_strtolower(trim($mot_cle))); |
/trunk/jrest/services/CelSyndicationImage.php |
---|
610,7 → 610,8 |
$nom_retenu = $donnees['nom_ret']; |
// |
$mots_cles_obs = $donnees['mots_cles_texte_obs']; |
$lieu = $donnees['zone_geo'].' ('.$this->convertirCodeZoneGeoVersCodeInsee($donnees['ce_zone_geo']).') > '.$donnees['lieudit'].' > '.$donnees['station']; |
$lieu = Cel::formaterZoneGeoEtCodePourAffichage($donnees).' > '.$donnees['lieudit'].' > '.$donnees['station']; |
$milieu = $donnees['milieu']; |
$coordonnees = ($this->etreNull($donnees['latitude']) && $this->etreNull($donnees['longitude'])) ? '' : $donnees['latitude'].'/'.$donnees['longitude']; |
$commentaire_obs = $donnees['commentaire_obs']; |
/trunk/jrest/services/CelWidgetMapPoint.php |
---|
119,6 → 119,7 |
$this->construireWhereRectangleCommuneOR().") ". |
$this->construireWhereDept(). |
$this->construireWhereCommune(). |
$this->construireWherePays(). |
$this->construireWhereUtilisateur(). |
$this->construireWhereNumTaxonAvecSousTaxons(). |
$this->construireWhereNomTaxon(). |
157,6 → 158,7 |
$this->construireWhereRectangleCommuneOR().") ". |
$this->construireWhereDept(). |
$this->construireWhereCommune(). |
$this->construireWherePays(). |
$this->construireWhereUtilisateur(). |
$this->construireWhereNumTaxonAvecSousTaxons(). |
$this->construireWhereNomTaxon(). |
342,6 → 344,7 |
"WHERE transmission = '1' ". |
(($this->communeEstDemandee()) ? $this->construireWhereCommuneSansCoordonneesAvecSensibles() : $this->construireWhereCoordonneesSansSensibles()). |
$this->construireWhereDept(). |
$this->construireWherePays(). |
$this->construireWhereUtilisateur(). |
$this->construireWhereNumTaxonAvecSousTaxons(). |
$this->construireWhereNomTaxon(). |
489,6 → 492,7 |
" AND nom_ret != '' ". |
$this->construireWhereDept(). |
$this->construireWhereCommune(). |
$this->construireWherePays(). |
$this->construireWhereUtilisateur(). |
$this->construireWhereNumTaxon(). |
$this->construireWhereNomTaxon(). |
756,6 → 760,7 |
$this->construireWhereCoordonnees(). |
$this->construireWhereDept(). |
$this->construireWhereCommune(). |
$this->construireWherePays(). |
$this->construireWhereUtilisateur(). |
$this->construireWhereNumTaxon(). |
$this->construireWhereNomTaxon(). |
923,6 → 928,16 |
} |
return $sql; |
} |
private function construireWherePays() { |
$sql = ''; |
extract($this->parametres); |
if (isset($this->parametres['pays']) && !$this->etreNull($pays)) { |
$pays = Cel::db()->proteger($pays); |
$sql = " AND pays = $pays"; |
} |
return $sql; |
} |
private function construireWhereCommuneSansCoordonneesAvecSensibles() { |
$sql = ''; |
/trunk/jrest/services/CelSyndicationObservation.php |
---|
488,7 → 488,7 |
private function creerTitre($obs) { |
$date = ($obs['date_observation'] != '0000-00-00 00:00:00') ? 'le '.date("d/m/Y", strtotime($obs['date_observation'])) : '' ; |
$nom_plante = $obs['nom_sel'].' [nn'.$obs['nom_sel_nn'].']'; |
$lieu = $obs['zone_geo'].' ('.$obs['ce_zone_geo'].')'; |
$lieu = Cel::formaterZoneGeoEtCodePourAffichage($obs); |
$utilisateur = $this->getIntituleAuteur($obs['courriel_utilisateur']); |
$titre = "$nom_plante à $lieu par $utilisateur $date"; |
$titre = $this->nettoyerTexte($titre); |
517,7 → 517,8 |
$auteur_mail = $obs['courriel_utilisateur']; |
$mots_cles_obs = $obs['mots_cles_texte']; |
$lien_correction = sprintf($this->config['settings']['phpEditUrlTpl'], $obs['id_observation']); |
$lieu = $obs['zone_geo'].' ('.$this->convertirCodeZoneGeoVersCodeInsee($obs['ce_zone_geo']).') > '.$obs['lieudit'].' > '.$obs['station']; |
$lieu = Cel::formaterZoneGeoEtCodePourAffichage($obs).' > '.$obs['lieudit'].' > '.$obs['station']; |
$milieu = $obs['milieu']; |
$coordonnees = ($this->etreNull($obs['latitude']) && $this->etreNull($obs['longitude'])) ? '' : $obs['latitude'].'/'.$obs['longitude']; |
$commentaire = $obs['commentaire']; |