Subversion Repositories eFlore/Applications.cel

Rev

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

Rev 136 Rev 140
Line 17... Line 17...
17
import org.tela_botanica.client.vues.NuageMotsClesVue;
17
import org.tela_botanica.client.vues.NuageMotsClesVue;
18
import org.tela_botanica.client.vues.PanneauFiltresObservationVues;
18
import org.tela_botanica.client.vues.PanneauFiltresObservationVues;
Line 19... Line 19...
19
 
19
 
20
import com.google.gwt.core.client.GWT;
20
import com.google.gwt.core.client.GWT;
-
 
21
import com.google.gwt.core.client.JavaScriptObject;
21
import com.google.gwt.core.client.JavaScriptObject;
22
import com.google.gwt.user.client.History;
22
import com.google.gwt.user.client.Window;
23
import com.google.gwt.user.client.Window;
23
import com.gwtext.client.core.EventObject;
24
import com.gwtext.client.core.EventObject;
24
import com.gwtext.client.core.Ext;
25
import com.gwtext.client.core.Ext;
25
import com.gwtext.client.core.ExtElement;
26
import com.gwtext.client.core.ExtElement;
Line 137... Line 138...
137
  	
138
  	
Line 138... Line 139...
138
  	private NuageMotsClesVue nuaMC = null;
139
  	private NuageMotsClesVue nuaMC = null;
Line -... Line 140...
-
 
140
  	
-
 
141
  	private Panel conteneurFormulaire = null ;
139
  	
142
  	
140
  	private Panel conteneurFormulaire = null ;
143
  	private boolean importerObservations = false ;
141
  	
144
  	
Line 256... Line 259...
256
			{
259
			{
257
				estInstancie = true ;
260
				estInstancie = true ;
258
				thisMediateur = new ObservationMediateur(carnetEnLigneMediateur) ;
261
				thisMediateur = new ObservationMediateur(carnetEnLigneMediateur) ;
259
			}
262
			}
Line 260... Line -...
260
			
-
 
261
	
263
			
262
			return thisMediateur ;	
264
			return thisMediateur ;	
-
 
265
	}
-
 
266
	
-
 
267
	
-
 
268
	public void connecterUtilisateur() {
-
 
269
		
-
 
270
		if(importerObservations) {
-
 
271
			
-
 
272
			observationModele.importerObservations();
-
 
273
		}
-
 
274
		
-
 
275
		if(panneauPrincipalObservation == null || !panneauPrincipalObservation.isCreated()) 
-
 
276
		{
-
 
277
			panneauPrincipalObservation.addListener(new ContainerListenerAdapter()
-
 
278
			{
-
 
279
				public void onRender(Component c)
-
 
280
				{
-
 
281
					panneauPrincipalObservation.purgeListeners() ;
-
 
282
					obtenirNombreObservation();
-
 
283
					initialiserArbres();
-
 
284
					analyserHistorique();
-
 
285
				}
-
 
286
				
-
 
287
			}) ;
-
 
288
		}
-
 
289
		else
-
 
290
		{
-
 
291
			obtenirNombreObservation();
-
 
292
			initialiserArbres();
-
 
293
			analyserHistorique();
-
 
294
		}
-
 
295
	}
-
 
296
	
-
 
297
	private void initialiserArbres() {
-
 
298
		getPanneauFiltres().getArbreDateObservationFiltreVue().initialiser();
-
 
299
		getPanneauFiltres().getArbreEntiteGeographiqueObservationFiltreVue().initialiser();
-
 
300
		
-
 
301
		
Line 263... Line 302...
263
	}
302
	}
Line 402... Line 441...
402
		
441
		
Line 403... Line 442...
403
	}
442
	}
404
	
-
 
405
	
-
 
406
	// U du CRUD
-
 
407
	
-
 
408
	
443
	
Line 409... Line 444...
409
 
444
	
410
	
445
	// U du CRUD
Line 538... Line 573...
538
	 * Retourne l'identifiant de l'utilisateur connecte
573
	 * Retourne l'identifiant de l'utilisateur connecte
539
	 * @return : identifiant de l'utilisateur connecte
574
	 * @return : identifiant de l'utilisateur connecte
540
	 */
575
	 */
541
	public String getIdentifiant() {
576
	public String getIdentifiant() {
Line 542... Line 577...
542
		
577
		
Line 543... Line 578...
543
		return carnetEnLigneMediateur.getUtilisateur().getIdentifiant();
578
		return carnetEnLigneMediateur.getUtilisateur().getIdentite();
Line 544... Line 579...
544
	
579
	
Line 600... Line 635...
600
 
635
 
Line 601... Line 636...
601
 
636
 
602
	public void obtenirDatesObservation() {
-
 
603
		
637
	public void obtenirDatesObservation() {
Line 604... Line 638...
604
		observationModele.obtenirDatesObservation(filtres.getArbreDateObservationFiltreVue()) ;
638
		
Line 612... Line 646...
612
	}
646
	}
Line 613... Line 647...
613
 
647
 
Line -... Line 648...
-
 
648
 
-
 
649
	public void deconnecterUtilisateur() {
-
 
650
		
-
 
651
		if(panneauPrincipalObservation == null || panneauPrincipalObservation.isCreated() || !panneauPrincipalObservation.isVisible())
-
 
652
		{
-
 
653
			panneauPrincipalObservation.addListener(new ContainerListenerAdapter()
-
 
654
			{
-
 
655
				public void onShow(Component component)
-
 
656
				{
-
 
657
					deconnecterUtilisateur();
-
 
658
					panneauPrincipalObservation.purgeListeners();
-
 
659
				}
-
 
660
			});
614
 
661
		}
615
	public void deconnecterUtilisateur() {
662
		else
616
		
663
		{
617
		listeObservation.raz() ;
664
			listeObservation.raz() ;
618
		formulaireSaisieObservationVue.raz() ;
665
			formulaireSaisieObservationVue.raz() ;
619
		filtres.getArbreDateObservationFiltreVue().raz() ;
666
			filtres.getArbreDateObservationFiltreVue().raz() ;
620
		filtres.getArbreEntiteGeographiqueObservationFiltreVue().raz() ;
667
			filtres.getArbreEntiteGeographiqueObservationFiltreVue().raz() ;
621
		informationRepartitionVue.raz() ;
668
			informationRepartitionVue.raz() ;
622
		imageGeneriqueVue.raz() ;
669
			imageGeneriqueVue.raz() ;
Line 623... Line 670...
623
		mvz.raz() ;
670
			mvz.raz() ;
Line 658... Line 705...
658
	}
705
	}
Line 659... Line 706...
659
 
706
 
Line -... Line 707...
-
 
707
 
660
 
708
	public void transmettreObservations() {
661
	public void transmettreObservations() {
709
		
662
		
710
		if(carnetEnLigneMediateur.getUtilisateur().isIdentifie()) {
663
		if(listeObservation.getIdSelectionnees().length > 0) {
711
			if(listeObservation.getIdSelectionnees().length > 0) {
664
			if(Window.confirm("Êtes vous sur de vouloir transmettre les observations sélectionnées ?")) { 
712
				if(Window.confirm("Êtes vous sur de vouloir transmettre les observations sélectionnées ?")) { 
665
				String[] numObs = listeObservation.getIdSelectionnees();
713
					String[] numObs = listeObservation.getIdSelectionnees();
666
				String numObsApl = "" ;
714
					String numObsApl = "" ;
667
				for(int i = 0 ; i < numObs.length ; i++) {
715
					for(int i = 0 ; i < numObs.length ; i++) {
-
 
716
						numObsApl += numObs[i] ;
668
					numObsApl += numObs[i] ;
717
						if(i != numObs.length - 1) {
-
 
718
							numObsApl +="," ;
-
 
719
						}
669
					if(i != numObs.length - 1) {
720
					}
-
 
721
					
-
 
722
					observationModele.transmettreListeObservation(listeObservation,numObsApl) ;
670
						numObsApl +="," ;
723
				}
671
					}
724
			}
672
				}
725
			else
673
				
726
			{
674
				observationModele.transmettreListeObservation(listeObservation,numObsApl) ;
727
				Window.alert("Aucune observation sélectionnée");
675
			}
728
			}
-
 
729
		}
676
		}
730
		else
-
 
731
		{
-
 
732
			if(Window.confirm("La transmission des observations nécessite d'être identifié, voulez-vous vous identifier ? (toutes vos observations saisies seront conservées)")) {
677
		else
733
				importerObservations = true ;
Line 678... Line 734...
678
		{
734
				carnetEnLigneMediateur.afficherDialogueConnexion();
-
 
735
			}
-
 
736
		}
-
 
737
		
-
 
738
	}
-
 
739
	
-
 
740
	public void analyserHistorique() {
-
 
741
		
-
 
742
		if (History.getToken().length()>0) {
-
 
743
 
Line 679... Line 744...
679
			Window.alert("Aucune observation sélectionnée");
744
	        final String anum=History.getToken();
Line 680... Line 745...
680
		}
745
	        observationModele.analyserHistorique(formulaireSaisieObservationVue,anum);