Index: tapas/web/project/formTapas.jsp
===================================================================
--- tapas/web/project/formTapas.jsp	(revision 495)
+++ tapas/web/project/formTapas.jsp	(revision 496)
@@ -1,6 +1,6 @@
+<%@ page import="com.ether.ClimatoReference" %>
+<%@ page import="com.ether.InstrumentalFunction" %>
+<%@ page import="com.ether.SpectralUnit" %>
 <%@ page import="com.ether.WebException" %>
-<%@ page import="com.ether.SpectralUnit" %>
-<%@ page import="com.ether.InstrumentalFunction" %>
-<%@ page import="com.ether.ClimatoReference" %>
 <%@ page import="com.ether.YesNo" %>
 <%@ page contentType="text/html;charset=UTF-8" language="java" %>
@@ -67,45 +67,38 @@
             tapasTexts["confirm"] = "<spring:message code="label.confirm"/>";
 
-            tapasTexts["label.ira"]="<spring:message code="label.ira"/>";
-            tapasTexts["label.ide"]="<spring:message code="label.ide"/>";
-            tapasTexts["label.iza"]="<spring:message code="label.iza"/>";
-            tapasTexts["label.spectralUnit"]="<spring:message code="label.spectralUnit"/>";
-            tapasTexts["label.spectralRange"]="<spring:message code="label.spectralRange"/>";
-            tapasTexts["label.to"]="<spring:message code="label.to"/>";
-            tapasTexts["label.observatory"]="<spring:message code="label.observatory"/>";
-            tapasTexts["label.preferences"]="<spring:message code="label.preferences"/>";
-            tapasTexts["label.resolution"]="<spring:message code="label.resolution"/>";
-            tapasTexts["label.ratio"]="<spring:message code="label.ratio"/>";
-            tapasTexts["label.ifunction"]="<spring:message code="label.ifunction"/>";
-            tapasTexts["label.climato"]="<spring:message code="label.climato"/>";
-            tapasTexts["label.datemesure"]="<spring:message code="label.datemesure"/>";
+            tapasTexts["label.ira"] = "<spring:message code="label.ira"/>";
+            tapasTexts["label.ide"] = "<spring:message code="label.ide"/>";
+            tapasTexts["label.iza"] = "<spring:message code="label.iza"/>";
+            tapasTexts["label.spectralUnit"] = "<spring:message code="label.spectralUnit"/>";
+            tapasTexts["label.spectralRange"] = "<spring:message code="label.spectralRange"/>";
+            tapasTexts["label.to"] = "<spring:message code="label.to"/>";
+            tapasTexts["label.observatory"] = "<spring:message code="label.observatory"/>";
+            tapasTexts["label.preferences"] = "<spring:message code="label.preferences"/>";
+            tapasTexts["label.resolution"] = "<spring:message code="label.resolution"/>";
+            tapasTexts["label.ratio"] = "<spring:message code="label.ratio"/>";
+            tapasTexts["label.ifunction"] = "<spring:message code="label.ifunction"/>";
+            tapasTexts["label.climato"] = "<spring:message code="label.climato"/>";
+            tapasTexts["label.datemesure"] = "<spring:message code="label.datemesure"/>";
 
-            tapasTexts["label.format"]="<spring:message code="label.format"/>";
-            tapasTexts["label.era"]="<spring:message code="label.era"/>";
-            tapasTexts["label.eo2"]="<spring:message code="label.eo2"/>";
-            tapasTexts["label.eh2o"]="<spring:message code="label.eh2o"/>";
-            tapasTexts["label.eco2"]="<spring:message code="label.eco2"/>";
-            tapasTexts["label.eo3"]="<spring:message code="label.eo3"/>";
-            tapasTexts["text.select"]="<spring:message code="text.select"/>";
-            tapasTexts["text.toselect"]="<spring:message code="text.toselect"/>";
+            tapasTexts["label.format"] = "<spring:message code="label.format"/>";
+            tapasTexts["label.era"] = "<spring:message code="label.era"/>";
+            tapasTexts["label.eo2"] = "<spring:message code="label.eo2"/>";
+            tapasTexts["label.eh2o"] = "<spring:message code="label.eh2o"/>";
+            tapasTexts["label.eco2"] = "<spring:message code="label.eco2"/>";
+            tapasTexts["label.eo3"] = "<spring:message code="label.eo3"/>";
+            tapasTexts["text.select"] = "<spring:message code="text.select"/>";
+            tapasTexts["text.toselect"] = "<spring:message code="text.toselect"/>";
 
 
-            tapasTexts["label.datemesure"]="<spring:message code="label.datemesure"/>";
+            tapasTexts["label.datemesure"] = "<spring:message code="label.datemesure"/>";
 
-            tapasTexts["text.validnum"]="<spring:message code="text.validnum"/>";
-            tapasTexts["text.badvalue"]="<spring:message code="text.badvalue"/>";
+            tapasTexts["text.validnum"] = "<spring:message code="text.validnum"/>";
+            tapasTexts["text.badvalue"] = "<spring:message code="text.badvalue"/>";
 
-            tapasTexts["label.requete"]="<spring:message code="label.requete"/>";
+            tapasTexts["label.requete"] = "<spring:message code="label.requete"/>";
 
-            tapasTexts["label.delButton"]="<spring:message code="label.delButton"/>";
+            tapasTexts["label.delButton"] = "<spring:message code="label.delButton"/>";
 
-
-
-
-
-
-            //var interfaceTapas = new InterfaceTapas(${jSonFileFormats},${jSonYesNos},${jSonObservatories},${jSonSpectralUnits},${jSonInstrumentalFunctions},${jSonClimatoReferences});
-            var interfaceTapas = new InterfaceTapas(${jSonFileFormats},${jSonYesNos},${jSonSpectralUnits},${jSonInstrumentalFunctions},${jSonClimatoReferences});
-
+            var interfaceTapas = new InterfaceTapas( ${jSonFileFormats}, ${jSonYesNos}, ${jSonObservatories}, ${jSonSpectralUnits}, ${jSonInstrumentalFunctions}, ${jSonClimatoReferences} );
         </script>
 
Index: tapas/web/project/formTapas_script.jsp
===================================================================
--- tapas/web/project/formTapas_script.jsp	(revision 495)
+++ tapas/web/project/formTapas_script.jsp	(revision 496)
@@ -4,6 +4,5 @@
 var InterfaceTapas = Class.create( {
 
-    //initialize: function( jsonFileFormats, jsonYesNos, jsonObservatories, jsonSpectralUnits, jsonInstrumentalFunctions, jsonClimatoReferences )
-    initialize: function( jsonFileFormats, jsonYesNos, jsonSpectralUnits, jsonInstrumentalFunctions, jsonClimatoReferences )
+    initialize: function( jsonFileFormats, jsonYesNos, jsonObservatories, jsonSpectralUnits, jsonInstrumentalFunctions, jsonClimatoReferences )
     {
         /** *********** CONTAINERS *********** **/
@@ -16,6 +15,5 @@
         this.jSonFileFormats = jsonFileFormats || null;
         this.jSonYesNos = jsonYesNos || null;
-        //this.jSonObservatories = jsonObservatories || false;
-        this.jSonObservatories = false;
+        this.jSonObservatories = jsonObservatories || false;
         this.jSonSpectralUnits = jsonSpectralUnits || null;
         this.jSonInstrumentalFunctions = jsonInstrumentalFunctions || null;
@@ -35,5 +33,4 @@
         this.createForm();
         this.tabActive = this.createTab();
-
     },
 
@@ -42,9 +39,7 @@
     createTab:function()
     {
-
         var ntab = new Tab( {value:tapasTexts["label.requete"] + " " + this.nbRequest, parent:this.containerTabs, numTab: this.nbRequest, id:"tab_request" + this.nbRequest, className: "tab_class", onClick:jQuery.proxy( this.onClickTab, this )} );
         ntab.active();
         return ntab;
-
     },
 
@@ -265,4 +260,5 @@
     handleCreateXML: function( result )
     {
+        // TODO : gÃ©rer le bob ??
         var bob = jQuery.parseJSON( result ).result;
         alert( bob );
@@ -301,7 +297,5 @@
             this.createForm();
 
-            this.delRequestButton.enable();
-            if( 9 == this.nbRequest ) this.addRequestButton.disable();
-            else this.addRequestButton.enable();
+            this.updateButtons();
         }
     },
@@ -324,10 +318,4 @@
             this.tabActive.numTab = "1";
             this.numRequest = "1";
-            // this.nbRequest--;
-            if( 1 >= this.nbRequest )
-                this.delRequestButton.disable();
-
-            if( 9 == this.nbRequest ) this.addRequestButton.disable();
-            else this.addRequestButton.enable();
 
             for( var i = 1; i <= this.nbRequest; i++ )
@@ -340,22 +328,22 @@
                     $( "#tab_request" + i ).attr( {name:z} );
                     //document.getElementById("tab_request"+i).name=z;
-                    document.getElementById( "tab_request" + i ).id = "tab_request" + z;
-                    document.getElementById( "tabObservation_" + i ).id = "tabObservation_" + z;
-                    document.getElementById( "select_iobservatory_" + i ).id = "select_iobservatory_" + z;
-                    document.getElementById( "select_ispectral_choice_" + i ).id = "select_ispectral_choice_" + z;
-                    document.getElementById( "iminspectral_ranger_" + i ).id = "iminspectral_ranger_" + z;
-                    document.getElementById( "imaxspectral_ranger_" + i ).id = "imaxspectral_ranger_" + z;
-                    document.getElementById( "select_ifunction_" + i ).id = "select_ifunction_" + z;
-                    document.getElementById( "select_icr_" + i ).id = "select_icr_" + z;
-                    document.getElementById( "ide_" + i ).id = "ide_" + z;
-                    document.getElementById( "iza_" + i ).id = "iza_" + z;
-                    document.getElementById( "irp_" + i ).id = "irp_" + z;
-                    document.getElementById( "isr_" + i ).id = "isr_" + z;
-                    document.getElementById( "select_iformat_" + i ).id = "select_iformat_" + z;
-                    document.getElementById( "select_irextinction_" + i ).id = "select_irextinction_" + z;
-                    document.getElementById( "select_ih2oe_" + i ).id = "select_ih2oe_" + z;
-                    document.getElementById( "select_io2e_" + i ).id = "select_io2e_" + z;
-                    document.getElementById( "select_io3e_" + i ).id = "select_io3e_" + z;
-                    document.getElementById( "select_ico2e_" + i ).id = "select_ico2e_" + z;
+                    $( "#tab_request" + i ).attr( {id:"tab_request" + z} );
+                    $( "#tabObservation_" + i ).attr( {id:"tabObservation_" + z} );
+                    $( "#select_iobservatory_" + i ).attr( {id:"select_iobservatory_" + z} );
+                    $( "#select_ispectral_choice_" + i ).attr( {id:"select_ispectral_choice_" + z} );
+                    $( "#iminspectral_ranger_" + i ).attr( {id:"iminspectral_ranger_" + z} );
+                    $( "#imaxspectral_ranger_" + i ).attr( {id:"imaxspectral_ranger_" + z} );
+                    $( "#select_ifunction_" + i ).attr( {id:"select_ifunction_" + z} );
+                    $( "#select_icr_" + i ).attr( {id:"select_icr_" + z} );
+                    $( "#ide_" + i ).attr( {id:"ide_" + z} );
+                    $( "#iza_" + i ).attr( {id:"iza_" + z} );
+                    $( "#irp_" + i ).attr( {id:"irp_" + z} );
+                    $( "#isr_" + i ).attr( {id:"isr_" + z} );
+                    $( "#select_iformat_" + i ).attr( {id:"select_iformat_" + z} );
+                    $( "#select_irextinction_" + i ).attr( {id:"select_irextinction_" + z} );
+                    $( "#select_ih2oe_" + i ).attr( {id:"select_ih2oe_" + z} );
+                    $( "#select_io2e_" + i ).attr( {id:"select_io2e_" + z} );
+                    $( "#select_io3e_" + i ).attr( {id:"select_io3e_" + z} );
+                    $( "#select_ico2e_" + i ).attr( {id:"select_ico2e_" + z} );
 
                     // Supression du calendrier puis re-crÃ©ation en insÃ©rant l'ancienne date
@@ -363,5 +351,5 @@
                     AnyTime.noPicker( "iobservation_date_" + i );
                     this.createCalendar( $( "#tabObservation_" + z ), tapasTexts["label.datemesure"], "iobservation_date_" + z, oldDate, false );
-                    document.getElementById( "iobservation_date_" + i ).id = "iobservation_date_" + z;
+                    $( "#iobservation_date_" + i ).attr( {id:"iobservation_date_" + z} );
 
                     // Idem pour les heures !!!
@@ -371,10 +359,12 @@
                     AnyTime.noPicker( "ira_" + i );
                     this.createTime( $( "#tabObservation_" + z ), tapasTexts["label.ira"], "ira_" + z, oldTime, false );
-                    document.getElementById( "ira_" + i ).id = "ira_" + z;
-//                    z++;
+                    $( "#ira_" + i ).attr( {id:"ira_" + z} );
                 }
             }
 
             this.nbRequest--;
+
+            // Mise Ã  jour des boutons
+            this.updateButtons();
 
             //tabs
@@ -405,6 +395,5 @@
         this.tabActive.numTab = realTabId;
 
-        if( 1 == realTabId ) this.delRequestButton.disable();
-        else this.delRequestButton.enable();
+        this.updateButtons();
     },
 
@@ -702,6 +691,4 @@
         var tapas = new Object();
         tapas.requests = requests;
-
-
         return tapas;
     },
@@ -718,47 +705,20 @@
                         isValidNum( $( "#isr" ).val(), tapasTexts["label.ratio"], tapasTexts["text.badvalue"] ) && isSup( $( "#isr" ).val(), 1, tapasTexts["label.ratio"], tapasTexts["text.badvalue"] )
                 )
+    },
+
+    updateButtons: function()
+    {
+        if( 1 < this.nbRequest )
+            this.delRequestButton.enable();
+        else
+            this.delRequestButton.disable();
+
+        if( 9 <= this.nbRequest )
+            this.addRequestButton.disable();
+        else
+            this.addRequestButton.enable();
     }
 
-
-    /*,
-
-     isEmpty: function(string){
-     return (string.trim()=='');
-     },
-
-
-     isMail: function(email){
-     return (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(email));
-     },
-
-
-     isInt: function(number){
-     return (/^[0-9]+$/.test(number));
-     },
-
-
-     isFloat: function(number){
-     return (/^[0-9]+(\.[0-9]+)?$/.test(number));
-     },
-
-
-     isIP: function(ip){
-     return (/^(([0-2]*[0-9]+[0-9]+)\.([0-2]*[0-9]+[0-9]+)\.([0-2]*[0-9]+[0-9]+)\.([0-2]*[0-9]+[0-9]+))$/.test(ip));
-     },
-
-
-
-     isURL: function(string){
-     return (/^(((ht|f)tp(s?))\:\/\/)([0-9a-zA-Z\-]+\.)+[a-zA-Z]{2,6}(\:[0-9]+)?(\/\S*)?$/.test(string.toLowerCase()));
-     },
-
-     isValidNum: function(number) {
-     if (!this.isEmpty(number) && this.isFloat(number)) return true;
-     else return false;
-     }*/
-
-
 } );
 
-
 </script>
