Subversion Repositories eFlore/Applications.coel

Rev

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

Rev 731 Rev 776
Line 744... Line 744...
744
				Info.display("Enregistrement", "Les modifications apportées à la personne " + personneSelectionnee.getId() + " ont été correctement enregistrées.");
744
				Info.display("Enregistrement", "Les modifications apportées à la personne " + personneSelectionnee.getId() + " ont été correctement enregistrées.");
745
			}
745
			}
746
			else if (info.getType().equals("maj_utilisateur"))	{
746
			else if (info.getType().equals("maj_utilisateur"))	{
747
				gererEtatActivationBouton();
747
				gererEtatActivationBouton();
748
			} else if (info.getDonnee(0) instanceof PersonneListe)	{
748
			} else if (info.getDonnee(0) instanceof PersonneListe)	{
-
 
749
				
749
				Collection colPersonneListe = ((PersonneListe) info.getDonnee(0)).values();
750
				Collection colPersonneListe = ((PersonneListe) info.getDonnee(0)).values();
750
				Iterator itPersonneListe = colPersonneListe.iterator();
751
				Iterator itPersonneListe = colPersonneListe.iterator();
751
				Personne personne = (Personne) itPersonneListe.next();
752
				Personne personne = (Personne) itPersonneListe.next();
Line 752... Line 753...
752
				
753
				
753
				personneSauvegarde = new Personne();
754
				personneSauvegarde = new Personne();
Line 754... Line 755...
754
				personneSauvegarde = (Personne) personne.cloner(personneSauvegarde);
755
				personneSauvegarde = (Personne) personne.cloner(personneSauvegarde);
755
				
-
 
756
				binderPersonne(personne);
-
 
757
				//Mise à jour de la personne		
-
 
758
				//Personne personne = (Personne) nouvellesDonnees;
-
 
759
				
-
 
760
				ComboBox cbProjets = (ComboBox) hmIdentite.get("cbProjets");
-
 
761
				cbProjets.setValue(cbProjets.getStore().findModel("id_projet", personne.get("ce_projet")));
-
 
762
				
-
 
763
				//Prefixe
-
 
764
				String prefixe = personne.get("ce_truk_prefix");
-
 
765
				ComboBox<Valeur> cbPrefixe = (ComboBox<Valeur>) hmIdentite.get("cbPrefixe");
-
 
766
				
-
 
767
				
-
 
768
				String prefixeCourant = personne.get("ce_truk_prefix");
-
 
769
				if (cbPrefixe.getStore().findModel("id_valeur", prefixeCourant) != null)	{
-
 
770
					cbPrefixe.setValue(cbPrefixe.getStore().findModel("id_valeur", prefixeCourant));
-
 
771
				}	else	{
-
 
772
					cbPrefixe.setRawValue(prefixeCourant);
-
 
773
				}
-
 
774
				
-
 
775
				
-
 
776
				((TextField) hmIdentite.get("tfPrenom")).setValue(personne.get("prenom"));
-
 
777
				((TextField) hmIdentite.get("tfNom")).setValue(personne.get("nom"));
-
 
778
				
-
 
779
				//Suffixe
-
 
780
				String suffixe = personne.get("ce_truk_suffixe");
-
 
781
				ComboBox<Valeur> cbSuffixe = (ComboBox<Valeur>) hmIdentite.get("cbSuffixe");
-
 
782
				
-
 
783
				String suffixeCourant = personne.get("ce_truk_suffix");
-
 
784
				if (cbSuffixe.getStore().findModel("id_valeur", suffixeCourant) != null)	{
-
 
785
					cbSuffixe.setValue(cbSuffixe.getStore().findModel("id_valeur", suffixeCourant));
-
 
786
				}	else	{
-
 
787
					cbSuffixe.setRawValue(suffixeCourant);
-
 
788
				}
-
 
789
				
-
 
790
				((TextField) hmIdentite.get("tfNomAutre")).setValue(personne.get("truk_nom_autre"));
-
 
791
				((TextField) hmIdentite.get("tfAbreviation")).setValue(personne.get("abreviation"));
-
 
792
				((TextField) hmIdentite.get("tfAbreviationAutre")).setValue(personne.get("truk_abreviation_autre"));
-
 
793
				
-
 
794
				
-
 
795
				(((DateField) hmIdentite.get("dfDateNaissance"))).setValue(personne.getDate("naissance_date"));
-
 
796
				((TextField) hmIdentite.get("tfLieuNaissance")).setValue(personne.get("naissance_lieu"));
-
 
797
				
-
 
798
				(((DateField) hmIdentite.get("dfDateDeces"))).setValue(personne.getDate("deces_date"));
-
 
799
				((TextField) hmIdentite.get("tfLieuDeces")).setValue(personne.get("deces_lieu"));
-
 
800
				
-
 
801
				((ChampMultiValeursMultiTypes) hmIdentite.get("telephones")).peupler(personne.getString("truk_telephone"));
-
 
802
				
-
 
803
				//Courriel
-
 
804
				((ChampMultiValeurs) hmIdentite.get("courriels")).peupler(personne.getCourriel());
-
 
805
				
-
 
806
				//Sites web
-
 
807
				((ChampMultiValeurs) hmIdentite.get("sites")).peupler(personne.getString("truk_url"));
-
 
808
				
-
 
809
				
-
 
810
				// Sexe
-
 
811
				String strSexe = personne.get("ce_sexe");
-
 
812
				ComboBox<Valeur> cbSexe = (ComboBox<Valeur>) hmIdentite.get("cbSexe");
-
 
813
 
-
 
814
				if (cbSexe.getStore().findModel("id_valeur", strSexe) != null)	{
-
 
815
					cbSexe.setValue(cbSexe.getStore().findModel("id_valeur", strSexe));
-
 
816
				}	else	{
-
 
817
					cbSexe.setRawValue(strSexe);
-
 
818
				}
-
 
819
				
-
 
820
				((TextArea) hmIdentite.get("taDescription")).setRawValue((String) personne.get("description"));
-
 
821
				
-
 
822
				//Logo
-
 
823
				((ChampMultiValeurs) hmIdentite.get("logos")).peupler(personne.getString("truk_logo"));
-
 
824
				
-
 
825
				/*--------------------------------------------------
-
 
826
				                      Adresse
-
 
827
				 ---------------------------------------------------*/
-
 
828
				
-
 
829
				// Adresse
-
 
830
				((TextField<String>) hmAdresse.get("tfAdresse1")).setValue((String) personne.get("adresse_01"));
-
 
831
 
-
 
832
				// Complément
-
 
833
				((TextField<String>) hmAdresse.get("tfAdresse2")).setValue((String) personne.get("adresse_02"));
-
 
834
				
-
 
835
				//Boite postale
-
 
836
				((TextField<String>) hmAdresse.get("tfBoitePostale")).setValue((String) personne.get("bp"));
-
 
837
				
-
 
838
				//Pays
-
 
839
				String strPays = personne.get("pays");
-
 
Line 840... Line -...
840
				ComboBox<Valeur> cbPays = (ComboBox<Valeur>) hmAdresse.get("cbPays");
-
 
841
				
-
 
842
				
-
 
843
				if (cbPays.getStore().findModel("nom", strPays) != null)	{
-
 
844
					cbPays.setValue(cbPays.getStore().findModel("nom", strPays));
-
 
845
				}	else	{
-
 
846
					cbPays.setRawValue(strPays);
-
 
847
				}
756
				
848
				
-
 
849
				//Région
-
 
850
				String strRegion = personne.get("region");
-
 
851
				if ((strRegion!=null)&&(!strRegion.equals("")))	{
-
 
852
					ComboBox<Valeur> cbRegion = (ComboBox<Valeur>) hmAdresse.get("cbRegion");
-
 
853
					cbRegion.setVisible(true);
-
 
854
					
-
 
855
					if (cbRegion.getStore().findModel("nom", strRegion) != null)	{
-
 
856
						cbRegion.setValue(cbRegion.getStore().findModel("nom", strRegion));
-
 
857
					}	else	{
-
 
858
						cbRegion.setRawValue(strRegion);
-
 
859
					}
-
 
860
				}
-
 
861
				
-
 
862
				//Cp
-
 
863
				((TextField) hmAdresse.get("tfCodePostal")).setValue(personne.get("code_postal"));
-
 
864
				
-
 
865
				//Ville
-
 
Line 866... Line 757...
866
				((TextField) hmAdresse.get("tfVille")).setValue(personne.get("ville"));
757
				binderPersonne(personne);
867
				
758
				
868
				gererEtatActivationBouton();
759
				mettreAJourPersonne(personne);
869
				
760
				
870
				nouvellesDonnees = null;
761
				nouvellesDonnees = null;
Line 871... Line 762...
871
			} else {
762
			} else {
872
				Info.display("messages", info.getMessages().toString());
763
				Info.display("messages", info.getMessages().toString());
Line 873... Line 764...
873
			}
764
			}
Line 923... Line 814...
923
		if (this.mode.equals(MODE_AJOUTER))	{
814
		if (this.mode.equals(MODE_AJOUTER))	{
924
			gererEtatActivationBouton();
815
			gererEtatActivationBouton();
925
		}
816
		}
926
	}
817
	}
Line -... Line 818...
-
 
818
 
-
 
819
	private void mettreAJourPersonne(Personne personne)	{
-
 
820
		
-
 
821
 
-
 
822
		//Mise à jour de la personne		
-
 
823
		//Personne personne = (Personne) nouvellesDonnees;
-
 
824
		
-
 
825
		ComboBox cbProjets = (ComboBox) hmIdentite.get("cbProjets");
-
 
826
		cbProjets.setValue(cbProjets.getStore().findModel("id_projet", personne.get("ce_projet")));
-
 
827
		
-
 
828
		//Prefixe
-
 
829
		String prefixe = personne.get("ce_truk_prefix");
-
 
830
		ComboBox<Valeur> cbPrefixe = (ComboBox<Valeur>) hmIdentite.get("cbPrefixe");
-
 
831
		
-
 
832
		
-
 
833
		String prefixeCourant = personne.get("ce_truk_prefix");
-
 
834
		if (cbPrefixe.getStore().findModel("id_valeur", prefixeCourant) != null)	{
-
 
835
			cbPrefixe.setValue(cbPrefixe.getStore().findModel("id_valeur", prefixeCourant));
-
 
836
		}	else	{
-
 
837
			cbPrefixe.setRawValue(prefixeCourant);
-
 
838
		}
-
 
839
		
-
 
840
		
-
 
841
		((TextField) hmIdentite.get("tfPrenom")).setValue(personne.get("prenom"));
-
 
842
		((TextField) hmIdentite.get("tfNom")).setValue(personne.get("nom"));
-
 
843
		
-
 
844
		//Suffixe
-
 
845
		String suffixe = personne.get("ce_truk_suffixe");
-
 
846
		ComboBox<Valeur> cbSuffixe = (ComboBox<Valeur>) hmIdentite.get("cbSuffixe");
-
 
847
		
-
 
848
		String suffixeCourant = personne.get("ce_truk_suffix");
-
 
849
		if (cbSuffixe.getStore().findModel("id_valeur", suffixeCourant) != null)	{
-
 
850
			cbSuffixe.setValue(cbSuffixe.getStore().findModel("id_valeur", suffixeCourant));
-
 
851
		}	else	{
-
 
852
			cbSuffixe.setRawValue(suffixeCourant);
-
 
853
		}
-
 
854
		
-
 
855
		((TextField) hmIdentite.get("tfNomAutre")).setValue(personne.get("truk_nom_autre"));
-
 
856
		((TextField) hmIdentite.get("tfAbreviation")).setValue(personne.get("abreviation"));
-
 
857
		((TextField) hmIdentite.get("tfAbreviationAutre")).setValue(personne.get("truk_abreviation_autre"));
-
 
858
		
-
 
859
		
-
 
860
		(((DateField) hmIdentite.get("dfDateNaissance"))).setValue(personne.getDate("naissance_date"));
-
 
861
		((TextField) hmIdentite.get("tfLieuNaissance")).setValue(personne.get("naissance_lieu"));
-
 
862
		
-
 
863
		(((DateField) hmIdentite.get("dfDateDeces"))).setValue(personne.getDate("deces_date"));
-
 
864
		((TextField) hmIdentite.get("tfLieuDeces")).setValue(personne.get("deces_lieu"));
-
 
865
		
-
 
866
		((ChampMultiValeursMultiTypes) hmIdentite.get("telephones")).peupler(personne.getString("truk_telephone"));
-
 
867
		
-
 
868
		//Courriel
-
 
869
		((ChampMultiValeurs) hmIdentite.get("courriels")).peupler(personne.getCourriel());
-
 
870
		
-
 
871
		//Sites web
-
 
872
		((ChampMultiValeurs) hmIdentite.get("sites")).peupler(personne.getString("truk_url"));
-
 
873
		
-
 
874
		
-
 
875
		// Sexe
-
 
876
		String strSexe = personne.get("ce_sexe");
-
 
877
		ComboBox<Valeur> cbSexe = (ComboBox<Valeur>) hmIdentite.get("cbSexe");
-
 
878
 
-
 
879
		if (cbSexe.getStore().findModel("id_valeur", strSexe) != null)	{
-
 
880
			cbSexe.setValue(cbSexe.getStore().findModel("id_valeur", strSexe));
-
 
881
		}	else	{
-
 
882
			cbSexe.setRawValue(strSexe);
-
 
883
		}
-
 
884
		
-
 
885
		((TextArea) hmIdentite.get("taDescription")).setRawValue((String) personne.get("description"));
-
 
886
		
-
 
887
		//Logo
-
 
888
		((ChampMultiValeurs) hmIdentite.get("logos")).peupler(personne.getString("truk_logo"));
-
 
889
		
-
 
890
		/*--------------------------------------------------
-
 
891
		                      Adresse
-
 
892
		 ---------------------------------------------------*/
-
 
893
		
-
 
894
		// Adresse
-
 
895
		((TextField<String>) hmAdresse.get("tfAdresse1")).setValue((String) personne.get("adresse_01"));
-
 
896
 
-
 
897
		// Complément
-
 
898
		((TextField<String>) hmAdresse.get("tfAdresse2")).setValue((String) personne.get("adresse_02"));
-
 
899
		
-
 
900
		//Boite postale
-
 
901
		((TextField<String>) hmAdresse.get("tfBoitePostale")).setValue((String) personne.get("bp"));
-
 
902
		
-
 
903
		//Pays
-
 
904
		String strPays = personne.get("pays");
-
 
905
		ComboBox<Valeur> cbPays = (ComboBox<Valeur>) hmAdresse.get("cbPays");
-
 
906
		
-
 
907
		
-
 
908
		if (cbPays.getStore().findModel("nom", strPays) != null)	{
-
 
909
			cbPays.setValue(cbPays.getStore().findModel("nom", strPays));
-
 
910
		}	else	{
-
 
911
			cbPays.setRawValue(strPays);
-
 
912
		}
-
 
913
		
-
 
914
		//Région
-
 
915
		String strRegion = personne.get("region");
-
 
916
		if ((strRegion!=null)&&(!strRegion.equals("")))	{
-
 
917
			ComboBox<Valeur> cbRegion = (ComboBox<Valeur>) hmAdresse.get("cbRegion");
-
 
918
			cbRegion.setVisible(true);
-
 
919
			
-
 
920
			if (cbRegion.getStore().findModel("nom", strRegion) != null)	{
-
 
921
				cbRegion.setValue(cbRegion.getStore().findModel("nom", strRegion));
-
 
922
			}	else	{
-
 
923
				cbRegion.setRawValue(strRegion);
-
 
924
			}
-
 
925
		}
-
 
926
		
-
 
927
		//Cp
-
 
928
		((TextField) hmAdresse.get("tfCodePostal")).setValue(personne.get("code_postal"));
-
 
929
		
-
 
930
		//Ville
-
 
931
		((TextField) hmAdresse.get("tfVille")).setValue(personne.get("ville"));
-
 
932
		
-
 
933
		gererEtatActivationBouton();
-
 
934
		
Line 927... Line 935...
927
 
935
	}
928
 
936
 
929
	public void remplirCombobox(String idComboBox, List liste, String hashMapId)	{
937
	public void remplirCombobox(String idComboBox, List liste, String hashMapId)	{
930
		HashMap hm = null;
938
		HashMap hm = null;
Line 954... Line 962...
954
	}
962
	}
Line 955... Line 963...
955
	
963
	
956
	public void reinitialiser()	{
964
	public void reinitialiser()	{
Line 957... Line 965...
957
		mediateur.afficherPopinChargement();
965
		mediateur.afficherPopinChargement();
958
		
-
 
Line 959... Line 966...
959
		binderPersonne(personneSauvegarde);
966
		
-
 
967
		mettreAJourPersonne(personneSauvegarde);
960
		layout();
968
		
Line 961... Line 969...
961
		
969
		mediateur.masquerPopinChargement();
962
		mediateur.masquerPopinChargement();
970