19,6 → 19,7 |
|
import com.google.gwt.core.client.GWT; |
import com.google.gwt.core.client.JavaScriptObject; |
import com.google.gwt.user.client.History; |
import com.google.gwt.user.client.Window; |
import com.gwtext.client.core.EventObject; |
import com.gwtext.client.core.Ext; |
139,6 → 140,8 |
|
private Panel conteneurFormulaire = null ; |
|
private boolean importerObservations = false ; |
|
/** |
* constructeur privé (on accède a la classe par la méthode getInstance |
*/ |
258,9 → 261,45 |
thisMediateur = new ObservationMediateur(carnetEnLigneMediateur) ; |
} |
|
|
return thisMediateur ; |
} |
|
|
public void connecterUtilisateur() { |
|
if(importerObservations) { |
|
observationModele.importerObservations(); |
} |
|
if(panneauPrincipalObservation == null || !panneauPrincipalObservation.isCreated()) |
{ |
panneauPrincipalObservation.addListener(new ContainerListenerAdapter() |
{ |
public void onRender(Component c) |
{ |
panneauPrincipalObservation.purgeListeners() ; |
obtenirNombreObservation(); |
initialiserArbres(); |
analyserHistorique(); |
} |
|
}) ; |
} |
else |
{ |
obtenirNombreObservation(); |
initialiserArbres(); |
analyserHistorique(); |
} |
} |
|
private void initialiserArbres() { |
getPanneauFiltres().getArbreDateObservationFiltreVue().initialiser(); |
getPanneauFiltres().getArbreEntiteGeographiqueObservationFiltreVue().initialiser(); |
|
|
} |
|
|
|
404,10 → 443,6 |
|
|
// U du CRUD |
|
|
|
|
public void modifierObservation(Observation obs) { |
|
|
540,7 → 575,7 |
*/ |
public String getIdentifiant() { |
|
return carnetEnLigneMediateur.getUtilisateur().getIdentifiant(); |
return carnetEnLigneMediateur.getUtilisateur().getIdentite(); |
|
} |
|
602,7 → 637,6 |
public void obtenirDatesObservation() { |
|
observationModele.obtenirDatesObservation(filtres.getArbreDateObservationFiltreVue()) ; |
|
} |
|
|
614,14 → 648,27 |
|
public void deconnecterUtilisateur() { |
|
listeObservation.raz() ; |
formulaireSaisieObservationVue.raz() ; |
filtres.getArbreDateObservationFiltreVue().raz() ; |
filtres.getArbreEntiteGeographiqueObservationFiltreVue().raz() ; |
informationRepartitionVue.raz() ; |
imageGeneriqueVue.raz() ; |
mvz.raz() ; |
|
if(panneauPrincipalObservation == null || panneauPrincipalObservation.isCreated() || !panneauPrincipalObservation.isVisible()) |
{ |
panneauPrincipalObservation.addListener(new ContainerListenerAdapter() |
{ |
public void onShow(Component component) |
{ |
deconnecterUtilisateur(); |
panneauPrincipalObservation.purgeListeners(); |
} |
}); |
} |
else |
{ |
listeObservation.raz() ; |
formulaireSaisieObservationVue.raz() ; |
filtres.getArbreDateObservationFiltreVue().raz() ; |
filtres.getArbreEntiteGeographiqueObservationFiltreVue().raz() ; |
informationRepartitionVue.raz() ; |
imageGeneriqueVue.raz() ; |
mvz.raz() ; |
} |
} |
|
|
660,28 → 707,46 |
|
public void transmettreObservations() { |
|
if(listeObservation.getIdSelectionnees().length > 0) { |
if(Window.confirm("Êtes vous sur de vouloir transmettre les observations sélectionnées ?")) { |
String[] numObs = listeObservation.getIdSelectionnees(); |
String numObsApl = "" ; |
for(int i = 0 ; i < numObs.length ; i++) { |
numObsApl += numObs[i] ; |
if(i != numObs.length - 1) { |
numObsApl +="," ; |
if(carnetEnLigneMediateur.getUtilisateur().isIdentifie()) { |
if(listeObservation.getIdSelectionnees().length > 0) { |
if(Window.confirm("Êtes vous sur de vouloir transmettre les observations sélectionnées ?")) { |
String[] numObs = listeObservation.getIdSelectionnees(); |
String numObsApl = "" ; |
for(int i = 0 ; i < numObs.length ; i++) { |
numObsApl += numObs[i] ; |
if(i != numObs.length - 1) { |
numObsApl +="," ; |
} |
} |
|
observationModele.transmettreListeObservation(listeObservation,numObsApl) ; |
} |
|
observationModele.transmettreListeObservation(listeObservation,numObsApl) ; |
} |
else |
{ |
Window.alert("Aucune observation sélectionnée"); |
} |
} |
else |
{ |
Window.alert("Aucune observation sélectionnée"); |
if(Window.confirm("La transmission des observations nécessite d'être identifié, voulez-vous vous identifier ? (toutes vos observations saisies seront conservées)")) { |
importerObservations = true ; |
carnetEnLigneMediateur.afficherDialogueConnexion(); |
} |
} |
|
} |
|
public void analyserHistorique() { |
|
if (History.getToken().length()>0) { |
|
final String anum=History.getToken(); |
observationModele.analyserHistorique(formulaireSaisieObservationVue,anum); |
} |
} |
|
|
/*public void ajouterMotCleRecherche(String motCle) { |
|
filtres.getMotsClesObsVue().rafraichir(motCle, false); |