Subversion Repositories eFlore/Applications.coel

Compare Revisions

Ignore whitespace Rev 1733 → Rev 1765

/trunk/jrest/services/CoelStructure.php
45,7 → 45,7
if ($type == '*' || is_numeric($type)) {
// Pré traitement des paramêtres
$p = $this->traiterParametresUrl(array('id_projet', 'id_structure', 'recherche'), $param);
$p = $this->traiterParametresUrl(array('id_structure', 'recherche'), $param);
$info = $this->getElementParDefaut($p);
} else {
$methode = 'getElement'.$type;
65,7 → 65,7
* Méthode par défaut pour garder la compatibilité avec Coel.
* Appelée avec les paramêtres d'url suivant :
* /CoelStructure/_/_/_
* ou les _ représentent dans l'ordre : id_projet, id_structure et nom
* ou les _ représentent dans l'ordre : id_structure et nom
* Si un des paramêtres est abscent, il prendre la valeur *
*/
public function getElementParDefaut($p) {
73,7 → 73,6
$info = array();
 
$whereClause = array();
if(isset($p['id_projet'])) $whereClause[] = "cs_ce_projet = {$p['id_projet']}";
if(isset($p['id_structure'])) $whereClause[] = "cs_id_structure = {$p['id_structure']}";
 
if(isset($p['recherche'])) {
139,7 → 138,7
*/
public function getElementParZoneGeo($param) {
// Pré traitement des paramêtres
$p = $this->traiterParametresUrl(array('type', 'projets'), $param);
$p = $this->traiterParametresUrl(array('type'), $param);
if (!isset($p['type'])) {
$this->messages[] = "Il est obligatoire d'indiquer type de recherche pour utiliser ce service.";
return array();
153,7 → 152,6
' COUNT( cs_id_structure ) AS nbre '.
'FROM coel_structure '.
'WHERE cs_ce_truk_pays = 2654 '.
(isset($p['projets']) ? " AND cs_ce_projet IN ({$p['projets']}) " : '').
'GROUP BY IF ( SUBSTRING( cs_code_postal FROM 1 FOR 2 ) >= 96, '.
' SUBSTRING( cs_code_postal FROM 1 FOR 3 ), '.
' SUBSTRING( cs_code_postal FROM 1 FOR 2 ) ) '.
295,7 → 293,7
$this->mettreAJourAvecCle($id_utilisateur, $id_session, $table_id, $table);
}
} catch (PDOException $e) {
$this->messages[] = sprintf($this->getTxt('sql_erreur'), $e->getFile(), $e->getLine(), $e->getMessage(), $requete);
$this->messages[] = sprintf($this->getTxt('sql_erreur'), $e->getFile(), $e->getLine(), $e->getMessage());
}
 
// Envoie sur la sortie standard
400,11 → 398,11
return FALSE;
}
private function ajouterGuid($abr_projet, $id_structure) {
private function ajouterGuid($id_structure) {
if ($id_structure !== false) {
$table_guid = $this->tables[120];
$table_guid['champs_valeurs_id']['cs_id_structure'] = $id_structure;
$table_guid['champs_valeurs_protege']['cs_guid'] = $this->bdd->quote(sprintf($this->config['coel']['guid'], $abr_projet, 'str'.$id_structure));
$table_guid['champs_valeurs_protege']['cs_guid'] = $this->bdd->quote(sprintf($this->config['coel']['guid'], 'str'.$id_structure));
$this->modifier($table_guid);
}
}