Subversion Repositories eFlore/Applications.coel

Rev

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

Rev 1468 Rev 1513
Line 1... Line 1...
1
package org.tela_botanica.client.vues.structure;
1
package org.tela_botanica.client.vues.structure;
Line 2... Line 2...
2
 
2
 
3
import java.util.ArrayList;
3
import java.util.ArrayList;
4
import java.util.Date;
4
import java.util.Date;
-
 
5
import java.util.Iterator;
5
import java.util.Iterator;
6
import java.util.LinkedList;
Line 6... Line 7...
6
import java.util.List;
7
import java.util.List;
7
 
8
 
8
import org.tela_botanica.client.ComposantClass;
9
import org.tela_botanica.client.ComposantClass;
Line 790... Line 791...
790
					comboLstpu.setValue(comboLstpu.getStore().findModel("id_valeur", identification.getTypePublic()));
791
					comboLstpu.setValue(comboLstpu.getStore().findModel("id_valeur", identification.getTypePublic()));
791
				}
792
				}
792
			}
793
			}
Line 793... Line 794...
793
			
794
			
794
			String dateFondation = identification.getAnneeOuDateFondation();
-
 
795
			if (!dateFondation.equals(""))	{
-
 
796
				if (dateFondation.endsWith("00-00"))	{
795
			String dateFondation = identification.getAnneeOuDateFondation();
797
					dateFondationChp.setValue(dateFondation.substring(0, 4));
-
 
798
				} else {
-
 
799
					Date date = DateTimeFormat.getFormat("yyyy-MM-dd").parse(dateFondation);
-
 
800
					dateFondationChp.setValue(DateTimeFormat.getFormat("dd/MM/yyyy").format(date));
-
 
801
				}
-
 
Line 802... Line 796...
802
			}
796
			dateFondationChp.setValue(dateFondation);
803
			
797
			
804
			descriptionChp.setValue(identification.getDescription());
798
			descriptionChp.setValue(identification.getDescription());
Line 2031... Line 2025...
2031
		}
2025
		}
Line 2032... Line 2026...
2032
		
2026
		
Line 2033... Line 2027...
2033
	}
2027
	}
2034
	
-
 
2035
	public void rafraichir(Object nouvellesDonnees) {
-
 
2036
		
2028
	
2037
		
2029
	public void rafraichir(Object nouvellesDonnees) {
2038
		try {
2030
		try {
2039
			if (nouvellesDonnees instanceof Information) {
2031
			if (nouvellesDonnees instanceof Information) {
2040
				Information info = (Information) nouvellesDonnees;
2032
				Information info = (Information) nouvellesDonnees;
Line 2050... Line 2042...
2050
		}
2042
		}
Line 2051... Line 2043...
2051
		
2043
		
2052
		controlerFermeture();
2044
		controlerFermeture();
Line 2053... Line 2045...
2053
	}
2045
	}
2054
	
2046
	
2055
	public void rafraichirInformation(Information info) {
2047
	public void rafraichirInformation(Information info) {		
2056
		if (info.getMessages() != null && !info.getMessages().toString().equals("[]")) {
2048
		if (info.getMessages() != null && !info.getMessages().toString().equals("[]")) {
2057
			GWT.log("MESSAGES:\n"+info.getMessages().toString(), null);
-
 
Line 2058... Line 2049...
2058
		}
2049
			GWT.log("MESSAGES:\n"+info.getMessages().toString(), null);
2059
 
2050
		}
2060
		
2051
		
2061
		if (info.getType().equals("modif_structure")) {
2052
		if (info.getType().equals("modif_structure")) {
Line 2081... Line 2072...
2081
			testerLancementRafraichirPersonnel();
2072
			testerLancementRafraichirPersonnel();
2082
		} else if (info.getType().equals("selection_structure")) {
2073
		} else if (info.getType().equals("selection_structure")) {
2083
			InfoLogger.display("Modification d'une institution", info.toString());
2074
			InfoLogger.display("Modification d'une institution", info.toString());
2084
			String titre = i18nC.titreModifFormStructurePanneau();
2075
			String titre = i18nC.titreModifFormStructurePanneau();
2085
			if (info.getDonnee(0) != null) {
2076
			if (info.getDonnee(0) != null) {
-
 
2077
				try {
2086
				identification = (Structure) info.getDonnee(0);
2078
					identification = (Structure) info.getDonnee(0);
2087
				if (onglets.getSelectedItem().equals(identificationOnglet)) {
2079
					if (onglets.getSelectedItem().equals(identificationOnglet)) {
2088
					peuplerStructureIdentification();
2080
						peuplerStructureIdentification();
-
 
2081
					}
-
 
2082
				} catch(Exception e) {
-
 
2083
					GWT.log("Problème de cast. "+info.getDonnee(0)+" ne peut être casté en Structure", e);
2089
				}
2084
				}
-
 
2085
				
2090
				// Composition du titre
2086
				// Composition du titre
2091
				titre += " - ID : "+identification.getId();
2087
				titre += " - ID : "+identification.getId();
2092
			}
2088
			}
2093
			if (info.getDonnee(1) != null) {
2089
			if (info.getDonnee(1) != null) {
2094
				conservation = (StructureConservation) info.getDonnee(1);
2090
				conservation = (StructureConservation) info.getDonnee(1);
Line 2268... Line 2264...
2268
	}
2264
	}
Line 2269... Line 2265...
2269
	
2265
	
2270
	private void initialiserGrillePersonnelEnModification() {		
2266
	private void initialiserGrillePersonnelEnModification() {		
2271
		mediateur.selectionnerStructureAPersonne(this, identification.getId(), StructureAPersonne.ROLE_EQUIPE, null);			
2267
		mediateur.selectionnerStructureAPersonne(this, identification.getId(), StructureAPersonne.ROLE_EQUIPE, null);			
-
 
2268
	}
2272
	}
2269