Subversion Repositories eFlore/Applications.coel

Rev

Rev 867 | Rev 883 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 867 Rev 875
1
package org.tela_botanica.client.vues;
1
package org.tela_botanica.client.vues;
-
 
2
 
-
 
3
import java.util.ArrayList;
2
 
4
 
3
import org.tela_botanica.client.Mediateur;
5
import org.tela_botanica.client.Mediateur;
4
import org.tela_botanica.client.composants.ChampComboBoxListeValeurs;
6
import org.tela_botanica.client.composants.ChampComboBoxListeValeurs;
5
import org.tela_botanica.client.interfaces.Rafraichissable;
7
import org.tela_botanica.client.interfaces.Rafraichissable;
6
import org.tela_botanica.client.modeles.Collection;
8
import org.tela_botanica.client.modeles.Collection;
7
import org.tela_botanica.client.modeles.Information;
9
import org.tela_botanica.client.modeles.Information;
8
import org.tela_botanica.client.modeles.MenuApplicationId;
10
import org.tela_botanica.client.modeles.MenuApplicationId;
9
import org.tela_botanica.client.modeles.Valeur;
11
import org.tela_botanica.client.modeles.Valeur;
-
 
12
import org.tela_botanica.client.util.UtilArray;
10
 
13
 
11
import com.extjs.gxt.ui.client.event.BaseEvent;
14
import com.extjs.gxt.ui.client.event.BaseEvent;
12
import com.extjs.gxt.ui.client.event.ButtonEvent;
15
import com.extjs.gxt.ui.client.event.ButtonEvent;
13
import com.extjs.gxt.ui.client.event.Events;
16
import com.extjs.gxt.ui.client.event.Events;
14
import com.extjs.gxt.ui.client.event.Listener;
17
import com.extjs.gxt.ui.client.event.Listener;
15
import com.extjs.gxt.ui.client.event.SelectionListener;
18
import com.extjs.gxt.ui.client.event.SelectionListener;
16
import com.extjs.gxt.ui.client.widget.Info;
19
import com.extjs.gxt.ui.client.widget.Info;
-
 
20
import com.extjs.gxt.ui.client.widget.MessageBox;
17
import com.extjs.gxt.ui.client.widget.TabItem;
21
import com.extjs.gxt.ui.client.widget.TabItem;
18
import com.extjs.gxt.ui.client.widget.TabPanel;
22
import com.extjs.gxt.ui.client.widget.TabPanel;
19
import com.extjs.gxt.ui.client.widget.button.Button;
23
import com.extjs.gxt.ui.client.widget.button.Button;
20
import com.extjs.gxt.ui.client.widget.form.FieldSet;
24
import com.extjs.gxt.ui.client.widget.form.FieldSet;
21
import com.extjs.gxt.ui.client.widget.form.TextField;
25
import com.extjs.gxt.ui.client.widget.form.TextField;
22
import com.extjs.gxt.ui.client.widget.form.FormPanel.LabelAlign;
26
import com.extjs.gxt.ui.client.widget.form.FormPanel.LabelAlign;
23
import com.extjs.gxt.ui.client.widget.layout.FormData;
27
import com.extjs.gxt.ui.client.widget.layout.FormData;
24
import com.google.gwt.core.client.GWT;
28
import com.google.gwt.core.client.GWT;
25
 
29
 
26
public class CollectionForm extends Formulaire implements Rafraichissable {
30
public class CollectionForm extends Formulaire implements Rafraichissable {
27
 
31
 
28
	protected Collection collection = null;
32
	protected Collection collection = null;
29
	protected Collection collectionCollectee = null;
33
	protected Collection collectionCollectee = null;
30
 
34
 
31
	private ChampComboBoxListeValeurs typesCollectionCombo = null;
35
	private ChampComboBoxListeValeurs typesCollectionCombo = null;
32
	
36
	
33
	private TabPanel onglets = null;
37
	private TabPanel onglets = null;
34
	private CollectionFormGeneral generalOnglet = null;
38
	private CollectionFormGeneral generalOnglet = null;
35
	private CollectionFormPersonne personneOnglet = null;
39
	private CollectionFormPersonne personneOnglet = null;
36
	private CollectionFormPublication publicationOnglet = null;
40
	private CollectionFormPublication publicationOnglet = null;
37
	private CollectionFormDescription descriptionOnglet = null;
41
	private CollectionFormDescription descriptionOnglet = null;
38
	private CollectionFormContenu contenuOnglet = null;
42
	private CollectionFormContenu contenuOnglet = null;
39
	private CollectionFormInventaire inventaireOnglet = null;
43
	private CollectionFormInventaire inventaireOnglet = null;
40
	private TextField<String> nomChp = null;
44
	private TextField<String> nomChp = null;
41
	
45
	
42
	public CollectionForm(Mediateur mediateurCourrant, String modeDeCreation) {
46
	public CollectionForm(Mediateur mediateurCourrant, String modeDeCreation) {
43
		initialiserFormulaire(mediateurCourrant, modeDeCreation, MenuApplicationId.COLLECTION);
47
		initialiserFormulaire(mediateurCourrant, modeDeCreation, MenuApplicationId.COLLECTION);
44
		creerFieldsetPrincipal();
48
		creerFieldsetPrincipal();
45
	}
49
	}
46
	
50
	
47
	private void creerFieldsetPrincipal() {
51
	private void creerFieldsetPrincipal() {
48
		FieldSet principalFieldSet = new FieldSet();
52
		FieldSet principalFieldSet = new FieldSet();
49
		principalFieldSet.setHeading("Info");
53
		principalFieldSet.setHeading("Info");
50
		principalFieldSet.setCollapsible(true);
54
		principalFieldSet.setCollapsible(true);
51
		principalFieldSet.setLayout(Formulaire.creerFormLayout(150, LabelAlign.LEFT));
55
		principalFieldSet.setLayout(Formulaire.creerFormLayout(150, LabelAlign.LEFT));
52
		
56
		
53
		nomChp  = new TextField<String>();
57
		nomChp  = new TextField<String>();
54
		nomChp.setTabIndex(tabIndex++);
58
		nomChp.setTabIndex(tabIndex++);
55
		nomChp.setFieldLabel(i18nC.nomCollection());
59
		nomChp.setFieldLabel(i18nC.nomCollection());
56
		nomChp.setAllowBlank(false);
60
		nomChp.setAllowBlank(false);
57
		nomChp.getMessages().setBlankText(i18nC.champObligatoire());
61
		nomChp.getMessages().setBlankText(i18nC.champObligatoire());
58
		principalFieldSet.add(nomChp, new FormData(450, 0));
62
		principalFieldSet.add(nomChp, new FormData(450, 0));
59
		
63
		
60
		typesCollectionCombo = new ChampComboBoxListeValeurs(i18nC.typeCollectionNcd(), "typeCollectionNcd", tabIndex++);
64
		typesCollectionCombo = new ChampComboBoxListeValeurs(i18nC.typeCollectionNcd(), "typeCollectionNcd", tabIndex++);
61
		typesCollectionCombo.peupler(Valeur.COLLECTION_NCD_HERBIER);
65
		typesCollectionCombo.peupler(Valeur.COLLECTION_NCD_HERBIER);
62
		typesCollectionCombo.addListener(Events.Select, new Listener<BaseEvent>() {
66
		typesCollectionCombo.addListener(Events.Select, new Listener<BaseEvent>() {
63
			@Override
67
			@Override
64
			public void handleEvent(BaseEvent be) {
68
			public void handleEvent(BaseEvent be) {
65
				Valeur valeur = typesCollectionCombo.getValue();
69
				Valeur valeur = typesCollectionCombo.getValue();
66
				panneauFormulaire.remove(onglets);
70
				panneauFormulaire.remove(onglets);
67
				mediateur.activerChargement("");
71
				mediateur.activerChargement("");
68
				if (valeur != null && valeur.getId().equals(Valeur.COLLECTION_NCD_HERBIER)) {
72
				if (valeur != null && valeur.getId().equals(Valeur.COLLECTION_NCD_HERBIER)) {
69
					onglets = creerOngletsHerbier();
73
					onglets = creerOngletsHerbier();
70
					panneauFormulaire.add(onglets);
74
					panneauFormulaire.add(onglets);
71
				} else {
75
				} else {
72
					onglets = creerOngletsDefaut();
76
					onglets = creerOngletsDefaut();
73
					panneauFormulaire.add(onglets);
77
					panneauFormulaire.add(onglets);
74
				}
78
				}
75
				mediateur.desactiverChargement();
79
				mediateur.desactiverChargement();
76
				panneauFormulaire.layout();
80
				panneauFormulaire.layout();
77
			}
81
			}
78
		});
82
		});
79
		principalFieldSet.add(typesCollectionCombo, new FormData(150, 0));
83
		principalFieldSet.add(typesCollectionCombo, new FormData(150, 0));
80
		typesCollectionCombo.fireEvent(Events.Select);
84
		typesCollectionCombo.fireEvent(Events.Select);
81
		
85
		
82
		panneauFormulaire.setTopComponent(principalFieldSet);
86
		panneauFormulaire.setTopComponent(principalFieldSet);
83
	}
87
	}
84
	
88
	
85
	protected TabPanel creerOngletsDefaut() {
89
	protected TabPanel creerOngletsDefaut() {
86
		TabPanel ongletsCollectionDefaut = new TabPanel();
90
		TabPanel ongletsCollectionDefaut = new TabPanel();
87
		
91
		
88
		// Onlget formulaire GENERAL
92
		// Onlget formulaire GENERAL
89
		ongletsCollectionDefaut.add(creerOngletGeneral());
93
		ongletsCollectionDefaut.add(creerOngletGeneral());
90
		
94
		
91
		// Onlget formulaire AUTEUR
95
		// Onlget formulaire AUTEUR
92
		ongletsCollectionDefaut.add(creerOngletPersonne());
96
		ongletsCollectionDefaut.add(creerOngletPersonne());
93
 
97
 
94
		return ongletsCollectionDefaut;
98
		return ongletsCollectionDefaut;
95
	}
99
	}
96
	
100
	
97
	protected TabPanel creerOngletsHerbier() {
101
	protected TabPanel creerOngletsHerbier() {
98
		TabPanel ongletsCollectionHerbier = new TabPanel();
102
		TabPanel ongletsCollectionHerbier = new TabPanel();
99
		// NOTE : pour faire apparaître les scrollBar il faut définir la hauteur du panneau d'onglets à 100% (autoHeight ne semble pas fonctionner) 
103
		// NOTE : pour faire apparaître les scrollBar il faut définir la hauteur du panneau d'onglets à 100% (autoHeight ne semble pas fonctionner) 
100
		ongletsCollectionHerbier.setHeight("100%");
104
		ongletsCollectionHerbier.setHeight("100%");
101
		
105
		
102
		// Onlget formulaire GENERAL
106
		// Onlget formulaire GENERAL
103
		ongletsCollectionHerbier.add(creerOngletGeneral());
107
		ongletsCollectionHerbier.add(creerOngletGeneral());
104
		
108
		
105
		// Onlget formulaire AUTEUR
109
		// Onlget formulaire AUTEUR
106
		ongletsCollectionHerbier.add(creerOngletPersonne());
110
		ongletsCollectionHerbier.add(creerOngletPersonne());
107
		
111
		
108
		// Onlget formulaire PUBLICATION
112
		// Onlget formulaire PUBLICATION
109
		ongletsCollectionHerbier.add(creerOngletPublication());
113
		ongletsCollectionHerbier.add(creerOngletPublication());
110
		
114
		
111
		// Onlget formulaire DESCRIPTION
115
		// Onlget formulaire DESCRIPTION
112
		ongletsCollectionHerbier.add(creerOngletDescription());
116
		ongletsCollectionHerbier.add(creerOngletDescription());
113
		
117
		
114
		// Onlget formulaire CONTENU
118
		// Onlget formulaire CONTENU
115
		ongletsCollectionHerbier.add(creerOngletContenu());
119
		ongletsCollectionHerbier.add(creerOngletContenu());
116
		
120
		
117
		// Onlget formulaire INVENTAIRE
121
		// Onlget formulaire INVENTAIRE
118
		ongletsCollectionHerbier.add(creerOngletInventaire());
122
		ongletsCollectionHerbier.add(creerOngletInventaire());
119
		
123
		
120
		// Sélection de l'onglet par défaut
124
		// Sélection de l'onglet par défaut
121
		ongletsCollectionHerbier.setSelection(generalOnglet);
125
		ongletsCollectionHerbier.setSelection(generalOnglet);
122
		
126
		
123
		return ongletsCollectionHerbier;
127
		return ongletsCollectionHerbier;
124
	}
128
	}
125
	
129
	
126
	private TabItem creerOngletGeneral() {
130
	private TabItem creerOngletGeneral() {
127
		generalOnglet = new CollectionFormGeneral(this);
131
		generalOnglet = new CollectionFormGeneral(this);
128
		return generalOnglet;
132
		return generalOnglet;
129
	}
133
	}
130
	
134
	
131
	private TabItem creerOngletPersonne() {
135
	private TabItem creerOngletPersonne() {
132
		personneOnglet = new CollectionFormPersonne(this);
136
		personneOnglet = new CollectionFormPersonne(this);
133
		return personneOnglet;
137
		return personneOnglet;
134
	}
138
	}
135
	
139
	
136
	private TabItem creerOngletPublication() {
140
	private TabItem creerOngletPublication() {
137
		publicationOnglet = new CollectionFormPublication(this);
141
		publicationOnglet = new CollectionFormPublication(this);
138
		return publicationOnglet;
142
		return publicationOnglet;
139
	}
143
	}
140
	
144
	
141
	private TabItem creerOngletDescription() {
145
	private TabItem creerOngletDescription() {
142
		descriptionOnglet = new CollectionFormDescription(this);
146
		descriptionOnglet = new CollectionFormDescription(this);
143
		return descriptionOnglet;
147
		return descriptionOnglet;
144
	}
148
	}
145
	
149
	
146
	private TabItem creerOngletContenu() {
150
	private TabItem creerOngletContenu() {
147
		contenuOnglet = new CollectionFormContenu(this);
151
		contenuOnglet = new CollectionFormContenu(this);
148
		return contenuOnglet;
152
		return contenuOnglet;
149
	}
153
	}
150
	
154
	
151
	private TabItem creerOngletInventaire() {
155
	private TabItem creerOngletInventaire() {
152
		inventaireOnglet = new CollectionFormInventaire(this);
156
		inventaireOnglet = new CollectionFormInventaire(this);
153
		return inventaireOnglet;
157
		return inventaireOnglet;
154
	}
158
	}
155
	
159
	
156
	public void rafraichir(Object nouvellesDonnees) {
160
	public void rafraichir(Object nouvellesDonnees) {
157
		if (nouvellesDonnees instanceof Information) {
161
		if (nouvellesDonnees instanceof Information) {
158
			Information info = (Information) nouvellesDonnees;
162
			Information info = (Information) nouvellesDonnees;
159
			rafraichirInformation(info);
163
			rafraichirInformation(info);
160
		} else {
164
		} else {
161
			GWT.log(Mediateur.i18nM.erreurRafraichir(nouvellesDonnees.getClass(), this.getClass()), null);
165
			GWT.log(Mediateur.i18nM.erreurRafraichir(nouvellesDonnees.getClass(), this.getClass()), null);
162
		}
166
		}
163
		
167
		
164
		controlerFermetureApresRafraichissement();
168
		controlerFermetureApresRafraichissement();
165
	}
169
	}
166
 
170
 
167
	private void rafraichirInformation(Information info) {
171
	private void rafraichirInformation(Information info) {
168
		if (info.getMessages() != null && !info.getMessages().toString().equals("[]")) {
172
		if (info.getMessages() != null && !info.getMessages().toString().equals("[]")) {
169
			GWT.log("MESSAGES:\n"+info.getMessages().toString(), null);
173
			GWT.log("MESSAGES:\n"+info.getMessages().toString(), null);
170
		}
174
		}
171
		
175
		
172
		if (info.getType().equals("modif_structure")) {
176
		if (info.getType().equals("modif_collection")) {
173
			Info.display("Modification d'une collection", info.toString());
177
			Info.display("Modification d'une collection", info.toString());
174
		} else if (info.getType().equals("selection_collection")) {
178
		} else if (info.getType().equals("selection_collection")) {
175
			Info.display("Modification d'une collection", info.toString());
179
			Info.display("Modification d'une collection", info.toString());
176
			if (info.getDonnee(0) != null) {
180
			if (info.getDonnee(0) != null) {
177
				collection = (Collection) info.getDonnee(0);
181
				collection = (Collection) info.getDonnee(0);
178
			}
182
			}
179
			peupler();
183
			peupler();
180
			actualiserTitrePanneau();
184
			actualiserTitrePanneau();
-
 
185
		} else if (info.getType().equals("ajout_collection")) {
-
 
186
			if (info.getDonnee(0) != null && info.getDonnee(0) instanceof String) {
-
 
187
				String collectionId = (String) info.getDonnee(0);
-
 
188
				Info.display("Ajout d'une collection", "La collection '"+collectionId+"' a bien été ajoutée");
-
 
189
			
-
 
190
				// Suite à la récupération de l'id de l'institution nouvellement ajoutée nous ajoutons les personnes et les publications liées
-
 
191
				personneOnglet.rafraichir(info);
-
 
192
				publicationOnglet.rafraichir(info);
-
 
193
			} else {
-
 
194
				Info.display("Ajout d'une Institution", info.toString());
-
 
195
			}
181
		}
196
		}
182
	}
197
	}
183
		
198
		
184
	private void peupler() {
199
	private void peupler() {
185
		if (collection != null) {
200
		if (collection != null) {
186
			nomChp.setValue(collection.getNom());
201
			nomChp.setValue(collection.getNom());
187
			typesCollectionCombo.peupler(collection.getTypeNcd());
202
			typesCollectionCombo.peupler(collection.getTypeNcd());
188
			
203
			
189
			peuplerOnglets();
204
			peuplerOnglets();
190
		}
205
		}
191
	}
206
	}
192
 
207
 
193
	private void peuplerOnglets() {
208
	private void peuplerOnglets() {
194
		generalOnglet.peupler();
209
		generalOnglet.peupler();
-
 
210
		personneOnglet.peupler();
195
	}
211
	}
196
 
212
 
197
	private void actualiserTitrePanneau() {
213
	private void actualiserTitrePanneau() {
198
		String titre = i18nC.titreModifFormCollection();
214
		String titre = i18nC.titreModifFormCollection();
199
		// Composition du titre
215
		// Composition du titre
200
		titre += " - ID : "+collection.getId();
216
		titre += " - ID : "+collection.getId();
201
		panneauFormulaire.setHeading(titre);		
217
		panneauFormulaire.setHeading(titre);		
202
	}
218
	}
203
 
219
 
204
	@Override
220
	@Override
205
	protected SelectionListener<ButtonEvent> creerEcouteurValidation() {
221
	protected SelectionListener<ButtonEvent> creerEcouteurValidation() {
206
		SelectionListener<ButtonEvent> ecouteur = new SelectionListener<ButtonEvent>() {
222
		SelectionListener<ButtonEvent> ecouteur = new SelectionListener<ButtonEvent>() {
207
			@Override
223
			@Override
208
			public void componentSelected(ButtonEvent ce) {
224
			public void componentSelected(ButtonEvent ce) {
209
				String code = ((Button) ce.getComponent()).getData("code");
225
				String code = ((Button) ce.getComponent()).getData("code");
210
				if (code.equals(FormulaireBarreValidation.CODE_BOUTON_VALIDER)) {
226
				if (code.equals(FormulaireBarreValidation.CODE_BOUTON_VALIDER)) {
211
					soumettreFormulaire();
227
					soumettreFormulaire();
212
					clicBoutonvalidation = true;
228
					clicBoutonvalidation = true;
213
				} else if (code.equals(FormulaireBarreValidation.CODE_BOUTON_APPLIQUER)) {
229
				} else if (code.equals(FormulaireBarreValidation.CODE_BOUTON_APPLIQUER)) {
214
					soumettreFormulaire();
230
					soumettreFormulaire();
215
				} else if (code.equals(FormulaireBarreValidation.CODE_BOUTON_ANNULER)) {
231
				} else if (code.equals(FormulaireBarreValidation.CODE_BOUTON_ANNULER)) {
216
					mediateur.clicMenu(menuIdCourant);
232
					mediateur.clicMenu(menuIdCourant);
217
				} else if (code.equals(FormulaireBarreValidation.CODE_BOUTON_REINITIALISER)) {
233
				} else if (code.equals(FormulaireBarreValidation.CODE_BOUTON_REINITIALISER)) {
218
					reinitialiserFormulaire();
234
					reinitialiserFormulaire();
219
				}
235
				}
220
			}
236
			}
221
		};
237
		};
222
		
238
		
223
		return ecouteur;
239
		return ecouteur;
224
	}
240
	}
225
	
241
	
226
	protected boolean soumettreFormulaire() {
242
	protected boolean soumettreFormulaire() {
227
		// Vérification de la validité des champs du formulaire
243
		// Vérification de la validité des champs du formulaire
228
		boolean fomulaireValide = verifierFormulaire();
244
		boolean fomulaireValide = verifierFormulaire();
229
		if (fomulaireValide) {
245
		if (fomulaireValide) {
230
			// Collecte des données du formulaire
246
			// Collecte des données du formulaire
231
			Collection collection = collecterCollection();
247
			Collection collection = collecterCollection();
232
			
248
			
233
			if (mode.equals(MODE_AJOUTER)) {
249
			if (mode.equals(MODE_AJOUTER)) {
234
				mediateur.ajouterCollection(this, collection);
250
				mediateur.ajouterCollection(this, collection);
235
			} else if (mode.equals(MODE_MODIFIER)) {
251
			} else if (mode.equals(MODE_MODIFIER)) {
236
				if (collection == null) {
252
				if (collection == null) {
237
					Info.display("Modification d'une collection", "Rien n'a été enregistré car le formulaire n'a pas été modifié.");
253
					Info.display("Modification d'une collection", "Rien n'a été enregistré car le formulaire n'a pas été modifié.");
238
				} else {
254
				} else {
239
					mediateur.modifierCollection(this, collection);
255
					mediateur.modifierCollection(this, collection);
240
				}
256
				}
241
			}
257
			}
-
 
258
			
-
 
259
			soumettreOnglets();
242
		}
260
		}
243
		return fomulaireValide;
261
		return fomulaireValide;
244
	}
262
	}
-
 
263
	
-
 
264
	private void soumettreOnglets() {
-
 
265
		personneOnglet.soumettre();
-
 
266
	}
245
	
267
	
246
	protected void reinitialiserFormulaire() {
268
	protected void reinitialiserFormulaire() {
247
		if (mode.equals(StructureForm.MODE_MODIFIER)) {
269
		if (mode.equals(StructureForm.MODE_MODIFIER)) {
248
			mediateur.afficherFormCollection(collection.getId());
270
			mediateur.afficherFormCollection(collection.getId());
249
		} else {
271
		} else {
250
			mediateur.afficherFormCollection(null);
272
			mediateur.afficherFormCollection(null);
251
		}
273
		}
252
	}
274
	}
253
	
275
	
254
	private Collection collecterCollection() {
276
	private Collection collecterCollection() {
255
		collectionCollectee = (Collection) collection.cloner(new Collection());
277
		collectionCollectee = (Collection) collection.cloner(new Collection());
256
		
278
		
257
		this.collecter();
279
		this.collecter();
258
		collecterOnglets();
280
		collecterOnglets();
259
		
281
		
260
		Collection collectionARetourner = null;
282
		Collection collectionARetourner = null;
261
		if (!collectionCollectee.comparer(collection)) {
283
		if (!collectionCollectee.comparer(collection)) {
262
			collectionARetourner = collection = collectionCollectee;
284
			collectionARetourner = collection = collectionCollectee;
263
		}
285
		}
264
		return collectionARetourner;
286
		return collectionARetourner;
265
	}
287
	}
266
	
288
	
267
	private void collecter() {
289
	private void collecter() {
268
		collectionCollectee.setNom(nomChp.getValue());
290
		collectionCollectee.setNom(nomChp.getValue());
269
		collectionCollectee.setTypeNcd(typesCollectionCombo.getValue().getId());
291
		collectionCollectee.setTypeNcd(typesCollectionCombo.getValue().getId());
270
	}
292
	}
271
	
293
	
272
	private void collecterOnglets() {
294
	private void collecterOnglets() {
273
		generalOnglet.collecter();
295
		generalOnglet.collecter();
274
	}
296
	}
275
	
297
	
276
	protected boolean verifierFormulaire() {
298
	protected boolean verifierFormulaire() {
-
 
299
		ArrayList<String> messages = new ArrayList<String>();
-
 
300
		
-
 
301
		// Vérification des infos sur le nom de la collection
-
 
302
		if (nomChp.getValue() == null || nomChp.getValue().equals("") || collection.getNom().equals("")) {
-
 
303
			messages.add("Veuillez donner un nom à la collection.");
-
 
304
		}
-
 
305
		
-
 
306
		// Vérification des infos sur le type de collection
-
 
307
		if (typesCollectionCombo.getValue() == null || typesCollectionCombo.getValue().equals("") || collection.getIdProjet().equals("")) {
-
 
308
			messages.add("Veuillez sélectionner un type pour la collection.");
-
 
309
		}
-
 
310
		
-
 
311
		messages.addAll(verifierOnglets());
-
 
312
				
-
 
313
		// Affichage des messages d'alerte
-
 
314
		if (messages.size() != 0) {
-
 
315
			String[] tableauDesMessages = {};
-
 
316
			tableauDesMessages = messages.toArray(tableauDesMessages);
-
 
317
			MessageBox.alert("Erreurs de saisies", UtilArray.implode(tableauDesMessages, "<br />"), null);
-
 
318
			return false;
-
 
319
		}
277
		return true;
320
		return true;
278
	}
321
	}
-
 
322
	
-
 
323
	private ArrayList<String> verifierOnglets() {
-
 
324
		ArrayList<String> messages = new ArrayList<String>();
-
 
325
		messages.addAll(generalOnglet.verifier());
-
 
326
		messages.addAll(personneOnglet.verifier());
-
 
327
		return messages;
-
 
328
	}
279
}
329
}
280
330