Subversion Repositories eFlore/Applications.coel

Compare Revisions

Ignore whitespace Rev 1672 → Rev 1673

/trunk/jrest/services/CoelStructure.php
37,7 → 37,9
$type = $param[0];
if ($type == '*' || is_numeric($type)) {
$info = $this->getElementParDefaut($param);
// Pré traitement des paramêtres
$p = $this->traiterParametresUrl(array('id_projet', 'id_structure', 'recherche'), $param);
$info = $this->getElementParDefaut($p);
} else {
$methode = 'getElement'.$type;
if (method_exists($this, $methode)) {
59,13 → 61,10
* ou les _ représentent dans l'ordre : id_projet, id_structure et nom
* Si un des paramêtres est abscent, il prendre la valeur *
*/
public function getElementParDefaut($param) {
public function getElementParDefaut($p) {
// Initialisation des variables
$info = array();
// Pré traitement des paramêtres
$p = $this->traiterParametresUrl(array('id_projet', 'id_structure', 'recherche'), $param);
 
// Construction de la requête
$requete = (($this->distinct) ? 'SELECT DISTINCT' : 'SELECT').' cs.*, csc.*, csv.*, '.
' cmhl_date_modification, cmhl_notes, cmhl_source, cmhl_ce_modifier_par, cmhl_ce_etat, cmhl_ip '.
274,7 → 273,8
// Envoie sur la sortie standard
 
if($form_needs_refresh) { // coordonnées mises à jour en DB: en informer le formulaire (si resté ouvert)
// $this->envoyer('reload'); // TODO: handle this
$this->envoyer($this->getElementParDefaut(array('id_structure' => $uid[0])));
exit;
}
$this->envoyer(); // OK par défaut
}
/trunk/src/org/tela_botanica/client/vues/structure/StructureForm.java
402,6 → 402,14
if (info.getType().equals("modif_structure")) {
InfoLogger.display("Modification d'une institution", info.toString());
Structure structureMaj = (Structure)(info.getDonnee(0));
if(structureMaj != null) {
// TRUE uniquement si la modification a retourné un objet JSON pour mise à jour
// (contenant les coordonnées générées, cf r1673)
structure.setLatitude(structureMaj.getLatitude());
structure.setLongitude(structureMaj.getLongitude());
}
controlerFermeture();
} else if (info.getType().equals("ajout_structure")) {
if (info.getDonnee(0) != null && info.getDonnee(0) instanceof String) {
/trunk/src/org/tela_botanica/client/modeles/structure/StructureAsyncDao.java
184,8 → 184,18
rb.envoyerRequete(postDonneesEncodees, new JsonRestRequestCallback() {
@Override
public void surReponse(JSONValue responseValue) {
// Si la requête a impliquées des valeurs autogénérées, l'objet modifié est retourné
JSONObject obj;
if ((obj = responseValue.isObject()) != null) {
if (obj.get("structures").isObject() != null) {
Structure structure = new Structure(obj.get("structures").isObject());
Information info = new Information("modif_structure");
info.setDonnee(structure);
vueARafraichir.rafraichir(info);
}
}
// Si la requête est un succès, reception d'une chaine
if (responseValue.isString() != null) {
else if (responseValue.isString() != null) {
Information info = new Information("modif_structure");
info.setMessage(responseValue.isString().stringValue());
vueARafraichir.rafraichir(info);
293,4 → 303,4
}
return postDonnees;
}
}
}