Subversion Repositories eFlore/Applications.coel

Rev

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

Rev 211 Rev 213
Line 129... Line 129...
129
	private TextField<String> urlChp;
129
	private TextField<String> urlChp;
130
	private ListStore<Valeur> magazinPays;
130
	private ListStore<Valeur> magazinPays;
131
	private ComboBox<Valeur> comboPays;
131
	private ComboBox<Valeur> comboPays;
Line 132... Line 132...
132
 
132
 
133
	// Onglet PERSONNEL
133
	// Onglet PERSONNEL
134
	private ArrayList<StructureAPersonne> personnel;
134
	private StructureAPersonneListe  personnel;
135
	private NumberField nbreTotalPersonneStructureChp = null;
135
	private NumberField nbreTotalPersonneStructureChp = null;
136
	private EditorGrid<StructureAPersonne> grillePersonnel = null;
136
	private EditorGrid<StructureAPersonne> grillePersonnel = null;
137
	private ListStore<StructureAPersonne> personnelGrilleMagazin = null;
137
	private ListStore<StructureAPersonne> personnelGrilleMagazin = null;
Line 859... Line 859...
859
			// NBRE PERSONNE
859
			// NBRE PERSONNE
860
			nbreTotalPersonneStructureChp.setValue(identification.getNbrePersonne());
860
			nbreTotalPersonneStructureChp.setValue(identification.getNbrePersonne());
861
		}
861
		}
Line 862... Line 862...
862
		
862
		
-
 
863
		if (personnel != null) {
-
 
864
			
-
 
865
			ArrayList<StructureAPersonne> personnes = new ArrayList<StructureAPersonne>();
-
 
866
			for (Iterator<String> it = personnel.keySet().iterator(); it.hasNext();) {
-
 
867
				String index = it.next();
-
 
868
				if (magazinLiFonction != null && ((String) personnel.get(index).getFonction()).matches("^[0-9]+$")) {
-
 
869
					GWT.log(personnel.get(index).getFonction(), null);
-
 
870
					personnel.get(index).set("fonction", magazinLiFonction.findModel("id_valeur", personnel.get(index).getFonction()).getNom());
-
 
871
				} else {
-
 
872
					personnel.get(index).set("fonction", personnel.get(index).getFonction());
-
 
873
				}
-
 
874
				personnes.add(personnel.get(index));
863
		if (personnel != null) {
875
			}
864
			personnelGrilleMagazin.removeAll();
876
			personnelGrilleMagazin.removeAll();
Line 865... Line 877...
865
			personnelGrilleMagazin.add(personnel);
877
			personnelGrilleMagazin.add(personnes);
866
			
878
			
867
			grillePersonnel.getColumnModel().getColumn(1).getEditor().fireEvent(Events.StateSave);
879
			grillePersonnel.getColumnModel().getColumn(1).getEditor().fireEvent(Events.StateSave);
868
			/*
880
			/*
Line 921... Line 933...
921
		List<ColumnConfig> configs = new ArrayList<ColumnConfig>();
933
		List<ColumnConfig> configs = new ArrayList<ColumnConfig>();
Line 922... Line 934...
922
 
934
 
923
		CheckBoxSelectionModel<StructureAPersonne> sm = new CheckBoxSelectionModel<StructureAPersonne>();
935
		CheckBoxSelectionModel<StructureAPersonne> sm = new CheckBoxSelectionModel<StructureAPersonne>();
Line 924... Line 936...
924
		configs.add(sm.getColumn());
936
		configs.add(sm.getColumn());
925
		
937
		
926
		ColumnConfig column = new ColumnConfig("ce_truk_fonction", "Fonction", 100);
938
		ColumnConfig column = new ColumnConfig("fonction", "Fonction", 100);
927
		modele.obtenirListeValeurs(((Configuration) Registry.get(RegistreId.CONFIG)).getListeId("fonction"));
939
		modele.obtenirListeValeurs(((Configuration) Registry.get(RegistreId.CONFIG)).getListeId("fonction"));
Line 928... Line 940...
928
		magazinLiFonction = new ListStore<Valeur>();
940
		magazinLiFonction = new ListStore<Valeur>();
Line 947... Line 959...
947
		
959
		
948
		CellEditor fonctionEditor = new CellEditor(comboLiFonction) {  
960
		CellEditor fonctionEditor = new CellEditor(comboLiFonction) {  
949
			@Override  
961
			@Override  
950
			public Object preProcessValue(Object valeur) {  
962
			public Object preProcessValue(Object valeur) {  
-
 
963
				if (valeur == null) {
951
				if (valeur == null) {
964
					GWT.log("pre null :", null);
952
					return valeur; 
965
					return null; 
953
				}
966
				}
954
				GWT.log("pre : "+valeur.toString(), null);
967
				GWT.log("pre : "+valeur.toString(), null);
955
				Object retour = null;
968
				Object retour = null;
956
				if (((String) valeur).matches("^[0-9]+$")) {
969
				if (((String) valeur).matches("^[0-9]+$")) {
-
 
970
					Valeur valeurRecherche = comboLiFonction.getStore().findModel("id_valeur", (String) valeur);
-
 
971
					if (valeurRecherche != null) {
-
 
972
						retour = valeurRecherche;
-
 
973
						GWT.log("pre - retour valeur par chiffre : \n"+retour.toString(), null);
-
 
974
					} else {
-
 
975
						this.getField().setRawValue((String) valeur);
-
 
976
						retour = null;
-
 
977
					}
-
 
978
				} else if (valeur instanceof String) {
-
 
979
					this.getField().setRawValue((String) valeur);
957
					retour = comboLiFonction.getStore().findModel("id_valeur", (String) valeur);
980
					retour = null;
958
				} else {
981
				} else {
-
 
982
					retour = comboLiFonction.getStore().findModel("nom", (String) valeur);
959
					retour = comboLiFonction.getStore().findModel("nom", (String) valeur);
983
					GWT.log("pre - retour valeur par chaine : \n"+retour.toString(), null);
960
				}
-
 
-
 
984
				}
961
				GWT.log("pre - retour : \n"+retour.toString(), null);
985
				
962
				return retour;
986
				return retour;
Line 963... Line 987...
963
			}  
987
			}  
964
			
988
			
965
			@Override  
989
			@Override  
966
			public Object postProcessValue(Object valeur) {  
990
			public Object postProcessValue(Object valeur) {  
-
 
991
				if (valeur == null) {
967
				if (valeur == null) {
992
					// Si la combobox n'a pas été utilisé, nous renvoyons la valeur brute saisie par l'utilisateur
-
 
993
					GWT.log("post raw : \n"+this.getField().getRawValue(), null);
-
 
994
					String retour = this.getField().getRawValue();
-
 
995
					if (retour.matches("^[0-9]+$")) {
-
 
996
						GWT.log("ici", null);
-
 
997
						Valeur valeurRecherche = comboLiFonction.getStore().findModel("id_valeur", (String) retour);
-
 
998
						if (valeurRecherche != null) {
-
 
999
							retour = valeurRecherche.getNom();
-
 
1000
						}
968
					// Si la combobox n'a pas été utilisé, nous renvoyons la valeur brute saisie par l'utilisateur
1001
					}
969
					return this.getField().getRawValue();
-
 
970
				} else {
1002
					return retour;
971
					this.setUpdateEl(false);
-
 
972
					GWT.log("post : \n"+valeur.toString(), null);
1003
				} else {
973
					if (valeur instanceof String && ((String) valeur).matches("^[0-9]+$")) {
-
 
974
						GWT.log("ici", null);
1004
					GWT.log("post : \n"+valeur.toString(), null);
975
						return (comboLiFonction.getStore().findModel("id_valeur", (String) valeur)).getNom();
1005
					String nom = "";
976
					} else {
1006
					if (valeur instanceof Valeur) {
977
						String nom = (((Valeur) valeur).getNom());
-
 
978
						GWT.log("la "+nom, null);
1007
						nom = (((Valeur) valeur).getNom());
-
 
1008
						GWT.log("la "+nom, null);
979
						return nom;
1009
					}
980
					}
1010
					return nom;
981
				}
1011
				}
982
			}
1012
			}
983
		};
1013
		};
Line 1683... Line 1713...
1683
						}
1713
						}
1684
					}
1714
					}
1685
					structureFormPanneau.setHeading(titre);
1715
					structureFormPanneau.setHeading(titre);
1686
				} else if (info.getType().equals("liste_structure_a_personne")) {
1716
				} else if (info.getType().equals("liste_structure_a_personne")) {
1687
					if (info.getDonnee(0) != null) {
1717
					if (info.getDonnee(0) != null) {
1688
						StructureAPersonneListe personnes = (StructureAPersonneListe) info.getDonnee(0);
1718
						personnel = (StructureAPersonneListe) info.getDonnee(0);
1689
						personnel = new ArrayList<StructureAPersonne>();
-
 
1690
						for (Iterator<String> it = personnes.keySet().iterator(); it.hasNext();) {
-
 
1691
							String index = it.next();
-
 
1692
							personnes.get(index).set("fonction", magazinLiFonction.findModel("id_valeur", personnes.get(index).getFonction()).getNom());
-
 
1693
							personnel.add(personnes.get(index));
-
 
1694
						}
-
 
Line 1695... Line 1719...
1695
						
1719
						
1696
						//GWT.log(personnel.toString(), null);
1720
						//GWT.log(personnel.toString(), null);
1697
						if (onglets.getSelectedItem().equals(personnelOnglet)) {
1721
						if (onglets.getSelectedItem().equals(personnelOnglet)) {
1698
							peuplerStructurePersonnel();
1722
							peuplerStructurePersonnel();