| Line 22... |
Line 22... |
| 22 |
import org.tela_botanica.client.modeles.MenuApplicationId;
|
22 |
import org.tela_botanica.client.modeles.MenuApplicationId;
|
| 23 |
import org.tela_botanica.client.modeles.Personne;
|
23 |
import org.tela_botanica.client.modeles.Personne;
|
| 24 |
import org.tela_botanica.client.modeles.PersonneListe;
|
24 |
import org.tela_botanica.client.modeles.PersonneListe;
|
| 25 |
import org.tela_botanica.client.modeles.Projet;
|
25 |
import org.tela_botanica.client.modeles.Projet;
|
| 26 |
import org.tela_botanica.client.modeles.ProjetListe;
|
26 |
import org.tela_botanica.client.modeles.ProjetListe;
|
| - |
|
27 |
import org.tela_botanica.client.modeles.Publication;
|
| 27 |
import org.tela_botanica.client.modeles.Utilisateur;
|
28 |
import org.tela_botanica.client.modeles.Utilisateur;
|
| 28 |
import org.tela_botanica.client.modeles.Valeur;
|
29 |
import org.tela_botanica.client.modeles.Valeur;
|
| 29 |
import org.tela_botanica.client.modeles.ValeurListe;
|
30 |
import org.tela_botanica.client.modeles.ValeurListe;
|
| 30 |
import org.tela_botanica.client.util.Pattern;
|
31 |
import org.tela_botanica.client.util.Pattern;
|
| 31 |
import org.tela_botanica.client.util.UtilString;
|
32 |
import org.tela_botanica.client.util.UtilString;
|
| Line 85... |
Line 86... |
| 85 |
// VARIABLES
|
86 |
// VARIABLES
|
| 86 |
private TabItem tiIdentite, tiAdresses, tiInfosNat;
|
87 |
private TabItem tiIdentite, tiAdresses, tiInfosNat;
|
| 87 |
private Mediateur mediateur;
|
88 |
private Mediateur mediateur;
|
| 88 |
private Configuration config = (Configuration) Registry.get(RegistreId.CONFIG);
|
89 |
private Configuration config = (Configuration) Registry.get(RegistreId.CONFIG);
|
| 89 |
private Personne personneSelectionnee, personneSauvegarde = null;
|
90 |
private Personne personneSelectionnee, personneSauvegarde = null;
|
| 90 |
private String mode = "";
|
91 |
protected String mode = "";
|
| Line 91... |
Line 92... |
| 91 |
|
92 |
|
| 92 |
//hmIdentite[...] référence par une chaine de caractère tous les composants de l'onglet Identite
|
93 |
//hmIdentite[...] référence par une chaine de caractère tous les composants de l'onglet Identite
|
| 93 |
private HashMap<String, Widget>hmIdentite = new HashMap<String, Widget>();
|
94 |
private HashMap<String, Widget>hmIdentite = new HashMap<String, Widget>();
|
| 94 |
private HashMap<String, Widget>hmAdresse = new HashMap<String, Widget>();
|
95 |
private HashMap<String, Widget>hmAdresse = new HashMap<String, Widget>();
|
| Line 98... |
Line 99... |
| 98 |
|
99 |
|
| Line 99... |
Line 100... |
| 99 |
private Button enregistrer, enregistrerEtRevenir;
|
100 |
private Button enregistrer, enregistrerEtRevenir;
|
| 100 |
|
101 |
|
| - |
|
102 |
public static final String MODE_AJOUTER = "AJOUT";
|
| 101 |
public static final String MODE_AJOUTER = "AJOUT";
|
103 |
public static final String MODE_MODIFIER = "MODIF";
|
| Line 102... |
Line 104... |
| 102 |
public static final String MODE_MODIFIER = "MODIF";
|
104 |
private Personne personne = null;
|
| Line 103... |
Line 105... |
| 103 |
private final String personneId;
|
105 |
private String personneId = null;
|
| - |
|
106 |
|
| - |
|
107 |
private FormBinding binding = null;
|
| - |
|
108 |
|
| Line -... |
Line 109... |
| - |
|
109 |
// CONSTRUCTEUR
|
| - |
|
110 |
public PersonneForm(Mediateur mediateurCourrant, String mode, String personneId) {
|
| - |
|
111 |
initialiserPersonneForm(mediateurCourrant, personneId);
|
| - |
|
112 |
}
|
| Line 104... |
Line -... |
| 104 |
|
- |
|
| 105 |
private FormBinding binding = null;
|
- |
|
| 106 |
|
113 |
|
| - |
|
114 |
public PersonneForm(Mediateur mediateurCourrant, String personneId, Rafraichissable vueARafraichirApresValidation) {
|
| - |
|
115 |
vueExterneARafraichirApresValidation = vueARafraichirApresValidation;
|
| - |
|
116 |
initialiserPersonneForm(mediateurCourrant, personneId);
|
| Line 107... |
Line 117... |
| 107 |
// CONSTRUCTEUR
|
117 |
}
|
| 108 |
|
- |
|
| 109 |
|
118 |
|
| - |
|
119 |
private void initialiserPersonneForm(Mediateur mediateurCourrant, String personneIdCourrant) {
|
| 110 |
|
120 |
personne = new Personne();
|
| - |
|
121 |
personne.setId(personneIdCourrant);
|
| Line 111... |
Line -... |
| 111 |
|
- |
|
| 112 |
public PersonneForm(Mediateur mediateur, String mode, String personneId) {
|
122 |
personneId = personneIdCourrant;
|
| 113 |
|
- |
|
| 114 |
this.personneId = personneId;
|
- |
|
| 115 |
this.mediateur = mediateur;
|
123 |
|
| 116 |
initialiserFormulaire(mediateur, mode, MenuApplicationId.PERSONNE);
|
124 |
String modeDeCreation = (personneId.isEmpty() ? Formulaire.MODE_AJOUTER : Formulaire.MODE_MODIFIER);
|
| - |
|
125 |
initialiserFormulaire(mediateurCourrant, modeDeCreation, MenuApplicationId.PERSONNE);
|
| 117 |
initialiserComposants();
|
126 |
|
| - |
|
127 |
initialiserComposants();
|
| - |
|
128 |
genererTitreFormulaire();
|
| - |
|
129 |
|
| - |
|
130 |
if (modeDeCreation.equals(Formulaire.MODE_MODIFIER)) {
|
| - |
|
131 |
mediateur.selectionnerPersonne(this, personne, null);
|
| 118 |
|
132 |
}
|
| 119 |
String titreFormulaire = "";
|
133 |
}
|
| Line 120... |
Line 134... |
| 120 |
if (mode.equals(MODE_MODIFIER)) {
|
134 |
|
| 121 |
titreFormulaire = mediateur.i18nC.personneModeModifier() + " ID: " + personneId;
|
135 |
private void genererTitreFormulaire() {
|
| 122 |
} else {
|
136 |
String titre = i18nC.personneModeAjout();
|
| Line 146... |
Line 160... |
| 146 |
public void initialiserOnglets() {
|
160 |
public void initialiserOnglets() {
|
| 147 |
//TabPanel
|
161 |
//TabPanel
|
| 148 |
TabPanel formulaireOnglets = new TabPanel();
|
162 |
TabPanel formulaireOnglets = new TabPanel();
|
| Line 149... |
Line 163... |
| 149 |
|
163 |
|
| 150 |
//Tab 1 : identite
|
164 |
//Tab 1 : identite
|
| 151 |
tiIdentite = new TabItem(mediateur.i18nC.personneIdentite());
|
165 |
tiIdentite = new TabItem(i18nC.personneIdentite());
|
| 152 |
tiIdentite.setLayout(new FormLayout());
|
166 |
tiIdentite.setLayout(new FormLayout());
|
| Line 153... |
Line 167... |
| 153 |
tiIdentite.setScrollMode(Scroll.AUTO);
|
167 |
tiIdentite.setScrollMode(Scroll.AUTO);
|
| 154 |
|
168 |
|
| Line 155... |
Line 169... |
| 155 |
formulaireOnglets.add(tiIdentite);
|
169 |
formulaireOnglets.add(tiIdentite);
|
| 156 |
hmIdentite.put("tiIdentite", tiIdentite);
|
170 |
hmIdentite.put("tiIdentite", tiIdentite);
|
| 157 |
|
171 |
|
| 158 |
//Tab 2 : Adresse
|
172 |
//Tab 2 : Adresse
|
| 159 |
tiAdresses = new TabItem(mediateur.i18nC.adresse());
|
173 |
tiAdresses = new TabItem(i18nC.adresse());
|
| Line 160... |
Line 174... |
| 160 |
tiAdresses.setLayout(new FormLayout());
|
174 |
tiAdresses.setLayout(new FormLayout());
|
| 161 |
tiAdresses.setScrollMode(Scroll.AUTO);
|
175 |
tiAdresses.setScrollMode(Scroll.AUTO);
|
| 162 |
formulaireOnglets.add(tiAdresses);
|
176 |
formulaireOnglets.add(tiAdresses);
|
| 163 |
|
177 |
|
| Line 164... |
Line 178... |
| 164 |
//Tab 3 : Infos Naturalistes
|
178 |
//Tab 3 : Infos Naturalistes
|
| 165 |
tiInfosNat = new TabItem(mediateur.i18nC.personneInfoNat());
|
179 |
tiInfosNat = new TabItem(i18nC.personneInfoNat());
|
| Line 198... |
Line 212... |
| 198 |
// Création des champs
|
212 |
// Création des champs
|
| 199 |
FormLayout formLayout = new FormLayout();
|
213 |
FormLayout formLayout = new FormLayout();
|
| 200 |
formLayout.setLabelAlign(LabelAlign.LEFT);
|
214 |
formLayout.setLabelAlign(LabelAlign.LEFT);
|
| Line 201... |
Line 215... |
| 201 |
|
215 |
|
| 202 |
FieldSet fsProjet = new FieldSet();
|
216 |
FieldSet fsProjet = new FieldSet();
|
| 203 |
fsProjet.setHeading(mediateur.i18nC.menuProjet());
|
217 |
fsProjet.setHeading(i18nC.menuProjet());
|
| Line 204... |
Line 218... |
| 204 |
fsProjet.setLayout(new FormLayout());
|
218 |
fsProjet.setLayout(new FormLayout());
|
| 205 |
|
219 |
|
| 206 |
ListStore<Projet> storeProjets = new ListStore<Projet>();
|
220 |
ListStore<Projet> storeProjets = new ListStore<Projet>();
|
| 207 |
ComboBox cbProjets = new ComboBox<Projet>();
|
221 |
ComboBox cbProjets = new ComboBox<Projet>();
|
| 208 |
cbProjets.setFieldLabel(mediateur.i18nC.personneProjet()+ " :");
|
222 |
cbProjets.setFieldLabel(i18nC.personneProjet()+ " :");
|
| 209 |
cbProjets.setEmptyText(mediateur.i18nC.txtListeProjetDefaut());
|
223 |
cbProjets.setEmptyText(i18nC.txtListeProjetDefaut());
|
| 210 |
cbProjets.setLabelSeparator("");
|
224 |
cbProjets.setLabelSeparator("");
|
| 211 |
cbProjets.setDisplayField("nom");
|
225 |
cbProjets.setDisplayField("nom");
|
| 212 |
cbProjets.setEditable(false);
|
226 |
cbProjets.setEditable(false);
|
| Line 225... |
Line 239... |
| 225 |
fsNoms.setHeading("Noms");
|
239 |
fsNoms.setHeading("Noms");
|
| 226 |
fsNoms.setLayout(formLayout);
|
240 |
fsNoms.setLayout(formLayout);
|
| Line 227... |
Line 241... |
| 227 |
|
241 |
|
| 228 |
// Nom complet : Affiché que si valeurs saisies
|
242 |
// Nom complet : Affiché que si valeurs saisies
|
| 229 |
LabelField nomComplet = new LabelField();
|
243 |
LabelField nomComplet = new LabelField();
|
| 230 |
nomComplet.setFieldLabel(mediateur.i18nC.personneNomComplet() +" :");
|
244 |
nomComplet.setFieldLabel(i18nC.personneNomComplet() +" :");
|
| Line 231... |
Line 245... |
| 231 |
nomComplet.hide();
|
245 |
nomComplet.hide();
|
| 232 |
|
246 |
|
| Line 467... |
Line 481... |
| 467 |
|
481 |
|
| 468 |
// Logo
|
482 |
// Logo
|
| 469 |
LayoutContainer lcLogoUrl = new LayoutContainer();
|
483 |
LayoutContainer lcLogoUrl = new LayoutContainer();
|
| Line 470... |
Line 484... |
| 470 |
hmIdentite.put("lcLogoUrl", lcLogoUrl);
|
484 |
hmIdentite.put("lcLogoUrl", lcLogoUrl);
|
| 471 |
|
485 |
|
| 472 |
ChampMultiValeursImage logo = new ChampMultiValeursImage(mediateur.i18nC.personneLogos());
|
486 |
ChampMultiValeursImage logo = new ChampMultiValeursImage(i18nC.personneLogos());
|
| 473 |
logo.setImageHeight("150px");
|
487 |
logo.setImageHeight("150px");
|
| 474 |
logo.setValeurParDefaut("http://");
|
488 |
logo.setValeurParDefaut("http://");
|
| 475 |
logo.setValidation(Pattern.url, "http://www.monsite.com/mon_image.jpg");
|
489 |
logo.setValidation(Pattern.url, "http://www.monsite.com/mon_image.jpg");
|
| Line 604... |
Line 618... |
| 604 |
public void creerComposantsInfosNat() {
|
618 |
public void creerComposantsInfosNat() {
|
| Line 605... |
Line 619... |
| 605 |
|
619 |
|
| 606 |
FieldSet fsInfosNat = new FieldSet();
|
620 |
FieldSet fsInfosNat = new FieldSet();
|
| Line 607... |
Line 621... |
| 607 |
fsInfosNat.setTitle("Informations Naturaliste");
|
621 |
fsInfosNat.setTitle("Informations Naturaliste");
|
| 608 |
|
622 |
|
| 609 |
ChampMultiValeurs specialite = new ChampMultiValeurs(mediateur.i18nC.personneSpecialite());
|
623 |
ChampMultiValeurs specialite = new ChampMultiValeurs(i18nC.personneSpecialite());
|
| Line 610... |
Line 624... |
| 610 |
fsInfosNat.add(specialite);
|
624 |
fsInfosNat.add(specialite);
|
| 611 |
hmInfosNat.put("specialite", specialite);
|
625 |
hmInfosNat.put("specialite", specialite);
|
| 612 |
|
626 |
|
| Line 613... |
Line 627... |
| 613 |
ChampMultiValeursMultiTypes recolte = new ChampMultiValeursMultiTypes(mediateur.i18nC.personneRecolte());
|
627 |
ChampMultiValeursMultiTypes recolte = new ChampMultiValeursMultiTypes(i18nC.personneRecolte());
|
| 614 |
recolte.initialiserType("pays");
|
628 |
recolte.initialiserType("pays");
|