164,10 → 164,13 |
|
// Filtre par defaut : |
|
private String id_location = "all"; |
private String location = "all"; |
private String date = "all"; |
private String year = "all"; |
private String month = "all"; |
private String day = "all"; |
private String search = "all"; |
private String station = "all"; |
private String lieudit = "all"; |
private String ordre= null; |
|
|
192,7 → 195,7 |
|
navBar = new NavBar(); |
panel.getHeader().addWidget(navBar); |
|
|
|
// Contenu : |
|
235,23 → 238,25 |
|
|
|
// Selection d'une ligne |
table.addListener(Events.RowClick, new Listener() { |
|
public void handleEvent(BaseEvent be) { |
TableItem item=(TableItem) be.item; |
if (item!=null) { |
if (ordre==null) { |
if (ordre==null) { // Affichage de la ligne selectionne |
ordre= (String) item.getValue(4); |
mediator.onInventoryItemSelected(ordre); |
} |
else { |
if (ordre.compareTo((String) item.getValue(4))==0) { |
else { |
// Si une ligne etait deja selectionne |
if (ordre.compareTo((String) item.getValue(4))==0) { // C'est la meme, on la deselectionne |
ordre=null; |
table.deselect(be.rowIndex); |
mediator.onInventoryItemUnselected(); |
} |
else { |
ordre= (String) item.getValue(4); |
ordre= (String) item.getValue(4); // C'est une autre, on la selectionne |
mediator.onInventoryItemSelected(ordre); |
} |
|
290,7 → 295,7 |
|
new ResponseTextHandler() { |
public void onCompletion(String str) { |
mediator.onInventoryUpdated(location); |
mediator.onInventoryUpdated(id_location,"all","all"); |
} |
}); |
} |
349,12 → 354,8 |
|
// Transformation de la date selectionne vers date time stamp |
|
String adate="all"; |
if (date.compareTo("all")!=0) { |
adate=date.substring(6,10)+"-"+date.substring(3,5)+"-"+date.substring(0,2)+" 00:00:00"; |
} |
|
HTTPRequest.asyncGet(serviceBaseUrl + "/InventoryItemList/" + user + "/" + URL.encodeComponent(location) + "/" + adate + "/" + URL.encodeComponent(search) + "/" + URL.encodeComponent(station), |
HTTPRequest.asyncGet(serviceBaseUrl + "/InventoryItemList/" + user + "/" + id_location + "/" + URL.encodeComponent(location) + "/" + year + "/" + month + "/" + day + "/" + URL.encodeComponent(search) + "/" + URL.encodeComponent(lieudit), |
new ResponseTextHandler() { |
|
public void onCompletion(String str) { |
391,12 → 392,8 |
|
// Toutes date par defaut |
|
String adate="all"; |
if (date.compareTo("all")!=0) { |
adate=date.substring(6,10)+"-"+date.substring(3,5)+"-"+date.substring(0,2)+" 00:00:00"; |
} |
|
HTTPRequest.asyncGet(serviceBaseUrl + "/InventoryItemList/" + user + "/" + URL.encodeComponent(location) +"/" + adate + "/" + URL.encodeComponent(search) + "/" + URL.encodeComponent(station) + "/" |
HTTPRequest.asyncGet(serviceBaseUrl + "/InventoryItemList/" + user + "/" + id_location + "/" + URL.encodeComponent(location) +"/" + year + "/" + month + "/" + day + "/" + URL.encodeComponent(search) + "/" + URL.encodeComponent(lieudit) + "/" |
+ startIndex + "/" + VISIBLE_TAXON_COUNT, |
|
new ResponseTextHandler() { |
407,7 → 404,6 |
JSONArray jsonArray; |
JSONArray jsonArrayNested; |
|
int row=0; |
int i=0; |
|
if ((jsonArray = jsonValue.isArray()) != null) { |
427,7 → 423,7 |
// Statut Observation transmise ? |
|
|
String atransmit=((JSONString) jsonArrayNested .get(11)).stringValue(); |
String atransmit=((JSONString) jsonArrayNested .get(12)).stringValue(); |
|
if (atransmit.compareTo("1")==0) { |
values[0] = new Image("tela.gif"); |
516,8 → 512,19 |
if (alieudit.compareTo("000null")!=0) { |
observationText.append(", "+alieudit); |
} |
|
|
// Station - |
|
String astation=Util.toCelString(((JSONString) jsonArrayNested .get(10)).toString()); |
|
|
if (astation.compareTo("000null")!=0) { |
observationText.append(", "+astation); |
} |
|
|
String acomment=Util.toCelString(((JSONString) jsonArrayNested .get(10)).toString()); |
String acomment=Util.toCelString(((JSONString) jsonArrayNested .get(11)).toString()); |
// Commentaire |
|
if (acomment.compareTo("null")!=0) { |
680,8 → 687,20 |
this.search = search; |
} |
|
|
|
/* |
* Departement en cours |
* |
*/ |
|
public void setIdLocation(String id_location) { |
this.id_location = id_location; |
} |
|
|
|
/* |
* Localite en cours |
* |
*/ |
697,8 → 716,8 |
* |
*/ |
|
public void setStation(String station) { |
this.station = station; |
public void setLieudit(String lieudit) { |
this.lieudit = lieudit; |
} |
|
|
709,10 → 728,19 |
*/ |
|
|
public void setDate(String date) { |
this.date = date; |
public void setYear(String year) { |
this.year = year; |
} |
|
|
public void setMonth(String month) { |
this.month = month; |
} |
|
public void setDay(String day) { |
this.day = day; |
} |
|
|
/* |
* Utilisateur en cours |
734,61 → 762,108 |
|
mediator.getActionView().getExportButton().setHTML("<a href=\""+mediator.getServiceBaseUrl()+"/InventoryExport/" |
+ user + "/" |
+ URL.encodeComponent(id_location) + "/" |
+ URL.encodeComponent(location) + "/" |
+ URL.encodeComponent(station)+ "/" |
+ URL.encodeComponent(search) + "/" |
+ date + |
"\">"+"Export tableur</a>"); |
+ URL.encodeComponent(lieudit)+ "/" |
+ year + "/" |
+ month + "/" |
+ day |
+ "\">"+"Export tableur</a>"); |
|
|
// Mise a jour ligne de selection |
|
|
|
String com; |
if (location.compareTo("all")==0) { |
com="Toutes communes"; |
String dep; |
if (id_location.compareTo("all")==0) { |
dep="Tous départements"; |
} |
else { |
if (location.compareTo("000null")==0) { |
com="Communes non renseignées"; |
if (id_location.compareTo("000null")==0) { |
dep="Départements non renseignées "; |
} |
else { |
com="Commune de "+location; |
dep="Département "+id_location; |
} |
} |
|
|
String dat; |
|
if (date.compareTo("all")==0) { |
dat=", toutes périodes"; |
|
String com; |
if (location.compareTo("all")==0) { |
com=", toutes communes"; |
} |
else { |
if (date.compareTo("00/00/0000")==0) { |
dat=", périodes non renseignées"; |
if (location.compareTo("000null")==0) { |
com=", communes non renseignées"; |
} |
else { |
dat=", le "+ date; |
com=", commune de "+location; |
} |
} |
|
|
String stat; |
|
if (station.compareTo("all")==0) { |
stat=", toutes stations"; |
String lieu; |
|
if (lieudit.compareTo("all")==0) { |
lieu=", tous lieux dits"; |
} |
else { |
if (station.compareTo("000null")==0) { |
stat=", stations non renseignées"; |
if (lieudit.compareTo("000null")==0) { |
lieu=", lieu-dit non renseignées"; |
} |
else { |
stat=", station "+ station; |
lieu=", lieu-dit "+ lieudit; |
} |
} |
|
String dat; |
|
if ((year.compareTo("all")==0) && (month.compareTo("all")==0) && (day.compareTo("all")==0)) { |
dat=", toutes periodes"; |
} |
|
else { |
|
String yea=""; |
String da=""; |
String mont=""; |
|
if (year.compareTo("all")==0) { |
yea=", toutes années"; |
} |
else { |
if (year.compareTo("0")==0) { |
yea=", periode non renseignée"; |
} |
else { |
yea=", "+ year; |
|
if (month.compareTo("all")==0) { |
mont=", tous mois"; |
} |
else { |
mont="/"+ month; |
} |
|
|
if (day.compareTo("all")==0) { |
da=", tous jours"; |
} |
else { |
da="/"+ day; |
} |
} |
} |
|
dat=yea + mont + da; |
|
} |
|
|
panel.getHeader().setText(com + dat + stat ); |
panel.getHeader().setText(dep + com + lieu + dat); |
|
|
|
799,6 → 874,9 |
|
/* +--Fin du code ---------------------------------------------------------------------------------------+ |
* $Log$ |
* Revision 1.1 2008-01-02 21:26:04 ddelon |
* mise en place mygwt |
* |
* Revision 1.8 2007-12-22 14:48:53 ddelon |
* Documentation et refactorisation |
* |