Subversion Repositories eFlore/Applications.cel

Compare Revisions

Ignore whitespace Rev 1567 → Rev 1568

/trunk/jrest/services/CelWidgetMapPoint.php
111,7 → 111,7
$this->construireWhereDept().
$this->construireWhereCommune().
$this->construireWhereUtilisateur().
$this->construireWhereNumTaxon().
$this->construireWhereNumTaxonAvecSousTaxons().
$this->construireWhereNomTaxon().
$this->construireWhereReferentiel().
$this->construireWhereDate().
121,7 → 121,7
$this->construireWhereTag().
$this->construireWhereNombreDeJours().
' GROUP BY id_coord';
 
$resultats_emplacements = $this->executerRequete($requete);
$emplacements = $this->traiterEmplacements($resultats_emplacements, $this->compterObservations($params));
return $emplacements;
148,7 → 148,7
$this->construireWhereDept().
$this->construireWhereCommune().
$this->construireWhereUtilisateur().
$this->construireWhereNumTaxon().
$this->construireWhereNumTaxonAvecSousTaxons().
$this->construireWhereNomTaxon().
$this->construireWhereReferentiel().
$this->construireWhereDate().
157,7 → 157,7
$this->construireWhereProjet().
$this->construireWhereTag().
$this->construireWhereNombreDeJours();
//echo $requete;exit;
 
$resultats_nb_obs = $this->executerRequete($requete);
return $resultats_nb_obs[0]['nb'];
}
332,7 → 332,7
(($this->communeEstDemandee()) ? $this->construireWhereCommuneSansCoordonneesAvecSensibles() : $this->construireWhereCoordonneesSansSensibles()).
$this->construireWhereDept().
$this->construireWhereUtilisateur().
$this->construireWhereNumTaxon().
$this->construireWhereNumTaxonAvecSousTaxons().
$this->construireWhereNomTaxon().
$this->construireWhereReferentiel().
$this->construireWhereDate().
956,17 → 956,52
}
return $sql;
}
 
private function construireWhereNumTaxon() {
$sql = '';
// Récupération des coordonnées depuis l'id station
extract($this->parametres);
if (isset($this->parametres['num_taxon']) && !$this->etreNull($num_taxon)) {
$num_taxon = $this->proteger($num_taxon);
$sql = " AND nt = $num_taxon ";
}
return $sql;
}
private function construireWhereNumTaxonAvecSousTaxons() {
$sql = '';
// Récupération des coordonnées depuis l'id station
extract($this->parametres);
if (isset($this->parametres['num_taxon']) && !$this->etreNull($num_taxon)) {
$sous_taxons = $this->obtenirSousTaxons($this->parametres['num_taxon']);
$num_taxon = $this->proteger($num_taxon);
$sql = " AND nt = $num_taxon ";
if(!empty($sous_taxons)) {
$sql_in_sous_tax = implode(',', $sous_taxons);
$sql = " AND (nt = $num_taxon OR ".
"nom_sel_nn IN (".$sql_in_sous_tax.") OR ".
"nom_ret_nn IN (".$sql_in_sous_tax.") ".
") ";
}
else {
$sql = " AND nt = $num_taxon ";
}
}
return $sql;
}
private function obtenirSousTaxons($nt) {
$referentiel = 'bdtfx';
if($this->parametres['referentiel'] && $this->parametres['referentiel'] != "" && $this->parametres['referentiel'] != '*') {
$referentiel = $this->parametres['referentiel'];
}
$nn_sous_taxons = array();
$sous_taxons = $this->obtenirSousTaxonsPourNt($referentiel, $nt);
foreach($sous_taxons as $sous_tax) {
$nn_sous_taxons[] = $sous_tax['num_nom'];
}
return $nn_sous_taxons;
}
 
private function construireWhereProjet() {
$sql = '';