Subversion Repositories eFlore/Archives.cel-v1

Rev

Rev 30 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 30 Rev 31
1
/**
1
/**
2
 David Delon david.delon@clapas.net 2007
2
 David Delon david.delon@clapas.net 2007
3
 
3
 
4
 */
4
 */
5
 
5
 
6
 
6
 
7
/*
7
/*
8
 * InventoryListView.java  (Composite de Panel)
8
 * ListeObservationsVue.java  (Composite de Panel)
9
 *
9
 *
10
 * Cas d'utilisation :
10
 * Cas d'utilisation :
11
 * 
11
 * 
12
 * Affichage de releve 
12
 * Affichage de releve 
13
 *
13
 *
14
 * 1 : Recherche du nombre de releves associe au navigateur ou a l'utilisateur est connecte, en fonction des criteres de selection
14
 * 1 : Recherche du nombre de releves associe au navigateur ou a l'utilisateur est connecte, en fonction des criteres de selection
15
 * 2 : Recherche des releves correspondant au critere precedent
15
 * 2 : Recherche des releves correspondant au critere precedent
16
 * 3 : Affichage des releves avec positionnement sur le dernier releve
16
 * 3 : Affichage des releves avec positionnement sur le dernier releve
17
 * 
17
 * 
18
 * Selection de releve
18
 * Selection de releve
19
 * 
19
 * 
20
 * 1 : L'utilisateur selectionne un releve : lancement de l'affichage detaille pour le releve selectionne
20
 * 1 : L'utilisateur selectionne un releve : lancement de l'affichage detaille pour le releve selectionne
21
 * 
21
 * 
22
 * 
22
 * 
23
 * Pagination :
23
 * Pagination :
24
 * 
24
 * 
25
 * 1 : Avancement ou recul d'une page
25
 * 1 : Avancement ou recul d'une page
26
 *
26
 *
27
 *
27
 *
28
 * 
28
 * 
29
 *  Suppression d'une liste d'element 
29
 *  Suppression d'une liste d'element 
30
 */
30
 */
31
 
31
 
32
 
32
 
33
/* Actions declenchees :
33
/* Actions declenchees :
34
 * 
34
 * 
35
 * onInventoryItemSelected(numero d'ordre de la ligne selectionne) : selection d'une ligne
35
 * onInventoryItemSelected(numero d'ordre de la ligne selectionne) : selection d'une ligne
36
 * onInventoryItemUnselected(numero d'ordre de la ligne selectionne) : deselection d'une ligne
36
 * onInventoryItemUnselected(numero d'ordre de la ligne selectionne) : deselection d'une ligne
37
 * onInventoryUpdated(location) : action suite a la modification, suppression, creation d'un element d'inventaire
37
 * onInventoryUpdated(location) : action suite a la modification, suppression, creation d'un element d'inventaire
38
 * 
38
 * 
39
 */
39
 */
40
 
40
 
41
 
41
 
42
package org.tela_botanica.client;
42
package org.tela_botanica.client;
43
 
43
 
44
 
44
 
45
import net.mygwt.ui.client.Events;
45
import net.mygwt.ui.client.Events;
46
import net.mygwt.ui.client.Style;
46
import net.mygwt.ui.client.Style;
47
import net.mygwt.ui.client.event.BaseEvent;
47
import net.mygwt.ui.client.event.BaseEvent;
48
import net.mygwt.ui.client.event.Listener;
48
import net.mygwt.ui.client.event.Listener;
49
import net.mygwt.ui.client.widget.ContentPanel;
49
import net.mygwt.ui.client.widget.ContentPanel;
50
import net.mygwt.ui.client.widget.WidgetContainer;
50
import net.mygwt.ui.client.widget.WidgetContainer;
51
import net.mygwt.ui.client.widget.layout.BorderLayoutData;
51
import net.mygwt.ui.client.widget.layout.BorderLayoutData;
52
import net.mygwt.ui.client.widget.layout.FillLayout;
52
import net.mygwt.ui.client.widget.layout.FillLayout;
53
import net.mygwt.ui.client.widget.table.Table;
53
import net.mygwt.ui.client.widget.table.Table;
54
import net.mygwt.ui.client.widget.table.TableColumn;
54
import net.mygwt.ui.client.widget.table.TableColumn;
55
import net.mygwt.ui.client.widget.table.TableColumnModel;
55
import net.mygwt.ui.client.widget.table.TableColumnModel;
56
import net.mygwt.ui.client.widget.table.TableItem;
56
import net.mygwt.ui.client.widget.table.TableItem;
57
 
57
 
58
import com.google.gwt.http.client.URL;
58
import com.google.gwt.http.client.URL;
59
import com.google.gwt.json.client.JSONArray;
59
import com.google.gwt.json.client.JSONArray;
60
import com.google.gwt.json.client.JSONNumber;
60
import com.google.gwt.json.client.JSONNumber;
61
import com.google.gwt.json.client.JSONParser;
61
import com.google.gwt.json.client.JSONParser;
62
import com.google.gwt.json.client.JSONString;
62
import com.google.gwt.json.client.JSONString;
63
import com.google.gwt.json.client.JSONValue;
63
import com.google.gwt.json.client.JSONValue;
64
import com.google.gwt.user.client.HTTPRequest;
64
import com.google.gwt.user.client.HTTPRequest;
65
import com.google.gwt.user.client.ResponseTextHandler;
65
import com.google.gwt.user.client.ResponseTextHandler;
66
import com.google.gwt.user.client.ui.Composite;
66
import com.google.gwt.user.client.ui.Composite;
67
import com.google.gwt.user.client.ui.DockPanel;
67
import com.google.gwt.user.client.ui.DockPanel;
68
import com.google.gwt.user.client.ui.HTML;
68
import com.google.gwt.user.client.ui.HTML;
69
import com.google.gwt.user.client.ui.HorizontalPanel;
69
import com.google.gwt.user.client.ui.HorizontalPanel;
70
import com.google.gwt.user.client.ui.Image;
70
import com.google.gwt.user.client.ui.Image;
71
import com.google.gwt.user.client.ui.Button;
71
import com.google.gwt.user.client.ui.Button;
72
import com.google.gwt.user.client.ui.Label;
72
import com.google.gwt.user.client.ui.Label;
73
import com.google.gwt.user.client.ui.Widget;
73
import com.google.gwt.user.client.ui.Widget;
74
import com.google.gwt.user.client.ui.ClickListener;
74
import com.google.gwt.user.client.ui.ClickListener;
75
import com.google.gwt.user.client.ui.HasHorizontalAlignment;
75
import com.google.gwt.user.client.ui.HasHorizontalAlignment;
76
import com.google.gwt.user.client.ui.HasVerticalAlignment;
76
import com.google.gwt.user.client.ui.HasVerticalAlignment;
77
 
77
 
78
 
78
 
79
public class InventoryListView 
79
public class InventoryListView 
80
		 {
80
		 {
81
 
81
 
82
	// Debut Barre de navigation
82
	// Debut Barre de navigation
83
 
83
 
84
	private class NavBar extends Composite implements ClickListener {
84
	private class NavBar extends Composite implements ClickListener {
85
 
85
 
86
		
86
		
87
		public final DockPanel bar = new DockPanel();
87
		public final DockPanel bar = new DockPanel();
88
		
88
		
89
 
89
 
90
		public final Button gotoFirst = new Button("<<", this);
90
		public final Button gotoFirst = new Button("<<", this);
91
		public final Button gotoNext = new Button(">", this);
91
		public final Button gotoNext = new Button(">", this);
92
		public final Button gotoPrev = new Button("<", this);
92
		public final Button gotoPrev = new Button("<", this);
93
		public final Button gotoEnd = new Button(">>", this);
93
		public final Button gotoEnd = new Button(">>", this);
94
		public final Label status = new Label();
94
		public final Label status = new Label();
95
		
95
		
96
 
96
 
97
		public NavBar() {
97
		public NavBar() {
98
			
98
			
99
			initWidget(bar);
99
			initWidget(bar);
100
			
100
			
101
			status.setWordWrap(false);
101
			status.setWordWrap(false);
102
 
102
 
103
			HorizontalPanel buttons = new HorizontalPanel();
103
			HorizontalPanel buttons = new HorizontalPanel();
104
			
104
			
105
			buttons.add(status);
105
			buttons.add(status);
106
			buttons.setCellHorizontalAlignment(status, HasHorizontalAlignment.ALIGN_RIGHT);
106
			buttons.setCellHorizontalAlignment(status, HasHorizontalAlignment.ALIGN_RIGHT);
107
			buttons.setCellVerticalAlignment(status, HasVerticalAlignment.ALIGN_MIDDLE);
107
			buttons.setCellVerticalAlignment(status, HasVerticalAlignment.ALIGN_MIDDLE);
108
 
108
 
109
 
109
 
110
			buttons.add(gotoFirst);
110
			buttons.add(gotoFirst);
111
			buttons.add(gotoPrev);
111
			buttons.add(gotoPrev);
112
			buttons.add(gotoNext);
112
			buttons.add(gotoNext);
113
			buttons.add(gotoEnd);
113
			buttons.add(gotoEnd);
114
			
114
			
115
			bar.add(buttons, DockPanel.EAST);
115
			bar.add(buttons, DockPanel.EAST);
116
 
116
 
117
			
117
			
118
		}
118
		}
119
		
119
		
120
 
120
 
121
		public void onClick(Widget sender) {
121
		public void onClick(Widget sender) {
122
			if (sender == gotoNext) {
122
			if (sender == gotoNext) {
123
				// Move forward a page.
123
				// Move forward a page.
124
				startIndex += VISIBLE_TAXON_COUNT;
124
				startIndex += VISIBLE_TAXON_COUNT;
125
				if (startIndex >= count)
125
				if (startIndex >= count)
126
					startIndex -= VISIBLE_TAXON_COUNT;
126
					startIndex -= VISIBLE_TAXON_COUNT;
127
			} else {
127
			} else {
128
				if (sender == gotoPrev) {
128
				if (sender == gotoPrev) {
129
					// Move back a page.
129
					// Move back a page.
130
					startIndex -= VISIBLE_TAXON_COUNT;
130
					startIndex -= VISIBLE_TAXON_COUNT;
131
					if (startIndex < 0)
131
					if (startIndex < 0)
132
						startIndex = 0;
132
						startIndex = 0;
133
				} else {
133
				} else {
134
					if (sender == gotoEnd) {
134
					if (sender == gotoEnd) {
135
						gotoEnd();
135
						gotoEnd();
136
					} else {
136
					} else {
137
						if (sender == gotoFirst) {
137
						if (sender == gotoFirst) {
138
							startIndex = 0;
138
							startIndex = 0;
139
						}
139
						}
140
					}
140
					}
141
				}
141
				}
142
			}
142
			}
143
			update();
143
			update();
144
		}
144
		}
145
 
145
 
146
	}
146
	}
147
 
147
 
148
	// Fin Barre de navigation
148
	// Fin Barre de navigation
149
 
149
 
150
	// Conteneur (header et table sont dans panel)
150
	// Conteneur (header et table sont dans panel)
151
	private ContentPanel panel =null;
151
	private ContentPanel panel =null;
152
	private Table table = null;
152
	private Table table = null;
153
	
153
	
154
	// Services 
154
	// Services 
155
	private String serviceBaseUrl = null;
155
	private String serviceBaseUrl = null;
156
	private String user;
156
	private String user;
157
	private Mediator mediator = null;
157
	private Mediator mediator = null;
158
 
158
 
159
	// Navigation
159
	// Navigation
160
	private int startIndex = 0;
160
	private int startIndex = 0;
161
	private int count = 0;
161
	private int count = 0;
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;
164
 
164
 
165
	// Filtre par defaut :
165
	// Filtre par defaut :
166
	
166
	
167
	private String id_location = "all";
167
	private String id_location = "all";
168
	private String location = "all";
168
	private String location = "all";
169
	private String year = "all";
169
	private String year = "all";
170
	private String month = "all";
170
	private String month = "all";
171
	private String day = "all";
171
	private String day = "all";
172
	private String search = "all";
172
	private String search = "all";
173
	private String lieudit = "all";
173
	private String lieudit = "all";
174
	private String ordre= null;
174
	private String ordre= null;
175
	
175
	
176
	
176
	
177
 
177
 
178
 
178
 
179
	public InventoryListView(Mediator med) {
179
	public InventoryListView(Mediator med) {
180
		
180
		
181
		
181
		
182
		// Traitement contexte utilisateur et service
182
		// Traitement contexte utilisateur et service
183
 
183
 
184
		mediator=med;
184
		mediator=med;
185
 
185
 
186
		user=mediator.getUser();
186
		user=mediator.getUser();
187
	    serviceBaseUrl = mediator.getServiceBaseUrl();
187
	    serviceBaseUrl = mediator.getServiceBaseUrl();
188
	
188
	
189
	    
189
	    
190
	    panel= new ContentPanel(Style.HEADER);
190
	    panel= new ContentPanel(Style.HEADER);
191
	    panel.setLayout(new FillLayout());
191
	    panel.setLayout(new FillLayout());
192
	    
192
	    
193
	    
193
	    
194
	    // Barre navigation integree au header 
194
	    // Barre navigation integree au header 
195
	    
195
	    
196
		navBar = new NavBar();
196
		navBar = new NavBar();
197
		panel.getHeader().addWidget(navBar);
197
		panel.getHeader().addWidget(navBar);
198
 
198
 
199
		
199
		
200
		//  Contenu :
200
		//  Contenu :
201
		
201
		
202
		
202
		
203
		//  Colonnes :
203
		//  Colonnes :
204
		
204
		
205
		TableColumn[] columns = new TableColumn[6]; 
205
		TableColumn[] columns = new TableColumn[6]; 
206
		
206
		
207
		// TODO : renderer date, alignement etc
207
		// TODO : renderer date, alignement etc
208
		
208
		
209
		columns[0] = new TableColumn("etat","Aransmis", 50);  
209
		columns[0] = new TableColumn("etat","Aransmis", 50);  
210
 
210
 
211
		columns[1] = new TableColumn("nom","Nom saisi", 250);  
211
		columns[1] = new TableColumn("nom","Nom saisi", 250);  
212
		
212
		
213
		columns[2] = new TableColumn("nomr","Nom retenu", 250);  
213
		columns[2] = new TableColumn("nomr","Nom retenu", 250);  
214
 
214
 
215
		columns[3] = new TableColumn("lieu","Lieu", 350);  
215
		columns[3] = new TableColumn("lieu","Lieu", 350);  
216
 
216
 
217
		columns[4] = new TableColumn("date","Date", 75);  
217
		columns[4] = new TableColumn("date","Date", 75);  
218
 
218
 
219
		columns[5] = new TableColumn("ordre","Ordre", 50);  
219
		columns[5] = new TableColumn("ordre","Ordre", 50);  
220
		
220
		
221
	
221
	
222
		TableColumnModel cm = new TableColumnModel(columns);  
222
		TableColumnModel cm = new TableColumnModel(columns);  
223
		
223
		
224
		// Table : 
224
		// Table : 
225
		
225
		
226
		table = new Table(Style.MULTI | Style.HORIZONTAL, cm);  
226
		table = new Table(Style.MULTI | Style.HORIZONTAL, cm);  
227
		table.setBorders(false);  
227
		table.setBorders(false);  
228
		
228
		
229
		
229
		
230
		panel.add(table);
230
		panel.add(table);
231
		
231
		
232
		WidgetContainer center=mediator.getCenterContainer();
232
		WidgetContainer center=mediator.getCenterContainer();
233
		BorderLayoutData centerData = new BorderLayoutData(Style.CENTER, .75f, 100, 1000);
233
		BorderLayoutData centerData = new BorderLayoutData(Style.CENTER, .75f, 100, 1000);
234
		center.add(panel,centerData);
234
		center.add(panel,centerData);
235
 
235
 
236
		
236
		
237
 
237
 
238
		// Selection d'une ligne 
238
		// Selection d'une ligne 
239
		table.addListener(Events.RowClick, new Listener() {
239
		table.addListener(Events.RowClick, new Listener() {
240
 
240
 
241
		      public void handleEvent(BaseEvent be) {
241
		      public void handleEvent(BaseEvent be) {
242
		        TableItem item=(TableItem) be.item;
242
		        TableItem item=(TableItem) be.item;
243
		        if (item!=null) {
243
		        if (item!=null) {
244
		        	if (ordre==null) { // Affichage de la ligne selectionne
244
		        	if (ordre==null) { // Affichage de la ligne selectionne
245
		        		ordre= (String) item.getValue(5);
245
		        		ordre= (String) item.getValue(5);
246
		        		mediator.onInventoryItemSelected(ordre);
246
		        		mediator.onInventoryItemSelected(ordre);
247
		        	}
247
		        	}
248
		        	else { 
248
		        	else { 
249
		        		// Si une ligne etait deja selectionne 
249
		        		// Si une ligne etait deja selectionne 
250
		        		if (ordre.compareTo((String) item.getValue(5))==0) { // C'est la meme, on la deselectionne
250
		        		if (ordre.compareTo((String) item.getValue(5))==0) { // C'est la meme, on la deselectionne
251
		        			ordre=null;
251
		        			ordre=null;
252
		        			table.deselect(be.rowIndex);
252
		        			table.deselect(be.rowIndex);
253
		        			mediator.onInventoryItemUnselected();
253
		        			mediator.onInventoryItemUnselected();
254
		        		}
254
		        		}
255
		        		else {
255
		        		else {
256
			        		ordre= (String) item.getValue(5); // C'est une autre, on la selectionne
256
			        		ordre= (String) item.getValue(5); // C'est une autre, on la selectionne
257
		        			mediator.onInventoryItemSelected(ordre);
257
		        			mediator.onInventoryItemSelected(ordre);
258
		        		}
258
		        		}
259
		        		
259
		        		
260
		        	}
260
		        	}
261
		        }
261
		        }
262
		      }
262
		      }
263
		});
263
		});
264
		
264
		
265
	
265
	
266
	
266
	
267
 
267
 
268
 
268
 
269
	}
269
	}
270
	
270
	
271
	
271
	
272
	/**
272
	/**
273
	 * Suppression d'un ensemble d'element de la liste d'inventaire, on garde ici car s'applique a plusieurs elements
273
	 * Suppression d'un ensemble d'element de la liste d'inventaire, on garde ici car s'applique a plusieurs elements
274
	 * 
274
	 * 
275
	 */
275
	 */
276
 
276
 
277
	public void deleteElement() {
277
	public void deleteElement() {
278
 
278
 
279
		setStatusDisabled();
279
		setStatusDisabled();
280
		TableItem[] selection=table.getSelection();
280
		TableItem[] selection=table.getSelection();
281
 
281
 
282
		StringBuffer ids=new StringBuffer();
282
		StringBuffer ids=new StringBuffer();
283
		for (int i = 0; i < selection.length; i++) {
283
		for (int i = 0; i < selection.length; i++) {
284
			ids.append((String)(((TableItem) selection[i]).getValue(5)));
284
			ids.append((String)(((TableItem) selection[i]).getValue(5)));
285
			if (i<(selection.length-1)) ids.append(",");
285
			if (i<(selection.length-1)) ids.append(",");
286
		} 
286
		} 
287
		
287
		
288
		if (ids.length()>0) {
288
		if (ids.length()>0) {
289
			
289
			
290
			HTTPRequest.asyncPost(serviceBaseUrl + "/Inventory/" + user
290
			HTTPRequest.asyncPost(serviceBaseUrl + "/Inventory/" + user
291
							+ "/" + ids.toString(), "action=DELETE",
291
							+ "/" + ids.toString(), "action=DELETE",
292
							
292
							
293
							new ResponseTextHandler() {
293
							new ResponseTextHandler() {
294
								public void onCompletion(String str) {
294
								public void onCompletion(String str) {
295
											mediator.onInventoryUpdated(id_location,"all","all");
295
											mediator.onInventoryUpdated(id_location,"all","all");
296
											mediator.getEntryView().clear();
296
											mediator.getEntryView().clear();
297
								}
297
								}
298
							});
298
							});
299
		}
299
		}
300
	
300
	
301
		setStatusEnabled();
301
		setStatusEnabled();
302
 
302
 
303
	}
303
	}
304
	
304
	
305
	
305
	
306
	
306
	
307
	
307
	
308
	/**
308
	/**
309
	 * Transmission de releve a Tela, on garde ici car s'applique a plusieurs elements
309
	 * Transmission de releve a Tela, on garde ici car s'applique a plusieurs elements
310
	 */
310
	 */
311
 
311
 
312
	
312
	
313
	public void transmitElement() {
313
	public void transmitElement() {
314
	
314
	
315
		setStatusDisabled();
315
		setStatusDisabled();
316
		
316
		
317
		TableItem[] selection=table.getSelection();
317
		TableItem[] selection=table.getSelection();
318
 
318
 
319
		StringBuffer ids=new StringBuffer();
319
		StringBuffer ids=new StringBuffer();
320
		for (int i = 0; i < selection.length; i++) {
320
		for (int i = 0; i < selection.length; i++) {
321
			ids.append((String)(((TableItem) selection[i]).getValue(5)));
321
			ids.append((String)(((TableItem) selection[i]).getValue(5)));
322
			if (i<(selection.length-1)) ids.append(",");
322
			if (i<(selection.length-1)) ids.append(",");
323
		} 
323
		} 
324
		
324
		
325
		if (ids.length()>0) {
325
		if (ids.length()>0) {
326
		
326
		
327
			HTTPRequest.asyncPost(serviceBaseUrl + "/InventoryTransmit/" + user
327
			HTTPRequest.asyncPost(serviceBaseUrl + "/InventoryTransmit/" + user
328
							+ "/" + ids.toString(), "transmission=1",
328
							+ "/" + ids.toString(), "transmission=1",
329
							
329
							
330
							new ResponseTextHandler() {
330
							new ResponseTextHandler() {
331
								public void onCompletion(String str) {
331
								public void onCompletion(String str) {
332
											update(); // Pour affichage logo 
332
											update(); // Pour affichage logo 
333
								}
333
								}
334
							});
334
							});
335
		}
335
		}
336
	
336
	
337
		setStatusEnabled();
337
		setStatusEnabled();
338
 
338
 
339
		
339
		
340
	}
340
	}
341
	
341
	
342
	
342
	
343
	/**
343
	/**
344
	 * Recherche nombre d'enregistrement pour l'utilisateur et la localite en cours
344
	 * Recherche nombre d'enregistrement pour l'utilisateur et la localite en cours
345
	 * 
345
	 * 
346
	 */
346
	 */
347
	
347
	
348
	public void updateCount	() {
348
	public void updateCount	() {
349
		
349
		
350
		setStatusDisabled();
350
		setStatusDisabled();
351
 
351
 
352
		
352
		
353
		// Transformation de la date selectionne vers date time stamp
353
		// Transformation de la date selectionne vers date time stamp
354
		
354
		
355
 
355
 
356
		HTTPRequest.asyncGet(serviceBaseUrl + "/InventoryItemList/" + user + "/" + id_location + "/" + URL.encodeComponent(location) + "/" + year  + "/"  + month  + "/"  + day  + "/" + URL.encodeComponent(search) +  "/" + URL.encodeComponent(lieudit), 
356
		HTTPRequest.asyncGet(serviceBaseUrl + "/InventoryItemList/" + user + "/" + id_location + "/" + URL.encodeComponent(location) + "/" + year  + "/"  + month  + "/"  + day  + "/" + URL.encodeComponent(search) +  "/" + URL.encodeComponent(lieudit), 
357
				new ResponseTextHandler() {
357
				new ResponseTextHandler() {
358
 
358
 
359
					public void onCompletion(String str) {
359
					public void onCompletion(String str) {
360
 
360
 
361
						JSONValue jsonValue = JSONParser.parse(str);
361
						JSONValue jsonValue = JSONParser.parse(str);
362
						JSONNumber jsonNumber;
362
						JSONNumber jsonNumber;
363
						if ((jsonNumber = jsonValue.isNumber()) != null) {
363
						if ((jsonNumber = jsonValue.isNumber()) != null) {
364
							count = (int) jsonNumber.getValue();
364
							count = (int) jsonNumber.getValue();
365
						//	if (location.compareTo("")==0) location="000null";
365
						//	if (location.compareTo("")==0) location="000null";
366
							gotoEnd(); // Derniere page
366
							gotoEnd(); // Derniere page
367
							update();
367
							update();
368
						}
368
						}
369
					}
369
					}
370
				});
370
				});
371
 
371
 
372
	}
372
	}
373
	
373
	
374
	/**
374
	/**
375
	 * Mise a jour de l'affichage, a partir des donnaes d'inventaire deja
375
	 * Mise a jour de l'affichage, a partir des donnaes d'inventaire deja
376
	 * saisies. La valeur de this.startIndex permet de determiner quelles
376
	 * saisies. La valeur de this.startIndex permet de determiner quelles
377
	 * donnaes seront affichees
377
	 * donnaes seront affichees
378
	 * 
378
	 * 
379
	 */
379
	 */
380
 
380
 
381
	public void update() {
381
	public void update() {
382
 
382
 
383
		
383
		
384
		
384
		
385
//   TODO : optimisation	 (ne pas supprimer mais remplacer)
385
//   TODO : optimisation	 (ne pas supprimer mais remplacer)
386
		
386
		
387
 
387
 
388
		
388
		
389
//      Ligne d'information 
389
//      Ligne d'information 
390
 
390
 
391
		// Toutes date par defaut
391
		// Toutes date par defaut
392
		
392
		
393
 
393
 
394
		HTTPRequest.asyncGet(serviceBaseUrl + "/InventoryItemList/" + user + "/" + id_location + "/" + URL.encodeComponent(location) +"/" + year  + "/"  + month  + "/"  + day   + "/" + URL.encodeComponent(search) + "/" + URL.encodeComponent(lieudit) + "/"
394
		HTTPRequest.asyncGet(serviceBaseUrl + "/InventoryItemList/" + user + "/" + id_location + "/" + URL.encodeComponent(location) +"/" + year  + "/"  + month  + "/"  + day   + "/" + URL.encodeComponent(search) + "/" + URL.encodeComponent(lieudit) + "/"
395
				+ startIndex + "/" + VISIBLE_TAXON_COUNT,
395
				+ startIndex + "/" + VISIBLE_TAXON_COUNT,
396
 
396
 
397
		new ResponseTextHandler() {
397
		new ResponseTextHandler() {
398
 
398
 
399
			public void onCompletion(String str) {
399
			public void onCompletion(String str) {
400
 
400
 
401
				JSONValue jsonValue = JSONParser.parse(str);
401
				JSONValue jsonValue = JSONParser.parse(str);
402
				JSONArray jsonArray;
402
				JSONArray jsonArray;
403
				JSONArray jsonArrayNested;
403
				JSONArray jsonArrayNested;
404
				
404
				
405
				int i=0;
405
				int i=0;
406
 
406
 
407
				if ((jsonArray = jsonValue.isArray()) != null) {
407
				if ((jsonArray = jsonValue.isArray()) != null) {
408
					
408
					
409
					StringBuffer lieu=null;
409
					StringBuffer lieu=null;
410
 
410
 
411
					int arraySize = jsonArray.size();
411
					int arraySize = jsonArray.size();
412
					
412
					
413
					for (i = 0; i < arraySize; ++i) {
413
					for (i = 0; i < arraySize; ++i) {
414
						if ((jsonArrayNested = jsonArray.get(i).isArray()) != null) {
414
						if ((jsonArrayNested = jsonArray.get(i).isArray()) != null) {
415
							
415
							
416
 
416
 
417
							Object[] values = new Object[6];
417
							Object[] values = new Object[6];
418
							
418
							
419
													
419
													
420
							// Statut Observation transmise ?
420
							// Statut Observation transmise ?
421
							
421
							
422
							String atransmit=((JSONString) jsonArrayNested .get(13)).stringValue();
422
							String atransmit=((JSONString) jsonArrayNested .get(13)).stringValue();
423
							
423
							
424
							if (atransmit.compareTo("1")==0) {
424
							if (atransmit.compareTo("1")==0) {
425
								values[0] = new Image("tela.gif");
425
								values[0] = new Image("tela.gif");
426
							}
426
							}
427
							else {
427
							else {
428
								values[0] = new HTML("&nbsp;");
428
								values[0] = new HTML("&nbsp;");
429
							}
429
							}
430
							
430
							
431
						
431
						
432
							// Nom saisi
432
							// Nom saisi
433
							
433
							
434
							values[1] = new HTML("<b>"+Util.toCelString(((JSONString) jsonArrayNested .get(0)).toString())+"</b>");
434
							values[1] = new HTML("<b>"+Util.toCelString(((JSONString) jsonArrayNested .get(0)).toString())+"</b>");
435
							
435
							
436
							
436
							
437
 
437
 
438
							// Nom retenu
438
							// Nom retenu
439
							String aname=Util.toCelString(((JSONString) jsonArrayNested .get(2)).toString());
439
							String aname=Util.toCelString(((JSONString) jsonArrayNested .get(2)).toString());
440
							
440
							
441
							if (aname.compareTo("null")==0) {
441
							if (aname.compareTo("null")==0) {
442
								values[2] = new HTML("&nbsp;");
442
								values[2] = new HTML("&nbsp;");
443
							}
443
							}
444
							else {
444
							else {
445
								values[2] = new HTML(aname);
445
								values[2] = new HTML(aname);
446
							}
446
							}
447
							
447
							
448
							// Num nomenclatural
448
							// Num nomenclatural
449
							/*
449
							/*
450
							String ann=((JSONString) jsonArrayNested .get(3)).stringValue();
450
							String ann=((JSONString) jsonArrayNested .get(3)).stringValue();
451
							
451
							
452
							if (ann.compareTo("0")!=0) {
452
							if (ann.compareTo("0")!=0) {
453
								observationText.append(""+ann+"-");
453
								observationText.append(""+ann+"-");
454
							}
454
							}
455
							else {
455
							else {
456
								observationText.append("0-");
456
								observationText.append("0-");
457
							}
457
							}
458
							*/
458
							*/
459
 
459
 
460
							
460
							
461
							// Num Taxonomique
461
							// Num Taxonomique
462
							
462
							
463
							/*
463
							/*
464
							String ant=((JSONString) jsonArrayNested .get(4)).stringValue();
464
							String ant=((JSONString) jsonArrayNested .get(4)).stringValue();
465
							
465
							
466
							if (ant.compareTo("0")!=0) {
466
							if (ant.compareTo("0")!=0) {
467
								observationText.append(ant+", ");
467
								observationText.append(ant+", ");
468
							}
468
							}
469
							else {
469
							else {
470
								observationText.append("0, ");
470
								observationText.append("0, ");
471
							}
471
							}
472
							*/
472
							*/
473
 
473
 
474
							// Famille
474
							// Famille
475
							
475
							
476
							/*
476
							/*
477
							String afamily=Util.toCelString(((JSONString) jsonArrayNested .get(5)).toString());
477
							String afamily=Util.toCelString(((JSONString) jsonArrayNested .get(5)).toString());
478
							
478
							
479
							if (afamily.compareTo("null")==0) {
479
							if (afamily.compareTo("null")==0) {
480
								//
480
								//
481
							}
481
							}
482
							else {
482
							else {
483
								observationText.append(afamily+", ");
483
								observationText.append(afamily+", ");
484
							}
484
							}
485
							*/
485
							*/
486
 
486
 
487
//							Localisation - Lieu
487
//							Localisation - Lieu
488
 
488
 
489
							lieu=new StringBuffer();
489
							lieu=new StringBuffer();
490
 
490
 
491
							String aloc=Util.toCelString(((JSONString) jsonArrayNested .get(6)).toString());
491
							String aloc=Util.toCelString(((JSONString) jsonArrayNested .get(6)).toString());
492
								
492
								
493
								if (aloc.compareTo("000null")==0) {
493
								if (aloc.compareTo("000null")==0) {
494
									if (lieu.length()==0) {
494
									if (lieu.length()==0) {
495
										lieu.append("Commune absente");
495
										lieu.append("Commune absente");
496
									}
496
									}
497
									else {
497
									else {
498
										lieu.append("commune absente");
498
										lieu.append("commune absente");
499
									}
499
									}
500
								}
500
								}
501
								else {
501
								else {
502
									if (lieu.length()==0) {
502
									if (lieu.length()==0) {
503
										lieu.append("Commune de "+aloc);
503
										lieu.append("Commune de "+aloc);
504
									}
504
									}
505
									else {
505
									else {
506
										lieu.append("commune de "+aloc);
506
										lieu.append("commune de "+aloc);
507
									}
507
									}
508
										
508
										
509
								}
509
								}
510
							
510
							
511
								
511
								
512
								String alieudit=Util.toCelString(((JSONString) jsonArrayNested .get(9)).toString());
512
								String alieudit=Util.toCelString(((JSONString) jsonArrayNested .get(9)).toString());
513
							
513
							
514
//								Localisation - Lieu dit
514
//								Localisation - Lieu dit
515
								
515
								
516
								if (alieudit.compareTo("000null")!=0) {
516
								if (alieudit.compareTo("000null")!=0) {
517
									lieu.append(", "+alieudit);
517
									lieu.append(", "+alieudit);
518
								}
518
								}
519
								
519
								
520
								
520
								
521
//								Station -
521
//								Station -
522
								
522
								
523
								String astation=Util.toCelString(((JSONString) jsonArrayNested .get(10)).toString());
523
								String astation=Util.toCelString(((JSONString) jsonArrayNested .get(10)).toString());
524
 
524
 
525
								
525
								
526
								if (astation.compareTo("000null")!=0) {
526
								if (astation.compareTo("000null")!=0) {
527
									lieu.append(", "+astation);
527
									lieu.append(", "+astation);
528
								}
528
								}
529
 
529
 
530
								
530
								
531
//								Milieu
531
//								Milieu
532
								
532
								
533
								String amilieu=Util.toCelString(((JSONString) jsonArrayNested .get(11)).toString());
533
								String amilieu=Util.toCelString(((JSONString) jsonArrayNested .get(11)).toString());
534
 
534
 
535
								
535
								
536
								if (amilieu.compareTo("000null")!=0) {
536
								if (amilieu.compareTo("000null")!=0) {
537
									lieu.append(", "+amilieu);
537
									lieu.append(", "+amilieu);
538
								}								
538
								}								
539
							
539
							
540
								String acomment=Util.toCelString(((JSONString) jsonArrayNested .get(12)).toString());
540
								String acomment=Util.toCelString(((JSONString) jsonArrayNested .get(12)).toString());
541
//								Commentaire
541
//								Commentaire
542
								
542
								
543
								if (acomment.compareTo("null")!=0) {
543
								if (acomment.compareTo("null")!=0) {
544
									lieu.append(", "+acomment);
544
									lieu.append(", "+acomment);
545
								}
545
								}
546
 
546
 
547
								
547
								
548
								if (lieu.toString().compareTo("")==0) {
548
								if (lieu.toString().compareTo("")==0) {
549
									values[3] = new HTML("&nbsp;");
549
									values[3] = new HTML("&nbsp;");
550
								}
550
								}
551
								else {
551
								else {
552
									values[3] = new HTML(lieu.toString());
552
									values[3] = new HTML(lieu.toString());
553
								}
553
								}
554
 
554
 
555
								
555
								
556
								String adate=((JSONString) jsonArrayNested .get(8)).stringValue();
556
								String adate=((JSONString) jsonArrayNested .get(8)).stringValue();
557
								
557
								
558
//								Date 
558
//								Date 
559
								if (adate.compareTo("0000-00-00 00:00:00")!=0) {
559
								if (adate.compareTo("0000-00-00 00:00:00")!=0) {
560
									values[4]=new HTML("<b>"+adate+"</b>"); 
560
									values[4]=new HTML("<b>"+adate+"</b>"); 
561
								}
561
								}
562
								else { 
562
								else { 
563
									values[4] = new HTML("&nbsp;");
563
									values[4] = new HTML("&nbsp;");
564
								}
564
								}
565
									
565
									
566
 
566
 
567
							
567
							
568
							String aordre=((JSONString) jsonArrayNested.get(7)).stringValue();
568
							String aordre=((JSONString) jsonArrayNested.get(7)).stringValue();
569
						
569
						
570
							// Numero d'ordre (cache)
570
							// Numero d'ordre (cache)
571
							
571
							
572
							values[5] = aordre;
572
							values[5] = aordre;
573
							
573
							
574
							
574
							
575
						
575
						
576
							
576
							
577
					    	if (i>=table.getItemCount()) {
577
					    	if (i>=table.getItemCount()) {
578
					    		TableItem item = new TableItem(values);
578
					    		TableItem item = new TableItem(values);
579
					    		table.add(item);
579
					    		table.add(item);
580
							}
580
							}
581
							else {
581
							else {
582
								TableItem item=table.getItem(i);
582
								TableItem item=table.getItem(i);
583
								item.setValue(0,values[0]);
583
								item.setValue(0,values[0]);
584
								item.setValue(1,values[1]);
584
								item.setValue(1,values[1]);
585
								item.setValue(2,values[2]);
585
								item.setValue(2,values[2]);
586
								item.setValue(3,values[3]);
586
								item.setValue(3,values[3]);
587
								item.setValue(4,values[4]);
587
								item.setValue(4,values[4]);
588
								item.setValue(5,values[5]);
588
								item.setValue(5,values[5]);
589
							}
589
							}
590
					    	
590
					    	
591
					    	// Spagetti
591
					    	// Spagetti
592
							if (ordre!=null) {
592
							if (ordre!=null) {
593
								if (aordre.compareTo(ordre)==0) {
593
								if (aordre.compareTo(ordre)==0) {
594
									table.select(i);
594
									table.select(i);
595
								}
595
								}
596
								else {
596
								else {
597
									table.deselect(i);
597
									table.deselect(i);
598
								}
598
								}
599
							}
599
							}
600
							
600
							
601
						}
601
						}
602
 
602
 
603
					}
603
					}
604
				}
604
				}
605
 
605
 
606
				// Suppression fin ancien affichage
606
				// Suppression fin ancien affichage
607
				if (i<table.getItemCount()) {
607
				if (i<table.getItemCount()) {
608
					 for (int j = table.getItemCount() -1 ; j >= i; j--) {
608
					 for (int j = table.getItemCount() -1 ; j >= i; j--) {
609
						 TableItem item=table.getItem(j);
609
						 TableItem item=table.getItem(j);
610
						 table.remove(item);
610
						 table.remove(item);
611
					 }
611
					 }
612
				}
612
				}
613
				
613
				
614
				setStatusEnabled();
614
				setStatusEnabled();
615
				
615
				
616
				
616
				
617
			}
617
			}
618
		});
618
		});
619
		
619
		
620
 
620
 
621
	}
621
	}
622
 
622
 
623
 
623
 
624
	/**
624
	/**
625
	 * Affichage message d'attente et desactivation navigation
625
	 * Affichage message d'attente et desactivation navigation
626
	 * 
626
	 * 
627
	 * @param
627
	 * @param
628
	 * @return void
628
	 * @return void
629
	 */
629
	 */
630
 
630
 
631
	private void setStatusDisabled() {
631
	private void setStatusDisabled() {
632
 
632
 
633
		navBar.gotoFirst.setEnabled(false);
633
		navBar.gotoFirst.setEnabled(false);
634
		navBar.gotoPrev.setEnabled(false);
634
		navBar.gotoPrev.setEnabled(false);
635
		navBar.gotoNext.setEnabled(false);
635
		navBar.gotoNext.setEnabled(false);
636
		navBar.gotoEnd.setEnabled(false);
636
		navBar.gotoEnd.setEnabled(false);
637
 
637
 
638
		navBar.status.setText("Patientez ...");
638
		navBar.status.setText("Patientez ...");
639
	}
639
	}
640
 
640
 
641
	/**
641
	/**
642
	 * Affichage numero de page et gestion de la navigation
642
	 * Affichage numero de page et gestion de la navigation
643
	 * 
643
	 * 
644
	 */
644
	 */
645
 
645
 
646
	private void setStatusEnabled() {
646
	private void setStatusEnabled() {
647
 
647
 
648
		// Il y a forcemment un disabled avant d'arriver ici
648
		// Il y a forcemment un disabled avant d'arriver ici
649
 
649
 
650
		if (count > 0) {
650
		if (count > 0) {
651
 
651
 
652
			if (startIndex >= VISIBLE_TAXON_COUNT) { // Au dela de la
652
			if (startIndex >= VISIBLE_TAXON_COUNT) { // Au dela de la
653
														// premiere page
653
														// premiere page
654
				navBar.gotoPrev.setEnabled(true);
654
				navBar.gotoPrev.setEnabled(true);
655
				navBar.gotoFirst.setEnabled(true);
655
				navBar.gotoFirst.setEnabled(true);
656
				if (startIndex < (count - VISIBLE_TAXON_COUNT)) { // Pas la
656
				if (startIndex < (count - VISIBLE_TAXON_COUNT)) { // Pas la
657
																	// derniere
657
																	// derniere
658
																	// page
658
																	// page
659
					navBar.gotoNext.setEnabled(true);
659
					navBar.gotoNext.setEnabled(true);
660
					navBar.gotoEnd.setEnabled(true);
660
					navBar.gotoEnd.setEnabled(true);
661
					navBar.status.setText((startIndex + 1) + " - "
661
					navBar.status.setText((startIndex + 1) + " - "
662
							+ (startIndex + VISIBLE_TAXON_COUNT) + " sur " + count );
662
							+ (startIndex + VISIBLE_TAXON_COUNT) + " sur " + count );
663
				} else { // Derniere page
663
				} else { // Derniere page
664
					navBar.status.setText((startIndex + 1) + " - " + count + " sur " + count );
664
					navBar.status.setText((startIndex + 1) + " - " + count + " sur " + count );
665
				}
665
				}
666
			} else { // Premiere page
666
			} else { // Premiere page
667
				if (count > VISIBLE_TAXON_COUNT) { // Des pages derrieres
667
				if (count > VISIBLE_TAXON_COUNT) { // Des pages derrieres
668
					navBar.gotoNext.setEnabled(true);
668
					navBar.gotoNext.setEnabled(true);
669
					navBar.gotoEnd.setEnabled(true);
669
					navBar.gotoEnd.setEnabled(true);
670
					navBar.status.setText((startIndex + 1) + " - "
670
					navBar.status.setText((startIndex + 1) + " - "
671
							+ (startIndex + VISIBLE_TAXON_COUNT) + " sur " + count);
671
							+ (startIndex + VISIBLE_TAXON_COUNT) + " sur " + count);
672
				} else {
672
				} else {
673
					navBar.status.setText((startIndex + 1) + " - " + count + " sur " + count);
673
					navBar.status.setText((startIndex + 1) + " - " + count + " sur " + count);
674
				}
674
				}
675
			}
675
			}
676
		}
676
		}
677
 
677
 
678
		else { // Pas d'inventaire, pas de navigation
678
		else { // Pas d'inventaire, pas de navigation
679
			navBar.status.setText("0 - 0 sur 0");
679
			navBar.status.setText("0 - 0 sur 0");
680
		}
680
		}
681
	}
681
	}
682
 
682
 
683
	/*
683
	/*
684
	 * Positionnement index de parcours (this.startIndex) pour affichage de la
684
	 * Positionnement index de parcours (this.startIndex) pour affichage de la
685
	 * derniere page
685
	 * derniere page
686
	 * 
686
	 * 
687
	 * @param
687
	 * @param
688
	 * @return void
688
	 * @return void
689
	 */
689
	 */
690
 
690
 
691
	private void gotoEnd() {
691
	private void gotoEnd() {
692
 
692
 
693
		if ((count == 0) || (count % VISIBLE_TAXON_COUNT) > 0) {
693
		if ((count == 0) || (count % VISIBLE_TAXON_COUNT) > 0) {
694
			startIndex = count - (count % VISIBLE_TAXON_COUNT);
694
			startIndex = count - (count % VISIBLE_TAXON_COUNT);
695
		} else {
695
		} else {
696
			startIndex = count - VISIBLE_TAXON_COUNT;
696
			startIndex = count - VISIBLE_TAXON_COUNT;
697
		}
697
		}
698
 
698
 
699
	}
699
	}
700
 
700
 
701
	/*
701
	/*
702
	 * Recherche en cours
702
	 * Recherche en cours
703
	 * 
703
	 * 
704
	 */
704
	 */
705
	
705
	
706
	public void setSearch(String search) {
706
	public void setSearch(String search) {
707
		this.search = search;
707
		this.search = search;
708
	}
708
	}
709
 
709
 
710
 
710
 
711
	
711
	
712
	/*
712
	/*
713
	 * Departement en cours 
713
	 * Departement en cours 
714
	 * 
714
	 * 
715
	 */
715
	 */
716
	
716
	
717
	public void setIdLocation(String id_location) {
717
	public void setIdLocation(String id_location) {
718
		this.id_location = id_location;
718
		this.id_location = id_location;
719
	}
719
	}
720
 
720
 
721
 
721
 
722
	
722
	
723
	/*
723
	/*
724
	 * Localite en cours 
724
	 * Localite en cours 
725
	 * 
725
	 * 
726
	 */
726
	 */
727
	
727
	
728
	public void setLocation(String location) {
728
	public void setLocation(String location) {
729
		this.location = location;
729
		this.location = location;
730
	}
730
	}
731
 
731
 
732
 
732
 
733
	
733
	
734
	/*
734
	/*
735
	 * Lieudit en cours 
735
	 * Lieudit en cours 
736
	 * 
736
	 * 
737
	 */
737
	 */
738
 
738
 
739
	public void setLieudit(String lieudit) {
739
	public void setLieudit(String lieudit) {
740
		this.lieudit = lieudit;
740
		this.lieudit = lieudit;
741
	}
741
	}
742
 
742
 
743
	
743
	
744
	
744
	
745
	/*
745
	/*
746
	 * Date en cours 
746
	 * Date en cours 
747
	 * 
747
	 * 
748
	 */
748
	 */
749
	
749
	
750
 
750
 
751
	public void setYear(String year) {
751
	public void setYear(String year) {
752
		this.year = year;
752
		this.year = year;
753
	}
753
	}
754
 
754
 
755
 
755
 
756
	public void setMonth(String month) {
756
	public void setMonth(String month) {
757
		this.month = month;
757
		this.month = month;
758
	}
758
	}
759
 
759
 
760
	public void setDay(String day) {
760
	public void setDay(String day) {
761
		this.day = day;
761
		this.day = day;
762
	}
762
	}
763
 
763
 
764
	
764
	
765
	/*
765
	/*
766
	 * Utilisateur en cours 
766
	 * Utilisateur en cours 
767
	 * 
767
	 * 
768
	 */
768
	 */
769
	
769
	
770
 
770
 
771
	
771
	
772
	public void setUser(String user) {
772
	public void setUser(String user) {
773
		this.user = user;
773
		this.user = user;
774
	}
774
	}
775
 
775
 
776
 
776
 
777
	public void displayFilter() {
777
	public void displayFilter() {
778
		
778
		
779
		
779
		
780
	
780
	
781
	// Mise a jour boutton export feuille de calcul
781
	// Mise a jour boutton export feuille de calcul
782
	
782
	
783
	mediator.getActionView().getExportButton().setHTML("<a href=\""+mediator.getServiceBaseUrl()+"/InventoryExport/" 
783
	mediator.getActionView().getExportButton().setHTML("<a href=\""+mediator.getServiceBaseUrl()+"/InventoryExport/" 
784
			+  user + "/"
784
			+  user + "/"
785
			+ URL.encodeComponent(id_location) + "/"
785
			+ URL.encodeComponent(id_location) + "/"
786
			+ URL.encodeComponent(location) + "/"
786
			+ URL.encodeComponent(location) + "/"
787
			+ URL.encodeComponent(lieudit)+ "/"
787
			+ URL.encodeComponent(lieudit)+ "/"
788
			+ year + "/"
788
			+ year + "/"
789
			+ month  + "/"
789
			+ month  + "/"
790
			+ day 
790
			+ day 
791
			+ "\">"+"Export&nbsp;tableur</a>");
791
			+ "\">"+"Export&nbsp;tableur</a>");
792
 
792
 
793
	
793
	
794
	// Mise a jour ligne de selection 
794
	// Mise a jour ligne de selection 
795
	
795
	
796
	
796
	
797
	
797
	
798
	String dep;
798
	String dep;
799
	if (id_location.compareTo("all")==0) {
799
	if (id_location.compareTo("all")==0) {
800
		dep="Tous d&eacute;partements";
800
		dep="Tous d&eacute;partements";
801
	}
801
	}
802
	else {
802
	else {
803
		if (id_location.compareTo("000null")==0) {
803
		if (id_location.compareTo("000null")==0) {
804
			dep="D&eacute;partements non renseign&eacute;es ";
804
			dep="D&eacute;partements non renseign&eacute;es ";
805
		}
805
		}
806
		else {
806
		else {
807
		dep="Département "+id_location;
807
		dep="Département "+id_location;
808
		}
808
		}
809
	}
809
	}
810
	
810
	
811
	
811
	
812
	
812
	
813
	String com;
813
	String com;
814
	if (location.compareTo("all")==0) {
814
	if (location.compareTo("all")==0) {
815
		com=", toutes communes";
815
		com=", toutes communes";
816
	}
816
	}
817
	else {
817
	else {
818
		if (location.compareTo("000null")==0) {
818
		if (location.compareTo("000null")==0) {
819
			com=", communes non renseign&eacute;es";
819
			com=", communes non renseign&eacute;es";
820
		}
820
		}
821
		else {
821
		else {
822
		com=", commune de "+location;
822
		com=", commune de "+location;
823
		}
823
		}
824
	}
824
	}
825
 
825
 
826
	
826
	
827
	
827
	
828
	String lieu;
828
	String lieu;
829
	
829
	
830
	if (lieudit.compareTo("all")==0) {
830
	if (lieudit.compareTo("all")==0) {
831
		lieu=", tous lieux dits";
831
		lieu=", tous lieux dits";
832
	}
832
	}
833
	else {
833
	else {
834
		if (lieudit.compareTo("000null")==0) {
834
		if (lieudit.compareTo("000null")==0) {
835
			lieu=", lieu-dit non renseign&eacute;es";
835
			lieu=", lieu-dit non renseign&eacute;es";
836
		}
836
		}
837
		else {
837
		else {
838
			lieu=", lieu-dit "+ lieudit;
838
			lieu=", lieu-dit "+ lieudit;
839
		}
839
		}
840
	}
840
	}
841
	
841
	
842
	String dat;
842
	String dat;
843
	
843
	
844
	if ((year.compareTo("all")==0) && (month.compareTo("all")==0) && (day.compareTo("all")==0)) {
844
	if ((year.compareTo("all")==0) && (month.compareTo("all")==0) && (day.compareTo("all")==0)) {
845
		dat=", toutes periodes";
845
		dat=", toutes periodes";
846
	}
846
	}
847
	
847
	
848
	else {
848
	else {
849
	
849
	
850
    	String yea="";
850
    	String yea="";
851
       	String da="";
851
       	String da="";
852
       	String mont="";
852
       	String mont="";
853
       	
853
       	
854
    	if (year.compareTo("all")==0) {
854
    	if (year.compareTo("all")==0) {
855
    		yea=", toutes ann&eacute;es";
855
    		yea=", toutes ann&eacute;es";
856
    	}
856
    	}
857
    	else {
857
    	else {
858
    		if (year.compareTo("0")==0) {
858
    		if (year.compareTo("0")==0) {
859
    			yea=", periode non renseign&eacute;e";
859
    			yea=", periode non renseign&eacute;e";
860
    		}
860
    		}
861
    		else {
861
    		else {
862
    			yea=", "+ year;
862
    			yea=", "+ year;
863
    
863
    
864
            	if (month.compareTo("all")==0) {
864
            	if (month.compareTo("all")==0) {
865
            		mont=", tous mois";
865
            		mont=", tous mois";
866
            	}
866
            	}
867
            	else {
867
            	else {
868
            			mont="/"+ month;
868
            			mont="/"+ month;
869
            	}
869
            	}
870
            
870
            
871
            
871
            
872
            	if (day.compareTo("all")==0) {
872
            	if (day.compareTo("all")==0) {
873
            		da=", tous jours";
873
            		da=", tous jours";
874
            	}
874
            	}
875
            	else {
875
            	else {
876
            			da="/"+ day;
876
            			da="/"+ day;
877
            	}
877
            	}
878
    		}
878
    		}
879
    	}
879
    	}
880
            	
880
            	
881
        dat=yea + mont + da;
881
        dat=yea + mont + da;
882
    	
882
    	
883
	}
883
	}
884
 
884
 
885
	
885
	
886
	panel.getHeader().setText(dep + com + lieu + dat);
886
	panel.getHeader().setText(dep + com + lieu + dat);
887
 
887
 
888
 
888
 
889
	
889
	
890
}
890
}
891
 
891
 
892
 
892
 
893
}
893
}
894
 
894
 
895
/* +--Fin du code ---------------------------------------------------------------------------------------+
895
/* +--Fin du code ---------------------------------------------------------------------------------------+
896
* $Log$
896
* $Log$
-
 
897
* Revision 1.3  2008-04-28 13:10:43  ddelon
-
 
898
* Integration MyGwt
-
 
899
*
897
* Revision 1.2  2008-01-30 08:55:40  ddelon
900
* Revision 1.2  2008-01-30 08:55:40  ddelon
898
* fin mise en place mygwt
901
* fin mise en place mygwt
899
*
902
*
900
* Revision 1.1  2008-01-02 21:26:04  ddelon
903
* Revision 1.1  2008-01-02 21:26:04  ddelon
901
* mise en place mygwt
904
* mise en place mygwt
902
*
905
*
903
* Revision 1.8  2007-12-22 14:48:53  ddelon
906
* Revision 1.8  2007-12-22 14:48:53  ddelon
904
* Documentation et refactorisation
907
* Documentation et refactorisation
905
*
908
*
906
* Revision 1.7  2007-09-17 19:25:34  ddelon
909
* Revision 1.7  2007-09-17 19:25:34  ddelon
907
* Documentation
910
* Documentation
908
*
911
*
909
*/
912
*/