30,7 → 30,6 |
import com.google.gwt.user.client.ui.Grid; |
import com.google.gwt.user.client.ui.HTML; |
import com.google.gwt.user.client.ui.HorizontalPanel; |
import com.google.gwt.user.client.ui.Image; |
import com.google.gwt.user.client.ui.SourcesTableEvents; |
import com.google.gwt.user.client.ui.TableListener; |
import com.google.gwt.user.client.ui.VerticalPanel; |
159,7 → 158,6 |
private String location = "all"; |
private String date = "all"; |
private String search = "all"; |
private String station = "all"; |
|
private boolean add=false; |
|
215,7 → 213,7 |
if (table.getWidget(row, 0)!=null) { |
selectRow(row); |
// Numero d'ordre |
mediator.onInventoryItemSelected(table.getText(row, 5)); |
mediator.onInventoryItemSelected(table.getText(row, 4)); |
} |
} |
|
427,7 → 425,6 |
location="000null"; |
} |
add=true; |
mediator.onInventoryUpdated(location); |
updateCount(); |
} |
}); |
457,8 → 454,8 |
String num_nom_ret, String num_taxon, String famille,final String loc, String id_location,String dat, String complementLocation, String comment) { |
|
|
HTTPRequest.asyncPost(serviceBaseUrl + "/Inventory/" + user + "/" +ordre + "/", |
"&nom_sel=" + nom_sel + "&num_nom_sel=" + num_nom_sel |
HTTPRequest.asyncPost(serviceBaseUrl + "/Inventory/" +ordre + "/", "identifiant=" |
+ user + "&nom_sel=" + nom_sel + "&num_nom_sel=" + num_nom_sel |
+ "&nom_ret=" + nom_ret + "&num_nom_ret=" + num_nom_ret |
+ "&num_taxon=" + num_taxon + "&famille=" + famille + "&location=" + loc + "&id_location=" + id_location + "&date_observation=" + dat |
+ "&station="+ complementLocation + "&commentaire="+ comment, |
467,58 → 464,12 |
|
public void onCompletion(String str) { |
add=false; |
mediator.onInventoryUpdated(location); |
update(); |
} |
}); |
} |
|
/** |
* Transmission de releve à Tela |
* |
*/ |
|
|
|
public void transmitElement() { |
|
setStatusDisabled(); |
Vector parseChecked = new Vector(); |
|
// TODO : optimiser |
// Lifo ... |
for (int i = table.getRowCount() - 1; i >= 0; i--) { |
if (table.getWidget(i, 0)!=null) { |
if (((CheckBox) table.getWidget(i, 0)).isChecked()) { |
// Numero ordre |
parseChecked.add(table.getText(i, 5)); |
} |
} |
} |
StringBuffer ids=new StringBuffer(); |
for (Iterator it = parseChecked.iterator(); it.hasNext();) { |
ids.append((String)it.next()); |
if (it.hasNext()) ids.append(","); |
} |
|
if (ids.length()>0) { |
|
HTTPRequest.asyncPost(serviceBaseUrl + "/InventoryTransmit/" + user |
+ "/" + ids.toString(), "transmission=1", |
|
new ResponseTextHandler() { |
public void onCompletion(String str) { |
update(); |
} |
}); |
} |
|
setStatusEnabled(); |
|
|
} |
|
|
/** |
* Suppression d'un element lde l'inventaire, a partir de son numero d'ordre |
* |
527,6 → 478,7 |
public void deleteElement() { |
|
setStatusDisabled(); |
boolean checked = false; |
Vector parseChecked = new Vector(); |
|
// TODO : optimiser |
534,8 → 486,9 |
for (int i = table.getRowCount() - 1; i >= 0; i--) { |
if (table.getWidget(i, 0)!=null) { |
if (((CheckBox) table.getWidget(i, 0)).isChecked()) { |
checked = true; |
// Numero ordre |
parseChecked.add(table.getText(i, 5)); |
parseChecked.add(table.getText(i, 4)); |
count--; |
} |
} |
545,20 → 498,18 |
ids.append((String)it.next()); |
if (it.hasNext()) ids.append(","); |
} |
if (ids.length()>0) { |
|
HTTPRequest.asyncPost(serviceBaseUrl + "/Inventory/" + user |
+ "/" + ids.toString(), "action=DELETE", |
|
new ResponseTextHandler() { |
public void onCompletion(String str) { |
mediator.onInventoryUpdated("all"); |
updateCount(); |
} |
}); |
HTTPRequest.asyncPost(serviceBaseUrl + "/Inventory/" + user |
+ "/" + ids.toString(), "action=DELETE", |
|
new ResponseTextHandler() { |
public void onCompletion(String str) { |
updateCount(); |
} |
}); |
|
if (!checked) { |
setStatusEnabled(); |
} |
|
setStatusEnabled(); |
} |
|
/** |
599,7 → 550,7 |
adate=date.substring(6,10)+"-"+date.substring(3,5)+"-"+date.substring(0,2)+" 00:00:00"; |
} |
|
HTTPRequest.asyncGet(serviceBaseUrl + "/InventoryItemList/" + user + "/" + location + "/" + adate + "/" + search + "/" + station, |
HTTPRequest.asyncGet(serviceBaseUrl + "/InventoryItemList/" + user + "/" + location + "/" + adate + "/" + search, |
new ResponseTextHandler() { |
|
public void onCompletion(String str) { |
615,7 → 566,7 |
*/ |
if (location.compareTo("")==0) |
location="000null"; |
// mediator.onInventoryItemUpdate(location); |
mediator.onInventoryItemUpdate(location); |
gotoEnd(); // Derniere page |
update(); |
} |
655,7 → 606,7 |
} |
else { |
if (location.compareTo("000null")==0) { |
com="Communes non renseignées"; |
com="Communes non précisées"; |
} |
else { |
com="Commune de "+location; |
666,36 → 617,20 |
String dat; |
|
if (date.compareTo("all")==0) { |
dat=", toutes périodes"; |
dat=", toute période"; |
} |
else { |
if (date.compareTo("00/00/0000")==0) { |
dat=", périodes non renseignées"; |
dat=", période non précisé"; |
} |
else { |
dat=", le "+ date; |
} |
} |
|
|
String stat; |
header.setHTML(0, 0, com + dat ); |
|
if (station.compareTo("all")==0) { |
stat=", toutes stations"; |
} |
else { |
if (station.compareTo("000null")==0) { |
stat=", stations non renseignées"; |
} |
else { |
stat=", station "+ station; |
} |
} |
|
|
header.setHTML(0, 0, com + dat + stat ); |
|
HTTPRequest.asyncGet(serviceBaseUrl + "/InventoryItemList/" + user + "/" + location +"/" + adate + "/" + search + "/" + station + "/" |
HTTPRequest.asyncGet(serviceBaseUrl + "/InventoryItemList/" + user + "/" + location +"/" + adate + "/" + search + "/" + |
+ startIndex + "/" + VISIBLE_TAXON_COUNT, |
|
new ResponseTextHandler() { |
709,8 → 644,6 |
StringBuffer left=new StringBuffer(); |
StringBuffer center=new StringBuffer(); |
StringBuffer right=new StringBuffer(); |
|
|
|
|
int row=0; |
732,20 → 665,8 |
|
// Case a cocher |
table.setWidget(row, 0, new CheckBox()); |
|
|
// Observation transmise |
|
|
String atransmit=((JSONString) jsonArrayNested .get(11)).stringValue(); |
|
if (atransmit.compareTo("1")==0) { |
table.setWidget(row,1,new Image("tela.gif")); |
} |
else { |
table.setWidget(row,1,new HTML(" ")); |
} |
|
// Nom saisi |
|
left.append("<b>"+((JSONString) jsonArrayNested .get(0)).stringValue()+"</b>"); |
|
// Nom retenu |
816,7 → 737,7 |
|
// Localisation - Lieu dit |
|
if (alieudit.compareTo("000null")!=0) { |
if (alieudit.compareTo("null")!=0) { |
center.append(", "+alieudit); |
} |
|
826,8 → 747,11 |
if (acomment.compareTo("null")!=0) { |
center.append(", "+acomment); |
} |
|
|
|
|
|
String adate=((JSONString) jsonArrayNested .get(8)).stringValue(); |
|
// Date |
839,28 → 763,28 |
} |
|
|
table.setHTML(row, 2, subLeft(" "+left,40)); |
table.setHTML(row, 3, subLeft(" "+center,120)); |
table.setHTML(row, 4, subLeft(" "+right,25)); |
|
|
|
|
table.setHTML(row, 1, subLeft(" "+left,40)); |
table.setHTML(row, 2, subLeft(" "+center,120)); |
table.setHTML(row, 3, subLeft(" "+right,25)); |
|
table.getRowFormatter().removeStyleName(row, "inventoryItem-SelectedRow"); |
|
|
table.getCellFormatter().setWidth(row,0,"2%"); |
table.getCellFormatter().setWidth(row,1,"2%"); |
table.getCellFormatter().setWordWrap(row,1,false); |
table.getCellFormatter().setWidth(row,1,"10%"); |
table.getCellFormatter().setWordWrap(row,2,false); |
table.getCellFormatter().setWidth(row,2,"10%"); |
table.getCellFormatter().setWordWrap(row,3,false); |
table.getCellFormatter().setWordWrap(row,4,false); |
table.getCellFormatter().setWidth(row,4,"7%"); |
table.getCellFormatter().setWidth(row,3,"7%"); |
|
|
String aordre=((JSONString) jsonArrayNested.get(7)).stringValue(); |
|
// Numero d'ordre (caché) |
|
|
table.setText(row, 5, aordre); |
table.setText(row, 4, aordre); |
|
if (add){ |
if (i ==(arraySize -1)) { |
875,7 → 799,7 |
} |
} |
|
table.getCellFormatter().setVisible(row, 5, false); |
table.getCellFormatter().setVisible(row, 4, false); |
|
|
} |
891,8 → 815,7 |
table.setHTML(j,2," "); |
table.setHTML(j,3," "); |
table.setHTML(j,4," "); |
table.setHTML(j,5," "); |
table.getCellFormatter().setVisible(j, 5, false); |
table.getCellFormatter().setVisible(j, 4, false); |
table.getRowFormatter().removeStyleName(j, "inventoryItem-SelectedRow"); |
} |
|
1010,18 → 933,7 |
public void setDate(String date) { |
this.date = date; |
} |
|
|
public void setUser(String user) { |
this.user = user; |
} |
|
|
public void setStation(String station) { |
this.station = station; |
} |
|
|
|
|
|