Subversion Repositories eFlore/Applications.coel

Compare Revisions

Ignore whitespace Rev 1707 → Rev 1708

/trunk/jrest/services/CoelStructure.php
19,7 → 19,7
);
 
// ATTENTION : tjrs garder la table principale en premier, puis mettre les tables spécialisées.
static $tables = array( 120 => array(
protected $tables = array( 120 => array(
'nom' => 'coel_structure',
'prefixe' => 'cs',
'id' => array('cs_id_structure')),
246,7 → 246,12
} catch (PDOException $e) {
$this->messages[] = sprintf($this->getTxt('sql_erreur'), $e->getFile(), $e->getLine(), $e->getMessage(), $requete);
}
 
if($form_needs_refresh) { // coordonnées mises à jour en DB: en informer le formulaire
$this->envoyer($this->getElementParDefaut(array('id_structure' => $id_structure)));
exit;
}
$this->envoyer($id_structure);
}
 
363,13 → 368,14
}
 
static function callNominatim(&$params) {
if ( (! @$params['cs_latitude'] || ! @$params['cs_longitude']) &&
(@$params['cs_adresse_01'] || @$params['cs_code_postal'] || @$params['cs_ville']) ) {
if (
(! @$params['cs_latitude'] || ! @$params['cs_longitude']) &&
(@$params['cs_adresse_01'] || @$params['cs_code_postal'] || @$params['cs_ville']) ) {
$lonlat = array();
if(Coel::coordGuess(Coel::addrReStruct($params), $lonlat)) {
$params['cs_latitude'] = $lonlat['lat'];
$params['cs_longitude'] = $lonlat['lon'];
$form_needs_refresh = TRUE;
return TRUE;
}
}
return FALSE;
377,7 → 383,7
private function ajouterGuid($abr_projet, $id_structure) {
if ($id_structure !== false) {
$table_guid = self::$tables[120];
$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));
$this->modifier($table_guid);