Subversion Repositories eFlore/Applications.coel

Rev

Rev 1596 | Rev 1616 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1596 Rev 1613
Line 235... Line 235...
235
	private CellEditor fonctionEditor = null;
235
	private CellEditor fonctionEditor = null;
236
	private List<Valeur> fonctionsListe = null;
236
	private List<Valeur> fonctionsListe = null;
Line 237... Line 237...
237
	
237
	
Line -... Line 238...
-
 
238
	private Sequenceur sequenceur;
-
 
239
	
-
 
240
	private Structure structure = null;
-
 
241
	
238
	private Sequenceur sequenceur;
242
	public Rafraichissable vueExterneARafraichirApresValidation = null;
239
	
243
	
240
	public StructureForm(Mediateur mediateurCourrant, String modeDeCreation, Sequenceur sequenceur) {
244
	public StructureForm(Mediateur mediateurCourrant, String modeDeCreation, Sequenceur sequenceur) {
Line 241... Line 245...
241
		initialiserFormulaire(mediateurCourrant, modeDeCreation, MenuApplicationId.STRUCTURE);
245
		initialiserFormulaire(mediateurCourrant, modeDeCreation, MenuApplicationId.STRUCTURE);
Line 279... Line 283...
279
		} else {
283
		} else {
280
			mediateur.afficherFormStructure(null);
284
			mediateur.afficherFormStructure(null);
281
		}
285
		}
282
	}
286
	}
Line -... Line 287...
-
 
287
	
-
 
288
	private void repandreRafraichissement() {
-
 
289
		if (vueExterneARafraichirApresValidation != null) {
-
 
290
			String type = "structure_modifiee";
-
 
291
			if (mode.equals(Formulaire.MODE_AJOUTER)) {
-
 
292
				type = "structure_ajoutee";
-
 
293
			}
-
 
294
			Information info = new Information(type);
-
 
295
			info.setDonnee(0, structure);
-
 
296
			vueExterneARafraichirApresValidation.rafraichir(info);
-
 
297
		}
-
 
298
	}
283
	
299
	
Line 284... Line 300...
284
	public boolean soumettreFormulaire() {
300
	public boolean soumettreFormulaire() {
285
		
301
		
-
 
302
		// Vérification de la validité des champs du formulaire
-
 
303
		boolean fomulaireValide = verifierFormulaire();
-
 
304
		
-
 
305
		Structure identification = collecterStructureIdentification();
-
 
306
		
-
 
307
		structure = this.identification;
-
 
308
		if(identification != null) {
-
 
309
			structure = identification;
-
 
310
		} else {
-
 
311
			identification = this.identification;
-
 
312
		}
-
 
313
		
-
 
314
 
-
 
315
		structure.setConservation(this.conservation);
286
		// Vérification de la validité des champs du formulaire
316
		structure.setValorisation(this.valorisation); 
287
		boolean fomulaireValide = verifierFormulaire();
317
		
288
		if (fomulaireValide) {
-
 
289
			// Collecte des données du formulaire
318
		if (fomulaireValide) {
290
			Structure structure = collecterStructureIdentification();
319
			// Collecte des données du formulaire
-
 
320
			StructureConservation conservation = collecterStructureConservation();
-
 
321
			StructureValorisation valorisation = collecterStructureValorisation();
-
 
322
			
-
 
323
			if(conservation != null) {
-
 
324
				structure.setConservation(conservation);
-
 
325
			}
-
 
326
			
-
 
327
			if(valorisation != null) {
-
 
328
				structure.setValorisation(valorisation);
291
			StructureConservation conservation = collecterStructureConservation();
329
			}
Line -... Line 330...
-
 
330
			
-
 
331
			collecterStructurePersonnel();
-
 
332
			
-
 
333
			structure.setPersonnel(personnel);
292
			StructureValorisation valorisation = collecterStructureValorisation();
334
			structure.setConservation(conservation);
293
			collecterStructurePersonnel();
335
			structure.setValorisation(valorisation);
294
			
336
			
295
			if (mode.equals(MODE_AJOUTER)) {
337
			if (mode.equals(MODE_AJOUTER)) {
296
				// Ajout des informations sur la Structure
338
				// Ajout des informations sur la Structure
Line 740... Line 782...
740
			
782
			
741
			if (!structureCollectee.comparer(identification)) {
783
			if (!structureCollectee.comparer(identification)) {
742
				structureARetourner = identification = structureCollectee;
784
				structureARetourner = identification = structureCollectee;
Line -... Line 785...
-
 
785
			}
-
 
786
			
743
			}
787
		} else {
744
			
788
			
745
		}
789
		}
Line 746... Line 790...
746
		return structureARetourner;
790
		return structureARetourner;
Line 2031... Line 2075...
2031
	public void rafraichir(Object nouvellesDonnees) {
2075
	public void rafraichir(Object nouvellesDonnees) {
2032
		try {
2076
		try {
2033
			if (nouvellesDonnees instanceof Information) {
2077
			if (nouvellesDonnees instanceof Information) {
2034
				Information info = (Information) nouvellesDonnees;
2078
				Information info = (Information) nouvellesDonnees;
2035
				rafraichirInformation(info);
2079
				rafraichirInformation(info);
-
 
2080
				repandreRafraichissement();
2036
			} else if (nouvellesDonnees instanceof ValeurListe) {
2081
			} else if (nouvellesDonnees instanceof ValeurListe) {
2037
				ValeurListe listeValeurs = (ValeurListe) nouvellesDonnees;
2082
				ValeurListe listeValeurs = (ValeurListe) nouvellesDonnees;
2038
				rafraichirValeurListe(listeValeurs);
2083
				rafraichirValeurListe(listeValeurs);
2039
			} else {
2084
			} else {
2040
				GWT.log(Mediateur.i18nM.erreurRafraichir(nouvellesDonnees.getClass(), this.getClass()), null);
2085
				GWT.log(Mediateur.i18nM.erreurRafraichir(nouvellesDonnees.getClass(), this.getClass()), null);
Line 2051... Line 2096...
2051
			GWT.log("MESSAGES:\n"+info.getMessages().toString(), null);
2096
			GWT.log("MESSAGES:\n"+info.getMessages().toString(), null);
2052
		}
2097
		}
Line 2053... Line 2098...
2053
		
2098
		
2054
		if (info.getType().equals("modif_structure")) {
2099
		if (info.getType().equals("modif_structure")) {
-
 
2100
			InfoLogger.display("Modification d'une institution", info.toString());
2055
			InfoLogger.display("Modification d'une institution", info.toString());
2101
			controlerFermeture();
2056
		} else if (info.getType().equals("ajout_structure")) {
2102
		} else if (info.getType().equals("ajout_structure")) {
2057
			if (info.getDonnee(0) != null && info.getDonnee(0) instanceof String) {
2103
			if (info.getDonnee(0) != null && info.getDonnee(0) instanceof String) {
2058
				String structureId = (String) info.getDonnee(0);
2104
				String structureId = (String) info.getDonnee(0);