Subversion Repositories eFlore/Applications.cel

Compare Revisions

Ignore whitespace Rev 488 → Rev 489

/trunk/jrest/services/CelWidgetMap.php
47,6 → 47,8
$this->envoyer($info);
} else if ($retour['type'] == 'json') {
$this->envoyerJson($retour['variable_js'], $retour['donnees']);
} else if ($retour['type'] == 'jsonp') {
$this->envoyerJsonp($retour['variable_js'], $retour['donnees']);
} else {
$this->envoyer($retour, null, null, true);
}
103,8 → 105,9
$points = array_values($points);
 
// Création des infos du widget
$json['type'] = 'json';
$json['type'] = (isset($this->formatRetour)) ? $this->formatRetour : 'json';
$json['variable_js'] = 'obs';
$json['donnees']['points'] = $points;
$json['donnees']['nombre'] = count($points);
$json['donnees']['centre_x'] = $x_moyen;
236,7 → 239,34
* Liste des taxons présents sur la carte
*/
public function getTaxons($params) {
$json = null;
$parametres = $this->traiterParametres(array('utilisateur', 'projet', 'dept', 'num_taxon'), $params, false);
extract($parametres);
// Récupération du filtre where pour les mots clés "projet"
if (isset($projet)) {
$projet_sql = $this->getSqlWhereProjet($projet);
}
 
$requete = 'SELECT nom_sel, num_nom_sel, nom_ret, num_nom_ret, num_taxon, famille '.
'FROM cel_inventory AS i '.
' LEFT JOIN locations AS l '.
' ON (l.name = i.location AND l.code = i.id_location) '.
"WHERE transmission = '1' ".
(isset($utilisateur) ? " AND identifiant = '$utilisateur' " : '').
(isset($dept) ? " AND l.insee_code LIKE '$dept%' " : '').
(isset($num_taxon) ? " AND num_taxon = '$num_taxon' " : '' ).
((isset($projet) && $projet_sql != '') ? " AND ($projet_sql) " : '' );
//$this->debug[] = $requete;
 
$resultats = $this->executerRequete($requete);
// Post-traitement
if (is_array($resultats)) {
$resultats = $this->nettoyerTableau($resultats);
}
return $resultats;
}
/**