30,6 → 30,7 |
import org.tela_botanica.client.modeles.publication.Publication; |
import org.tela_botanica.client.modeles.publication.PublicationAPersonneListe; |
import org.tela_botanica.client.modeles.publication.PublicationListe; |
import org.tela_botanica.client.util.Debug; |
import org.tela_botanica.client.util.Pattern; |
import org.tela_botanica.client.util.UtilString; |
import org.tela_botanica.client.vues.Formulaire; |
54,7 → 55,7 |
import com.extjs.gxt.ui.client.widget.MessageBox; |
|
import com.extjs.gxt.ui.client.widget.ContentPanel; |
import com.extjs.gxt.ui.client.widget.Info; |
import org.tela_botanica.client.composants.InfoLogger; |
import com.extjs.gxt.ui.client.widget.TabItem; |
import com.extjs.gxt.ui.client.widget.TabPanel; |
import com.extjs.gxt.ui.client.widget.Text; |
183,6 → 184,7 |
tiInfosNat = creerOnglet(i18nC.personneInfoNat(), "tiInfosNat"); |
formulaireOnglets.add(tiInfosNat); |
|
//Tab 4 : Publications |
tiPubli = new PersonneFormPublication(this); |
formulaireOnglets.add(tiPubli); |
|
671,7 → 673,7 |
ajouterPubli.addSelectionListener(new SelectionListener<ButtonEvent>() { |
@Override |
public void componentSelected(ButtonEvent ce) { |
Window.alert("ajout publi"); |
Debug.log("|> PersonneForm.creerComposantsPubli() : A MODIFIER ! ajout publi"); |
/*StructureAPersonne membreDuPersonnel = new StructureAPersonne("", StructureAPersonne.ROLE_EQUIPE, StructureAPersonne.ETAT_AJOUTE); |
ajouterMembreAGrillePersonnel(membreDuPersonnel);*/ |
} |
749,6 → 751,9 |
} |
|
public void rafraichirPublicationsExistante(String nomPubli) { |
|
Debug.log("|> PersonneForm.rafraichirPublicationsExistante()"); |
|
nomPubli +="%"; |
mediateur.selectionnerPublicationParNomComplet(this, null, nomPubli); |
} |
778,13 → 783,25 |
// RAFRAICHISSEMENT DU PANNEAU |
|
public void rafraichir(Object nouvellesDonnees) { |
|
Debug.log("|> PersonneForm.rafraichir(Object nouvellesDonnees) BEGIN"); |
|
if (nouvellesDonnees instanceof PublicationAPersonneListe) { |
|
Debug.log("|--> PersonneForm.rafraichir(Object nouvellesDonnees) : nouvellesDonnees instanceof PublicationAPersonneListe"); |
|
Information info = new Information(); |
info.setType("publication_liees"); |
info.setDonnee(0, (PublicationAPersonneListe) nouvellesDonnees); |
|
Debug.log("|--> tiPubli.rafraichir(info)"); |
tiPubli.rafraichir(info); |
|
} else if (nouvellesDonnees instanceof ValeurListe) { |
|
Debug.log("|--> PersonneForm.rafraichir(Object nouvellesDonnees) : nouvellesDonnees instanceof ValeurListe"); |
|
|
ValeurListe listeValeurs = (ValeurListe) nouvellesDonnees; |
|
// Créer une liste de valeurs |
793,7 → 810,11 |
liste.add(listeValeurs.get(it.next())); |
} |
if (listeValeurs.getId().equals(config.getListeId("relationPersonnePublication"))) { |
|
Debug.log("|--> tiPubli.rafraichir(nouvellesDonnees)"); |
tiPubli.rafraichir(nouvellesDonnees); |
|
|
} else if (listeValeurs.getId().equals(config.getListeId("prefixe"))) { |
remplirCombobox("cbPrefixe", liste, "hmIdentite"); |
} else if (listeValeurs.getId().equals(config.getListeId("suffixes"))) { |
829,6 → 850,10 |
|
} |
} else if (nouvellesDonnees instanceof ProjetListe) { |
|
|
Debug.log("|--> PersonneForm.rafraichir(Object nouvellesDonnees) : nouvellesDonnees instanceof ProjetListe"); |
|
ProjetListe projets = (ProjetListe) nouvellesDonnees; |
List<Projet> liste = projets.toList(); |
|
838,29 → 863,40 |
storeProjets.add(liste); |
cbProjets.setStore(storeProjets); |
} else if (nouvellesDonnees instanceof PublicationListe) { |
|
Debug.log("|> PersonneForm.rafraichir"); |
Debug.log("|--> nouvellesDonnees instanceof PublicationListe"); |
|
|
PublicationListe publicationListe = (PublicationListe) nouvellesDonnees; |
|
Debug.log("|--> nouvellesDonnees ="+publicationListe.toString()); |
|
List<Publication> liste = publicationListe.toList(); |
|
storePubli.removeAll(); |
storePubli.add(liste); |
cbPubli.setStore(storePubli); |
|
} else if (nouvellesDonnees instanceof Information) { |
|
Debug.log("|--> PersonneForm.rafraichir(Object nouvellesDonnees) : nouvellesDonnees instanceof Information"); |
|
Information info = (Information) nouvellesDonnees; |
if (info.getType().equals("ajout_personne")) { |
if (info.getDonnee(0) != null) { |
personneSelectionnee.setId(info.getDonnee(0).toString()); |
GWT.log("Ajout de la personne " + personneSelectionnee.getId(), null); |
Info.display("Enregistrement", "La personne a été ajoutée (id: " + personneSelectionnee.getId() + ")"); |
InfoLogger.display("Enregistrement", "La personne a été ajoutée (id: " + personneSelectionnee.getId() + ")"); |
repandreRafraichissement(); |
if (clicBoutonvalidation) { |
mediateur.clicMenu(menuIdCourant); |
} |
} else { |
Info.display("Enregistrement", info.getMessages().toString()); |
InfoLogger.display("Enregistrement", info.getMessages().toString()); |
} |
} else if (info.getType().equals("modification_personne")) { |
Info.display("Enregistrement", "Les modifications apportées à la personne " + personneSelectionnee.getId() + " ont été correctement enregistrées."); |
InfoLogger.display("Enregistrement", "Les modifications apportées à la personne " + personneSelectionnee.getId() + " ont été correctement enregistrées."); |
repandreRafraichissement(); |
if (clicBoutonvalidation) { |
mediateur.clicMenu(menuIdCourant); |
883,11 → 919,14 |
|
nouvellesDonnees = null; |
} else { |
Info.display("messages", info.getMessages().toString()); |
InfoLogger.display("messages", info.getMessages().toString()); |
} |
} |
|
if (nouvellesDonnees == null) { |
|
Debug.log("|--> PersonneForm.rafraichir(Object nouvellesDonnees) : nouvellesDonnees == null"); |
|
ComboBox<Valeur> cb= hmIdentite.getComboBoxValeur("cbPrefixe"); |
|
//Met à jour le nom Complet du formulaire |
939,9 → 978,14 |
if (this.mode.equals(MODE_AJOUTER)) { |
gererEtatActivationBouton(); |
} |
|
Debug.log("|> PersonneForm.rafraichir(Object nouvellesDonnees) END"); |
} |
|
private void repandreRafraichissement() { |
|
Debug.log("|> PersonneForm.repandreRafraichissement()"); |
|
if (vueExterneARafraichirApresValidation != null) { |
String type = "personne_modifiee"; |
if (mode.equals(Formulaire.MODE_AJOUTER)) { |
967,6 → 1011,10 |
} |
|
private void mettreAJourPersonne(Personne personne) { |
|
Debug.log("|> BEGIN PersonneForm.mettreAJourPersonne()"); |
|
|
//Mise à jour de la personne |
//Personne personne = (Personne) nouvellesDonnees; |
ComboBox cbProjets = hmIdentite.getComboBox("cbProjets"); |
1087,8 → 1135,12 |
hmInfosNat.getChampMultiValeursMultiTypes("recolte").peupler(tr); |
|
//Onglet publi |
|
Debug.log("|--> appel à tiPubli.mettreAJourPersonne()"); |
tiPubli.mettreAJourPersonne(); |
gererEtatActivationBouton(); |
|
Debug.log("|> BEGIN PersonneForm.mettreAJourPersonne()"); |
} |
|
public void remplirCombobox(String idComboBox, List liste, String hashMapId) { |
1125,6 → 1177,9 |
} |
|
public void binderPersonne(Personne personne) { |
|
Debug.log("|> BEGIN PersonneForm.binderPersonne()"); |
|
binding = new FormBinding(getFormulaire()); |
|
personneSelectionnee = personne; |
1135,6 → 1190,9 |
|
binding.bind(personneSelectionnee); |
layout(); |
|
Debug.log("|> END PersonneForm.binderPersonne()"); |
|
} |
|
private String obtenirValeurCombo(String strComboName) { |