Subversion Repositories eFlore/Archives.cel-v1

Rev

Rev 28 | Rev 30 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 28 Rev 29
Line 162... Line 162...
162
	private static final int VISIBLE_TAXON_COUNT = 15;
162
	private static final int VISIBLE_TAXON_COUNT = 15;
163
	private NavBar navBar=null;
163
	private NavBar navBar=null;
Line 164... Line 164...
164
 
164
 
Line -... Line 165...
-
 
165
	// Filtre par defaut :
165
	// Filtre par defaut :
166
	
-
 
167
	private String id_location = "all";
-
 
168
	private String location = "all";
166
	
169
	private String year = "all";
167
	private String location = "all";
170
	private String month = "all";
168
	private String date = "all";
171
	private String day = "all";
169
	private String search = "all";
172
	private String search = "all";
Line 233... Line 236...
233
		BorderLayoutData centerData = new BorderLayoutData(Style.CENTER, .75f, 100, 1000);
236
		BorderLayoutData centerData = new BorderLayoutData(Style.CENTER, .75f, 100, 1000);
234
		center.add(panel,centerData);
237
		center.add(panel,centerData);
Line -... Line 238...
-
 
238
 
235
 
239
		
Line 236... Line 240...
236
		
240
 
237
 
241
		// Selection d'une ligne 
238
		table.addListener(Events.RowClick, new Listener() {
242
		table.addListener(Events.RowClick, new Listener() {
239
 
243
 
240
		      public void handleEvent(BaseEvent be) {
244
		      public void handleEvent(BaseEvent be) {
241
		        TableItem item=(TableItem) be.item;
245
		        TableItem item=(TableItem) be.item;
242
		        if (item!=null) {
246
		        if (item!=null) {
243
		        	if (ordre==null) {
247
		        	if (ordre==null) { // Affichage de la ligne selectionne
-
 
248
		        		ordre= (String) item.getValue(4);
244
		        		ordre= (String) item.getValue(4);
249
		        		mediator.onInventoryItemSelected(ordre);
245
		        		mediator.onInventoryItemSelected(ordre);
250
		        	}
246
		        	}
251
		        	else { 
247
		        	else {
252
		        		// Si une ligne etait deja selectionne 
248
		        		if (ordre.compareTo((String) item.getValue(4))==0) {
253
		        		if (ordre.compareTo((String) item.getValue(4))==0) { // C'est la meme, on la deselectionne
249
		        			ordre=null;
254
		        			ordre=null;
250
		        			table.deselect(be.rowIndex);
255
		        			table.deselect(be.rowIndex);
251
		        			mediator.onInventoryItemUnselected();
256
		        			mediator.onInventoryItemUnselected();
252
		        		}
257
		        		}
Line 253... Line 258...
253
		        		else {
258
		        		else {
254
			        		ordre= (String) item.getValue(4);
259
			        		ordre= (String) item.getValue(4); // C'est une autre, on la selectionne
Line 288... Line 293...
288
			HTTPRequest.asyncPost(serviceBaseUrl + "/Inventory/" + user
293
			HTTPRequest.asyncPost(serviceBaseUrl + "/Inventory/" + user
289
							+ "/" + ids.toString(), "action=DELETE",
294
							+ "/" + ids.toString(), "action=DELETE",
Line 290... Line 295...
290
							
295
							
291
							new ResponseTextHandler() {
296
							new ResponseTextHandler() {
292
								public void onCompletion(String str) {
297
								public void onCompletion(String str) {
293
											mediator.onInventoryUpdated(location);
298
											mediator.onInventoryUpdated(id_location,"all","all");
294
								}
299
								}
295
							});
300
							});
Line 296... Line 301...
296
		}
301
		}
Line 347... Line 352...
347
		setStatusDisabled();
352
		setStatusDisabled();
Line 348... Line 353...
348
 
353
 
Line 349... Line -...
349
		
-
 
350
		// Transformation de la date selectionne vers date time stamp
-
 
351
		
-
 
352
		String adate="all";
-
 
Line 353... Line 354...
353
		if (date.compareTo("all")!=0) {
354
		
354
			adate=date.substring(6,10)+"-"+date.substring(3,5)+"-"+date.substring(0,2)+" 00:00:00";
355
		// Transformation de la date selectionne vers date time stamp
Line 355... Line 356...
355
		}
356
		
Line 356... Line 357...
356
 
357
 
Line 389... Line 390...
389
		
390
		
Line 390... Line 391...
390
//      Ligne d'information 
391
//      Ligne d'information 
Line 391... Line -...
391
 
-
 
392
		// Toutes date par defaut
-
 
393
		
-
 
394
		String adate="all";
-
 
Line 395... Line 392...
395
		if (date.compareTo("all")!=0) {
392
 
396
			adate=date.substring(6,10)+"-"+date.substring(3,5)+"-"+date.substring(0,2)+" 00:00:00";
393
		// Toutes date par defaut
Line 397... Line 394...
397
		}
394
		
Line 398... Line 395...
398
 
395
 
Line 399... Line 396...
399
		HTTPRequest.asyncGet(serviceBaseUrl + "/InventoryItemList/" + user + "/" + URL.encodeComponent(location) +"/" + adate + "/" + URL.encodeComponent(search) + "/" + URL.encodeComponent(station) + "/"
396
		HTTPRequest.asyncGet(serviceBaseUrl + "/InventoryItemList/" + user + "/" + id_location + "/" + URL.encodeComponent(location) +"/" + year  + "/"  + month  + "/"  + day   + "/" + URL.encodeComponent(search) + "/" + URL.encodeComponent(lieudit) + "/"
400
				+ startIndex + "/" + VISIBLE_TAXON_COUNT,
397
				+ startIndex + "/" + VISIBLE_TAXON_COUNT,
401
 
398
 
Line 402... Line -...
402
		new ResponseTextHandler() {
-
 
403
 
399
		new ResponseTextHandler() {
Line 404... Line 400...
404
			public void onCompletion(String str) {
400
 
Line 405... Line 401...
405
 
401
			public void onCompletion(String str) {
Line 425... Line 421...
425
							observationText=new StringBuffer();
421
							observationText=new StringBuffer();
Line 426... Line 422...
426
													
422
													
Line 427... Line 423...
427
							// Statut Observation transmise ?
423
							// Statut Observation transmise ?
Line 428... Line 424...
428
							
424
							
429
							
425
							
430
							String atransmit=((JSONString) jsonArrayNested .get(11)).stringValue();
426
							String atransmit=((JSONString) jsonArrayNested .get(12)).stringValue();
431
							
427
							
Line 515... Line 511...
515
								
511
								
516
								if (alieudit.compareTo("000null")!=0) {
512
								if (alieudit.compareTo("000null")!=0) {
517
									observationText.append(", "+alieudit);
513
									observationText.append(", "+alieudit);
Line -... Line 514...
-
 
514
								}
-
 
515
								
-
 
516
								
-
 
517
//								Station -
-
 
518
								
-
 
519
								String astation=Util.toCelString(((JSONString) jsonArrayNested .get(10)).toString());
-
 
520
 
-
 
521
								
-
 
522
								if (astation.compareTo("000null")!=0) {
-
 
523
									observationText.append(", "+astation);
-
 
524
								}
518
								}
525
 
519
							
526
							
Line 520... Line 527...
520
								String acomment=Util.toCelString(((JSONString) jsonArrayNested .get(10)).toString());
527
								String acomment=Util.toCelString(((JSONString) jsonArrayNested .get(11)).toString());
521
//								Commentaire
528
//								Commentaire
522
								
529
								
Line 679... Line 686...
679
	public void setSearch(String search) {
686
	public void setSearch(String search) {
680
		this.search = search;
687
		this.search = search;
681
	}
688
	}
Line -... Line 689...
-
 
689
 
-
 
690
 
-
 
691
	
-
 
692
	/*
-
 
693
	 * Departement en cours 
-
 
694
	 * 
-
 
695
	 */
-
 
696
	
-
 
697
	public void setIdLocation(String id_location) {
-
 
698
		this.id_location = id_location;
-
 
699
	}
-
 
700
 
682
 
701
 
683
	
702
	
684
	/*
703
	/*
685
	 * Localite en cours 
704
	 * Localite en cours 
Line 695... Line 714...
695
	/*
714
	/*
696
	 * Station en cours 
715
	 * Station en cours 
697
	 * 
716
	 * 
698
	 */
717
	 */
Line 699... Line 718...
699
 
718
 
700
	public void setStation(String station) {
719
	public void setLieudit(String lieudit) {
701
		this.station = station;
720
		this.lieudit = lieudit;
Line 702... Line 721...
702
	}
721
	}
703
 
722
 
704
	
723
	
705
	
724
	
Line -... Line 725...
-
 
725
	/*
-
 
726
	 * Date en cours 
-
 
727
	 * 
-
 
728
	 */
-
 
729
	
-
 
730
 
-
 
731
	public void setYear(String year) {
-
 
732
		this.year = year;
-
 
733
	}
706
	/*
734
 
707
	 * Date en cours 
735
 
708
	 * 
736
	public void setMonth(String month) {
Line 709... Line 737...
709
	 */
737
		this.month = month;
710
	
738
	}
Line 732... Line 760...
732
	
760
	
Line 733... Line 761...
733
	// Mise a jour boutton export feuille de calcul
761
	// Mise a jour boutton export feuille de calcul
734
	
762
	
-
 
763
	mediator.getActionView().getExportButton().setHTML("<a href=\""+mediator.getServiceBaseUrl()+"/InventoryExport/" 
735
	mediator.getActionView().getExportButton().setHTML("<a href=\""+mediator.getServiceBaseUrl()+"/InventoryExport/" 
764
			+  user + "/"
736
			+  user + "/"
765
			+ URL.encodeComponent(id_location) + "/"
-
 
766
			+ URL.encodeComponent(location) + "/"
737
			+ URL.encodeComponent(location) + "/"
767
			+ URL.encodeComponent(lieudit)+ "/"
738
			+ URL.encodeComponent(station)+ "/"
768
			+ year + "/"
739
			+ URL.encodeComponent(search) + "/"
769
			+ month  + "/"
-
 
770
			+ day 
Line 740... Line 771...
740
			+ date + 
771
			+ "\">"+"Export&nbsp;tableur</a>");
Line -... Line 772...
-
 
772
 
-
 
773
	
-
 
774
	// Mise a jour ligne de selection 
-
 
775
	
-
 
776
	
-
 
777
	
-
 
778
	String dep;
-
 
779
	if (id_location.compareTo("all")==0) {
-
 
780
		dep="Tous d&eacute;partements";
-
 
781
	}
-
 
782
	else {
-
 
783
		if (id_location.compareTo("000null")==0) {
-
 
784
			dep="D&eacute;partements non renseign&eacute;es ";
-
 
785
		}
-
 
786
		else {
741
			"\">"+"Export&nbsp;tableur</a>");
787
		dep="Département "+id_location;
742
 
788
		}
743
	// Mise a jour ligne de selection 
789
	}
744
	
790
	
745
	
791
	
746
	
792
	
747
	String com;
793
	String com;
748
	if (location.compareTo("all")==0) {
794
	if (location.compareTo("all")==0) {
749
		com="Toutes communes";
795
		com=", toutes communes";
750
	}
796
	}
751
	else {
797
	else {
752
		if (location.compareTo("000null")==0) {
798
		if (location.compareTo("000null")==0) {
Line 753... Line -...
753
			com="Communes non renseign&eacute;es";
-
 
Line -... Line 799...
-
 
799
			com=", communes non renseign&eacute;es";
-
 
800
		}
754
		}
801
		else {
755
		else {
802
		com=", commune de "+location;
756
		com="Commune de "+location;
803
		}
757
		}
804
	}
758
	}
805
 
759
 
806
	
760
	
807
	
761
	String dat;
808
	String lieu;
762
	
809
	
763
	if (date.compareTo("all")==0) {
810
	if (lieudit.compareTo("all")==0) {
764
		dat=", toutes p&eacute;riodes";
811
		lieu=", tous lieux dits";
Line -... Line 812...
-
 
812
	}
-
 
813
	else {
-
 
814
		if (lieudit.compareTo("000null")==0) {
-
 
815
			lieu=", lieu-dit non renseign&eacute;es";
-
 
816
		}
-
 
817
		else {
-
 
818
			lieu=", lieu-dit "+ lieudit;
Line 765... Line 819...
765
	}
819
		}
-
 
820
	}
-
 
821
	
Line 766... Line 822...
766
	else {
822
	String dat;
767
		if (date.compareTo("00/00/0000")==0) {
823
	
768
			dat=", p&eacute;riodes non renseign&eacute;es";
824
	if ((year.compareTo("all")==0) && (month.compareTo("all")==0) && (day.compareTo("all")==0)) {
769
		}
825
		dat=", toutes periodes";
770
		else {
826
	}
771
			dat=", le "+ date;
827
	
772
		}
828
	else {
773
	}
829
	
774
 
830
    	String yea="";
-
 
831
       	String da="";
-
 
832
       	String mont="";
-
 
833
       	
775
	
834
    	if (year.compareTo("all")==0) {
-
 
835
    		yea=", toutes ann&eacute;es";
-
 
836
    	}
776
	String stat;
837
    	else {
Line -... Line 838...
-
 
838
    		if (year.compareTo("0")==0) {
-
 
839
    			yea=", periode non renseign&eacute;e";
-
 
840
    		}
-
 
841
    		else {
-
 
842
    			yea=", "+ year;
-
 
843
    
-
 
844
            	if (month.compareTo("all")==0) {
-
 
845
            		mont=", tous mois";
-
 
846
            	}
-
 
847
            	else {
-
 
848
            			mont="/"+ month;
-
 
849
            	}
-
 
850
            
-
 
851
            
777
	
852
            	if (day.compareTo("all")==0) {
Line 778... Line 853...
778
	if (station.compareTo("all")==0) {
853
            		da=", tous jours";
Line 779... Line 854...
779
		stat=", toutes stations";
854
            	}
Line 780... Line 855...
780
	}
855
            	else {
781
	else {
856
            			da="/"+ day;
-
 
857
            	}
-
 
858
    		}
-
 
859
    	}
782
		if (station.compareTo("000null")==0) {
860
            	
783
			stat=", stations non renseign&eacute;es";
861
        dat=yea + mont + da;
784
		}
862
    	
785
		else {
863
	}
786
			stat=", station "+ station;
864