Subversion Repositories eFlore/Archives.cel-v1

Rev

Rev 28 | Rev 30 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 28 Rev 29
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
 * InventoryListView.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";
-
 
168
	private String location = "all";
-
 
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";
170
	private String station = "all";
173
	private String lieudit = "all";
171
	private String ordre= null;
174
	private String ordre= null;
172
	
175
	
173
	
176
	
174
 
177
 
175
 
178
 
176
	public InventoryListView(Mediator med) {
179
	public InventoryListView(Mediator med) {
177
		
180
		
178
		
181
		
179
		// Traitement contexte utilisateur et service
182
		// Traitement contexte utilisateur et service
180
 
183
 
181
		mediator=med;
184
		mediator=med;
182
 
185
 
183
		user=mediator.getUser();
186
		user=mediator.getUser();
184
	    serviceBaseUrl = mediator.getServiceBaseUrl();
187
	    serviceBaseUrl = mediator.getServiceBaseUrl();
185
	
188
	
186
	    
189
	    
187
	    panel= new ContentPanel(Style.HEADER);
190
	    panel= new ContentPanel(Style.HEADER);
188
	    panel.setLayout(new FillLayout());
191
	    panel.setLayout(new FillLayout());
189
	    
192
	    
190
	    
193
	    
191
	    // Barre navigation integree au header 
194
	    // Barre navigation integree au header 
192
	    
195
	    
193
		navBar = new NavBar();
196
		navBar = new NavBar();
194
		panel.getHeader().addWidget(navBar);
197
		panel.getHeader().addWidget(navBar);
195
	    
198
 
196
		
199
		
197
		//  Contenu :
200
		//  Contenu :
198
		
201
		
199
		
202
		
200
		//  Colonnes :
203
		//  Colonnes :
201
		
204
		
202
		TableColumn[] columns = new TableColumn[5]; 
205
		TableColumn[] columns = new TableColumn[5]; 
203
		
206
		
204
		// TODO : renderer date, alignement etc
207
		// TODO : renderer date, alignement etc
205
		
208
		
206
		columns[0] = new TableColumn("etat","Transmis", 50);  
209
		columns[0] = new TableColumn("etat","Transmis", 50);  
207
		columns[0].setSortable(false);
210
		columns[0].setSortable(false);
208
 
211
 
209
		columns[1] = new TableColumn("nom","Nom saisi", 200);  
212
		columns[1] = new TableColumn("nom","Nom saisi", 200);  
210
		columns[1].setSortable(false);
213
		columns[1].setSortable(false);
211
		
214
		
212
		columns[2] = new TableColumn("observation","Observation", 650);  
215
		columns[2] = new TableColumn("observation","Observation", 650);  
213
		columns[2].setSortable(false);
216
		columns[2].setSortable(false);
214
 
217
 
215
		columns[3] = new TableColumn("date","Date", 75);  
218
		columns[3] = new TableColumn("date","Date", 75);  
216
		columns[3].setSortable(false);
219
		columns[3].setSortable(false);
217
 
220
 
218
		columns[4] = new TableColumn("ordre","Ordre", 50);  
221
		columns[4] = new TableColumn("ordre","Ordre", 50);  
219
		columns[4].setSortable(false);
222
		columns[4].setSortable(false);
220
		
223
		
221
	
224
	
222
		TableColumnModel cm = new TableColumnModel(columns);  
225
		TableColumnModel cm = new TableColumnModel(columns);  
223
		
226
		
224
		// Table : 
227
		// Table : 
225
		
228
		
226
		table = new Table(Style.MULTI | Style.HORIZONTAL, cm);  
229
		table = new Table(Style.MULTI | Style.HORIZONTAL, cm);  
227
		table.setBorders(false);  
230
		table.setBorders(false);  
228
		
231
		
229
		
232
		
230
		panel.add(table);
233
		panel.add(table);
231
		
234
		
232
		WidgetContainer center=mediator.getCenterContainer();
235
		WidgetContainer center=mediator.getCenterContainer();
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);
235
 
238
 
236
		
239
		
-
 
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
244
		        		ordre= (String) item.getValue(4);
248
		        		ordre= (String) item.getValue(4);
245
		        		mediator.onInventoryItemSelected(ordre);
249
		        		mediator.onInventoryItemSelected(ordre);
246
		        	}
250
		        	}
247
		        	else {
251
		        	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
		        		}
253
		        		else {
258
		        		else {
254
			        		ordre= (String) item.getValue(4);
259
			        		ordre= (String) item.getValue(4); // C'est une autre, on la selectionne
255
		        			mediator.onInventoryItemSelected(ordre);
260
		        			mediator.onInventoryItemSelected(ordre);
256
		        		}
261
		        		}
257
		        		
262
		        		
258
		        	}
263
		        	}
259
		        }
264
		        }
260
		      }
265
		      }
261
		});
266
		});
262
		
267
		
263
	
268
	
264
	
269
	
265
 
270
 
266
 
271
 
267
	}
272
	}
268
	
273
	
269
	
274
	
270
	/**
275
	/**
271
	 * Suppression d'un ensemble d'element de la liste d'inventaire, on garde ici car s'applique a plusieurs elements
276
	 * Suppression d'un ensemble d'element de la liste d'inventaire, on garde ici car s'applique a plusieurs elements
272
	 * 
277
	 * 
273
	 */
278
	 */
274
 
279
 
275
	public void deleteElement() {
280
	public void deleteElement() {
276
 
281
 
277
		setStatusDisabled();
282
		setStatusDisabled();
278
		TableItem[] selection=table.getSelection();
283
		TableItem[] selection=table.getSelection();
279
 
284
 
280
		StringBuffer ids=new StringBuffer();
285
		StringBuffer ids=new StringBuffer();
281
		for (int i = 0; i < selection.length; i++) {
286
		for (int i = 0; i < selection.length; i++) {
282
			ids.append((String)(((TableItem) selection[i]).getValue(4)));
287
			ids.append((String)(((TableItem) selection[i]).getValue(4)));
283
			if (i<(selection.length-1)) ids.append(",");
288
			if (i<(selection.length-1)) ids.append(",");
284
		} 
289
		} 
285
		
290
		
286
		if (ids.length()>0) {
291
		if (ids.length()>0) {
287
			
292
			
288
			HTTPRequest.asyncPost(serviceBaseUrl + "/Inventory/" + user
293
			HTTPRequest.asyncPost(serviceBaseUrl + "/Inventory/" + user
289
							+ "/" + ids.toString(), "action=DELETE",
294
							+ "/" + ids.toString(), "action=DELETE",
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
							});
296
		}
301
		}
297
	
302
	
298
		setStatusEnabled();
303
		setStatusEnabled();
299
 
304
 
300
	}
305
	}
301
	
306
	
302
	
307
	
303
	
308
	
304
	
309
	
305
	/**
310
	/**
306
	 * Transmission de releve a Tela, on garde ici car s'applique a plusieurs elements
311
	 * Transmission de releve a Tela, on garde ici car s'applique a plusieurs elements
307
	 */
312
	 */
308
 
313
 
309
	
314
	
310
	public void transmitElement() {
315
	public void transmitElement() {
311
	
316
	
312
		setStatusDisabled();
317
		setStatusDisabled();
313
		
318
		
314
		TableItem[] selection=table.getSelection();
319
		TableItem[] selection=table.getSelection();
315
 
320
 
316
		StringBuffer ids=new StringBuffer();
321
		StringBuffer ids=new StringBuffer();
317
		for (int i = 0; i < selection.length; i++) {
322
		for (int i = 0; i < selection.length; i++) {
318
			ids.append((String)(((TableItem) selection[i]).getValue(4)));
323
			ids.append((String)(((TableItem) selection[i]).getValue(4)));
319
			if (i<(selection.length-1)) ids.append(",");
324
			if (i<(selection.length-1)) ids.append(",");
320
		} 
325
		} 
321
		
326
		
322
		if (ids.length()>0) {
327
		if (ids.length()>0) {
323
		
328
		
324
			HTTPRequest.asyncPost(serviceBaseUrl + "/InventoryTransmit/" + user
329
			HTTPRequest.asyncPost(serviceBaseUrl + "/InventoryTransmit/" + user
325
							+ "/" + ids.toString(), "transmission=1",
330
							+ "/" + ids.toString(), "transmission=1",
326
							
331
							
327
							new ResponseTextHandler() {
332
							new ResponseTextHandler() {
328
								public void onCompletion(String str) {
333
								public void onCompletion(String str) {
329
											update(); // Pour affichage logo 
334
											update(); // Pour affichage logo 
330
								}
335
								}
331
							});
336
							});
332
		}
337
		}
333
	
338
	
334
		setStatusEnabled();
339
		setStatusEnabled();
335
 
340
 
336
		
341
		
337
	}
342
	}
338
	
343
	
339
	
344
	
340
	/**
345
	/**
341
	 * Recherche nombre d'enregistrement pour l'utilisateur et la localite en cours
346
	 * Recherche nombre d'enregistrement pour l'utilisateur et la localite en cours
342
	 * 
347
	 * 
343
	 */
348
	 */
344
	
349
	
345
	public void updateCount	() {
350
	public void updateCount	() {
346
		
351
		
347
		setStatusDisabled();
352
		setStatusDisabled();
348
 
353
 
349
		
354
		
350
		// Transformation de la date selectionne vers date time stamp
355
		// Transformation de la date selectionne vers date time stamp
351
		
-
 
352
		String adate="all";
-
 
353
		if (date.compareTo("all")!=0) {
-
 
354
			adate=date.substring(6,10)+"-"+date.substring(3,5)+"-"+date.substring(0,2)+" 00:00:00";
-
 
355
		}
356
		
356
 
357
 
357
		HTTPRequest.asyncGet(serviceBaseUrl + "/InventoryItemList/" + user + "/" + URL.encodeComponent(location) + "/" + adate  + "/" + URL.encodeComponent(search) +  "/" + URL.encodeComponent(station), 
358
		HTTPRequest.asyncGet(serviceBaseUrl + "/InventoryItemList/" + user + "/" + id_location + "/" + URL.encodeComponent(location) + "/" + year  + "/"  + month  + "/"  + day  + "/" + URL.encodeComponent(search) +  "/" + URL.encodeComponent(lieudit), 
358
				new ResponseTextHandler() {
359
				new ResponseTextHandler() {
359
 
360
 
360
					public void onCompletion(String str) {
361
					public void onCompletion(String str) {
361
 
362
 
362
						JSONValue jsonValue = JSONParser.parse(str);
363
						JSONValue jsonValue = JSONParser.parse(str);
363
						JSONNumber jsonNumber;
364
						JSONNumber jsonNumber;
364
						if ((jsonNumber = jsonValue.isNumber()) != null) {
365
						if ((jsonNumber = jsonValue.isNumber()) != null) {
365
							count = (int) jsonNumber.getValue();
366
							count = (int) jsonNumber.getValue();
366
						//	if (location.compareTo("")==0) location="000null";
367
						//	if (location.compareTo("")==0) location="000null";
367
							gotoEnd(); // Derniere page
368
							gotoEnd(); // Derniere page
368
							update();
369
							update();
369
						}
370
						}
370
					}
371
					}
371
				});
372
				});
372
 
373
 
373
	}
374
	}
374
	
375
	
375
	/**
376
	/**
376
	 * Mise a jour de l'affichage, a partir des donnaes d'inventaire deja
377
	 * Mise a jour de l'affichage, a partir des donnaes d'inventaire deja
377
	 * saisies. La valeur de this.startIndex permet de determiner quelles
378
	 * saisies. La valeur de this.startIndex permet de determiner quelles
378
	 * donnaes seront affichees
379
	 * donnaes seront affichees
379
	 * 
380
	 * 
380
	 */
381
	 */
381
 
382
 
382
	public void update() {
383
	public void update() {
383
 
384
 
384
		
385
		
385
		
386
		
386
//   TODO : optimisation	 (ne pas supprimer mais remplacer)
387
//   TODO : optimisation	 (ne pas supprimer mais remplacer)
387
		
388
		
388
 
389
 
389
		
390
		
390
//      Ligne d'information 
391
//      Ligne d'information 
391
 
392
 
392
		// Toutes date par defaut
393
		// Toutes date par defaut
393
		
-
 
394
		String adate="all";
-
 
395
		if (date.compareTo("all")!=0) {
-
 
396
			adate=date.substring(6,10)+"-"+date.substring(3,5)+"-"+date.substring(0,2)+" 00:00:00";
-
 
397
		}
394
		
398
 
395
 
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
 
402
		new ResponseTextHandler() {
399
		new ResponseTextHandler() {
403
 
400
 
404
			public void onCompletion(String str) {
401
			public void onCompletion(String str) {
405
 
402
 
406
				JSONValue jsonValue = JSONParser.parse(str);
403
				JSONValue jsonValue = JSONParser.parse(str);
407
				JSONArray jsonArray;
404
				JSONArray jsonArray;
408
				JSONArray jsonArrayNested;
405
				JSONArray jsonArrayNested;
409
				
-
 
410
				int row=0;
406
				
411
				int i=0;
407
				int i=0;
412
 
408
 
413
				if ((jsonArray = jsonValue.isArray()) != null) {
409
				if ((jsonArray = jsonValue.isArray()) != null) {
414
					
410
					
415
					StringBuffer observationText=null;
411
					StringBuffer observationText=null;
416
 
412
 
417
					int arraySize = jsonArray.size();
413
					int arraySize = jsonArray.size();
418
					
414
					
419
					for (i = 0; i < arraySize; ++i) {
415
					for (i = 0; i < arraySize; ++i) {
420
						if ((jsonArrayNested = jsonArray.get(i).isArray()) != null) {
416
						if ((jsonArrayNested = jsonArray.get(i).isArray()) != null) {
421
							
417
							
422
 
418
 
423
							Object[] values = new Object[5];
419
							Object[] values = new Object[5];
424
							
420
							
425
							observationText=new StringBuffer();
421
							observationText=new StringBuffer();
426
													
422
													
427
							// Statut Observation transmise ?
423
							// Statut Observation transmise ?
428
							
424
							
429
							
425
							
430
							String atransmit=((JSONString) jsonArrayNested .get(11)).stringValue();
426
							String atransmit=((JSONString) jsonArrayNested .get(12)).stringValue();
431
							
427
							
432
							if (atransmit.compareTo("1")==0) {
428
							if (atransmit.compareTo("1")==0) {
433
								values[0] = new Image("tela.gif");
429
								values[0] = new Image("tela.gif");
434
							}
430
							}
435
							else {
431
							else {
436
								values[0] = new HTML("&nbsp;");
432
								values[0] = new HTML("&nbsp;");
437
							}
433
							}
438
							
434
							
439
						
435
						
440
							// Nom saisi
436
							// Nom saisi
441
							
437
							
442
							values[1] = new HTML("<b>"+Util.toCelString(((JSONString) jsonArrayNested .get(0)).toString())+"</b>");
438
							values[1] = new HTML("<b>"+Util.toCelString(((JSONString) jsonArrayNested .get(0)).toString())+"</b>");
443
							
439
							
444
							
440
							
445
							
441
							
446
						    // Texte decrivant l'observation
442
						    // Texte decrivant l'observation
447
							
443
							
448
							// Nom retenu
444
							// Nom retenu
449
							String aname=Util.toCelString(((JSONString) jsonArrayNested .get(2)).toString());
445
							String aname=Util.toCelString(((JSONString) jsonArrayNested .get(2)).toString());
450
							
446
							
451
							if (aname.compareTo("null")==0) {
447
							if (aname.compareTo("null")==0) {
452
							}
448
							}
453
							else {
449
							else {
454
								observationText.append(aname+", ");
450
								observationText.append(aname+", ");
455
							}
451
							}
456
							
452
							
457
							// Num nomenclatural
453
							// Num nomenclatural
458
							String ann=((JSONString) jsonArrayNested .get(3)).stringValue();
454
							String ann=((JSONString) jsonArrayNested .get(3)).stringValue();
459
							
455
							
460
							if (ann.compareTo("0")!=0) {
456
							if (ann.compareTo("0")!=0) {
461
								observationText.append(""+ann+"-");
457
								observationText.append(""+ann+"-");
462
							}
458
							}
463
							else {
459
							else {
464
								observationText.append("0-");
460
								observationText.append("0-");
465
							}
461
							}
466
 
462
 
467
							
463
							
468
							// Num Taxonomique
464
							// Num Taxonomique
469
							
465
							
470
							String ant=((JSONString) jsonArrayNested .get(4)).stringValue();
466
							String ant=((JSONString) jsonArrayNested .get(4)).stringValue();
471
							
467
							
472
							if (ant.compareTo("0")!=0) {
468
							if (ant.compareTo("0")!=0) {
473
								observationText.append(ant+", ");
469
								observationText.append(ant+", ");
474
							}
470
							}
475
							else {
471
							else {
476
								observationText.append("0, ");
472
								observationText.append("0, ");
477
							}
473
							}
478
 
474
 
479
							// Famille
475
							// Famille
480
							String afamily=Util.toCelString(((JSONString) jsonArrayNested .get(5)).toString());
476
							String afamily=Util.toCelString(((JSONString) jsonArrayNested .get(5)).toString());
481
							
477
							
482
							if (afamily.compareTo("null")==0) {
478
							if (afamily.compareTo("null")==0) {
483
								//
479
								//
484
							}
480
							}
485
							else {
481
							else {
486
								observationText.append(afamily+", ");
482
								observationText.append(afamily+", ");
487
							}
483
							}
488
 
484
 
489
							
485
							
490
							String aloc=Util.toCelString(((JSONString) jsonArrayNested .get(6)).toString());
486
							String aloc=Util.toCelString(((JSONString) jsonArrayNested .get(6)).toString());
491
//								Localisation - Lieu
487
//								Localisation - Lieu
492
								
488
								
493
								if (aloc.compareTo("000null")==0) {
489
								if (aloc.compareTo("000null")==0) {
494
									if (observationText.length()==0) {
490
									if (observationText.length()==0) {
495
										observationText.append("Commune absente");
491
										observationText.append("Commune absente");
496
									}
492
									}
497
									else {
493
									else {
498
										observationText.append("commune absente");
494
										observationText.append("commune absente");
499
									}
495
									}
500
								}
496
								}
501
								else {
497
								else {
502
									if (observationText.length()==0) {
498
									if (observationText.length()==0) {
503
										observationText.append("Commune de "+aloc);
499
										observationText.append("Commune de "+aloc);
504
									}
500
									}
505
									else {
501
									else {
506
										observationText.append("commune de "+aloc);
502
										observationText.append("commune de "+aloc);
507
									}
503
									}
508
										
504
										
509
								}
505
								}
510
							
506
							
511
								
507
								
512
								String alieudit=Util.toCelString(((JSONString) jsonArrayNested .get(9)).toString());
508
								String alieudit=Util.toCelString(((JSONString) jsonArrayNested .get(9)).toString());
513
							
509
							
514
//								Localisation - Lieu dit
510
//								Localisation - Lieu dit
515
								
511
								
516
								if (alieudit.compareTo("000null")!=0) {
512
								if (alieudit.compareTo("000null")!=0) {
517
									observationText.append(", "+alieudit);
513
									observationText.append(", "+alieudit);
518
								}
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
								}
-
 
525
 
519
							
526
							
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
								
523
								if (acomment.compareTo("null")!=0) {
530
								if (acomment.compareTo("null")!=0) {
524
									observationText.append(", "+acomment);
531
									observationText.append(", "+acomment);
525
								}
532
								}
526
 
533
 
527
								
534
								
528
								String adate=((JSONString) jsonArrayNested .get(8)).stringValue();
535
								String adate=((JSONString) jsonArrayNested .get(8)).stringValue();
529
								
536
								
530
//								Date 
537
//								Date 
531
								if (adate.compareTo("0000-00-00 00:00:00")!=0) {
538
								if (adate.compareTo("0000-00-00 00:00:00")!=0) {
532
									values[3]=new HTML("<b>"+adate+"</b>"); 
539
									values[3]=new HTML("<b>"+adate+"</b>"); 
533
								}
540
								}
534
								else { 
541
								else { 
535
									values[3] = new HTML("&nbsp;");
542
									values[3] = new HTML("&nbsp;");
536
								}
543
								}
537
									
544
									
538
 
545
 
539
 
546
 
540
							values[2] = observationText;
547
							values[2] = observationText;
541
							
548
							
542
							String aordre=((JSONString) jsonArrayNested.get(7)).stringValue();
549
							String aordre=((JSONString) jsonArrayNested.get(7)).stringValue();
543
						
550
						
544
							// Numero d'ordre (cache)
551
							// Numero d'ordre (cache)
545
							
552
							
546
							values[4] = aordre;
553
							values[4] = aordre;
547
							
554
							
548
							
555
							
549
						
556
						
550
							
557
							
551
					    	if (i>=table.getItemCount()) {
558
					    	if (i>=table.getItemCount()) {
552
					    		TableItem item = new TableItem(values);
559
					    		TableItem item = new TableItem(values);
553
					    		table.add(item);
560
					    		table.add(item);
554
							}
561
							}
555
							else {
562
							else {
556
								TableItem item=table.getItem(i);
563
								TableItem item=table.getItem(i);
557
								item.setValue(0,values[0]);
564
								item.setValue(0,values[0]);
558
								item.setValue(1,values[1]);
565
								item.setValue(1,values[1]);
559
								item.setValue(2,values[2]);
566
								item.setValue(2,values[2]);
560
								item.setValue(3,values[3]);
567
								item.setValue(3,values[3]);
561
								item.setValue(4,values[4]);
568
								item.setValue(4,values[4]);
562
							}
569
							}
563
					    	
570
					    	
564
					    	// Spagetti
571
					    	// Spagetti
565
							if (ordre!=null) {
572
							if (ordre!=null) {
566
								if (aordre.compareTo(ordre)==0) {
573
								if (aordre.compareTo(ordre)==0) {
567
									table.select(i);
574
									table.select(i);
568
								}
575
								}
569
								else {
576
								else {
570
									table.deselect(i);
577
									table.deselect(i);
571
								}
578
								}
572
							}
579
							}
573
							
580
							
574
						}
581
						}
575
 
582
 
576
					}
583
					}
577
				}
584
				}
578
 
585
 
579
				// Suppression fin ancien affichage
586
				// Suppression fin ancien affichage
580
				if (i<table.getItemCount()) {
587
				if (i<table.getItemCount()) {
581
					 for (int j = table.getItemCount() -1 ; j >= i; j--) {
588
					 for (int j = table.getItemCount() -1 ; j >= i; j--) {
582
						 TableItem item=table.getItem(j);
589
						 TableItem item=table.getItem(j);
583
						 table.remove(item);
590
						 table.remove(item);
584
					 }
591
					 }
585
				}
592
				}
586
				
593
				
587
				setStatusEnabled();
594
				setStatusEnabled();
588
				
595
				
589
				
596
				
590
			}
597
			}
591
		});
598
		});
592
		
599
		
593
 
600
 
594
	}
601
	}
595
 
602
 
596
 
603
 
597
	/**
604
	/**
598
	 * Affichage message d'attente et desactivation navigation
605
	 * Affichage message d'attente et desactivation navigation
599
	 * 
606
	 * 
600
	 * @param
607
	 * @param
601
	 * @return void
608
	 * @return void
602
	 */
609
	 */
603
 
610
 
604
	private void setStatusDisabled() {
611
	private void setStatusDisabled() {
605
 
612
 
606
		navBar.gotoFirst.setEnabled(false);
613
		navBar.gotoFirst.setEnabled(false);
607
		navBar.gotoPrev.setEnabled(false);
614
		navBar.gotoPrev.setEnabled(false);
608
		navBar.gotoNext.setEnabled(false);
615
		navBar.gotoNext.setEnabled(false);
609
		navBar.gotoEnd.setEnabled(false);
616
		navBar.gotoEnd.setEnabled(false);
610
 
617
 
611
		navBar.status.setText("Patientez ...");
618
		navBar.status.setText("Patientez ...");
612
	}
619
	}
613
 
620
 
614
	/**
621
	/**
615
	 * Affichage numero de page et gestion de la navigation
622
	 * Affichage numero de page et gestion de la navigation
616
	 * 
623
	 * 
617
	 */
624
	 */
618
 
625
 
619
	private void setStatusEnabled() {
626
	private void setStatusEnabled() {
620
 
627
 
621
		// Il y a forcemment un disabled avant d'arriver ici
628
		// Il y a forcemment un disabled avant d'arriver ici
622
 
629
 
623
		if (count > 0) {
630
		if (count > 0) {
624
 
631
 
625
			if (startIndex >= VISIBLE_TAXON_COUNT) { // Au dela de la
632
			if (startIndex >= VISIBLE_TAXON_COUNT) { // Au dela de la
626
														// premiere page
633
														// premiere page
627
				navBar.gotoPrev.setEnabled(true);
634
				navBar.gotoPrev.setEnabled(true);
628
				navBar.gotoFirst.setEnabled(true);
635
				navBar.gotoFirst.setEnabled(true);
629
				if (startIndex < (count - VISIBLE_TAXON_COUNT)) { // Pas la
636
				if (startIndex < (count - VISIBLE_TAXON_COUNT)) { // Pas la
630
																	// derniere
637
																	// derniere
631
																	// page
638
																	// page
632
					navBar.gotoNext.setEnabled(true);
639
					navBar.gotoNext.setEnabled(true);
633
					navBar.gotoEnd.setEnabled(true);
640
					navBar.gotoEnd.setEnabled(true);
634
					navBar.status.setText((startIndex + 1) + " - "
641
					navBar.status.setText((startIndex + 1) + " - "
635
							+ (startIndex + VISIBLE_TAXON_COUNT) + " sur " + count );
642
							+ (startIndex + VISIBLE_TAXON_COUNT) + " sur " + count );
636
				} else { // Derniere page
643
				} else { // Derniere page
637
					navBar.status.setText((startIndex + 1) + " - " + count + " sur " + count );
644
					navBar.status.setText((startIndex + 1) + " - " + count + " sur " + count );
638
				}
645
				}
639
			} else { // Premiere page
646
			} else { // Premiere page
640
				if (count > VISIBLE_TAXON_COUNT) { // Des pages derrieres
647
				if (count > VISIBLE_TAXON_COUNT) { // Des pages derrieres
641
					navBar.gotoNext.setEnabled(true);
648
					navBar.gotoNext.setEnabled(true);
642
					navBar.gotoEnd.setEnabled(true);
649
					navBar.gotoEnd.setEnabled(true);
643
					navBar.status.setText((startIndex + 1) + " - "
650
					navBar.status.setText((startIndex + 1) + " - "
644
							+ (startIndex + VISIBLE_TAXON_COUNT) + " sur " + count);
651
							+ (startIndex + VISIBLE_TAXON_COUNT) + " sur " + count);
645
				} else {
652
				} else {
646
					navBar.status.setText((startIndex + 1) + " - " + count + " sur " + count);
653
					navBar.status.setText((startIndex + 1) + " - " + count + " sur " + count);
647
				}
654
				}
648
			}
655
			}
649
		}
656
		}
650
 
657
 
651
		else { // Pas d'inventaire, pas de navigation
658
		else { // Pas d'inventaire, pas de navigation
652
			navBar.status.setText("0 - 0 sur 0");
659
			navBar.status.setText("0 - 0 sur 0");
653
		}
660
		}
654
	}
661
	}
655
 
662
 
656
	/*
663
	/*
657
	 * Positionnement index de parcours (this.startIndex) pour affichage de la
664
	 * Positionnement index de parcours (this.startIndex) pour affichage de la
658
	 * derniere page
665
	 * derniere page
659
	 * 
666
	 * 
660
	 * @param
667
	 * @param
661
	 * @return void
668
	 * @return void
662
	 */
669
	 */
663
 
670
 
664
	private void gotoEnd() {
671
	private void gotoEnd() {
665
 
672
 
666
		if ((count == 0) || (count % VISIBLE_TAXON_COUNT) > 0) {
673
		if ((count == 0) || (count % VISIBLE_TAXON_COUNT) > 0) {
667
			startIndex = count - (count % VISIBLE_TAXON_COUNT);
674
			startIndex = count - (count % VISIBLE_TAXON_COUNT);
668
		} else {
675
		} else {
669
			startIndex = count - VISIBLE_TAXON_COUNT;
676
			startIndex = count - VISIBLE_TAXON_COUNT;
670
		}
677
		}
671
 
678
 
672
	}
679
	}
673
 
680
 
674
	/*
681
	/*
675
	 * Recherche en cours
682
	 * Recherche en cours
676
	 * 
683
	 * 
677
	 */
684
	 */
678
	
685
	
679
	public void setSearch(String search) {
686
	public void setSearch(String search) {
680
		this.search = search;
687
		this.search = search;
681
	}
688
	}
-
 
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 
686
	 * 
705
	 * 
687
	 */
706
	 */
688
	
707
	
689
	public void setLocation(String location) {
708
	public void setLocation(String location) {
690
		this.location = location;
709
		this.location = location;
691
	}
710
	}
692
 
711
 
693
 
712
 
694
	
713
	
695
	/*
714
	/*
696
	 * Station en cours 
715
	 * Station en cours 
697
	 * 
716
	 * 
698
	 */
717
	 */
699
 
718
 
700
	public void setStation(String station) {
719
	public void setLieudit(String lieudit) {
701
		this.station = station;
720
		this.lieudit = lieudit;
702
	}
721
	}
703
 
722
 
704
	
723
	
705
	
724
	
706
	/*
725
	/*
707
	 * Date en cours 
726
	 * Date en cours 
708
	 * 
727
	 * 
709
	 */
728
	 */
710
	
729
	
-
 
730
 
-
 
731
	public void setYear(String year) {
-
 
732
		this.year = year;
-
 
733
	}
-
 
734
 
-
 
735
 
-
 
736
	public void setMonth(String month) {
-
 
737
		this.month = month;
-
 
738
	}
711
 
739
 
712
	public void setDate(String date) {
740
	public void setDay(String day) {
713
		this.date = date;
741
		this.day = day;
714
	}
742
	}
715
 
743
 
716
	
744
	
717
	/*
745
	/*
718
	 * Utilisateur en cours 
746
	 * Utilisateur en cours 
719
	 * 
747
	 * 
720
	 */
748
	 */
721
	
749
	
722
 
750
 
723
	
751
	
724
	public void setUser(String user) {
752
	public void setUser(String user) {
725
		this.user = user;
753
		this.user = user;
726
	}
754
	}
727
 
755
 
728
 
756
 
729
	public void displayFilter() {
757
	public void displayFilter() {
730
		
758
		
731
		
759
		
732
	
760
	
733
	// Mise a jour boutton export feuille de calcul
761
	// Mise a jour boutton export feuille de calcul
734
	
762
	
735
	mediator.getActionView().getExportButton().setHTML("<a href=\""+mediator.getServiceBaseUrl()+"/InventoryExport/" 
763
	mediator.getActionView().getExportButton().setHTML("<a href=\""+mediator.getServiceBaseUrl()+"/InventoryExport/" 
736
			+  user + "/"
764
			+  user + "/"
-
 
765
			+ URL.encodeComponent(id_location) + "/"
737
			+ URL.encodeComponent(location) + "/"
766
			+ URL.encodeComponent(location) + "/"
738
			+ URL.encodeComponent(station)+ "/"
767
			+ URL.encodeComponent(lieudit)+ "/"
-
 
768
			+ year + "/"
739
			+ URL.encodeComponent(search) + "/"
769
			+ month  + "/"
740
			+ date + 
770
			+ day 
741
			"\">"+"Export&nbsp;tableur</a>");
771
			+ "\">"+"Export&nbsp;tableur</a>");
-
 
772
 
742
 
773
	
743
	// Mise a jour ligne de selection 
774
	// Mise a jour ligne de selection 
744
	
775
	
745
	
776
	
746
	
777
	
747
	String com;
778
	String dep;
748
	if (location.compareTo("all")==0) {
779
	if (id_location.compareTo("all")==0) {
749
		com="Toutes communes";
780
		dep="Tous d&eacute;partements";
750
	}
781
	}
751
	else {
782
	else {
752
		if (location.compareTo("000null")==0) {
783
		if (id_location.compareTo("000null")==0) {
753
			com="Communes non renseign&eacute;es";
784
			dep="D&eacute;partements non renseign&eacute;es ";
754
		}
785
		}
755
		else {
786
		else {
756
		com="Commune de "+location;
787
		dep="Département "+id_location;
757
		}
788
		}
758
	}
-
 
759
 
-
 
-
 
789
	}
-
 
790
	
760
	
791
	
761
	String dat;
792
	
762
	
793
	String com;
763
	if (date.compareTo("all")==0) {
794
	if (location.compareTo("all")==0) {
764
		dat=", toutes p&eacute;riodes";
795
		com=", toutes communes";
765
	}
796
	}
766
	else {
797
	else {
767
		if (date.compareTo("00/00/0000")==0) {
798
		if (location.compareTo("000null")==0) {
768
			dat=", p&eacute;riodes non renseign&eacute;es";
799
			com=", communes non renseign&eacute;es";
769
		}
800
		}
770
		else {
801
		else {
771
			dat=", le "+ date;
802
		com=", commune de "+location;
772
		}
803
		}
773
	}
804
	}
774
 
805
 
775
	
-
 
-
 
806
	
-
 
807
	
776
	String stat;
808
	String lieu;
777
	
809
	
778
	if (station.compareTo("all")==0) {
810
	if (lieudit.compareTo("all")==0) {
779
		stat=", toutes stations";
811
		lieu=", tous lieux dits";
780
	}
812
	}
781
	else {
813
	else {
782
		if (station.compareTo("000null")==0) {
814
		if (lieudit.compareTo("000null")==0) {
783
			stat=", stations non renseign&eacute;es";
815
			lieu=", lieu-dit non renseign&eacute;es";
784
		}
816
		}
785
		else {
817
		else {
786
			stat=", station "+ station;
818
			lieu=", lieu-dit "+ lieudit;
-
 
819
		}
-
 
820
	}
-
 
821
	
-
 
822
	String dat;
-
 
823
	
-
 
824
	if ((year.compareTo("all")==0) && (month.compareTo("all")==0) && (day.compareTo("all")==0)) {
-
 
825
		dat=", toutes periodes";
-
 
826
	}
-
 
827
	
-
 
828
	else {
-
 
829
	
-
 
830
    	String yea="";
-
 
831
       	String da="";
-
 
832
       	String mont="";
-
 
833
       	
-
 
834
    	if (year.compareTo("all")==0) {
-
 
835
    		yea=", toutes ann&eacute;es";
-
 
836
    	}
-
 
837
    	else {
-
 
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
            
-
 
852
            	if (day.compareTo("all")==0) {
-
 
853
            		da=", tous jours";
-
 
854
            	}
-
 
855
            	else {
-
 
856
            			da="/"+ day;
-
 
857
            	}
-
 
858
    		}
-
 
859
    	}
-
 
860
            	
-
 
861
        dat=yea + mont + da;
787
		}
862
    	
788
	}
863
	}
789
 
864
 
790
	
865
	
791
	panel.getHeader().setText(com +  dat + stat );
866
	panel.getHeader().setText(dep + com + lieu + dat);
792
 
867
 
793
 
868
 
794
	
869
	
795
}
870
}
796
 
871
 
797
 
872
 
798
}
873
}
799
 
874
 
800
/* +--Fin du code ---------------------------------------------------------------------------------------+
875
/* +--Fin du code ---------------------------------------------------------------------------------------+
801
* $Log$
876
* $Log$
-
 
877
* Revision 1.1  2008-01-02 21:26:04  ddelon
-
 
878
* mise en place mygwt
-
 
879
*
802
* Revision 1.8  2007-12-22 14:48:53  ddelon
880
* Revision 1.8  2007-12-22 14:48:53  ddelon
803
* Documentation et refactorisation
881
* Documentation et refactorisation
804
*
882
*
805
* Revision 1.7  2007-09-17 19:25:34  ddelon
883
* Revision 1.7  2007-09-17 19:25:34  ddelon
806
* Documentation
884
* Documentation
807
*
885
*
808
*/
886
*/