Subversion Repositories eFlore/Applications.coel

Rev

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

Rev 1241 Rev 1255
Line 261... Line 261...
261
		}
261
		}
262
	}
262
	}
Line 263... Line 263...
263
	
263
	
Line 264... Line -...
264
	public boolean soumettreFormulaire() {
-
 
265
		
-
 
266
		Debug.log("===> BEGIN StructureForm.soumettreFormulaire()");
264
	public boolean soumettreFormulaire() {
267
		
265
		
268
		// Vérification de la validité des champs du formulaire
266
		// Vérification de la validité des champs du formulaire
269
		boolean fomulaireValide = verifierFormulaire();
267
		boolean fomulaireValide = verifierFormulaire();
270
		if (fomulaireValide) {
268
		if (fomulaireValide) {
Line 279... Line 277...
279
				mediateur.ajouterStructure(this, structure, conservation, valorisation);
277
				mediateur.ajouterStructure(this, structure, conservation, valorisation);
280
				// L'ajout des relations StructureAPersonne se fait quand la structure a été ajoutée
278
				// L'ajout des relations StructureAPersonne se fait quand la structure a été ajoutée
281
				// Voir la méthode rafraichir().
279
				// Voir la méthode rafraichir().
282
			} else if (mode.equals(MODE_MODIFIER)) {
280
			} else if (mode.equals(MODE_MODIFIER)) {
Line 283... Line -...
283
				
-
 
284
				Debug.log("===> StructureForm.soumettreFormulaire(), mode="+mode);
-
 
285
				
281
				
286
				// Modification des informations sur la Structure
282
				// Modification des informations sur la Structure
287
				if (structure == null && conservation == null && valorisation == null) {
283
				if (structure == null && conservation == null && valorisation == null) {
288
					InfoLogger.display("Modification d'une institution", "Rien n'a été enregistré car le formulaire n'a pas été modifié.");
284
					InfoLogger.display("Modification d'une institution", "Rien n'a été enregistré car le formulaire n'a pas été modifié.");
289
				} else {
285
				} else {
290
					mediateur.modifierStructure(this, identification.getId(), structure, conservation, valorisation);
286
					mediateur.modifierStructure(this, identification.getId(), structure, conservation, valorisation);
Line 291... Line -...
291
				}
-
 
292
				
-
 
293
				Debug.log("===> StructureForm.soumettreFormulaire(), personnelModifie.size="+personnelModifie.size() + ", personnelAjoute.size()="+personnelAjoute.size());
287
				}
294
				
288
				
295
				if (personnelModifie.size() == 0 && personnelAjoute.size() == 0 && personnelSupprime.size() == 0) {
289
				if (personnelModifie.size() == 0 && personnelAjoute.size() == 0 && personnelSupprime.size() == 0) {
296
					InfoLogger.display("Modification du personnel", "Rien n'a été enregistré car le formulaire n'a pas été modifié.");
290
					InfoLogger.display("Modification du personnel", "Rien n'a été enregistré car le formulaire n'a pas été modifié.");
297
				} else {
291
				} else {
Line 311... Line 305...
311
					}
305
					}
312
				}
306
				}
313
			}
307
			}
314
		}
308
		}
Line 315... Line -...
315
		
-
 
316
		Debug.log("===> END StructureForm.soumettreFormulaire()");
-
 
317
		
309
		
318
		return fomulaireValide;
310
		return fomulaireValide;
Line 319... Line 311...
319
	}
311
	}
320
	
312
	
Line 1044... Line 1036...
1044
		if (personnelOnglet.getData("acces").equals(true)) {
1036
		if (personnelOnglet.getData("acces").equals(true)) {
1045
			personnelGrilleMagazin.commitChanges();
1037
			personnelGrilleMagazin.commitChanges();
1046
			int nbrePersonne = personnelGrilleMagazin.getCount();
1038
			int nbrePersonne = personnelGrilleMagazin.getCount();
1047
			for (int i = 0; i < nbrePersonne; i++) {
1039
			for (int i = 0; i < nbrePersonne; i++) {
1048
				StructureAPersonne personne = personnelGrilleMagazin.getAt(i);
1040
				StructureAPersonne personne = personnelGrilleMagazin.getAt(i);
1049
				
-
 
1050
Debug.log(":::> StructureForm.collecterStructurePersonnel()");
-
 
1051
Debug.log(":::> etat="+personne.get("etat"));
-
 
Line 1052... Line 1041...
1052
 
1041
 
1053
				// Seules les lignes ajoutées ou modifiées sont prises en compte.
1042
				// Seules les lignes ajoutées ou modifiées sont prises en compte.
1054
				Record record = personnelGrilleMagazin.getRecord(personne);
1043
				Record record = personnelGrilleMagazin.getRecord(personne);
1055
				if (personnelGrilleMagazin.getModifiedRecords().contains(record) == true 
1044
				if (personnelGrilleMagazin.getModifiedRecords().contains(record) == true 
Line 1190... Line 1179...
1190
		
1179
		
1191
		personnelOnglet = creerOnglet("Personnel", "personnel");
1180
		personnelOnglet = creerOnglet("Personnel", "personnel");
1192
		personnelOnglet.setLayout(creerFormLayout(400, LabelAlign.LEFT));
1181
		personnelOnglet.setLayout(creerFormLayout(400, LabelAlign.LEFT));
1193
		personnelOnglet.setStyleAttribute("padding", "0");
1182
		personnelOnglet.setStyleAttribute("padding", "0");
1194
		personnelOnglet.addListener(Events.Select, new Listener<ComponentEvent>() {  
1183
		personnelOnglet.addListener(Events.Select, new Listener<ComponentEvent>() {  
1195
			public void handleEvent(ComponentEvent be) {  
-
 
1196
				
-
 
Line 1197... Line 1184...
1197
Debug.log(":::> StructureForm.creerOngletPersonnel.HandleEvent()");				
1184
			public void handleEvent(ComponentEvent be) { 	
1198
				
1185
				
Line 1199... Line 1186...
1199
				// Indique que l'onglet a été rempli et a pu être modifié pour la méthode collecter...
1186
				// Indique que l'onglet a été rempli et a pu être modifié pour la méthode collecter...
1200
				personnelOnglet.setData("acces", true);
1187
				personnelOnglet.setData("acces", true);
1201
 
1188
 
1202
				// Rafraichissement du contenu de la grille du personnel
1189
				// Rafraichissement du contenu de la grille du personnel
1203
				if (mode.equals(MODE_AJOUTER)) {
-
 
1204
					rafraichirPersonnel();
-
 
1205
				}
-
 
1206
				/*
-
 
1207
				else {
-
 
1208
					initialiserGrillePersonnelEnModification();
1190
				if (mode.equals(MODE_AJOUTER)) {
1209
				}
1191
					rafraichirPersonnel();
Line 1210... Line 1192...
1210
				*/
1192
				}
1211
			}
1193
			}
Line 2003... Line 1985...
2003
		
1985
		
Line 2004... Line 1986...
2004
	}
1986
	}
Line 2005... Line -...
2005
	
-
 
2006
	public void rafraichir(Object nouvellesDonnees) {
-
 
2007
		
1987
	
2008
Debug.log("|0> StructureForm.rafraichir, nouvellesDonnees.getClass() = "+nouvellesDonnees.getClass());
1988
	public void rafraichir(Object nouvellesDonnees) {
2009
		
1989
		
2010
		try {
1990
		try {
2011
			if (nouvellesDonnees instanceof Information) {
1991
			if (nouvellesDonnees instanceof Information) {
Line 2029... Line 2009...
2029
	
2009
	
2030
	public void rafraichirInformation(Information info) {
2010
	public void rafraichirInformation(Information info) {
2031
		if (info.getMessages() != null && !info.getMessages().toString().equals("[]")) {
2011
		if (info.getMessages() != null && !info.getMessages().toString().equals("[]")) {
2032
			GWT.log("MESSAGES:\n"+info.getMessages().toString(), null);
2012
			GWT.log("MESSAGES:\n"+info.getMessages().toString(), null);
2033
		}
-
 
2034
 
-
 
Line 2035... Line 2013...
2035
Debug.log("|0> StructureForm.rafraichirInformation, info.getType() = "+info.getType());
2013
		}
2036
		
2014
		
2037
		if (info.getType().equals("modif_structure")) {
2015
		if (info.getType().equals("modif_structure")) {
2038
			InfoLogger.display("Modification d'une institution", info.toString());
2016
			InfoLogger.display("Modification d'une institution", info.toString());
Line 2082... Line 2060...
2082
						peuplerStructureValorisation();
2060
						peuplerStructureValorisation();
2083
					}
2061
					}
2084
				}
2062
				}
2085
			}
2063
			}
2086
		} else if (info.getType().equals("liste_structure_a_personne")) {
2064
		} else if (info.getType().equals("liste_structure_a_personne")) {
2087
			Debug.log("==> StructureForm.rafraichirInformation, typeInfo=liste_structure_a_personne");
-
 
2088
			if (info.getDonnee(0) != null) {
2065
			if (info.getDonnee(0) != null) {
2089
				personnel = (StructureAPersonneListe) info.getDonnee(0);
2066
				personnel = (StructureAPersonneListe) info.getDonnee(0);
Line 2090... Line 2067...
2090
				
2067
				
Line 2230... Line 2207...
2230
		projetsMagazin.removeAll();
2207
		projetsMagazin.removeAll();
2231
		projetsMagazin.add(liste);
2208
		projetsMagazin.add(liste);
2232
		projetsCombo.setStore(projetsMagazin);
2209
		projetsCombo.setStore(projetsMagazin);
2233
	}
2210
	}
Line 2234... Line 2211...
2234
	
2211
	
2235
	private void testerLancementRafraichirPersonnel() {
-
 
2236
Debug.log("==> BEGIN StructureForm.testerLancementRafraichirPersonnel()");
-
 
2237
		
2212
	private void testerLancementRafraichirPersonnel() {		
2238
		decompteRafraichissementPersonnel--;
2213
		decompteRafraichissementPersonnel--;
2239
		if (decompteRafraichissementPersonnel == 0) {
2214
		if (decompteRafraichissementPersonnel == 0) {
2240
			// Nous rechargeons la liste du Personnel
2215
			// Nous rechargeons la liste du Personnel
2241
			rafraichirPersonnel();
2216
			rafraichirPersonnel();
2242
		}		
-
 
2243
Debug.log("==> END StructureForm.testerLancementRafraichirPersonnel()");		
2217
		}			
Line 2244... Line 2218...
2244
	}
2218
	}
2245
	
-
 
2246
	private void rafraichirPersonnel() {
-
 
2247
Debug.log("==> BEGIN StructureForm.rafraichirPersonnel()");			
2219
	
2248
		
2220
	private void rafraichirPersonnel() {		
2249
		decompteRafraichissementPersonnel = 0;
2221
		decompteRafraichissementPersonnel = 0;
2250
		if (mode.equals(MODE_MODIFIER)) {
2222
		if (mode.equals(MODE_MODIFIER)) {
2251
			initialiserGrillePersonnelEnModification();
2223
			initialiserGrillePersonnelEnModification();
2252
		} else if (mode.equals(MODE_AJOUTER)) {
2224
		} else if (mode.equals(MODE_AJOUTER)) {
2253
			initialiserGrillePersonnelEnAjout();
-
 
2254
		}
2225
			initialiserGrillePersonnelEnAjout();
Line 2255... Line 2226...
2255
Debug.log("==> END StructureForm.rafraichirPersonnel()");	
2226
		}
2256
	}
2227
	}
2257
	
2228