13,6 → 13,7 |
import org.tela_botanica.client.RegistreId; |
import org.tela_botanica.client.composants.ChampMultiValeurs; |
import org.tela_botanica.client.composants.ChampMultiValeursImage; |
import org.tela_botanica.client.composants.ChampMultiValeursMultiTypes; |
import org.tela_botanica.client.images.Images; |
import org.tela_botanica.client.interfaces.Rafraichissable; |
import org.tela_botanica.client.modeles.Configuration; |
428,72 → 429,15 |
fsContactTel.setHeading("Contact - Téléphones"); |
fsContactTel.setLayout(new RowLayout()); |
|
|
ChampMultiValeursMultiTypes telephones = new ChampMultiValeursMultiTypes("Téléphones"); |
hmIdentite.put("telephones", telephones); |
telephones.initialiserType("tel", mediateur); |
fsContactTel.add(telephones); |
right.add(fsContactTel); |
hmIdentite.put("fsContactTel", fsContactTel); |
|
LayoutContainer lcTelephone = new LayoutContainer(); |
lcTelephone.setLayout(new ColumnLayout()); |
|
TextField tfTelephone = new TextField(); |
tfTelephone.setFieldLabel("tel"); |
lcTelephone.add(tfTelephone, new ColumnData(0.40)); |
|
hmIdentite.put("tfTelephone", tfTelephone); |
|
ListStore<Valeur> storeTel = new ListStore<Valeur>(); |
ComboBox<Valeur> cbTelephone = new ComboBox<Valeur>(); |
cbTelephone.setDisplayField("nom"); |
cbTelephone.setEmptyText("Choisissez:"); |
cbTelephone.setStore(storeTel); |
|
lcTelephone.add(cbTelephone, new ColumnData(0.40)); |
hmIdentite.put("cbTelephone", cbTelephone); |
|
mediateur.obtenirListeValeurEtRafraichir(this, "tel"); |
|
Button bAjouter = new Button(); |
bAjouter.setIcon(Images.ICONES.ajouter()); |
// TODO : taille du bouton trop grande |
bAjouter.addSelectionListener( |
new SelectionListener<ButtonEvent>() { |
public void componentSelected(ButtonEvent ce) { |
|
String strTelephone = ((TextField<String>) hmIdentite.get("tfTelephone")).getValue(); |
if ((strTelephone==null)||(strTelephone.trim().equals(""))) { |
MessageBox.alert("Erreur de saisie", "Vous devez saisir un numéro de téléphone", null); |
} else if (hmIdentite.get("tel-" + strTelephone) != null){ |
MessageBox.alert("Erreur de saisie", "Le numéro saisi est déjà présent dans la liste", null); |
} else { |
String strValeurTypeTel = ""; |
String idTel = ""; |
Valeur valeurTypeTel = ((ComboBox<Valeur>) hmIdentite.get("cbTelephone")).getValue(); |
|
if (valeurTypeTel != null) { |
strValeurTypeTel = valeurTypeTel.getNom(); |
idTel = valeurTypeTel.get("abreviation"); |
} else { |
strValeurTypeTel = ((ComboBox<Valeur>) hmIdentite.get("cbTelephone")).getRawValue(); |
idTel = strValeurTypeTel; |
} |
|
if (strValeurTypeTel.trim().equals("")) { |
MessageBox.alert("Erreur de saisie", "Vous devez saisir un type de téléphone", null); |
} else { |
ajouterTelephone(strTelephone, strValeurTypeTel, idTel); |
} |
} |
} |
} |
); |
|
lcTelephone.add(bAjouter, new ColumnData(0.15)); |
|
HiddenField<String> hfTelephone = new HiddenField<String>(); |
add(hfTelephone); |
hmIdentite.put("hfTelephone", hfTelephone); |
|
fsContactTel.add(lcTelephone); |
|
FieldSet fsContact = new FieldSet(); |
fsContact.setHeading("Contact - Autres"); |
fsContact.setId("fsContact"); |
918,7 → 862,7 |
|
|
// Telephone |
HashMap<String, String> hmTelephone = (HashMap<String, String>) personne.getChaineDenormaliseAsMapOrList("truk_telephone"); |
/*HashMap<String, String> hmTelephone = (HashMap<String, String>) personne.getChaineDenormaliseAsMapOrList("truk_telephone"); |
if (hmTelephone!=null) { |
|
ListStore storeTelephone = ((ComboBox) hmIdentite.get("cbTelephone")).getStore(); |
943,8 → 887,10 |
|
ajouterTelephone(strTelephone, idTel, strTypeTelephone); |
} |
} |
}*/ |
|
((ChampMultiValeursMultiTypes) hmIdentite.get("telephones")).peupler(personne.getString("truk_telephone")); |
|
//Courriel |
((ChampMultiValeurs) hmIdentite.get("courriels")).peupler(personne.getCourriel()); |
|
1350,7 → 1296,7 |
strValeur = obtenirValeurCombo("cbRegion"); |
personneSelectionnee.set("ce_truk_region", strValeur); |
|
personneSelectionnee.set("truk_telephone", ((HiddenField<String>) hmIdentite.get("hfTelephone")).getValue()); |
personneSelectionnee.set("truk_telephone", ((ChampMultiValeursMultiTypes) hmIdentite.get("telephones")).getValeurs()); |
|
String logoUrls = ((ChampMultiValeursImage) hmIdentite.get("logos")).getValeurs(); |
personneSelectionnee.set("truk_logo", logoUrls); |