Subversion Repositories eFlore/Applications.coel

Rev

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

Rev 1255 Rev 1256
Line 1036... Line 1036...
1036
		if (personnelOnglet.getData("acces").equals(true)) {
1036
		if (personnelOnglet.getData("acces").equals(true)) {
1037
			personnelGrilleMagazin.commitChanges();
1037
			personnelGrilleMagazin.commitChanges();
1038
			int nbrePersonne = personnelGrilleMagazin.getCount();
1038
			int nbrePersonne = personnelGrilleMagazin.getCount();
1039
			for (int i = 0; i < nbrePersonne; i++) {
1039
			for (int i = 0; i < nbrePersonne; i++) {
1040
				StructureAPersonne personne = personnelGrilleMagazin.getAt(i);
1040
				StructureAPersonne personne = personnelGrilleMagazin.getAt(i);
1041
 
1041
				
1042
				// 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.
1043
				Record record = personnelGrilleMagazin.getRecord(personne);
1043
				Record record = personnelGrilleMagazin.getRecord(personne);
1044
				if (personnelGrilleMagazin.getModifiedRecords().contains(record) == true 
1044
				if (personnelGrilleMagazin.getModifiedRecords().contains(record) == true 
1045
						|| (personne.get("etat") != null && (personne.get("etat").equals(StructureAPersonne.ETAT_AJOUTE) || personne.get("etat").equals(StructureAPersonne.ETAT_MODIFIE)) )) {
1045
						|| (personne.get("etat") != null && (personne.get("etat").equals(StructureAPersonne.ETAT_AJOUTE) || personne.get("etat").equals(StructureAPersonne.ETAT_MODIFIE)) )) {
Line 1179... Line 1179...
1179
		
1179
		
1180
		personnelOnglet = creerOnglet("Personnel", "personnel");
1180
		personnelOnglet = creerOnglet("Personnel", "personnel");
1181
		personnelOnglet.setLayout(creerFormLayout(400, LabelAlign.LEFT));
1181
		personnelOnglet.setLayout(creerFormLayout(400, LabelAlign.LEFT));
1182
		personnelOnglet.setStyleAttribute("padding", "0");
1182
		personnelOnglet.setStyleAttribute("padding", "0");
1183
		personnelOnglet.addListener(Events.Select, new Listener<ComponentEvent>() {  
1183
		personnelOnglet.addListener(Events.Select, new Listener<ComponentEvent>() {  
Line 1184... Line 1184...
1184
			public void handleEvent(ComponentEvent be) { 	
1184
			public void handleEvent(ComponentEvent be) {  
1185
				
1185
				
Line 1186... Line 1186...
1186
				// 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 1482... Line 1482...
1482
  		grillePersonnel.setTrackMouseOver(true);
1482
  		grillePersonnel.setTrackMouseOver(true);
Line 1483... Line 1483...
1483
  		
1483
  		
1484
  		
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
				
1485
		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 {
1486
			public void handleEvent(StoreEvent<StructureAPersonne> ce) {
1495
					System.out.println("ajoute");
1487
				ce.getModel().set("etat", aDonnee.ETAT_MODIFIE);
1496
				}
Line 1488... Line 1497...
1488
			}
1497
			}
1489
		});
1498
		});
Line 1985... Line 1994...
1985
		
1994
		
Line 1986... Line 1995...
1986
	}
1995
	}
Line -... Line 1996...
-
 
1996
	
1987
	
1997
	public void rafraichir(Object nouvellesDonnees) {
1988
	public void rafraichir(Object nouvellesDonnees) {
1998
		
1989
		
1999
		
1990
		try {
2000
		try {
1991
			if (nouvellesDonnees instanceof Information) {
2001
			if (nouvellesDonnees instanceof Information) {
Line 2009... Line 2019...
2009
	
2019
	
2010
	public void rafraichirInformation(Information info) {
2020
	public void rafraichirInformation(Information info) {
2011
		if (info.getMessages() != null && !info.getMessages().toString().equals("[]")) {
2021
		if (info.getMessages() != null && !info.getMessages().toString().equals("[]")) {
2012
			GWT.log("MESSAGES:\n"+info.getMessages().toString(), null);
2022
			GWT.log("MESSAGES:\n"+info.getMessages().toString(), null);
-
 
2023
		}
Line 2013... Line 2024...
2013
		}
2024
 
2014
		
2025
		
2015
		if (info.getType().equals("modif_structure")) {
2026
		if (info.getType().equals("modif_structure")) {
2016
			InfoLogger.display("Modification d'une institution", info.toString());
2027
			InfoLogger.display("Modification d'une institution", info.toString());
Line 2207... Line 2218...
2207
		projetsMagazin.removeAll();
2218
		projetsMagazin.removeAll();
2208
		projetsMagazin.add(liste);
2219
		projetsMagazin.add(liste);
2209
		projetsCombo.setStore(projetsMagazin);
2220
		projetsCombo.setStore(projetsMagazin);
2210
	}
2221
	}
Line 2211... Line 2222...
2211
	
2222
	
-
 
2223
	private void testerLancementRafraichirPersonnel() {
2212
	private void testerLancementRafraichirPersonnel() {		
2224
		
2213
		decompteRafraichissementPersonnel--;
2225
		decompteRafraichissementPersonnel--;
2214
		if (decompteRafraichissementPersonnel == 0) {
2226
		if (decompteRafraichissementPersonnel == 0) {
2215
			// Nous rechargeons la liste du Personnel
2227
			// Nous rechargeons la liste du Personnel
2216
			rafraichirPersonnel();
2228
			rafraichirPersonnel();
2217
		}			
2229
		}		
Line 2218... Line 2230...
2218
	}
2230
	}
2219
	
2231
	
2220
	private void rafraichirPersonnel() {		
2232
	private void rafraichirPersonnel() {
2221
		decompteRafraichissementPersonnel = 0;
2233
		decompteRafraichissementPersonnel = 0;
2222
		if (mode.equals(MODE_MODIFIER)) {
2234
		if (mode.equals(MODE_MODIFIER)) {
2223
			initialiserGrillePersonnelEnModification();
2235
			initialiserGrillePersonnelEnModification();