| Line 9... |
Line 9... |
| 9 |
import java.util.List;
|
9 |
import java.util.List;
|
| Line 10... |
Line 10... |
| 10 |
|
10 |
|
| 11 |
import org.tela_botanica.client.ComposantClass;
|
11 |
import org.tela_botanica.client.ComposantClass;
|
| 12 |
import org.tela_botanica.client.Mediateur;
|
12 |
import org.tela_botanica.client.Mediateur;
|
| - |
|
13 |
import org.tela_botanica.client.RegistreId;
|
| 13 |
import org.tela_botanica.client.RegistreId;
|
14 |
import org.tela_botanica.client.composants.ChampComboBoxRechercheTempsReelPaginable;
|
| 14 |
import org.tela_botanica.client.composants.ChampMultiValeurs;
|
15 |
import org.tela_botanica.client.composants.ChampMultiValeurs;
|
| 15 |
import org.tela_botanica.client.composants.ChampMultiValeursImage;
|
16 |
import org.tela_botanica.client.composants.ChampMultiValeursImage;
|
| - |
|
17 |
import org.tela_botanica.client.composants.ChampMultiValeursMultiTypes;
|
| - |
|
18 |
import org.tela_botanica.client.composants.ChampMultiValeursMultiTypesPaginable;
|
| 16 |
import org.tela_botanica.client.composants.ChampMultiValeursMultiTypes;
|
19 |
import org.tela_botanica.client.composants.ChampMultiValeursPaginable;
|
| 17 |
import org.tela_botanica.client.composants.HashMapComposants;
|
20 |
import org.tela_botanica.client.composants.HashMapComposants;
|
| 18 |
import org.tela_botanica.client.configuration.Configuration;
|
21 |
import org.tela_botanica.client.configuration.Configuration;
|
| 19 |
import org.tela_botanica.client.images.Images;
|
22 |
import org.tela_botanica.client.images.Images;
|
| Line 32... |
Line 35... |
| 32 |
import org.tela_botanica.client.modeles.publication.PublicationListe;
|
35 |
import org.tela_botanica.client.modeles.publication.PublicationListe;
|
| 33 |
import org.tela_botanica.client.util.Pattern;
|
36 |
import org.tela_botanica.client.util.Pattern;
|
| 34 |
import org.tela_botanica.client.util.UtilString;
|
37 |
import org.tela_botanica.client.util.UtilString;
|
| 35 |
import org.tela_botanica.client.vues.Formulaire;
|
38 |
import org.tela_botanica.client.vues.Formulaire;
|
| Line -... |
Line 39... |
| - |
|
39 |
|
| - |
|
40 |
import com.extjs.gxt.ui.client.data.ModelData;
|
| - |
|
41 |
import com.extjs.gxt.ui.client.data.ModelType;
|
| 36 |
|
42 |
import com.extjs.gxt.ui.client.data.PagingLoadResult;
|
| 37 |
import com.extjs.gxt.ui.client.event.Events;
|
43 |
import com.extjs.gxt.ui.client.event.Events;
|
| 38 |
import com.extjs.gxt.ui.client.Registry;
|
44 |
import com.extjs.gxt.ui.client.Registry;
|
| - |
|
45 |
import com.extjs.gxt.ui.client.Style.Scroll;
|
| 39 |
import com.extjs.gxt.ui.client.Style.Scroll;
|
46 |
import com.extjs.gxt.ui.client.Style.SortDir;
|
| Line 40... |
Line 47... |
| 40 |
import com.extjs.gxt.ui.client.Style.VerticalAlignment;
|
47 |
import com.extjs.gxt.ui.client.Style.VerticalAlignment;
|
| 41 |
|
48 |
|
| Line 53... |
Line 60... |
| 53 |
import com.extjs.gxt.ui.client.widget.LayoutContainer;
|
60 |
import com.extjs.gxt.ui.client.widget.LayoutContainer;
|
| 54 |
import com.extjs.gxt.ui.client.widget.MessageBox;
|
61 |
import com.extjs.gxt.ui.client.widget.MessageBox;
|
| Line 55... |
Line 62... |
| 55 |
|
62 |
|
| 56 |
import com.extjs.gxt.ui.client.widget.ContentPanel;
|
63 |
import com.extjs.gxt.ui.client.widget.ContentPanel;
|
| - |
|
64 |
import org.tela_botanica.client.composants.InfoLogger;
|
| - |
|
65 |
import org.tela_botanica.client.composants.pagination.Proxy;
|
| - |
|
66 |
import org.tela_botanica.client.composants.pagination.ProxyValeur;
|
| - |
|
67 |
import org.tela_botanica.client.composants.pagination.TransformateurJSONaModelData;
|
| 57 |
import org.tela_botanica.client.composants.InfoLogger;
|
68 |
|
| 58 |
import com.extjs.gxt.ui.client.widget.TabItem;
|
69 |
import com.extjs.gxt.ui.client.widget.TabItem;
|
| 59 |
import com.extjs.gxt.ui.client.widget.TabPanel;
|
70 |
import com.extjs.gxt.ui.client.widget.TabPanel;
|
| Line 60... |
Line 71... |
| 60 |
import com.extjs.gxt.ui.client.widget.Text;
|
71 |
import com.extjs.gxt.ui.client.widget.Text;
|
| Line 81... |
Line 92... |
| 81 |
import com.extjs.gxt.ui.client.widget.layout.TableLayout;
|
92 |
import com.extjs.gxt.ui.client.widget.layout.TableLayout;
|
| 82 |
import com.extjs.gxt.ui.client.widget.toolbar.SeparatorToolItem;
|
93 |
import com.extjs.gxt.ui.client.widget.toolbar.SeparatorToolItem;
|
| 83 |
import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
|
94 |
import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
|
| 84 |
import com.google.gwt.core.client.GWT;
|
95 |
import com.google.gwt.core.client.GWT;
|
| 85 |
import com.google.gwt.i18n.client.DateTimeFormat;
|
96 |
import com.google.gwt.i18n.client.DateTimeFormat;
|
| - |
|
97 |
import com.google.gwt.json.client.JSONObject;
|
| 86 |
import com.google.gwt.user.client.Window;
|
98 |
import com.google.gwt.user.client.Window;
|
| 87 |
import com.google.gwt.user.client.ui.Widget;
|
99 |
import com.google.gwt.user.client.ui.Widget;
|
| Line 88... |
Line 100... |
| 88 |
|
100 |
|
| Line 629... |
Line 641... |
| 629 |
FormLayout fl = new FormLayout();
|
641 |
FormLayout fl = new FormLayout();
|
| 630 |
fl.setLabelAlign(LabelAlign.TOP);
|
642 |
fl.setLabelAlign(LabelAlign.TOP);
|
| 631 |
FieldSet fsInfosNat = new FieldSet();
|
643 |
FieldSet fsInfosNat = new FieldSet();
|
| 632 |
fsInfosNat.setLayout(fl);
|
644 |
fsInfosNat.setLayout(fl);
|
| 633 |
fsInfosNat.setTitle("Informations Naturaliste");
|
645 |
fsInfosNat.setTitle("Informations Naturaliste");
|
| 634 |
|
646 |
|
| 635 |
TextArea taBiographie = new TextArea();
|
647 |
TextArea taBiographie = new TextArea();
|
| 636 |
taBiographie.setFieldLabel("Vie et renommée de l'auteur");
|
648 |
taBiographie.setFieldLabel("Vie et renommée de l'auteur");
|
| 637 |
taBiographie.setWidth("400");
|
649 |
taBiographie.setWidth("400");
|
| 638 |
taBiographie.setName("biographie");
|
650 |
taBiographie.setName("biographie");
|
| 639 |
fsInfosNat.add(taBiographie, new FormData(800, 200));
|
651 |
fsInfosNat.add(taBiographie, new FormData(800, 200));
|
| 640 |
|
652 |
|
| 641 |
ChampMultiValeurs specialite = new ChampMultiValeurs(i18nC.personneSpecialite());
|
653 |
ChampMultiValeurs specialite = new ChampMultiValeurs(i18nC.personneSpecialite());
|
| 642 |
fsInfosNat.add(specialite);
|
654 |
fsInfosNat.add(specialite);
|
| 643 |
hmInfosNat.put("specialite", specialite);
|
655 |
hmInfosNat.put("specialite", specialite);
|
| - |
|
656 |
|
| - |
|
657 |
ModelType typeTypes = new ModelType();
|
| - |
|
658 |
typeTypes.setRoot("valeurs");
|
| - |
|
659 |
typeTypes.setTotalName("nbElements");
|
| - |
|
660 |
typeTypes.addField("cmlv_nom");
|
| - |
|
661 |
typeTypes.addField("cmlv_id_valeur");
|
| - |
|
662 |
typeTypes.addField("cmlv_abreviation");
|
| - |
|
663 |
typeTypes.addField("cmlv_description");
|
| - |
|
664 |
|
| - |
|
665 |
String displayNameTypes = "cmlv_nom";
|
| - |
|
666 |
String nomListeTypes = "pays";
|
| - |
|
667 |
ProxyValeur<ModelData> proxyTypes = new ProxyValeur<ModelData>(nomListeTypes);
|
| - |
|
668 |
|
| - |
|
669 |
ChampMultiValeursMultiTypesPaginable recolte = new ChampMultiValeursMultiTypesPaginable(i18nC.personneRecolte(), 450, false, null, null, null, typeTypes, proxyTypes, displayNameTypes);
|
| Line 644... |
Line -... |
| 644 |
|
- |
|
| 645 |
ChampMultiValeursMultiTypes recolte = new ChampMultiValeursMultiTypes(i18nC.personneRecolte(), 200, 200);
|
- |
|
| 646 |
|
- |
|
| 647 |
recolte.initialiserType("pays");
|
670 |
|
| 648 |
hmInfosNat.put("recolte", recolte);
|
671 |
hmInfosNat.put("recolte", recolte);
|
| 649 |
fsInfosNat.add(recolte);
|
672 |
fsInfosNat.add(recolte);
|
| 650 |
tiInfosNat.add(fsInfosNat);
|
673 |
tiInfosNat.add(fsInfosNat);
|
| Line 770... |
Line 793... |
| 770 |
}
|
793 |
}
|
| Line 771... |
Line 794... |
| 771 |
|
794 |
|
| Line 772... |
Line 795... |
| 772 |
// RAFRAICHISSEMENT DU PANNEAU
|
795 |
// RAFRAICHISSEMENT DU PANNEAU
|
| 773 |
|
796 |
|
| 774 |
public void rafraichir(Object nouvellesDonnees) {
|
797 |
public void rafraichir(Object nouvellesDonnees) {
|
| 775 |
|
- |
|
| 776 |
if (nouvellesDonnees instanceof PublicationAPersonneListe) {
|
798 |
|
| 777 |
|
799 |
if (nouvellesDonnees instanceof PublicationAPersonneListe) {
|
| 778 |
Information info = new Information();
|
800 |
Information info = new Information();
|
| 779 |
info.setType("publication_liees");
|
801 |
info.setType("publication_liees");
|
| 780 |
info.setDonnee(0, (PublicationAPersonneListe) nouvellesDonnees);
|
- |
|
| 781 |
tiPubli.rafraichir(info);
|
- |
|
| Line -... |
Line 802... |
| - |
|
802 |
info.setDonnee(0, (PublicationAPersonneListe) nouvellesDonnees);
|
| 782 |
|
803 |
tiPubli.rafraichir(info);
|
| 783 |
} else if (nouvellesDonnees instanceof ValeurListe) {
|
- |
|
| 784 |
|
804 |
|
| 785 |
ValeurListe listeValeurs = (ValeurListe) nouvellesDonnees;
|
805 |
} else if (nouvellesDonnees instanceof ValeurListe) {
|
| 786 |
|
806 |
ValeurListe listeValeurs = (ValeurListe) nouvellesDonnees;
|
| 787 |
// Créer une liste de valeurs
|
807 |
// Créer une liste de valeurs
|
| 788 |
List<Valeur> liste = new ArrayList<Valeur>();
|
808 |
List<Valeur> liste = new ArrayList<Valeur>();
|
| Line 818... |
Line 838... |
| 818 |
ComboBox<Valeur> cbTelephone = hmIdentite.getComboBoxValeur("cbTelephone");
|
838 |
ComboBox<Valeur> cbTelephone = hmIdentite.getComboBoxValeur("cbTelephone");
|
| 819 |
cbTelephone.setValue(liste.get(1));
|
839 |
cbTelephone.setValue(liste.get(1));
|
| 820 |
} else if (listeValeurs.getId().equals(config.getListeId("pays"))) {
|
840 |
} else if (listeValeurs.getId().equals(config.getListeId("pays"))) {
|
| 821 |
remplirCombobox("cbPays", liste, "hmAdresse");
|
841 |
remplirCombobox("cbPays", liste, "hmAdresse");
|
| 822 |
} else if (listeValeurs.getId().equals(config.getListeId("region"))) {
|
842 |
} else if (listeValeurs.getId().equals(config.getListeId("region"))) {
|
| 823 |
remplirCombobox("cbRegion", liste, "hmAdresse");
|
843 |
remplirCombobox("cbRegion", liste, "hmAdresse");
|
| 824 |
mettreAJourRegion();
|
844 |
mettreAJourRegion();
|
| 825 |
hmAdresse.getComboBox("cbRegion").setVisible(true);
|
845 |
hmAdresse.getComboBox("cbRegion").setVisible(true);
|
| Line 826... |
Line 846... |
| 826 |
|
846 |
|
| 827 |
}
|
847 |
}
|
| Line 959... |
Line 979... |
| 959 |
}
|
979 |
}
|
| 960 |
}
|
980 |
}
|
| 961 |
}
|
981 |
}
|
| Line 962... |
Line 982... |
| 962 |
|
982 |
|
| 963 |
private void mettreAJourPersonne(Personne personne) {
|
983 |
private void mettreAJourPersonne(Personne personne) {
|
| 964 |
|
984 |
|
| 965 |
//Mise à jour de la personne
|
985 |
//Mise à jour de la personne
|
| 966 |
//Personne personne = (Personne) nouvellesDonnees;
|
986 |
//Personne personne = (Personne) nouvellesDonnees;
|
| 967 |
ComboBox cbProjets = hmIdentite.getComboBox("cbProjets");
|
987 |
ComboBox cbProjets = hmIdentite.getComboBox("cbProjets");
|
| Line 1043... |
Line 1063... |
| 1043 |
hmAdresse.getTextField("tfBoitePostale").setValue((String) personne.get("bp"));
|
1063 |
hmAdresse.getTextField("tfBoitePostale").setValue((String) personne.get("bp"));
|
| Line 1044... |
Line 1064... |
| 1044 |
|
1064 |
|
| 1045 |
//Pays
|
1065 |
//Pays
|
| 1046 |
String strPays = personne.get("ce_truk_pays");
|
1066 |
String strPays = personne.get("ce_truk_pays");
|
| - |
|
1067 |
ComboBox<Valeur> cbPays = hmAdresse.getComboBoxValeur("cbPays");
|
| - |
|
1068 |
cbPays.getStore().sort("nom", SortDir.ASC);
|
| 1047 |
ComboBox<Valeur> cbPays = hmAdresse.getComboBoxValeur("cbPays");
|
1069 |
|
| 1048 |
if (cbPays.getStore().findModel("id_valeur", strPays) != null) {
|
1070 |
if (cbPays.getStore().findModel("id_valeur", strPays) != null) {
|
| 1049 |
cbPays.setValue(cbPays.getStore().findModel("id_valeur", strPays));
|
1071 |
cbPays.setValue(cbPays.getStore().findModel("id_valeur", strPays));
|
| 1050 |
cbPays.fireEvent(Events.OnChange);
|
1072 |
cbPays.fireEvent(Events.OnChange);
|
| 1051 |
} else {
|
1073 |
} else {
|
| Line 1075... |
Line 1097... |
| 1075 |
/*--------------------------------------------------------
|
1097 |
/*--------------------------------------------------------
|
| 1076 |
* Infos naturalistes
|
1098 |
* Infos naturalistes
|
| 1077 |
* -----------------------------------------------------*/
|
1099 |
* -----------------------------------------------------*/
|
| Line 1078... |
Line 1100... |
| 1078 |
|
1100 |
|
| 1079 |
hmInfosNat.getChampMultiValeurs("specialite").peupler(personne.getString("ce_truk_specialite"));
|
1101 |
hmInfosNat.getChampMultiValeurs("specialite").peupler(personne.getString("ce_truk_specialite"));
|
| 1080 |
String tr = personne.getString("truk_recolte");
|
1102 |
String tr = personne.getString("truk_recolte");
|
| Line 1081... |
Line 1103... |
| 1081 |
hmInfosNat.getChampMultiValeursMultiTypes("recolte").peupler(tr);
|
1103 |
hmInfosNat.getChampMultiValeursMultiTypesPaginable("recolte").peupler(tr);
|
| 1082 |
|
1104 |
|
| 1083 |
//Onglet publi
|
1105 |
//Onglet publi
|
| 1084 |
tiPubli.mettreAJourPersonne();
|
1106 |
tiPubli.mettreAJourPersonne();
|
| Line 1115... |
Line 1137... |
| 1115 |
public void reinitialiserFormulaire() {
|
1137 |
public void reinitialiserFormulaire() {
|
| 1116 |
mediateur.afficherPopinChargement();
|
1138 |
mediateur.afficherPopinChargement();
|
| 1117 |
mettreAJourPersonne(personneSauvegarde);
|
1139 |
mettreAJourPersonne(personneSauvegarde);
|
| 1118 |
mediateur.masquerPopinChargement();
|
1140 |
mediateur.masquerPopinChargement();
|
| 1119 |
}
|
1141 |
}
|
| 1120 |
|
1142 |
|
| 1121 |
public void binderPersonne(Personne personne) {
|
1143 |
public void binderPersonne(Personne personne) {
|
| 1122 |
binding = new FormBinding(getFormulaire());
|
1144 |
binding = new FormBinding(getFormulaire());
|
| Line 1123... |
Line 1145... |
| 1123 |
|
1145 |
|
| Line 1128... |
Line 1150... |
| 1128 |
binding.removeFieldBinding(f);
|
1150 |
binding.removeFieldBinding(f);
|
| Line 1129... |
Line 1151... |
| 1129 |
|
1151 |
|
| 1130 |
binding.bind(personneSelectionnee);
|
1152 |
binding.bind(personneSelectionnee);
|
| 1131 |
layout();
|
1153 |
layout();
|
| 1132 |
}
|
1154 |
}
|
| 1133 |
|
1155 |
|
| 1134 |
private String obtenirValeurCombo(String strComboName) {
|
1156 |
private String obtenirValeurCombo(String strComboName) {
|
| 1135 |
String strValeur = "";
|
1157 |
String strValeur = "";
|
| Line 1136... |
Line 1158... |
| 1136 |
Valeur valeur;
|
1158 |
Valeur valeur;
|
| Line 1262... |
Line 1284... |
| 1262 |
|
1284 |
|
| 1263 |
} else {
|
1285 |
} else {
|
| 1264 |
personneSelectionnee.setNonDecedee();
|
1286 |
personneSelectionnee.setNonDecedee();
|
| Line 1265... |
Line 1287... |
| 1265 |
}
|
1287 |
}
|
| 1266 |
|
1288 |
|
| Line 1267... |
Line 1289... |
| 1267 |
strValeur = obtenirValeurCombo("cbPays");
|
1289 |
strValeur = obtenirValeurCombo("cbPays");
|
| 1268 |
personneSelectionnee.set("ce_truk_pays", strValeur);
|
1290 |
personneSelectionnee.set("ce_truk_pays", strValeur);
|
| - |
|
1291 |
|
| 1269 |
|
1292 |
strValeur = obtenirValeurCombo("cbRegion");
|
| 1270 |
strValeur = obtenirValeurCombo("cbRegion");
|
1293 |
ComboBox<Valeur> cbRegions = hmAdresse.getComboBoxValeur("cbRegion");
|
| 1271 |
ComboBox<Valeur> cbRegions = hmAdresse.getComboBoxValeur("cbRegion");
|
1294 |
|
| 1272 |
if (cbRegions.getStore().findModel("id", strValeur) == null) {
|
1295 |
if (cbRegions.getStore().findModel("id_valeur", strValeur) == null) {
|
| Line 1273... |
Line 1296... |
| 1273 |
strValeur = "AUTRE##" + strValeur;
|
1296 |
strValeur = "AUTRE##" + strValeur;
|
| Line 1280... |
Line 1303... |
| 1280 |
personneSelectionnee.set("truk_logo", logoUrls);
|
1303 |
personneSelectionnee.set("truk_logo", logoUrls);
|
| Line 1281... |
Line 1304... |
| 1281 |
|
1304 |
|
| Line 1282... |
Line 1305... |
| 1282 |
personneSelectionnee.set("truk_url", hmIdentite.getChampMultiValeurs("sites").getValeurs());
|
1305 |
personneSelectionnee.set("truk_url", hmIdentite.getChampMultiValeurs("sites").getValeurs());
|
| 1283 |
|
1306 |
|
| 1284 |
//Infos Naturalistes
|
1307 |
//Infos Naturalistes
|
| Line 1285... |
Line 1308... |
| 1285 |
String recolte = ((ChampMultiValeursMultiTypes) hmInfosNat.get("recolte")).getValeurs();
|
1308 |
String recolte = ((ChampMultiValeursMultiTypesPaginable) hmInfosNat.get("recolte")).getValeurs();
|
| 1286 |
personneSelectionnee.set("truk_recolte", recolte);
|
1309 |
personneSelectionnee.set("truk_recolte", recolte);
|