Subversion Repositories eFlore/Applications.del

Rev

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

Rev 1501 Rev 1517
Line 71... Line 71...
71
	private CacheClient() {
71
	private CacheClient() {
72
		instance = this;
72
		instance = this;
73
	}
73
	}
Line 74... Line 74...
74
 
74
 
-
 
75
	public void initialiserAvecParametres() {
-
 
76
		
-
 
77
		if(Location.getPath().contains("identiplante")) {
-
 
78
			if(Location.getHash().contains(ConstantesNavigation.PAGE_VALIDATION)) {
-
 
79
				setPageCourante(ConstantesNavigation.PAGE_VALIDATION+"~"+URLUtils.getURLSpecialParameterValue());
-
 
80
			} else {
-
 
81
				setPageCourante(ConstantesNavigation.PAGE_RECHERCHE_OBSERVATIONS);
-
 
82
			}
-
 
83
		} else if(Location.getPath().contains("pictoflora")) {
-
 
84
			if(Location.getHash().contains(ConstantesNavigation.PAGE_VALIDATION_PICTOFLORA)) {
-
 
85
				setPageCourante(ConstantesNavigation.PAGE_VALIDATION+URLUtils.getURLSpecialParameterValue());
-
 
86
			} else {
-
 
87
				setPageCourante(ConstantesNavigation.PAGE_RECHERCHE_IMAGES);
-
 
88
			}
-
 
89
		}
75
	public void initialiserAvecParametres() {
90
		
76
		String rechercheLibre = Location.getParameter("masque");
91
		String rechercheLibre = Location.getParameter("masque");
77
		String famille = Location.getParameter("masque.famille");
92
		String famille = Location.getParameter("masque.famille");
78
		String taxon = Location.getParameter("masque.ns");
93
		String taxon = Location.getParameter("masque.ns");
79
		String genre = Location.getParameter("masque.genre");
94
		String genre = Location.getParameter("masque.genre");
Line 133... Line 148...
133
			if(pageInt != null) setPageCouranteRechercheImages(pageInt);
148
			if(pageInt != null) setPageCouranteRechercheImages(pageInt);
134
		} else {
149
		} else {
135
			if(pageInt != null)	setPageCouranteRechercheObservations(pageInt);			
150
			if(pageInt != null)	setPageCouranteRechercheObservations(pageInt);			
136
		}
151
		}
Line 137... Line -...
137
		
-
 
138
		
152
		
139
		String tri = Location.getParameter("tri");		
153
		String tri = Location.getParameter("tri");		
Line 140... Line 154...
140
		String ordre = Location.getParameter("ordre");
154
		String ordre = Location.getParameter("ordre");
141
		
155
		
Line 182... Line 196...
182
			}
196
			}
183
		}
197
		}
Line 184... Line 198...
184
		
198
		
185
		informationsRechercheImage = rechercheParArguments;
199
		informationsRechercheImage = rechercheParArguments;
-
 
200
		informationsRechercheObservation = rechercheParArguments;
-
 
201
		
186
		informationsRechercheObservation = rechercheParArguments;
202
		mettreAjourUrlCourante();
Line 187... Line 203...
187
	}
203
	}
188
	
204
	
189
	public void setIdProtocoleEnAttente(String idProtocole) {
205
	public void setIdProtocoleEnAttente(String idProtocole) {
Line 336... Line 352...
336
		return referentielNonModifiable;
352
		return referentielNonModifiable;
337
	}
353
	}
Line 338... Line 354...
338
	
354
	
339
	public String genererUrlCourante() {
355
	public String genererUrlCourante() {
340
		String url = Window.Location.getHref();
-
 
341
		CacheClient cache = CacheClient.getInstance();
-
 
342
		
356
		String url = Window.Location.getHref();
343
		String arguments = "";
357
		String arguments = "";
-
 
358
		String argumentsRecherche = "";
344
		String argumentsRecherche = "";
359
		
Line 345... Line 360...
345
		if (cache.getPageCourante().equals(ConstantesNavigation.PAGE_RECHERCHE_IMAGES)) {
360
		if (getPageCourante().equals(ConstantesNavigation.PAGE_RECHERCHE_IMAGES)) {
346
			
361
			
347
			InformationsRecherche infoRecherche;
362
			InformationsRecherche infoRecherche;
348
			infoRecherche = cache.getInformationsRechercheImage();
363
			infoRecherche = getInformationsRechercheImage();
349
			if (CacheClient.getInstance().getProtocoleCourant() != null) {
364
			if (CacheClient.getInstance().getProtocoleCourant() != null) {
350
				infoRecherche.setIdProtocoleSelectionne(""+CacheClient.getInstance().getProtocoleCourant().getId());
365
				infoRecherche.setIdProtocoleSelectionne(""+CacheClient.getInstance().getProtocoleCourant().getId());
Line 357... Line 372...
357
			
372
			
358
			argumentsRecherche += (argumentsRecherche.isEmpty()) ? "" : "&";
373
			argumentsRecherche += (argumentsRecherche.isEmpty()) ? "" : "&";
Line 359... Line 374...
359
			argumentsRecherche += "page="+getPageCouranteRechercheImage()+"&pas="+getPasPagination();
374
			argumentsRecherche += "page="+getPageCouranteRechercheImage()+"&pas="+getPasPagination();
360
			
375
			
361
			argumentsRecherche = (argumentsRecherche.isEmpty()) ? argumentsRecherche : "?" + argumentsRecherche;
376
			argumentsRecherche = (argumentsRecherche.isEmpty()) ? argumentsRecherche : "?" + argumentsRecherche;
362
			arguments = argumentsRecherche + "#" + ConstantesNavigation.PAGE_RECHERCHE_IMAGES;
-
 
-
 
377
			arguments = argumentsRecherche;
363
			url = new Config().getUrl("del") + arguments;
378
			url = new Config().getUrl("pictoflora") + arguments;
Line 364... Line 379...
364
 
379
			url += "#"+ConstantesNavigation.PAGE_RECHERCHE_IMAGES;
365
		} else if (cache.getPageCourante().equals(ConstantesNavigation.PAGE_RECHERCHE_OBSERVATIONS) || cache.getPageCourante().equals("")) {
380
		} else if (getPageCourante().equals(ConstantesNavigation.PAGE_RECHERCHE_OBSERVATIONS) || getPageCourante().equals("")) {
366
			
381
			
367
			InformationsRecherche infoRecherche;
382
			InformationsRecherche infoRecherche;
368
			infoRecherche = cache.getInformationsRechercheObservation();
383
			infoRecherche = getInformationsRechercheObservation();
Line 369... Line 384...
369
			argumentsRecherche = "masque.type="+statut;
384
			argumentsRecherche = "masque.type="+statut;
370
			argumentsRecherche += "&page="+getPageCouranteRechercheObservations()+"&pas="+getPasPagination();
385
			argumentsRecherche += "&page="+getPageCouranteRechercheObservations()+"&pas="+getPasPagination();
371
			argumentsRecherche += "&"+infoRecherche.versChaineRequete();
386
			argumentsRecherche += "&"+infoRecherche.versChaineRequete();
Line 372... Line 387...
372
			
387
			
373
			if(!GWT.isScript()) {
388
			if(!GWT.isScript()) {
-
 
389
				argumentsRecherche += "&gwt.codesvr="+Location.getParameter("gwt.codesvr")+"";
374
				argumentsRecherche += "&gwt.codesvr="+Location.getParameter("gwt.codesvr")+"";
390
			}
375
			}
391
			
-
 
392
			arguments = "?"+argumentsRecherche;
-
 
393
			url = new Config().getUrl("identiplante") + arguments;
-
 
394
			url += "#"+ConstantesNavigation.PAGE_RECHERCHE_OBSERVATIONS;
-
 
395
		} else if (getPageCourante().contains(ConstantesNavigation.PAGE_VALIDATION) || getPageCourante().contains(ConstantesNavigation.PAGE_VALIDATION_PICTOFLORA)) {
-
 
396
			url = new Config().getUrl("del");
376
			
397
			if(getPageCourante().contains(ConstantesNavigation.PAGE_VALIDATION)) {
377
			arguments = "?"+argumentsRecherche + "#" + ConstantesNavigation.PAGE_RECHERCHE_OBSERVATIONS;
398
				url = new Config().getUrl("identiplante");
378
			url = new Config().getUrl("del") + arguments;
399
			} else {
379
		} else if (cache.getPageCourante().contains(ConstantesNavigation.PAGE_VALIDATION) || cache.getPageCourante().contains(ConstantesNavigation.PAGE_VALIDATION_PICTOFLORA)) {
400
				url = new Config().getUrl("pictoflora");
380
			url = new Config().getUrl("del");
401
			}
381
			if(!GWT.isScript()) {
402
			if(!GWT.isScript()) {
382
				url += "?gwt.codesvr="+Location.getParameter("gwt.codesvr");
403
				url += "?gwt.codesvr="+Location.getParameter("gwt.codesvr");
383
			}
404
			}
384
			url += "#"+cache.getPageCourante();
405
			url += "#"+getPageCourante();
Line 401... Line 422...
401
		// javascript double negative trick
422
		// javascript double negative trick
402
		// pour plus d'info http://stackoverflow.com/questions/4686583/can-someone-explain-this-double-negative-trick
423
		// pour plus d'info http://stackoverflow.com/questions/4686583/can-someone-explain-this-double-negative-trick
403
		if(!!($wnd.history && $wnd.history.pushState)) {
424
		if(!!($wnd.history && $wnd.history.pushState)) {
404
    		$wnd.history.pushState(nouvelleUrl, "", nouvelleUrl);
425
    		$wnd.history.pushState(nouvelleUrl, "", nouvelleUrl);
405
    	}
426
    	}
406
	}-*/;
427
	}-*/;	
407
	
-
 
408
}
428
}