Subversion Repositories eFlore/Archives.cel-v1

Compare Revisions

Ignore whitespace Rev 13 → Rev 14

/trunk/src/org/tela_botanica/client/InventoryItemList.java
30,6 → 30,7
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;
158,6 → 159,7
private String location = "all";
private String date = "all";
private String search = "all";
private String station = "all";
 
private boolean add=false;
213,7 → 215,7
if (table.getWidget(row, 0)!=null) {
selectRow(row);
// Numero d'ordre
mediator.onInventoryItemSelected(table.getText(row, 4));
mediator.onInventoryItemSelected(table.getText(row, 5));
}
}
 
425,6 → 427,7
location="000null";
}
add=true;
mediator.onInventoryUpdated(location);
updateCount();
}
});
454,8 → 457,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/" +ordre + "/", "identifiant="
+ user + "&nom_sel=" + nom_sel + "&num_nom_sel=" + num_nom_sel
HTTPRequest.asyncPost(serviceBaseUrl + "/Inventory/" + user + "/" +ordre + "/",
"&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,
464,12 → 467,58
 
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
*
478,7 → 527,6
public void deleteElement() {
 
setStatusDisabled();
boolean checked = false;
Vector parseChecked = new Vector();
 
// TODO : optimiser
486,9 → 534,8
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, 4));
parseChecked.add(table.getText(i, 5));
count--;
}
}
498,18 → 545,20
ids.append((String)it.next());
if (it.hasNext()) ids.append(",");
}
HTTPRequest.asyncPost(serviceBaseUrl + "/Inventory/" + user
+ "/" + ids.toString(), "action=DELETE",
new ResponseTextHandler() {
public void onCompletion(String str) {
updateCount();
}
});
 
if (!checked) {
setStatusEnabled();
if (ids.length()>0) {
HTTPRequest.asyncPost(serviceBaseUrl + "/Inventory/" + user
+ "/" + ids.toString(), "action=DELETE",
new ResponseTextHandler() {
public void onCompletion(String str) {
mediator.onInventoryUpdated("all");
updateCount();
}
});
}
setStatusEnabled();
}
/**
550,7 → 599,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,
HTTPRequest.asyncGet(serviceBaseUrl + "/InventoryItemList/" + user + "/" + location + "/" + adate + "/" + search + "/" + station,
new ResponseTextHandler() {
 
public void onCompletion(String str) {
566,7 → 615,7
*/
if (location.compareTo("")==0)
location="000null";
mediator.onInventoryItemUpdate(location);
// mediator.onInventoryItemUpdate(location);
gotoEnd(); // Derniere page
update();
}
606,7 → 655,7
}
else {
if (location.compareTo("000null")==0) {
com="Communes non précisées";
com="Communes non renseignées";
}
else {
com="Commune de "+location;
617,20 → 666,36
String dat;
if (date.compareTo("all")==0) {
dat=", toute période";
dat=", toutes périodes";
}
else {
if (date.compareTo("00/00/0000")==0) {
dat=", période non précisé";
dat=", périodes non renseignées";
}
else {
dat=", le "+ date;
}
}
header.setHTML(0, 0, com + dat );
String stat;
HTTPRequest.asyncGet(serviceBaseUrl + "/InventoryItemList/" + user + "/" + location +"/" + adate + "/" + search + "/" +
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 + "/"
+ startIndex + "/" + VISIBLE_TAXON_COUNT,
 
new ResponseTextHandler() {
644,6 → 709,8
StringBuffer left=new StringBuffer();
StringBuffer center=new StringBuffer();
StringBuffer right=new StringBuffer();
 
int row=0;
665,8 → 732,20
// Case a cocher
table.setWidget(row, 0, new CheckBox());
// Nom saisi
 
// 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(" "));
}
left.append("<b>"+((JSONString) jsonArrayNested .get(0)).stringValue()+"</b>");
// Nom retenu
737,7 → 816,7
// Localisation - Lieu dit
if (alieudit.compareTo("null")!=0) {
if (alieudit.compareTo("000null")!=0) {
center.append(", "+alieudit);
}
747,11 → 826,8
if (acomment.compareTo("null")!=0) {
center.append(", "+acomment);
}
 
String adate=((JSONString) jsonArrayNested .get(8)).stringValue();
// Date
763,28 → 839,28
}
 
table.setHTML(row, 2, subLeft("&nbsp;"+left,40));
table.setHTML(row, 3, subLeft("&nbsp;"+center,120));
table.setHTML(row, 4, subLeft("&nbsp;"+right,25));
table.setHTML(row, 1, subLeft("&nbsp;"+left,40));
table.setHTML(row, 2, subLeft("&nbsp;"+center,120));
table.setHTML(row, 3, subLeft("&nbsp;"+right,25));
table.getRowFormatter().removeStyleName(row, "inventoryItem-SelectedRow");
table.getCellFormatter().setWordWrap(row,1,false);
table.getCellFormatter().setWidth(row,1,"10%");
table.getCellFormatter().setWidth(row,0,"2%");
table.getCellFormatter().setWidth(row,1,"2%");
table.getCellFormatter().setWordWrap(row,2,false);
table.getCellFormatter().setWidth(row,2,"10%");
table.getCellFormatter().setWordWrap(row,3,false);
table.getCellFormatter().setWidth(row,3,"7%");
table.getCellFormatter().setWordWrap(row,4,false);
table.getCellFormatter().setWidth(row,4,"7%");
String aordre=((JSONString) jsonArrayNested.get(7)).stringValue();
// Numero d'ordre (caché)
table.setText(row, 4, aordre);
table.setText(row, 5, aordre);
 
if (add){
if (i ==(arraySize -1)) {
799,7 → 875,7
}
}
 
table.getCellFormatter().setVisible(row, 4, false);
table.getCellFormatter().setVisible(row, 5, false);
 
}
815,7 → 891,8
table.setHTML(j,2,"&nbsp;");
table.setHTML(j,3,"&nbsp;");
table.setHTML(j,4,"&nbsp;");
table.getCellFormatter().setVisible(j, 4, false);
table.setHTML(j,5,"&nbsp;");
table.getCellFormatter().setVisible(j, 5, false);
table.getRowFormatter().removeStyleName(j, "inventoryItem-SelectedRow");
}
933,7 → 1010,18
public void setDate(String date) {
this.date = date;
}
 
 
public void setUser(String user) {
this.user = user;
}
 
public void setStation(String station) {
this.station = station;
}