Subversion Repositories eFlore/Applications.cel

Compare Revisions

Ignore whitespace Rev 1496 → Rev 1497

/trunk/jrest/services/CelWidgetMapPoint.php
89,60 → 89,6
return array('type' => 'png', 'img' => $img);
}
 
/**
* Les stations de la carte par défaut
*/
public function getStations($params) {
$stations = null;
$requete = 'SELECT wgs84_latitude AS lat, wgs84_longitude AS lng, location AS nom '.
'FROM cel_obs AS co '.
' LEFT JOIN cel_zones_geo AS l '.
' ON (l.nom = co.zone_geo AND l.id_zone_geo = co.ce_zone_geo) '.
"WHERE transmission = '1' ".
" AND (( ".
" (latitude = '' OR latitude IS NULL OR latitude = '000null') ".
" AND (longitude = '' OR longitude IS NULL OR longitude = '000null') ".
" ) OR mots_cles_texte LIKE '%sensible%') ".
$this->construireWhereRectangleCommune().
$this->construireWhereDept().
$this->construireWhereCommune().
$this->construireWhereUtilisateur().
$this->construireWhereNumTaxon().
$this->construireWhereNomTaxon().
$this->construireWhereDate().
$this->construireWhereCommentaire().
$this->construireWherePhotosSeulement().
$this->construireWhereProjet().
$this->construireWhereTag();
 
$resultats_communes = $this->requeter($requete);
 
$requete = 'SELECT latitude AS lat, longitude AS lng, location AS nom '.
'FROM cel_obs AS co '.
' LEFT JOIN cel_zones_geo AS l '.
' ON (l.nom = co.zone_geo AND l.id_zone_geo = co.ce_zone_geo) '.
"WHERE transmission = '1' ".
" AND latitude != '' AND latitude IS NOT NULL AND latitude != '000null' ".
" AND longitude != '' AND longitude IS NOT NULL AND longitude != '000null' ".
" AND (mots_cles_texte IS NULL OR mots_cles_texte NOT LIKE '%sensible%') ".
$this->construireWhereRectangleStation().
$this->construireWhereDept().
$this->construireWhereCommune().
$this->construireWhereUtilisateur().
$this->construireWhereNumTaxon().
$this->construireWhereNomTaxon().
$this->construireWhereDate().
$this->construireWhereCommentaire().
$this->construireWherePhotosSeulement().
$this->construireWhereProjet().
$this->construireWhereTag();
 
$resultats_stations = $this->requeter($requete);
$stations = $this->traiterStations($resultats_communes, $resultats_stations);
 
return $stations;
}
 
public function getTout($params) {
 
$emplacements = null;
167,6 → 113,7
$this->construireWhereUtilisateur().
$this->construireWhereNumTaxon().
$this->construireWhereNomTaxon().
$this->construireWhereReferentiel().
$this->construireWhereDate().
$this->construireWhereCommentaire().
$this->construireWherePhotosSeulement().
203,6 → 150,7
$this->construireWhereUtilisateur().
$this->construireWhereNumTaxon().
$this->construireWhereNomTaxon().
$this->construireWhereReferentiel().
$this->construireWhereDate().
$this->construireWhereCommentaire().
$this->construireWherePhotosSeulement().
386,6 → 334,7
$this->construireWhereUtilisateur().
$this->construireWhereNumTaxon().
$this->construireWhereNomTaxon().
$this->construireWhereReferentiel().
$this->construireWhereDate().
$this->construireWhereCommentaire().
$this->construireWherePhotosSeulement().
539,6 → 488,7
$this->construireWhereUtilisateur().
$this->construireWhereNumTaxon().
$this->construireWhereNomTaxon().
$this->construireWhereReferentiel().
$this->construireWhereDate().
$this->construireWhereCommentaire().
$this->construireWherePhotosSeulement().
668,6 → 618,16
}
return $sql;
}
private function construireWhereReferentiel() {
$sql = '';
extract($this->parametres);
if (isset($referentiel) && !$this->etreNull($referentiel)) {
$referentiel = $this->proteger($referentiel.'%');
$sql = ' AND co.nom_referentiel LIKE '.$referentiel.' ';
}
return $sql;
}
 
private function construireWhereDate() {
$sql = '';
796,6 → 756,7
$this->construireWhereUtilisateur().
$this->construireWhereNumTaxon().
$this->construireWhereNomTaxon().
$this->construireWhereReferentiel().
$this->construireWhereProjet().
$this->construireWhereTag().
'ORDER BY utilisateur ASC, ordre ASC';
1069,6 → 1030,7
$this->construireWhereUtilisateur().
$this->construireWhereNumTaxon().
$this->construireWhereNomTaxon().
$this->construireWhereReferentiel().
$this->construireWhereProjet().
(!$this->etreNull($tag_sql) ? "AND ($tag_sql) " : '').
'ORDER BY utilisateur ASC, ci.ordre ASC';