Subversion Repositories eFlore/Applications.cel

Compare Revisions

Ignore whitespace Rev 388 → Rev 389

/trunk/src/org/tela_botanica/client/vues/observation/FormulaireSaisieObservationVue.java
17,19 → 17,14
import org.tela_botanica.client.modeles.ReferentielNom;
import org.tela_botanica.client.observation.ObservationMediateur;
 
import com.google.gwt.core.client.GWT;
import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.maps.client.geom.LatLng;
import com.google.gwt.user.client.Timer;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.ClickListener;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.Widget;
import com.gwtext.client.core.EventCallback;
import com.gwtext.client.core.EventObject;
import com.gwtext.client.core.Ext;
import com.gwtext.client.core.ExtElement;
import com.gwtext.client.core.Function;
import com.gwtext.client.core.ListenerConfig;
import com.gwtext.client.core.Position;
import com.gwtext.client.data.ArrayReader;
41,20 → 36,14
import com.gwtext.client.data.StringFieldDef;
import com.gwtext.client.widgets.BoxComponent;
import com.gwtext.client.widgets.Button;
import com.gwtext.client.widgets.Component;
import com.gwtext.client.widgets.Container;
import com.gwtext.client.widgets.DatePicker;
import com.gwtext.client.widgets.Panel;
import com.gwtext.client.widgets.ToolTip;
import com.gwtext.client.widgets.Toolbar;
import com.gwtext.client.widgets.Viewport;
import com.gwtext.client.widgets.event.BoxComponentListenerAdapter;
import com.gwtext.client.widgets.event.ButtonListenerAdapter;
import com.gwtext.client.widgets.event.ContainerListener;
import com.gwtext.client.widgets.event.ContainerListenerAdapter;
import com.gwtext.client.widgets.event.DatePickerListener;
import com.gwtext.client.widgets.event.DatePickerListenerAdapter;
import com.gwtext.client.widgets.event.PanelListener;
import com.gwtext.client.widgets.event.PanelListenerAdapter;
import com.gwtext.client.widgets.form.ComboBox;
import com.gwtext.client.widgets.form.DateField;
65,7 → 54,6
import com.gwtext.client.widgets.form.TextArea;
import com.gwtext.client.widgets.form.TextField;
import com.gwtext.client.widgets.form.event.ComboBoxListenerAdapter;
import com.gwtext.client.widgets.form.event.TextFieldListener;
import com.gwtext.client.widgets.form.event.TextFieldListenerAdapter;
import com.gwtext.client.widgets.layout.AnchorLayoutData;
import com.gwtext.client.widgets.layout.ColumnLayout;
437,12 → 425,12
espece=new ComboBox("Espèce","nom");
final String resultTplEspece = "<div class=\"search-item-espece\">{nom}</div>";
final String resultTplEspece = "<div class=\"search-item-espece {indicateurNomRetenu}\">{nom}</div>";
 
espece.setTpl(resultTplEspece);
espece.setMode(ComboBox.REMOTE);
// commune.setPageSize(10); // Ne fonctionne pas
// espece.setPageSize(10); // Ne fonctionne pas
espece.setItemSelector("div.search-item-espece");
espece.setTypeAhead(true);
espece.setLoadingText("Recherche...");
1026,6 → 1014,7
{
ReferentielCommune ref=(ReferentielCommune) data.get(it.next());
communeData[i][0]= ref.getCommune();
communeData[i][1]= ref.getDepartement();
1058,7 → 1047,7
{
ListeReferentielNom data = (ListeReferentielNom) nouvelleDonnees ;
Object[][] nomData = new Object[data.size()][2];
Object[][] nomData = new Object[data.size()][3];
int i = 0 ;
// on la parse et on récupère les informations quiç nous interessent
1069,6 → 1058,12
nomData[i][0]= ref.getNom();
nomData[i][1]= ref.getNumeroNom();
if (ref.getStatut().equals("3")) {
nomData[i][2]="nom_retenu";
}
else {
nomData[i][2]="";
}
i++ ;
1077,9 → 1072,10
// creation du store
FieldDef defNom = new StringFieldDef("nom");
FieldDef defNumeroNom = new StringFieldDef("numeroNom");
FieldDef indicateurNomRetenu = new StringFieldDef("indicateurNomRetenu");
FieldDef[] defTab = { defNom, defNumeroNom};
FieldDef[] defTab = { defNom, defNumeroNom, indicateurNomRetenu};
RecordDef rd = new RecordDef(defTab);
1223,6 → 1219,8
 
public void obtenirListeReferentielNom() {
// FIXME : trouver un autre moyen que le hack "/*" pour rechercher les taxons lors de la saisie d'un espace apres le genre
String esp=espece.getText().replaceAll(" ","/*");
esp=esp.replaceAll("%","");
1233,26 → 1231,30
 
public void ajouterObservation() {
if(departement.equals("000null") || departement.equals("")) {
String[] depCom = commune.getText().split(" ");
if(depCom.length > 1) {
String dep = depCom[1].replace('(', ' ');
dep =dep.replace(')', ' ');
dep = dep.trim();
dep = dep.replace('\\',' ');
dep = dep.trim();
try
{
int nDep = Integer.parseInt(dep);
if(nDep > 0 && nDep < 110) {
departement = dep ;
if(departement != null) {
// TODO : regler le probleme a la base plutot que ce patch
if(departement.equals("000null") || departement.equals("")) {
String[] depCom = commune.getText().split(" ");
if(depCom.length > 1) {
String dep = depCom[1].replace('(', ' ');
dep =dep.replace(')', ' ');
dep = dep.trim();
dep = dep.replace('\\',' ');
dep = dep.trim();
try
{
int nDep = Integer.parseInt(dep);
if(nDep > 0 && nDep < 110) {
departement = dep ;
}
}
catch(NumberFormatException e)
{
departement = "" ;
}
}
catch(NumberFormatException e)
{
departement = "" ;
}
}
}
 
/trunk/src/org/tela_botanica/client/modeles/ListeReferentielNomAsynchroneDAO.java
118,12 → 118,13
for (int i = 0; i < taillemax; i++) {
if ((noms=reponse.get(i).isArray()) != null) {
String nom=Util.toCelString(((JSONString) noms.get(0)).toString());
String numeroNom=Util.toCelString(((JSONString) noms.get(1)).toString());
String statut=Util.toCelString(((JSONString) noms.get(2)).toString());
ReferentielNom nomScientifique=new ReferentielNom(nom, numeroNom);
ReferentielNom nomScientifique=new ReferentielNom(nom, numeroNom, statut);
// FIXME : et si le numero de nom n'est pas unique ? (cas de multirefrentiel....)
/trunk/src/org/tela_botanica/client/modeles/ReferentielNom.java
15,9 → 15,11
 
private String nom=null;
private String numeroNom=null;
private String statut=null;
public ReferentielNom() {
}
 
24,19 → 26,20
/**
* @param nom
* @param numeroNom
* @param statut
*
*/
public ReferentielNom(String nom, String numeroNom) {
public ReferentielNom(String nom, String numeroNom, String statut) {
this.nom = nom;
this.numeroNom = numeroNom;
this.statut = statut;
 
}
 
 
 
public String getNom() {
return nom;
}
46,6 → 49,9
return numeroNom;
}
 
public String getStatut() {
return statut;
}