Subversion Repositories eFlore/Applications.coel

Rev

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

Rev 1115 Rev 1118
Line 13... Line 13...
13
import org.tela_botanica.client.util.Pattern;
13
import org.tela_botanica.client.util.Pattern;
14
import org.tela_botanica.client.util.UtilArray;
14
import org.tela_botanica.client.util.UtilArray;
15
import org.tela_botanica.client.util.UtilString;
15
import org.tela_botanica.client.util.UtilString;
16
import org.tela_botanica.client.vues.Formulaire;
16
import org.tela_botanica.client.vues.Formulaire;
Line -... Line 17...
-
 
17
 
17
 
18
import com.extjs.gxt.ui.client.event.BaseEvent;
-
 
19
import com.extjs.gxt.ui.client.event.Events;
18
import com.extjs.gxt.ui.client.event.Events;
20
import com.extjs.gxt.ui.client.event.Listener;
19
import com.extjs.gxt.ui.client.widget.Info;
21
import com.extjs.gxt.ui.client.widget.Info;
20
import com.extjs.gxt.ui.client.widget.MessageBox;
22
import com.extjs.gxt.ui.client.widget.MessageBox;
21
import com.extjs.gxt.ui.client.widget.form.CheckBox;
23
import com.extjs.gxt.ui.client.widget.form.CheckBox;
22
import com.extjs.gxt.ui.client.widget.form.FieldSet;
24
import com.extjs.gxt.ui.client.widget.form.FieldSet;
Line 89... Line 91...
89
		
91
		
Line 90... Line 92...
90
		creerTabIndex();
92
		creerTabIndex();
91
		
93
		
92
		if (modeDeCreation.equals(Formulaire.MODE_MODIFIER)) {
94
		if (modeDeCreation.equals(Formulaire.MODE_MODIFIER)) {
93
			mediateur.selectionnerProjet(this, projetId);
-
 
94
		}
-
 
95
			
-
 
96
		mediateur.obtenirListeValeurEtRafraichir(this, listeValeurIndexationDureeId);
95
			mediateur.selectionnerProjet(this, projetId);
Line 97... Line 96...
97
		mediateur.obtenirListeValeurEtRafraichir(this, listeValeurIndexationFrequenceId);
96
		}			
98
	}
97
	}
99
	
98
	
Line 118... Line 117...
118
		generalitesFieldset.setCollapsible(true);
117
		generalitesFieldset.setCollapsible(true);
119
		generalitesFieldset.setLayout(layout);
118
		generalitesFieldset.setLayout(layout);
Line 120... Line 119...
120
		
119
		
121
		nomChp = new TextField<String>();
120
		nomChp = new TextField<String>();
122
		nomChp.setName("cpu");
121
		nomChp.setName("cpu");
123
		nomChp.setFieldLabel("Nom");
122
		nomChp.setFieldLabel(i18nC.projetNom());
124
		nomChp.addStyleName(ComposantClass.OBLIGATOIRE);
123
		nomChp.addStyleName(ComposantClass.OBLIGATOIRE);
125
		nomChp.addListener(Events.Valid, creerEcouteurChampObligatoire());
124
		nomChp.addListener(Events.Valid, creerEcouteurChampObligatoire());
Line 126... Line 125...
126
		generalitesFieldset.add(nomChp, new FormData(450, 0));
125
		generalitesFieldset.add(nomChp, new FormData(450, 0));
127
		
126
		
128
		abreviationChp = new TextField<String>();
127
		abreviationChp = new TextField<String>();
129
		abreviationChp.setFieldLabel("Abréviation");
128
		abreviationChp.setFieldLabel(i18nC.projetAbreviation());
130
		abreviationChp.addStyleName(ComposantClass.OBLIGATOIRE);
129
		abreviationChp.addStyleName(ComposantClass.OBLIGATOIRE);
Line 131... Line 130...
131
		abreviationChp.addListener(Events.Valid, creerEcouteurChampObligatoire());
130
		abreviationChp.addListener(Events.Valid, creerEcouteurChampObligatoire());
132
		generalitesFieldset.add(abreviationChp, new FormData(450, 0));
131
		generalitesFieldset.add(abreviationChp, new FormData(450, 0));
133
		
132
		
134
		descriptionChp = new TextArea();
133
		descriptionChp = new TextArea();
135
		descriptionChp.setFieldLabel("Description");
134
		descriptionChp.setFieldLabel(i18nC.projetDescription());
Line 136... Line 135...
136
		descriptionChp.addStyleName(ComposantClass.OBLIGATOIRE);
135
		descriptionChp.addStyleName(ComposantClass.OBLIGATOIRE);
137
		descriptionChp.addListener(Events.Valid, creerEcouteurChampObligatoire());
136
		descriptionChp.addListener(Events.Valid, creerEcouteurChampObligatoire());
138
		generalitesFieldset.add(descriptionChp, new FormData(450, 0));
137
		generalitesFieldset.add(descriptionChp, new FormData(450, 0));
139
		
138
		
140
		resumeChp = new TextArea();
139
		resumeChp = new TextArea();
Line 141... Line 140...
141
		resumeChp.setFieldLabel("Résumé");
140
		resumeChp.setFieldLabel(i18nC.projetResume());
142
		resumeChp.addStyleName(ComposantClass.OBLIGATOIRE);
141
		resumeChp.addStyleName(ComposantClass.OBLIGATOIRE);
143
		resumeChp.addListener(Events.Valid, creerEcouteurChampObligatoire());
142
		resumeChp.addListener(Events.Valid, creerEcouteurChampObligatoire());
144
		generalitesFieldset.add(resumeChp, new FormData(450, 0));
143
		generalitesFieldset.add(resumeChp, new FormData(450, 0));
Line 145... Line 144...
145
		
144
		
146
		urlChp = new TextField<String>();
145
		urlChp = new TextField<String>();
Line 172... Line 171...
172
		
171
		
173
		langueChp = new ChampComboBoxListeValeurs(i18nC.projetLangue(), listeLanguesId);
172
		langueChp = new ChampComboBoxListeValeurs(i18nC.projetLangue(), listeLanguesId);
Line 174... Line 173...
174
		complementFieldset.add(langueChp, new FormData(200, 0));
173
		complementFieldset.add(langueChp, new FormData(200, 0));
175
		
174
		
-
 
175
		markPublicChp = new CheckBox();
-
 
176
		markPublicChp.setFieldLabel(i18nC.projetMarkPublic());
-
 
177
		markPublicChp.addListener(Events.Change, new Listener<BaseEvent>() {
-
 
178
			@Override
-
 
179
			public void handleEvent(BaseEvent be) {
-
 
180
				if (markPublicChp.getValue()) {
-
 
181
					indexationFieldset.show();
-
 
182
				} else {
-
 
183
					indexationFieldset.hide();
-
 
184
				}
176
		markPublicChp = new CheckBox();
185
			}
177
		markPublicChp.setFieldLabel("Public");
186
		});
Line 178... Line 187...
178
		complementFieldset.add(markPublicChp);
187
		complementFieldset.add(markPublicChp);
179
	}
188
	}
Line 185... Line 194...
185
		// Fieldset Indexation
194
		// Fieldset Indexation
186
		indexationFieldset = new FieldSet();
195
		indexationFieldset = new FieldSet();
187
		indexationFieldset.setHeading(i18nC.projetTitreIndexation());
196
		indexationFieldset.setHeading(i18nC.projetTitreIndexation());
188
		indexationFieldset.setCollapsible(true);
197
		indexationFieldset.setCollapsible(true);
189
		indexationFieldset.setLayout(layout);
198
		indexationFieldset.setLayout(layout);
-
 
199
		indexationFieldset.hide();
-
 
200
		indexationFieldset.addListener(Events.Hide, new Listener<BaseEvent>() {
-
 
201
			@Override
-
 
202
			public void handleEvent(BaseEvent be) {
-
 
203
				indexationHeureChp.clear();
-
 
204
				indexationFrequenceChp.clear();
-
 
205
				indexationDureeChp.clear();
-
 
206
			}
-
 
207
		});
Line 190... Line 208...
190
		
208
		
191
		indexationHeureChp = new TextField<String>();
209
		indexationHeureChp = new TextField<String>();
192
		indexationHeureChp.setFieldLabel(i18nC.projetIndexationHeure());
210
		indexationHeureChp.setFieldLabel(i18nC.projetIndexationHeure());
193
		indexationHeureChp.setToolTip(i18nC.projetMessageHeureMinute());
211
		indexationHeureChp.setToolTip(i18nC.projetMessageHeureMinute());
Line 344... Line 362...
344
		String uri = urlChp.getValue();
362
		String uri = urlChp.getValue();
345
		if (uri != null && ! uri.trim().isEmpty() && ! uri.matches(Pattern.url)) {
363
		if (uri != null && ! uri.trim().isEmpty() && ! uri.matches(Pattern.url)) {
346
			messages.add(i18nC.messageUrlNonValide());
364
			messages.add(i18nC.messageUrlNonValide());
347
		}
365
		}
Line 348... Line 366...
348
		
366
		
349
		String heure = indexationHeureChp.getValue();
367
		if (markPublicChp.getValue()) {
350
		if (!UtilString.isEmpty(heure)) {
368
			String heure = indexationHeureChp.getValue();
351
			if (!heure.matches(Pattern.heureMinute)) {
369
			if (!UtilString.isEmpty(heure) && !heure.matches(Pattern.heureMinute)) {
352
				messages.add(i18nC.projetMessageHeureMinute());
370
				messages.add(i18nC.projetMessageHeureMinute());
353
			}
371
			}
Line 354... Line 372...
354
		}
372
		}
Line 373... Line 391...
373
		citationChp.setValue(projet.getCitation());
391
		citationChp.setValue(projet.getCitation());
374
		licenceChp.setValue(projet.getLicence());
392
		licenceChp.setValue(projet.getLicence());
375
		langueChp.peupler(projet.getLangue());		
393
		langueChp.peupler(projet.getLangue());		
376
		if (projet.getMarkPublic().equals("1")) {
394
		if (projet.getMarkPublic().equals("1")) {
377
			markPublicChp.setValue(true);
395
			markPublicChp.setValue(true);
-
 
396
			String[] heureTab = projet.getIndexationHeure().split(":");
-
 
397
			if (heureTab.length > 1) {
-
 
398
				String heure = heureTab[0]+":"+heureTab[1];
-
 
399
				if (heure.matches(Pattern.heureMinute)) {
-
 
400
					indexationHeureChp.setValue(heure);
-
 
401
				}
-
 
402
			}
-
 
403
			indexationFrequenceChp.peupler(projet.getIndexationFreq());
-
 
404
			indexationDureeChp.peupler(projet.getIndexationDuree());
378
		} else {
405
		} else {
379
			markPublicChp.setValue(false);
406
			markPublicChp.setValue(false);
380
		}
407
		}
Line 381... Line -...
381
		
-
 
382
		String[] heureTab = projet.getIndexationHeure().split(":");
-
 
383
		if (heureTab.length > 1) {
-
 
384
			String heure = heureTab[0]+":"+heureTab[1];
-
 
385
			if (heure.matches(Pattern.heureMinute)) {
-
 
386
				indexationHeureChp.setValue(heure);
-
 
387
			}
-
 
388
		}
-
 
389
		indexationFrequenceChp.peupler(projet.getIndexationFreq());
-
 
390
		indexationDureeChp.peupler(projet.getIndexationDuree());
-
 
391
		
408
		
392
		doLayout(true);
409
		doLayout(true);
Line 393... Line 410...
393
	}
410
	}
394
	
411