Subversion Repositories eFlore/Applications.coel

Rev

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

Rev 1239 Rev 1262
Line 15... Line 15...
15
import org.tela_botanica.client.modeles.InterneValeurListe;
15
import org.tela_botanica.client.modeles.InterneValeurListe;
16
import org.tela_botanica.client.modeles.MenuApplicationId;
16
import org.tela_botanica.client.modeles.MenuApplicationId;
17
import org.tela_botanica.client.modeles.Valeur;
17
import org.tela_botanica.client.modeles.Valeur;
18
import org.tela_botanica.client.modeles.ValeurListe;
18
import org.tela_botanica.client.modeles.ValeurListe;
19
import org.tela_botanica.client.modeles.aDonnee;
19
import org.tela_botanica.client.modeles.aDonnee;
-
 
20
import org.tela_botanica.client.modeles.collection.CollectionAPersonne;
20
import org.tela_botanica.client.modeles.personne.Personne;
21
import org.tela_botanica.client.modeles.personne.Personne;
21
import org.tela_botanica.client.modeles.personne.PersonneListe;
22
import org.tela_botanica.client.modeles.personne.PersonneListe;
22
import org.tela_botanica.client.modeles.projet.Projet;
23
import org.tela_botanica.client.modeles.projet.Projet;
23
import org.tela_botanica.client.modeles.projet.ProjetListe;
24
import org.tela_botanica.client.modeles.projet.ProjetListe;
24
import org.tela_botanica.client.modeles.structure.Structure;
25
import org.tela_botanica.client.modeles.structure.Structure;
Line 260... Line 261...
260
		}
261
		}
261
	}
262
	}
Line 262... Line 263...
262
	
263
	
Line 263... Line -...
263
	public boolean soumettreFormulaire() {
-
 
264
		
-
 
265
		Debug.log("===> BEGIN StructureForm.soumettreFormulaire()");
264
	public boolean soumettreFormulaire() {
266
		
265
		
267
		// Vérification de la validité des champs du formulaire
266
		// Vérification de la validité des champs du formulaire
268
		boolean fomulaireValide = verifierFormulaire();
267
		boolean fomulaireValide = verifierFormulaire();
269
		if (fomulaireValide) {
268
		if (fomulaireValide) {
Line 278... Line 277...
278
				mediateur.ajouterStructure(this, structure, conservation, valorisation);
277
				mediateur.ajouterStructure(this, structure, conservation, valorisation);
279
				// 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
280
				// Voir la méthode rafraichir().
279
				// Voir la méthode rafraichir().
281
			} else if (mode.equals(MODE_MODIFIER)) {
280
			} else if (mode.equals(MODE_MODIFIER)) {
Line 282... Line -...
282
				
-
 
283
				Debug.log("===> StructureForm.soumettreFormulaire(), mode="+mode);
-
 
284
				
281
				
285
				// Modification des informations sur la Structure
282
				// Modification des informations sur la Structure
286
				if (structure == null && conservation == null && valorisation == null) {
283
				if (structure == null && conservation == null && valorisation == null) {
287
					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é.");
288
				} else {
285
				} else {
289
					mediateur.modifierStructure(this, identification.getId(), structure, conservation, valorisation);
286
					mediateur.modifierStructure(this, identification.getId(), structure, conservation, valorisation);
Line 290... Line -...
290
				}
-
 
291
				
-
 
292
				Debug.log("===> StructureForm.soumettreFormulaire(), personnelModifie.size="+personnelModifie.size() + ", personnelAjoute.size()="+personnelAjoute.size());
287
				}
293
				
288
				
294
				if (personnelModifie.size() == 0 && personnelAjoute.size() == 0 && personnelSupprime.size() == 0) {
289
				if (personnelModifie.size() == 0 && personnelAjoute.size() == 0 && personnelSupprime.size() == 0) {
295
					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é.");
296
				} else {
291
				} else {
Line 310... Line 305...
310
					}
305
					}
311
				}
306
				}
312
			}
307
			}
313
		}
308
		}
Line 314... Line -...
314
		
-
 
315
		Debug.log("===> END StructureForm.soumettreFormulaire()");
-
 
316
		
309
		
317
		return fomulaireValide;
310
		return fomulaireValide;
Line 318... Line 311...
318
	}
311
	}
319
	
312
	
Line 698... Line 691...
698
			structureCollectee.setLatitude(latitudeChp.getValue());
691
			structureCollectee.setLatitude(latitudeChp.getValue());
699
			structureCollectee.setLongitude(longitudeChp.getValue());
692
			structureCollectee.setLongitude(longitudeChp.getValue());
Line 700... Line 693...
700
			
693
			
701
			structureCollectee.setTelephoneFixe(telChp.getValue());
694
			structureCollectee.setTelephoneFixe(telChp.getValue());
-
 
695
			structureCollectee.setFax(faxChp.getValue());
702
			structureCollectee.setFax(faxChp.getValue());
696
			
703
			structureCollectee.setCourriel(emailChp.getValue());
697
			structureCollectee.setCourriel(emailChp.getValue());
Line 704... Line 698...
704
			structureCollectee.setUrl(Structure.URL_SITE, urlChp.getValue());
698
			structureCollectee.setUrl(Structure.URL_SITE, urlChp.getValue());
705
			
699
			
Line 783... Line 777...
783
			latitudeChp.setValue(identification.getLatitude());
777
			latitudeChp.setValue(identification.getLatitude());
784
			longitudeChp.setValue(identification.getLongitude());
778
			longitudeChp.setValue(identification.getLongitude());
Line 785... Line 779...
785
			
779
			
786
			telChp.setValue(identification.getTelephoneFixe());
780
			telChp.setValue(identification.getTelephoneFixe());
-
 
781
			faxChp.setValue(identification.getFax());
787
			faxChp.setValue(identification.getFax());
782
			
788
			emailChp.setValue(identification.getCourriel());
783
			emailChp.setValue(identification.getCourriel());
Line 789... Line 784...
789
			urlChp.setValue(identification.getUrl("WEB"));
784
			urlChp.setValue(identification.getUrl("WEB"));
Line 1042... Line 1037...
1042
			personnelGrilleMagazin.commitChanges();
1037
			personnelGrilleMagazin.commitChanges();
1043
			int nbrePersonne = personnelGrilleMagazin.getCount();
1038
			int nbrePersonne = personnelGrilleMagazin.getCount();
1044
			for (int i = 0; i < nbrePersonne; i++) {
1039
			for (int i = 0; i < nbrePersonne; i++) {
1045
				StructureAPersonne personne = personnelGrilleMagazin.getAt(i);
1040
				StructureAPersonne personne = personnelGrilleMagazin.getAt(i);
Line 1046... Line -...
1046
				
-
 
1047
Debug.log(":::> StructureForm.collecterStructurePersonnel()");
-
 
1048
Debug.log(":::> etat="+personne.get("etat"));
-
 
1049
 
1041
				
1050
				// 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.
1051
				Record record = personnelGrilleMagazin.getRecord(personne);
1043
				Record record = personnelGrilleMagazin.getRecord(personne);
1052
				if (personnelGrilleMagazin.getModifiedRecords().contains(record) == true 
1044
				if (personnelGrilleMagazin.getModifiedRecords().contains(record) == true 
Line 1189... Line 1181...
1189
		personnelOnglet.setLayout(creerFormLayout(400, LabelAlign.LEFT));
1181
		personnelOnglet.setLayout(creerFormLayout(400, LabelAlign.LEFT));
1190
		personnelOnglet.setStyleAttribute("padding", "0");
1182
		personnelOnglet.setStyleAttribute("padding", "0");
1191
		personnelOnglet.addListener(Events.Select, new Listener<ComponentEvent>() {  
1183
		personnelOnglet.addListener(Events.Select, new Listener<ComponentEvent>() {  
1192
			public void handleEvent(ComponentEvent be) {  
1184
			public void handleEvent(ComponentEvent be) {  
Line 1193... Line -...
1193
				
-
 
1194
Debug.log(":::> StructureForm.creerOngletPersonnel.HandleEvent()");				
-
 
1195
				
1185
				
1196
				// 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...
Line 1197... Line 1187...
1197
				personnelOnglet.setData("acces", true);
1187
				personnelOnglet.setData("acces", true);
1198
 
1188
 
1199
				// Rafraichissement du contenu de la grille du personnel
1189
				// Rafraichissement du contenu de la grille du personnel
1200
				if (mode.equals(MODE_AJOUTER)) {
1190
				if (mode.equals(MODE_AJOUTER)) {
1201
					rafraichirPersonnel();
-
 
1202
				}
-
 
1203
				/*
-
 
1204
				else {
-
 
1205
					initialiserGrillePersonnelEnModification();
-
 
1206
				}
1191
					rafraichirPersonnel();
1207
				*/
1192
				}
Line 1208... Line 1193...
1208
			}
1193
			}
1209
		});
1194
		});
Line 1228... Line 1213...
1228
				}
1213
				}
Line 1229... Line 1214...
1229
				
1214
				
1230
			}
1215
			}
Line 1231... Line -...
1231
		});
-
 
1232
		
-
 
1233
		/* TODELETE
-
 
1234
		personnelGrilleMagazin.addListener(Store.Update, new Listener<StoreEvent<StructureAPersonne>>() {
-
 
1235
			public void handleEvent(StoreEvent<StructureAPersonne> ce) {
-
 
1236
				
-
 
1237
				personnelGrilleMagazin.getAt(ce.getIndex()).set("etat", StructureAPersonne.ETAT_MODIFIE);
-
 
1238
				Debug.log("Modification de : "+personnelGrilleMagazin.getAt(ce.getIndex()).getNom());
-
 
1239
			}
-
 
1240
		});		
-
 
Line 1241... Line 1216...
1241
		*/
1216
		});
Line 1242... Line 1217...
1242
		
1217
		
Line 1507... Line 1482...
1507
  		grillePersonnel.setTrackMouseOver(true);
1482
  		grillePersonnel.setTrackMouseOver(true);
Line 1508... Line 1483...
1508
  		
1483
  		
1509
  		
1484
  		
-
 
1485
		personnelGrilleMagazin.addListener(Store.Update, new Listener<StoreEvent<StructureAPersonne>>() {
-
 
1486
			public void handleEvent(StoreEvent<StructureAPersonne> ce) {
-
 
1487
 
-
 
1488
				StructureAPersonne structureAPersonne = ce.getModel();
-
 
1489
				String etat = structureAPersonne.get("etat");
-
 
1490
				
1510
		personnelGrilleMagazin.addListener(Store.Update, new Listener<StoreEvent<StructureAPersonne>>() {
1491
				if (!etat.equals(aDonnee.ETAT_AJOUTE) && !UtilString.isEmpty(structureAPersonne.getId()))	{
-
 
1492
					System.out.println("modifier");
-
 
1493
					ce.getModel().set("etat", aDonnee.ETAT_MODIFIE);
-
 
1494
				} else {
1511
			public void handleEvent(StoreEvent<StructureAPersonne> ce) {
1495
					System.out.println("ajoute");
1512
				ce.getModel().set("etat", aDonnee.ETAT_MODIFIE);
1496
				}
Line 1513... Line 1497...
1513
			}
1497
			}
1514
		});
1498
		});
Line 2010... Line 1994...
2010
		
1994
		
Line 2011... Line 1995...
2011
	}
1995
	}
Line 2012... Line -...
2012
	
-
 
Line 2013... Line 1996...
2013
	public void rafraichir(Object nouvellesDonnees) {
1996
	
2014
		
1997
	public void rafraichir(Object nouvellesDonnees) {
2015
Debug.log("|0> StructureForm.rafraichir, nouvellesDonnees.getClass() = "+nouvellesDonnees.getClass());
1998
		
2016
		
1999
		
Line 2037... Line 2020...
2037
	public void rafraichirInformation(Information info) {
2020
	public void rafraichirInformation(Information info) {
2038
		if (info.getMessages() != null && !info.getMessages().toString().equals("[]")) {
2021
		if (info.getMessages() != null && !info.getMessages().toString().equals("[]")) {
2039
			GWT.log("MESSAGES:\n"+info.getMessages().toString(), null);
2022
			GWT.log("MESSAGES:\n"+info.getMessages().toString(), null);
2040
		}
2023
		}
Line 2041... Line -...
2041
 
-
 
Line 2042... Line 2024...
2042
Debug.log("|0> StructureForm.rafraichirInformation, info.getType() = "+info.getType());
2024
 
2043
		
2025
		
2044
		if (info.getType().equals("modif_structure")) {
2026
		if (info.getType().equals("modif_structure")) {
2045
			InfoLogger.display("Modification d'une institution", info.toString());
2027
			InfoLogger.display("Modification d'une institution", info.toString());
Line 2089... Line 2071...
2089
						peuplerStructureValorisation();
2071
						peuplerStructureValorisation();
2090
					}
2072
					}
2091
				}
2073
				}
2092
			}
2074
			}
2093
		} else if (info.getType().equals("liste_structure_a_personne")) {
2075
		} else if (info.getType().equals("liste_structure_a_personne")) {
2094
			Debug.log("==> StructureForm.rafraichirInformation, typeInfo=liste_structure_a_personne");
-
 
2095
			if (info.getDonnee(0) != null) {
2076
			if (info.getDonnee(0) != null) {
2096
				personnel = (StructureAPersonneListe) info.getDonnee(0);
2077
				personnel = (StructureAPersonneListe) info.getDonnee(0);
Line 2097... Line 2078...
2097
				
2078
				
2098
				peuplerStructurePersonnel();
2079
				peuplerStructurePersonnel();
2099
 
2080
				
2100
				personnelOnglet.layout();
2081
				personnelOnglet.layout();
Line 2101... Line 2082...
2101
				InfoLogger.display("Chargement du Personnel", "ok");
2082
				InfoLogger.display("Chargement du Personnel", "ok");
2102
 
2083
 
Line 2238... Line 2219...
2238
		projetsMagazin.add(liste);
2219
		projetsMagazin.add(liste);
2239
		projetsCombo.setStore(projetsMagazin);
2220
		projetsCombo.setStore(projetsMagazin);
2240
	}
2221
	}
Line 2241... Line 2222...
2241
	
2222
	
2242
	private void testerLancementRafraichirPersonnel() {
-
 
Line 2243... Line 2223...
2243
Debug.log("==> BEGIN StructureForm.testerLancementRafraichirPersonnel()");
2223
	private void testerLancementRafraichirPersonnel() {
2244
		
2224
		
2245
		decompteRafraichissementPersonnel--;
2225
		decompteRafraichissementPersonnel--;
2246
		if (decompteRafraichissementPersonnel == 0) {
2226
		if (decompteRafraichissementPersonnel == 0) {
2247
			// Nous rechargeons la liste du Personnel
2227
			// Nous rechargeons la liste du Personnel
2248
			rafraichirPersonnel();
-
 
2249
		}		
2228
			rafraichirPersonnel();
Line 2250... Line 2229...
2250
Debug.log("==> END StructureForm.testerLancementRafraichirPersonnel()");		
2229
		}		
2251
	}
-
 
2252
	
-
 
2253
	private void rafraichirPersonnel() {
2230
	}
2254
Debug.log("==> BEGIN StructureForm.rafraichirPersonnel()");			
2231
	
2255
		
2232
	private void rafraichirPersonnel() {
2256
		decompteRafraichissementPersonnel = 0;
2233
		decompteRafraichissementPersonnel = 0;
2257
		if (mode.equals(MODE_MODIFIER)) {
2234
		if (mode.equals(MODE_MODIFIER)) {
2258
			initialiserGrillePersonnelEnModification();
2235
			initialiserGrillePersonnelEnModification();
2259
		} else if (mode.equals(MODE_AJOUTER)) {
-
 
2260
			initialiserGrillePersonnelEnAjout();
2236
		} else if (mode.equals(MODE_AJOUTER)) {
Line 2261... Line 2237...
2261
		}
2237
			initialiserGrillePersonnelEnAjout();
2262
Debug.log("==> END StructureForm.rafraichirPersonnel()");	
2238
		}
2263
	}
2239
	}