Subversion Repositories eFlore/Applications.coel

Compare Revisions

Ignore whitespace Rev 1692 → Rev 1693

/trunk/jrest/services/CoelStructure.php
11,7 → 11,9
* @copyright 2009
*/
class CoelStructure extends Coel {
 
static $optional_bool_fields = array('cs_nbre_personne', 'csc_mark_formation', 'csc_mark_formation_interet');
 
// ATTENTION : tjrs garder la table principale en premier, puis mettre les tables spécialisées.
protected $tables = array( 120 => array(
'nom' => 'coel_structure',
168,6 → 170,15
}
return $info;
}
 
 
static function NULLifNotNum(&$params, $keys_to_null) {
foreach($keys_to_null as $v) {
if(array_key_exists($v, $params) && !is_numeric($params[$v])) {
$params[$v] = NULL;
}
}
}
/**
* Méthode appelée pour ajouter un élément.
192,6 → 203,8
}
}
 
self::NULLifNotNum($params, self::$optional_bool_fields);
 
$tables_a_modifier = $this->recupererTablesAModifier($params);
reset($tables_a_modifier);
 
267,10 → 280,9
$form_needs_refresh = TRUE;
}
}
if(array_key_exists('cs_nbre_personne', $params) && !is_numeric($params['cs_nbre_personne'])) {
$params['cs_nbre_personne'] = NULL;
}
 
self::NULLifNotNum($params, self::$optional_bool_fields);
 
// Vérification des tables à vraiment mettre à jour en fonction des données passées.
$tables_a_modifier = $this->recupererTablesAModifier($params);
// Pour chaque table du module nous lançons si nécessaire l'historisation puis la mise à jour
/trunk/src/org/tela_botanica/client/vues/structure/StructureFormConservation.java
320,15 → 320,16
StructureConservation conservationCollectee = (StructureConservation) conservation.cloner(new StructureConservation());
// FORMATION
if (formationMarkRGrpChp.getValue() != null) {
conservationCollectee.setFormation(formationMarkRGrpChp.getValue().getValueAttribute());
}
conservationCollectee.setFormation(formationMarkRGrpChp.getValue() == null ?
null :
formationMarkRGrpChp.getValue().getValueAttribute());
 
// FORMATION INFO
conservationCollectee.setFormationInfo(formationChp.getValue());
// FORMATION INTERET
if (interetFormationMarkRGrpChp.getValue() != null) {
conservationCollectee.setFormationInteret(interetFormationMarkRGrpChp.getValue().getValueAttribute());
}
conservationCollectee.setFormationInteret(interetFormationMarkRGrpChp.getValue() == null ?
null :
interetFormationMarkRGrpChp.getValue().getValueAttribute());
// STOCKAGE LOCAL
conservationCollectee.setStockageLocal(creerChaineDenormalisee(localStockageTrukCacGrpChp.getValues()));
484,11 → 485,16
if (formulaireCourant.mode.equals(Formulaire.MODE_MODIFIER) && conservation != null) {
// FORMATION
// Bouton oui, à toujours l'index 0 donc on teste en fonction...
((Radio) formationMarkRGrpChp.get((conservation.getFormation().equals("1") ? 0 : 1))).setValue(true);
if(conservation.getFormation() != null) {
((Radio) formationMarkRGrpChp.get(conservation.getFormation())).setValue(true);
}
 
// FORMATION INFO
formationChp.setValue(conservation.getFormationInfo());
// FORMATION INTERET
((Radio) interetFormationMarkRGrpChp.get((conservation.getFormationInteret().equals("1") ? 0 : 1))).setValue(true);
if(conservation.getFormationInteret() != null) {
((Radio) interetFormationMarkRGrpChp.get(conservation.getFormationInteret())).setValue(true);
}
// STOCKAGE LOCAL
peuplerCasesACocher(conservation.getStockageLocal(), localStockageTrukCacGrpChp,localStockageAutreChp);
/trunk/src/org/tela_botanica/client/vues/DetailVue.java
190,6 → 190,13
}
return txtARetourner;
}
 
protected String formaterOuiNon(Integer intAFormater) {
if(intAFormater == null) return "";
if(intAFormater.intValue() == 0) return i18nC.non();
if(intAFormater.intValue() == 1) return i18nC.oui();
return "";
}
protected String formaterSautDeLigne(String chaineAFormater) {
String txtARetourner = chaineAFormater.replaceAll("\n", sautLigneTpl);
307,4 → 314,4
return chaineARetourner;
}
}
}
/trunk/src/org/tela_botanica/client/modeles/structure/StructureConservation.java
48,11 → 48,14
}
// FORMATION
public String getFormation() {
return renvoyerValeurCorrecte("mark_formation");
public Integer getFormation() {
if (renvoyerValeurCorrecte("mark_formation").equals("")) {
return null;
}
return Integer.parseInt(renvoyerValeurCorrecte("mark_formation"));
}
public void setFormation(String f) {
this.set("mark_formation", f);
this.set("mark_formation", f != null ? Integer.parseInt(f) : null);
}
// FORMATION INFO
64,11 → 67,14
}
// FORMATION INTÉRÊT
public String getFormationInteret() {
return renvoyerValeurCorrecte("mark_formation_interet");
public Integer getFormationInteret() {
if (renvoyerValeurCorrecte("mark_formation_interet").equals("")) {
return null;
}
return Integer.parseInt(renvoyerValeurCorrecte("mark_formation_interet"));
}
public void setFormationInteret(String f) {
this.set("mark_formation_interet", f);
this.set("mark_formation_interet", f != null ? Integer.parseInt(f) : null);
}
// STOCKAGE LOCAL
233,4 → 239,4
public void setAcquisitionTraitementInsecte(String type, Object valeur) {
ajouterChaineDenormaliseAvecType("truk_acquisition_traitement_insecte", type, valeur);
}
}
}
/trunk/src/org/tela_botanica/client/modeles/structure/StructureAsyncDao.java
261,9 → 261,9
if (structureId != null) {
postDonnees += "&csc_id_structure=" + URL.encodeComponent(structureId);
}
postDonnees += "&csc_mark_formation=" + URL.encodeComponent(conservation.getFormation()) +
postDonnees += "&csc_mark_formation=" + (conservation.getFormation() != null ? conservation.getFormation() : "") +
"&csc_formation=" + URL.encodeComponent(conservation.getFormationInfo()) +
"&csc_mark_formation_interet=" + URL.encodeComponent(conservation.getFormationInteret()) +
"&csc_mark_formation_interet=" + (conservation.getFormationInteret() != null ? conservation.getFormationInteret() : "") +
"&csc_truk_stockage_local=" + URL.encodeComponent(conservation.getStockageLocal()) +
"&csc_truk_stockage_meuble=" + URL.encodeComponent(conservation.getStockageMeuble()) +
"&csc_truk_stockage_parametre=" + URL.encodeComponent(conservation.getStockageParametre()) +