Line 45... |
Line 45... |
45 |
import com.extjs.gxt.ui.client.widget.form.FormPanel;
|
45 |
import com.extjs.gxt.ui.client.widget.form.FormPanel;
|
46 |
import com.extjs.gxt.ui.client.widget.form.LabelField;
|
46 |
import com.extjs.gxt.ui.client.widget.form.LabelField;
|
47 |
import com.extjs.gxt.ui.client.widget.form.NumberField;
|
47 |
import com.extjs.gxt.ui.client.widget.form.NumberField;
|
48 |
import com.extjs.gxt.ui.client.widget.form.Radio;
|
48 |
import com.extjs.gxt.ui.client.widget.form.Radio;
|
49 |
import com.extjs.gxt.ui.client.widget.form.RadioGroup;
|
49 |
import com.extjs.gxt.ui.client.widget.form.RadioGroup;
|
- |
|
50 |
import com.extjs.gxt.ui.client.widget.form.TextArea;
|
50 |
import com.extjs.gxt.ui.client.widget.form.TextField;
|
51 |
import com.extjs.gxt.ui.client.widget.form.TextField;
|
51 |
import com.extjs.gxt.ui.client.widget.form.ComboBox.TriggerAction;
|
52 |
import com.extjs.gxt.ui.client.widget.form.ComboBox.TriggerAction;
|
52 |
import com.extjs.gxt.ui.client.widget.form.FormPanel.LabelAlign;
|
53 |
import com.extjs.gxt.ui.client.widget.form.FormPanel.LabelAlign;
|
53 |
import com.extjs.gxt.ui.client.widget.grid.CellEditor;
|
54 |
import com.extjs.gxt.ui.client.widget.grid.CellEditor;
|
54 |
import com.extjs.gxt.ui.client.widget.grid.CheckBoxSelectionModel;
|
55 |
import com.extjs.gxt.ui.client.widget.grid.CheckBoxSelectionModel;
|
Line 134... |
Line 135... |
134 |
private RadioGroup materielConservationCeRGrpChp = null;
|
135 |
private RadioGroup materielConservationCeRGrpChp = null;
|
Line 135... |
Line 136... |
135 |
|
136 |
|
136 |
private RadioGroup actionMarkRGrpChp;
|
137 |
private RadioGroup actionMarkRGrpChp;
|
137 |
private TextField<String> nomStructureChp;
|
138 |
private TextField<String> nomStructureChp;
|
138 |
private DateField dateFondationChp;
|
139 |
private DateField dateFondationChp;
|
139 |
private TextField<String> adrChp;
|
140 |
private TextArea adrChp;
|
140 |
private TextField<String> cpChp;
|
141 |
private TextField<String> cpChp;
|
141 |
private TextField<String> villeChp;
|
142 |
private TextField<String> villeChp;
|
142 |
private TextField<String> regionChp;
|
143 |
private TextField<String> regionChp;
|
143 |
private TextField<String> paysChp;
|
144 |
private TextField<String> paysChp;
|
144 |
private TextField<String> telChp;
|
145 |
private TextField<String> telChp;
|
145 |
private TextField<String> faxChp;
|
146 |
private TextField<String> faxChp;
|
146 |
private TextField<String> emailChp;
|
147 |
private TextField<String> emailChp;
|
- |
|
148 |
private TextField<String> urlChp;
|
- |
|
149 |
private ListStore<Valeur> magazinPays;
|
Line 147... |
Line 150... |
147 |
private TextField<String> urlChp;
|
150 |
private ComboBox<Valeur> comboPays;
|
148 |
|
151 |
|
149 |
public FormStructureVue() {
|
152 |
public FormStructureVue() {
|
150 |
//+-----------------------------------------------------------------------------------------------------------+
|
153 |
//+-----------------------------------------------------------------------------------------------------------+
|
Line 214... |
Line 217... |
214 |
|
217 |
|
215 |
private void soumettreFormulaire() {
|
218 |
private void soumettreFormulaire() {
|
216 |
GWT.log("Soumission du formulaire", null);
|
219 |
GWT.log("Soumission du formulaire", null);
|
217 |
Structure structure = collecterDonnees();
|
220 |
Structure structure = collecterDonnees();
|
218 |
if (mode == "AJOUT") {
|
221 |
if (mode == "AJOUT") {
|
- |
|
222 |
//mediateur.ajouterStructure(this, structure);
|
219 |
mediateur.ajouterStructure(this, structure);
|
223 |
GWT.log(structure.toString(), null);
|
220 |
} else if (mode == "MODIF") {
|
224 |
} else if (mode == "MODIF") {
|
221 |
mediateur.modifierStructure(this, structure);
|
225 |
mediateur.modifierStructure(this, structure);
|
222 |
}
|
226 |
}
|
Line 223... |
Line 227... |
223 |
}
|
227 |
}
|
224 |
|
228 |
|
225 |
private Structure collecterDonnees() {
|
229 |
private Structure collecterDonnees() {
|
- |
|
230 |
Structure structure = new Structure();
|
- |
|
231 |
structure.setNom(nomStructureChp.getValue());
|
- |
|
232 |
// Récupération de l'acronyme (= identifiant alternatif)
|
- |
|
233 |
structure.setIdAlternatif(null);
|
- |
|
234 |
if (comboAcronyme.getValue() != null) {
|
- |
|
235 |
String typeAcronyme = comboAcronyme.getValue().getAbr();
|
- |
|
236 |
GWT.log("Acronyme : "+typeAcronyme, null);
|
- |
|
237 |
if (typeAcronyme == "IH") {
|
- |
|
238 |
structure.setIdAlternatif(typeAcronyme+"##"+ihChp.getValue());
|
- |
|
239 |
} else if (typeAcronyme == "MNHN") {
|
- |
|
240 |
structure.setIdAlternatif(typeAcronyme+"##"+mnhnChp.getValue());
|
- |
|
241 |
}
|
- |
|
242 |
}
|
- |
|
243 |
// Récupération statut de la structure
|
- |
|
244 |
structure.setTypePublic(null);
|
- |
|
245 |
structure.setTypePrive(null);
|
- |
|
246 |
if (comboTypeStructure.getValue() != null) {
|
- |
|
247 |
String typeStructure = comboTypeStructure.getValue().getAbr();
|
- |
|
248 |
GWT.log("Statut : "+typeStructure, null);
|
- |
|
249 |
if (typeStructure == "stpu") {
|
- |
|
250 |
structure.setTypePublic(comboLstpu.getValue().getId());
|
- |
|
251 |
} else if (typeStructure == "stpr") {
|
- |
|
252 |
structure.setTypePrive(comboLstpr.getValue().getId());
|
226 |
Structure structure = new Structure();
|
253 |
}
|
227 |
structure.setNom(nomStructureChp.getValue());
|
254 |
}
|
228 |
structure.setDateFondation(dateFondationChp.getValue());
|
255 |
structure.setDateFondation(dateFondationChp.getValue());
|
229 |
|
256 |
|
230 |
structure.setAdresse(adrChp.getValue());
|
257 |
structure.setAdresse(adrChp.getValue());
|
231 |
structure.setCodePostal(cpChp.getValue());
|
258 |
structure.setCodePostal(cpChp.getValue());
|
232 |
structure.setVille(villeChp.getValue());
|
259 |
structure.setVille(villeChp.getValue());
|
- |
|
260 |
structure.setRegion(regionChp.getValue());
|
- |
|
261 |
structure.setPays(null);
|
- |
|
262 |
if (comboPays.getValue() != null) {
|
Line 233... |
Line 263... |
233 |
structure.setRegion(regionChp.getValue());
|
263 |
structure.setPays(comboPays.getValue().getAbreviation());
|
234 |
structure.setPays(paysChp.getValue());
|
264 |
}
|
235 |
|
265 |
|
236 |
structure.setTelephone(telChp.getValue());
|
266 |
structure.setTelephone(telChp.getValue());
|
Line 252... |
Line 282... |
252 |
paysChp.setValue(str.getPays());
|
282 |
paysChp.setValue(str.getPays());
|
Line 253... |
Line 283... |
253 |
|
283 |
|
254 |
telChp.setValue(str.getTelephone());
|
284 |
telChp.setValue(str.getTelephone());
|
255 |
faxChp.setValue(str.getFax());
|
285 |
faxChp.setValue(str.getFax());
|
256 |
emailChp.setValue(str.getCourriel());
|
286 |
emailChp.setValue(str.getCourriel());
|
257 |
urlChp.setValue(str.getUrl());
|
287 |
urlChp.setValue(str.getUrl("WEB"));
|
Line 258... |
Line 288... |
258 |
}
|
288 |
}
|
259 |
|
289 |
|
260 |
private TabItem creerOngletValorisation() {
|
290 |
private TabItem creerOngletValorisation() {
|
Line 837... |
Line 867... |
837 |
fieldSetAdresse.setHeading("Adresse");
|
867 |
fieldSetAdresse.setHeading("Adresse");
|
838 |
fieldSetAdresse.setCollapsible(true);
|
868 |
fieldSetAdresse.setCollapsible(true);
|
Line 839... |
Line 869... |
839 |
|
869 |
|
Line 840... |
Line 870... |
840 |
fieldSetAdresse.setLayout(creerFormLayout(100, LabelAlign.LEFT, 4));
|
870 |
fieldSetAdresse.setLayout(creerFormLayout(100, LabelAlign.LEFT, 4));
|
841 |
|
871 |
|
842 |
adrChp = new TextField<String>();
|
872 |
adrChp = new TextArea();
|
843 |
adrChp.setTabIndex(108);
|
873 |
adrChp.setTabIndex(108);
|
Line 844... |
Line 874... |
844 |
adrChp.setFieldLabel("Adresse");
|
874 |
adrChp.setFieldLabel("Adresse");
|
Line 857... |
Line 887... |
857 |
regionChp = new TextField<String>();
|
887 |
regionChp = new TextField<String>();
|
858 |
regionChp.setTabIndex(111);
|
888 |
regionChp.setTabIndex(111);
|
859 |
regionChp.setFieldLabel("Région");
|
889 |
regionChp.setFieldLabel("Région");
|
860 |
gaucheFdAdresse.add(regionChp);
|
890 |
gaucheFdAdresse.add(regionChp);
|
Line 861... |
Line 891... |
861 |
|
891 |
|
862 |
paysChp = new TextField<String>();
|
892 |
//paysChp = new TextField<String>();
|
863 |
paysChp.setTabIndex(112);
|
893 |
//paysChp.setTabIndex(112);
|
- |
|
894 |
//paysChp.setFieldLabel("Pays");
|
- |
|
895 |
modele.obtenirListeValeurs(((Configuration) Registry.get(RegistreId.CONFIG)).getListeId("pays"));
|
- |
|
896 |
magazinPays = new ListStore<Valeur>();
|
- |
|
897 |
magazinPays.add(new ArrayList<Valeur>());
|
- |
|
898 |
comboPays = new ComboBox<Valeur>();
|
- |
|
899 |
comboPays.setTabIndex(112);
|
- |
|
900 |
comboPays.setFieldLabel("Pays");
|
- |
|
901 |
comboPays.setEditable(true);
|
- |
|
902 |
//comboLstpu.setFieldLabel("Statut des structures publiques");
|
- |
|
903 |
comboPays.setLabelSeparator("");
|
- |
|
904 |
comboPays.setDisplayField("nom");
|
- |
|
905 |
comboPays.setEditable(false);
|
- |
|
906 |
comboPays.setTriggerAction(TriggerAction.ALL);
|
864 |
paysChp.setFieldLabel("Pays");
|
907 |
comboPays.setStore(magazinPays);
|
Line 865... |
Line 908... |
865 |
droiteFdAdresse.add(paysChp);
|
908 |
droiteFdAdresse.add(comboPays);
|
866 |
|
909 |
|
867 |
principalFdAdresse.add(gaucheFdAdresse, new ColumnData(.5));
|
910 |
principalFdAdresse.add(gaucheFdAdresse, new ColumnData(.5));
|
868 |
principalFdAdresse.add(droiteFdAdresse, new ColumnData(.5));
|
911 |
principalFdAdresse.add(droiteFdAdresse, new ColumnData(.5));
|
Line 1142... |
Line 1185... |
1142 |
if (listeValeurs.getId().equals(config.getListeId("fonction"))) {
|
1185 |
if (listeValeurs.getId().equals(config.getListeId("fonction"))) {
|
1143 |
magazinLiFonction.removeAll();
|
1186 |
magazinLiFonction.removeAll();
|
1144 |
magazinLiFonction.add(liste);
|
1187 |
magazinLiFonction.add(liste);
|
1145 |
comboLiFonction.setStore(magazinLiFonction);
|
1188 |
comboLiFonction.setStore(magazinLiFonction);
|
1146 |
}
|
1189 |
}
|
- |
|
1190 |
if (listeValeurs.getId().equals(config.getListeId("pays"))) {
|
- |
|
1191 |
magazinPays.removeAll();
|
- |
|
1192 |
magazinPays.add(liste);
|
- |
|
1193 |
comboPays.setStore(magazinPays);
|
- |
|
1194 |
}
|
1147 |
if (listeValeurs.getId().equals(config.getListeId("localStockage"))) {
|
1195 |
if (listeValeurs.getId().equals(config.getListeId("localStockage"))) {
|
1148 |
creerChoixMultipleCac(localStockageTrukCp, localStockageTrukCacGrpChp, listeValeurs, true);
|
1196 |
creerChoixMultipleCac(localStockageTrukCp, localStockageTrukCacGrpChp, listeValeurs, true);
|
1149 |
}
|
1197 |
}
|
1150 |
if (listeValeurs.getId().equals(config.getListeId("meubleStockage"))) {
|
1198 |
if (listeValeurs.getId().equals(config.getListeId("meubleStockage"))) {
|
1151 |
creerChoixMultipleCac(meubleStockageTrukCp, meubleStockageTrukCacGrpChp, listeValeurs, true);
|
1199 |
creerChoixMultipleCac(meubleStockageTrukCp, meubleStockageTrukCacGrpChp, listeValeurs, true);
|