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 671... Line 671...
671
		Button ajouterPubli = new Button("Ajouter");
671
		Button ajouterPubli = new Button("Ajouter");
672
		ajouterPubli.setIcon(Images.ICONES.vcardAjouter());
672
		ajouterPubli.setIcon(Images.ICONES.vcardAjouter());
673
		ajouterPubli.addSelectionListener(new SelectionListener<ButtonEvent>() {  
673
		ajouterPubli.addSelectionListener(new SelectionListener<ButtonEvent>() {  
674
			@Override  
674
			@Override  
675
			public void componentSelected(ButtonEvent ce) {  
675
			public void componentSelected(ButtonEvent ce) {  
676
Debug.log("|> PersonneForm.creerComposantsPubli() : A MODIFIER ! ajout publi");
-
 
677
				/*StructureAPersonne membreDuPersonnel = new StructureAPersonne("", StructureAPersonne.ROLE_EQUIPE, StructureAPersonne.ETAT_AJOUTE);
676
				/*StructureAPersonne membreDuPersonnel = new StructureAPersonne("", StructureAPersonne.ROLE_EQUIPE, StructureAPersonne.ETAT_AJOUTE);
678
				ajouterMembreAGrillePersonnel(membreDuPersonnel);*/
677
				ajouterMembreAGrillePersonnel(membreDuPersonnel);*/
679
			}  
678
			}  
680
		});
679
		});
681
		toolBar.add(ajouterPubli);
680
		toolBar.add(ajouterPubli);
Line 748... Line 747...
748
		
747
		
749
		
748
		
Line 750... Line 749...
750
		tiPubli.add(cp);
749
		tiPubli.add(cp);
751
	}
-
 
752
 
-
 
753
	public void rafraichirPublicationsExistante(String nomPubli)	{
-
 
754
		
750
	}
755
Debug.log("|> PersonneForm.rafraichirPublicationsExistante()");
751
 
756
		
752
	public void rafraichirPublicationsExistante(String nomPubli)	{		
Line 757... Line 753...
757
		nomPubli +="%";
753
		nomPubli +="%";
Line 781... Line 777...
781
	}
777
	}
Line 782... Line 778...
782
	
778
	
Line 783... Line 779...
783
	// RAFRAICHISSEMENT DU PANNEAU
779
	// RAFRAICHISSEMENT DU PANNEAU
784
 
-
 
785
	public void rafraichir(Object nouvellesDonnees) {
-
 
Line 786... Line 780...
786
		
780
 
787
Debug.log("|> PersonneForm.rafraichir(Object nouvellesDonnees) BEGIN");
-
 
788
 
-
 
Line 789... Line 781...
789
		if (nouvellesDonnees instanceof PublicationAPersonneListe)	{
781
	public void rafraichir(Object nouvellesDonnees) {
790
			
782
 
791
Debug.log("|--> PersonneForm.rafraichir(Object nouvellesDonnees) : nouvellesDonnees instanceof PublicationAPersonneListe");						
783
		if (nouvellesDonnees instanceof PublicationAPersonneListe)	{					
792
			
-
 
793
			Information info = new Information();
-
 
794
			info.setType("publication_liees");
784
			
Line 795... Line 785...
795
			info.setDonnee(0, (PublicationAPersonneListe) nouvellesDonnees);
785
			Information info = new Information();
796
 
-
 
797
Debug.log("|--> tiPubli.rafraichir(info)");
-
 
798
			tiPubli.rafraichir(info);
-
 
Line 799... Line 786...
799
 
786
			info.setType("publication_liees");
Line 800... Line 787...
800
		} else if (nouvellesDonnees instanceof ValeurListe) {
787
			info.setDonnee(0, (PublicationAPersonneListe) nouvellesDonnees);
801
			
788
			tiPubli.rafraichir(info);
802
Debug.log("|--> PersonneForm.rafraichir(Object nouvellesDonnees) : nouvellesDonnees instanceof ValeurListe");				
789
 
803
			
790
		} else if (nouvellesDonnees instanceof ValeurListe) {			
804
			
791
			
805
			ValeurListe listeValeurs = (ValeurListe) nouvellesDonnees;
792
			ValeurListe listeValeurs = (ValeurListe) nouvellesDonnees;
806
			
-
 
807
			// Créer une liste de valeurs
-
 
808
			List<Valeur> liste = new ArrayList<Valeur>();
793
			
809
			for (Iterator<String> it = listeValeurs.keySet().iterator(); it.hasNext();) {
-
 
810
				liste.add(listeValeurs.get(it.next()));
-
 
811
			}
794
			// Créer une liste de valeurs
812
			if (listeValeurs.getId().equals(config.getListeId("relationPersonnePublication")))	{
795
			List<Valeur> liste = new ArrayList<Valeur>();
813
	
796
			for (Iterator<String> it = listeValeurs.keySet().iterator(); it.hasNext();) {
814
Debug.log("|--> tiPubli.rafraichir(nouvellesDonnees)");
797
				liste.add(listeValeurs.get(it.next()));
815
				tiPubli.rafraichir(nouvellesDonnees);
798
			}
Line 847... Line 830...
847
				remplirCombobox("cbRegion", liste, "hmAdresse");
830
				remplirCombobox("cbRegion", liste, "hmAdresse");
848
				mettreAJourRegion();
831
				mettreAJourRegion();
849
				hmAdresse.getComboBox("cbRegion").setVisible(true);
832
				hmAdresse.getComboBox("cbRegion").setVisible(true);
Line 850... Line 833...
850
				
833
				
851
			}
834
			}
852
		} else if (nouvellesDonnees instanceof ProjetListe) {
-
 
853
			
-
 
854
			
-
 
855
Debug.log("|--> PersonneForm.rafraichir(Object nouvellesDonnees) : nouvellesDonnees instanceof ProjetListe");				
-
 
856
			
835
		} else if (nouvellesDonnees instanceof ProjetListe) {			
857
			ProjetListe projets = (ProjetListe) nouvellesDonnees;
836
			ProjetListe projets = (ProjetListe) nouvellesDonnees;
858
			List<Projet> liste = projets.toList();
-
 
859
			
837
			List<Projet> liste = projets.toList();
860
			ComboBox cbProjets = hmIdentite.getComboBox("cbProjets");
838
			ComboBox cbProjets = hmIdentite.getComboBox("cbProjets");
861
			ListStore<Projet> storeProjets= cbProjets.getStore();
839
			ListStore<Projet> storeProjets= cbProjets.getStore();
862
			storeProjets.removeAll();
840
			storeProjets.removeAll();
863
			storeProjets.add(liste);
841
			storeProjets.add(liste);
864
			cbProjets.setStore(storeProjets);
842
			cbProjets.setStore(storeProjets);
865
		} else if (nouvellesDonnees instanceof PublicationListe)	{
-
 
866
 
-
 
867
Debug.log("|> PersonneForm.rafraichir");
-
 
868
Debug.log("|--> nouvellesDonnees instanceof PublicationListe");
-
 
869
 
-
 
870
			
843
		} else if (nouvellesDonnees instanceof PublicationListe)	{
871
			PublicationListe publicationListe = (PublicationListe) nouvellesDonnees;
-
 
872
			
-
 
873
Debug.log("|--> nouvellesDonnees ="+publicationListe.toString());
-
 
874
			
844
			PublicationListe publicationListe = (PublicationListe) nouvellesDonnees;
875
			List<Publication> liste = publicationListe.toList();
-
 
876
			
845
			List<Publication> liste = publicationListe.toList();
877
			storePubli.removeAll();
846
			storePubli.removeAll();
878
			storePubli.add(liste);
847
			storePubli.add(liste);
879
			cbPubli.setStore(storePubli);
-
 
880
			
848
			cbPubli.setStore(storePubli);
881
		} else if (nouvellesDonnees instanceof Information)	{
-
 
882
			
-
 
883
Debug.log("|--> PersonneForm.rafraichir(Object nouvellesDonnees) : nouvellesDonnees instanceof Information");				
-
 
884
			
849
		} else if (nouvellesDonnees instanceof Information)	{			
885
			Information info = (Information) nouvellesDonnees;
850
			Information info = (Information) nouvellesDonnees;
886
			if (info.getType().equals("ajout_personne"))	{
851
			if (info.getType().equals("ajout_personne"))	{
887
				if (info.getDonnee(0) != null) {
852
				if (info.getDonnee(0) != null) {
888
					personneSelectionnee.setId(info.getDonnee(0).toString());
853
					personneSelectionnee.setId(info.getDonnee(0).toString());
Line 921... Line 886...
921
			} else {
886
			} else {
922
				InfoLogger.display("messages", info.getMessages().toString());
887
				InfoLogger.display("messages", info.getMessages().toString());
923
			}
888
			}
924
		}
889
		}
Line 925... Line 890...
925
		
890
		
926
		if (nouvellesDonnees == null) {
-
 
927
			
-
 
928
Debug.log("|--> PersonneForm.rafraichir(Object nouvellesDonnees) : nouvellesDonnees == null");	
-
 
929
			
891
		if (nouvellesDonnees == null) {			
Line 930... Line 892...
930
			ComboBox<Valeur> cb= hmIdentite.getComboBoxValeur("cbPrefixe");
892
			ComboBox<Valeur> cb= hmIdentite.getComboBoxValeur("cbPrefixe");
931
			
893
			
Line 975... Line 937...
975
		
937
		
Line 976... Line 938...
976
		mediateur.masquerPopinChargement();
938
		mediateur.masquerPopinChargement();
977
		
939
		
978
		if (this.mode.equals(MODE_AJOUTER))	{
940
		if (this.mode.equals(MODE_AJOUTER))	{
979
			gererEtatActivationBouton();
-
 
980
		}
-
 
981
		
941
			gererEtatActivationBouton();
Line 982... Line 942...
982
Debug.log("|> PersonneForm.rafraichir(Object nouvellesDonnees) END");		
942
		}	
983
	}
-
 
984
 
-
 
985
	private void repandreRafraichissement() {
-
 
986
		
943
	}
987
Debug.log("|> PersonneForm.repandreRafraichissement()");	
944
 
988
		
945
	private void repandreRafraichissement() {		
989
		if (vueExterneARafraichirApresValidation != null) {
946
		if (vueExterneARafraichirApresValidation != null) {
990
			String type = "personne_modifiee";
947
			String type = "personne_modifiee";
Line 1009... Line 966...
1009
			}
966
			}
1010
		}
967
		}
1011
	}
968
	}
Line 1012... Line 969...
1012
	
969
	
1013
	private void mettreAJourPersonne(Personne personne)	{
-
 
1014
		
-
 
Line 1015... Line -...
1015
Debug.log("|> BEGIN PersonneForm.mettreAJourPersonne()");	
-
 
1016
 
970
	private void mettreAJourPersonne(Personne personne)	{
1017
		
971
 
1018
		//Mise à jour de la personne		
972
		//Mise à jour de la personne		
1019
		//Personne personne = (Personne) nouvellesDonnees;
973
		//Personne personne = (Personne) nouvellesDonnees;
Line 1132... Line 1086...
1132
		
1086
		
1133
		hmInfosNat.getChampMultiValeurs("specialite").peupler(personne.getString("ce_truk_specialite"));
1087
		hmInfosNat.getChampMultiValeurs("specialite").peupler(personne.getString("ce_truk_specialite"));
1134
		String tr = personne.getString("truk_recolte");
1088
		String tr = personne.getString("truk_recolte");
Line 1135... Line 1089...
1135
		hmInfosNat.getChampMultiValeursMultiTypes("recolte").peupler(tr);
1089
		hmInfosNat.getChampMultiValeursMultiTypes("recolte").peupler(tr);
1136
		
-
 
1137
		//Onglet publi
-
 
1138
		
1090
		
1139
Debug.log("|--> appel à tiPubli.mettreAJourPersonne()");	
1091
		//Onglet publi	
1140
		tiPubli.mettreAJourPersonne();
-
 
1141
		gererEtatActivationBouton();
-
 
1142
		
1092
		tiPubli.mettreAJourPersonne();
Line 1143... Line 1093...
1143
Debug.log("|> BEGIN PersonneForm.mettreAJourPersonne()");	
1093
		gererEtatActivationBouton();
1144
	}
1094
	}
1145
 
1095
 
Line 1175... Line 1125...
1175
		mettreAJourPersonne(personneSauvegarde);
1125
		mettreAJourPersonne(personneSauvegarde);
1176
		mediateur.masquerPopinChargement();
1126
		mediateur.masquerPopinChargement();
1177
	}
1127
	}
Line 1178... Line 1128...
1178
	
1128
	
1179
	public void binderPersonne(Personne personne)	{
-
 
1180
		
-
 
1181
Debug.log("|> BEGIN PersonneForm.binderPersonne()");	
-
 
1182
 
1129
	public void binderPersonne(Personne personne)	{
Line 1183... Line 1130...
1183
		binding = new FormBinding(getFormulaire());
1130
		binding = new FormBinding(getFormulaire());
Line 1184... Line 1131...
1184
		
1131
		
1185
		personneSelectionnee = personne;
1132
		personneSelectionnee = personne;
1186
		
1133
		
Line 1187... Line 1134...
1187
		FieldBinding f = new FieldBinding((RadioGroup) hmIdentite.get("rbgDeces"), null);
1134
		FieldBinding f = new FieldBinding((RadioGroup) hmIdentite.get("rbgDeces"), null);
1188
		binding.autoBind();
1135
		binding.autoBind();
1189
		binding.removeFieldBinding(f);
-
 
1190
		
-
 
1191
		binding.bind(personneSelectionnee);
-
 
1192
		layout();
1136
		binding.removeFieldBinding(f);
Line 1193... Line 1137...
1193
		
1137
		
1194
Debug.log("|> END PersonneForm.binderPersonne()");
1138
		binding.bind(personneSelectionnee);
1195
 
1139
		layout();
Line 1215... Line 1159...
1215
	public boolean soumettreFormulaire() {
1159
	public boolean soumettreFormulaire() {
1216
		tiPubli.collecter();
1160
		tiPubli.collecter();
1217
		if (verifierFormulaire())	{
1161
		if (verifierFormulaire())	{
1218
			tiPubli.soumettre();
1162
			tiPubli.soumettre();
1219
			mediateur.enregistrerPersonne(this, personneSelectionnee);
1163
			mediateur.enregistrerPersonne(this, personneSelectionnee);
-
 
1164
			return true;
1220
		}
1165
		}
1221
		return true;
1166
		else return false;
1222
	}
1167
	}
Line 1223... Line 1168...
1223
 
1168
 
1224
	public boolean verifierFormulaire() {
1169
	public boolean verifierFormulaire() {
1225
		boolean success = true;
1170
		boolean success = true;