746,6 → 746,7 |
else if (info.getType().equals("maj_utilisateur")) { |
gererEtatActivationBouton(); |
} else if (info.getDonnee(0) instanceof PersonneListe) { |
|
Collection colPersonneListe = ((PersonneListe) info.getDonnee(0)).values(); |
Iterator itPersonneListe = colPersonneListe.iterator(); |
Personne personne = (Personne) itPersonneListe.next(); |
754,124 → 755,14 |
personneSauvegarde = (Personne) personne.cloner(personneSauvegarde); |
|
binderPersonne(personne); |
//Mise à jour de la personne |
//Personne personne = (Personne) nouvellesDonnees; |
|
ComboBox cbProjets = (ComboBox) hmIdentite.get("cbProjets"); |
cbProjets.setValue(cbProjets.getStore().findModel("id_projet", personne.get("ce_projet"))); |
mettreAJourPersonne(personne); |
|
//Prefixe |
String prefixe = personne.get("ce_truk_prefix"); |
ComboBox<Valeur> cbPrefixe = (ComboBox<Valeur>) hmIdentite.get("cbPrefixe"); |
|
|
String prefixeCourant = personne.get("ce_truk_prefix"); |
if (cbPrefixe.getStore().findModel("id_valeur", prefixeCourant) != null) { |
cbPrefixe.setValue(cbPrefixe.getStore().findModel("id_valeur", prefixeCourant)); |
} else { |
cbPrefixe.setRawValue(prefixeCourant); |
} |
|
|
((TextField) hmIdentite.get("tfPrenom")).setValue(personne.get("prenom")); |
((TextField) hmIdentite.get("tfNom")).setValue(personne.get("nom")); |
|
//Suffixe |
String suffixe = personne.get("ce_truk_suffixe"); |
ComboBox<Valeur> cbSuffixe = (ComboBox<Valeur>) hmIdentite.get("cbSuffixe"); |
|
String suffixeCourant = personne.get("ce_truk_suffix"); |
if (cbSuffixe.getStore().findModel("id_valeur", suffixeCourant) != null) { |
cbSuffixe.setValue(cbSuffixe.getStore().findModel("id_valeur", suffixeCourant)); |
} else { |
cbSuffixe.setRawValue(suffixeCourant); |
} |
|
((TextField) hmIdentite.get("tfNomAutre")).setValue(personne.get("truk_nom_autre")); |
((TextField) hmIdentite.get("tfAbreviation")).setValue(personne.get("abreviation")); |
((TextField) hmIdentite.get("tfAbreviationAutre")).setValue(personne.get("truk_abreviation_autre")); |
|
|
(((DateField) hmIdentite.get("dfDateNaissance"))).setValue(personne.getDate("naissance_date")); |
((TextField) hmIdentite.get("tfLieuNaissance")).setValue(personne.get("naissance_lieu")); |
|
(((DateField) hmIdentite.get("dfDateDeces"))).setValue(personne.getDate("deces_date")); |
((TextField) hmIdentite.get("tfLieuDeces")).setValue(personne.get("deces_lieu")); |
|
((ChampMultiValeursMultiTypes) hmIdentite.get("telephones")).peupler(personne.getString("truk_telephone")); |
|
//Courriel |
((ChampMultiValeurs) hmIdentite.get("courriels")).peupler(personne.getCourriel()); |
|
//Sites web |
((ChampMultiValeurs) hmIdentite.get("sites")).peupler(personne.getString("truk_url")); |
|
|
// Sexe |
String strSexe = personne.get("ce_sexe"); |
ComboBox<Valeur> cbSexe = (ComboBox<Valeur>) hmIdentite.get("cbSexe"); |
|
if (cbSexe.getStore().findModel("id_valeur", strSexe) != null) { |
cbSexe.setValue(cbSexe.getStore().findModel("id_valeur", strSexe)); |
} else { |
cbSexe.setRawValue(strSexe); |
} |
|
((TextArea) hmIdentite.get("taDescription")).setRawValue((String) personne.get("description")); |
|
//Logo |
((ChampMultiValeurs) hmIdentite.get("logos")).peupler(personne.getString("truk_logo")); |
|
/*-------------------------------------------------- |
Adresse |
---------------------------------------------------*/ |
|
// Adresse |
((TextField<String>) hmAdresse.get("tfAdresse1")).setValue((String) personne.get("adresse_01")); |
|
// Complément |
((TextField<String>) hmAdresse.get("tfAdresse2")).setValue((String) personne.get("adresse_02")); |
|
//Boite postale |
((TextField<String>) hmAdresse.get("tfBoitePostale")).setValue((String) personne.get("bp")); |
|
//Pays |
String strPays = personne.get("pays"); |
ComboBox<Valeur> cbPays = (ComboBox<Valeur>) hmAdresse.get("cbPays"); |
|
|
if (cbPays.getStore().findModel("nom", strPays) != null) { |
cbPays.setValue(cbPays.getStore().findModel("nom", strPays)); |
} else { |
cbPays.setRawValue(strPays); |
} |
|
//Région |
String strRegion = personne.get("region"); |
if ((strRegion!=null)&&(!strRegion.equals(""))) { |
ComboBox<Valeur> cbRegion = (ComboBox<Valeur>) hmAdresse.get("cbRegion"); |
cbRegion.setVisible(true); |
|
if (cbRegion.getStore().findModel("nom", strRegion) != null) { |
cbRegion.setValue(cbRegion.getStore().findModel("nom", strRegion)); |
} else { |
cbRegion.setRawValue(strRegion); |
} |
} |
|
//Cp |
((TextField) hmAdresse.get("tfCodePostal")).setValue(personne.get("code_postal")); |
|
//Ville |
((TextField) hmAdresse.get("tfVille")).setValue(personne.get("ville")); |
|
gererEtatActivationBouton(); |
|
nouvellesDonnees = null; |
} else { |
Info.display("messages", info.getMessages().toString()); |
} |
} |
} |
|
if (nouvellesDonnees == null) { |
ComboBox cb= (ComboBox) hmIdentite.get("cbPrefixe"); |
925,6 → 816,123 |
} |
} |
|
private void mettreAJourPersonne(Personne personne) { |
|
|
//Mise à jour de la personne |
//Personne personne = (Personne) nouvellesDonnees; |
|
ComboBox cbProjets = (ComboBox) hmIdentite.get("cbProjets"); |
cbProjets.setValue(cbProjets.getStore().findModel("id_projet", personne.get("ce_projet"))); |
|
//Prefixe |
String prefixe = personne.get("ce_truk_prefix"); |
ComboBox<Valeur> cbPrefixe = (ComboBox<Valeur>) hmIdentite.get("cbPrefixe"); |
|
|
String prefixeCourant = personne.get("ce_truk_prefix"); |
if (cbPrefixe.getStore().findModel("id_valeur", prefixeCourant) != null) { |
cbPrefixe.setValue(cbPrefixe.getStore().findModel("id_valeur", prefixeCourant)); |
} else { |
cbPrefixe.setRawValue(prefixeCourant); |
} |
|
|
((TextField) hmIdentite.get("tfPrenom")).setValue(personne.get("prenom")); |
((TextField) hmIdentite.get("tfNom")).setValue(personne.get("nom")); |
|
//Suffixe |
String suffixe = personne.get("ce_truk_suffixe"); |
ComboBox<Valeur> cbSuffixe = (ComboBox<Valeur>) hmIdentite.get("cbSuffixe"); |
|
String suffixeCourant = personne.get("ce_truk_suffix"); |
if (cbSuffixe.getStore().findModel("id_valeur", suffixeCourant) != null) { |
cbSuffixe.setValue(cbSuffixe.getStore().findModel("id_valeur", suffixeCourant)); |
} else { |
cbSuffixe.setRawValue(suffixeCourant); |
} |
|
((TextField) hmIdentite.get("tfNomAutre")).setValue(personne.get("truk_nom_autre")); |
((TextField) hmIdentite.get("tfAbreviation")).setValue(personne.get("abreviation")); |
((TextField) hmIdentite.get("tfAbreviationAutre")).setValue(personne.get("truk_abreviation_autre")); |
|
|
(((DateField) hmIdentite.get("dfDateNaissance"))).setValue(personne.getDate("naissance_date")); |
((TextField) hmIdentite.get("tfLieuNaissance")).setValue(personne.get("naissance_lieu")); |
|
(((DateField) hmIdentite.get("dfDateDeces"))).setValue(personne.getDate("deces_date")); |
((TextField) hmIdentite.get("tfLieuDeces")).setValue(personne.get("deces_lieu")); |
|
((ChampMultiValeursMultiTypes) hmIdentite.get("telephones")).peupler(personne.getString("truk_telephone")); |
|
//Courriel |
((ChampMultiValeurs) hmIdentite.get("courriels")).peupler(personne.getCourriel()); |
|
//Sites web |
((ChampMultiValeurs) hmIdentite.get("sites")).peupler(personne.getString("truk_url")); |
|
|
// Sexe |
String strSexe = personne.get("ce_sexe"); |
ComboBox<Valeur> cbSexe = (ComboBox<Valeur>) hmIdentite.get("cbSexe"); |
|
if (cbSexe.getStore().findModel("id_valeur", strSexe) != null) { |
cbSexe.setValue(cbSexe.getStore().findModel("id_valeur", strSexe)); |
} else { |
cbSexe.setRawValue(strSexe); |
} |
|
((TextArea) hmIdentite.get("taDescription")).setRawValue((String) personne.get("description")); |
|
//Logo |
((ChampMultiValeurs) hmIdentite.get("logos")).peupler(personne.getString("truk_logo")); |
|
/*-------------------------------------------------- |
Adresse |
---------------------------------------------------*/ |
|
// Adresse |
((TextField<String>) hmAdresse.get("tfAdresse1")).setValue((String) personne.get("adresse_01")); |
|
// Complément |
((TextField<String>) hmAdresse.get("tfAdresse2")).setValue((String) personne.get("adresse_02")); |
|
//Boite postale |
((TextField<String>) hmAdresse.get("tfBoitePostale")).setValue((String) personne.get("bp")); |
|
//Pays |
String strPays = personne.get("pays"); |
ComboBox<Valeur> cbPays = (ComboBox<Valeur>) hmAdresse.get("cbPays"); |
|
|
if (cbPays.getStore().findModel("nom", strPays) != null) { |
cbPays.setValue(cbPays.getStore().findModel("nom", strPays)); |
} else { |
cbPays.setRawValue(strPays); |
} |
|
//Région |
String strRegion = personne.get("region"); |
if ((strRegion!=null)&&(!strRegion.equals(""))) { |
ComboBox<Valeur> cbRegion = (ComboBox<Valeur>) hmAdresse.get("cbRegion"); |
cbRegion.setVisible(true); |
|
if (cbRegion.getStore().findModel("nom", strRegion) != null) { |
cbRegion.setValue(cbRegion.getStore().findModel("nom", strRegion)); |
} else { |
cbRegion.setRawValue(strRegion); |
} |
} |
|
//Cp |
((TextField) hmAdresse.get("tfCodePostal")).setValue(personne.get("code_postal")); |
|
//Ville |
((TextField) hmAdresse.get("tfVille")).setValue(personne.get("ville")); |
|
gererEtatActivationBouton(); |
|
} |
|
public void remplirCombobox(String idComboBox, List liste, String hashMapId) { |
HashMap hm = null; |
956,10 → 964,10 |
public void reinitialiser() { |
mediateur.afficherPopinChargement(); |
|
binderPersonne(personneSauvegarde); |
layout(); |
mettreAJourPersonne(personneSauvegarde); |
|
mediateur.masquerPopinChargement(); |
|
} |
|
public void binderPersonne(Personne personne) { |