Subversion Repositories eFlore/Applications.coel

Rev

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

Rev 1680 Rev 1764
Line 26... Line 26...
26
import org.tela_botanica.client.modeles.MenuApplicationId;
26
import org.tela_botanica.client.modeles.MenuApplicationId;
27
import org.tela_botanica.client.modeles.Valeur;
27
import org.tela_botanica.client.modeles.Valeur;
28
import org.tela_botanica.client.modeles.ValeurListe;
28
import org.tela_botanica.client.modeles.ValeurListe;
29
import org.tela_botanica.client.modeles.personne.Personne;
29
import org.tela_botanica.client.modeles.personne.Personne;
30
import org.tela_botanica.client.modeles.personne.PersonneListe;
30
import org.tela_botanica.client.modeles.personne.PersonneListe;
31
import org.tela_botanica.client.modeles.projet.Projet;
-
 
32
import org.tela_botanica.client.modeles.projet.ProjetListe;
-
 
33
import org.tela_botanica.client.modeles.publication.Publication;
31
import org.tela_botanica.client.modeles.publication.Publication;
34
import org.tela_botanica.client.modeles.publication.PublicationAPersonneListe;
32
import org.tela_botanica.client.modeles.publication.PublicationAPersonneListe;
35
import org.tela_botanica.client.modeles.publication.PublicationListe;
33
import org.tela_botanica.client.modeles.publication.PublicationListe;
36
import org.tela_botanica.client.synchronisation.Sequenceur;
34
import org.tela_botanica.client.synchronisation.Sequenceur;
37
import org.tela_botanica.client.util.Debug;
35
import org.tela_botanica.client.util.Debug;
Line 63... Line 61...
63
import com.extjs.gxt.ui.client.widget.MessageBox;
61
import com.extjs.gxt.ui.client.widget.MessageBox;
Line 64... Line 62...
64
 
62
 
65
import com.extjs.gxt.ui.client.widget.ContentPanel;
63
import com.extjs.gxt.ui.client.widget.ContentPanel;
66
import org.tela_botanica.client.composants.InfoLogger;
64
import org.tela_botanica.client.composants.InfoLogger;
67
import org.tela_botanica.client.composants.pagination.Proxy;
-
 
68
import org.tela_botanica.client.composants.pagination.ProxyProjets;
65
import org.tela_botanica.client.composants.pagination.Proxy;
Line 69... Line 66...
69
import org.tela_botanica.client.composants.pagination.ProxyValeur;
66
import org.tela_botanica.client.composants.pagination.ProxyValeur;
70
 
67
 
71
import com.extjs.gxt.ui.client.widget.TabItem;
68
import com.extjs.gxt.ui.client.widget.TabItem;
Line 152... Line 149...
152
		genererTitreFormulaire();
149
		genererTitreFormulaire();
Line 153... Line 150...
153
		
150
		
154
		mediateur.obtenirListeValeurEtRafraichir(this, "relationPersonnePublication", sequenceur);
151
		mediateur.obtenirListeValeurEtRafraichir(this, "relationPersonnePublication", sequenceur);
155
		mediateur.obtenirListeValeurEtRafraichir(this, "relationPersonnePublication", null);
152
		mediateur.obtenirListeValeurEtRafraichir(this, "relationPersonnePublication", null);
156
		if (modeDeCreation.equals(Formulaire.MODE_MODIFIER)) {
153
		if (modeDeCreation.equals(Formulaire.MODE_MODIFIER)) {
157
			mediateur.selectionnerPersonne(this, personne, null, sequenceur);
154
			mediateur.selectionnerPersonne(this, personne.getId(), sequenceur);
158
		}
155
		}
Line 159... Line 156...
159
	}
156
	}
160
	
157
	
Line 234... Line 231...
234
		main.setScrollMode(Scroll.AUTO);
231
		main.setScrollMode(Scroll.AUTO);
Line 235... Line 232...
235
		
232
		
236
		// Création des champs
233
		// Création des champs
237
		FormLayout formLayout = new FormLayout();
234
		FormLayout formLayout = new FormLayout();
238
		formLayout.setLabelAlign(LabelAlign.LEFT);
-
 
239
		
-
 
240
		//+------------------------------------------------------------------------------------------------------------+
-
 
241
		// Fieldset PROJET
-
 
242
		FieldSet fsProjet = new FieldSet();
-
 
243
		fsProjet.setHeadingHtml(i18nC.menuProjet());
-
 
244
		fsProjet.setLayout(new FormLayout());
-
 
245
		
-
 
246
		ModelType modelTypeProjets = new ModelType();
-
 
247
		modelTypeProjets.setRoot("projets");
-
 
248
		modelTypeProjets.setTotalName("nbElements");
-
 
249
		modelTypeProjets.addField("cpr_nom");
-
 
250
		modelTypeProjets.addField("cpr_id_projet");
-
 
251
		
-
 
252
		String displayNameProjets = "cpr_nom";
-
 
253
		ProxyProjets<ModelData> proxyProjets = new ProxyProjets<ModelData>(null);
-
 
254
		
-
 
255
		ChampComboBoxRechercheTempsReelPaginable cbProjets = new ChampComboBoxRechercheTempsReelPaginable(proxyProjets, modelTypeProjets, displayNameProjets);
-
 
256
		cbProjets.setWidth(100, 600);
-
 
257
		cbProjets.getCombo().setTabIndex(tabIndex++);
-
 
258
		cbProjets.getCombo().setFieldLabel(i18nC.personneProjet());
-
 
259
		cbProjets.getCombo().setEmptyText(i18nC.txtListeProjetDefaut());
-
 
260
		cbProjets.getCombo().addStyleName(ComposantClass.OBLIGATOIRE);
-
 
261
		cbProjets.getCombo().addListener(Events.Valid, Formulaire.creerEcouteurChampObligatoire());
-
 
262
		cbProjets.getCombo().setAllowBlank(false);
-
 
263
		cbProjets.getCombo().setEditable(false);
-
 
264
		
-
 
265
		fsProjet.add(cbProjets, new FormData(600, 0));
-
 
266
		
-
 
267
		hmIdentite.put("cbProjets", cbProjets);
-
 
268
				
-
 
Line 269... Line 235...
269
		left.add(fsProjet);
235
		formLayout.setLabelAlign(LabelAlign.LEFT);
270
			
236
			
271
		//+------------------------------------------------------------------------------------------------------------+
237
		//+------------------------------------------------------------------------------------------------------------+
272
		// Fieldset NOM
238
		// Fieldset NOM
Line 777... Line 743...
777
		tiPubli.add(cp);
743
		tiPubli.add(cp);
778
	}
744
	}
Line 779... Line 745...
779
 
745
 
780
	public void rafraichirPublicationsExistante(String nomPubli)	{		
746
	public void rafraichirPublicationsExistante(String nomPubli)	{		
781
		nomPubli +="%";
747
		nomPubli +="%";
782
		mediateur.selectionnerPublicationParNomComplet(this, null, nomPubli);
748
		mediateur.selectionnerPublicationParNomComplet(this, nomPubli);
Line 783... Line 749...
783
	}
749
	}
784
	
750
	
785
	/**
751
	/**
Line 855... Line 821...
855
				remplirCombobox("cbRegion", liste, "hmAdresse");			
821
				remplirCombobox("cbRegion", liste, "hmAdresse");			
856
				mettreAJourRegion();
822
				mettreAJourRegion();
857
				hmAdresse.getComboBox("cbRegion").setVisible(true);
823
				hmAdresse.getComboBox("cbRegion").setVisible(true);
Line 858... Line 824...
858
				
824
				
859
			}
-
 
860
		} else if (nouvellesDonnees instanceof ProjetListe) {			
-
 
861
			ProjetListe projets = (ProjetListe) nouvellesDonnees;
-
 
862
			List<Projet> liste = projets.toList();
-
 
863
			ComboBox cbProjets = hmIdentite.getComboBox("cbProjets");
-
 
864
			ListStore<Projet> storeProjets= cbProjets.getStore();
-
 
865
			storeProjets.removeAll();
-
 
866
			storeProjets.add(liste);
-
 
867
			cbProjets.setStore(storeProjets);
825
			}
868
		} else if (nouvellesDonnees instanceof PublicationListe)	{
826
		} else if (nouvellesDonnees instanceof PublicationListe)	{
869
			PublicationListe publicationListe = (PublicationListe) nouvellesDonnees;
827
			PublicationListe publicationListe = (PublicationListe) nouvellesDonnees;
870
			List<Publication> liste = publicationListe.toList();
828
			List<Publication> liste = publicationListe.toList();
871
			storePubli.removeAll();
829
			storePubli.removeAll();
Line 1000... Line 958...
1000
	}
958
	}
Line 1001... Line 959...
1001
	
959
	
Line 1002... Line 960...
1002
	private void mettreAJourPersonne(Personne personne)	{
960
	private void mettreAJourPersonne(Personne personne)	{
1003
		
-
 
1004
		//Mise à jour de la personne
-
 
1005
		ChampComboBoxRechercheTempsReelPaginable cbProjets = hmIdentite.getComboBoxRechercheTempsReelPaginable("cbProjets");
-
 
1006
		if (cbProjets.getCombo().getStore() != null
-
 
1007
				&& personne != null
-
 
1008
				&& personne.getIdProjet() != null
-
 
1009
				&& !UtilString.isEmpty(personne.getIdProjet())) {
-
 
1010
			cbProjets.chargerValeurInitiale(personne.getIdProjet(), "cpr_id_projet");
-
 
1011
		} else {
-
 
Line 1012... Line 961...
1012
			cbProjets.getCombo().setValue(null);
961
		
1013
		}
962
		//Mise à jour de la personne
1014
		
963
		
Line 1201... Line 1150...
1201
 
1150
 
1202
	public boolean verifierFormulaire() {
1151
	public boolean verifierFormulaire() {
1203
		boolean success = true;
1152
		boolean success = true;
Line 1204... Line -...
1204
		LinkedList<String> lstMessageErreur = new LinkedList<String>();
-
 
1205
		
-
 
1206
		ChampComboBoxRechercheTempsReelPaginable cbProjets = hmIdentite.getComboBoxRechercheTempsReelPaginable("cbProjets");
-
 
1207
		if (cbProjets.getValeur() == null)	{
-
 
1208
			lstMessageErreur.add("Le projet n'a pas été renseigné");
-
 
1209
		} else {
-
 
1210
			Projet projet = new Projet(cbProjets.getValeur());
-
 
1211
			personneSelectionnee.set("ce_projet", projet.getId());
-
 
1212
		}
1153
		LinkedList<String> lstMessageErreur = new LinkedList<String>();
1213
		
1154
		
1214
		String strTfNom = (String) hmIdentite.getTextField("tfNom").getValue();
1155
		String strTfNom = (String) hmIdentite.getTextField("tfNom").getValue();
1215
		if ((strTfNom == null)||(strTfNom.trim().equals("")))	{
1156
		if ((strTfNom == null)||(strTfNom.trim().equals("")))	{
1216
			lstMessageErreur.add("Le nom n'a pas été saisi");
1157
			lstMessageErreur.add("Le nom n'a pas été saisi");