Changeset 504 for tapas/web/project


Ignore:
Timestamp:
05/11/12 12:34:56 (12 years ago)
Author:
rboipsl
Message:

ajout champs shortName dans table Observatory
gestion nomenclature fichier donnees arletty et ecmwf
modif width interface

Location:
tapas/web/project
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • tapas/web/project/formTapas.jsp

    r500 r504  
    4040        <div class="containerForm" id="formulaire"></div> 
    4141 
    42         <div id="errForm" class="errorsForm"></div> 
    4342 
    4443        <script type="text/javascript"> 
     
    9998 
    10099            tapasTexts["label.delButton"] = "<spring:message code="label.delButton"/>"; 
     100            tapasTexts["label.confirm.del"] = "<spring:message code="label.confirm.del"/>"; 
     101            tapasTexts["text.erreur.saisie"] = "<spring:message code="text.erreur.saisie"/>"; 
     102            tapasTexts["label.title.add"] = "<spring:message code="label.title.add"/>"; 
     103            tapasTexts["label.title.del"] = "<spring:message code="label.title.del"/>"; 
    101104 
    102105            var interfaceTapas = new InterfaceTapas( ${jSonFileFormats}, ${jSonYesNos}, ${jSonObservatories}, ${jSonSpectralUnits}, ${jSonInstrumentalFunctions}, ${jSonClimatoReferences} ); 
  • tapas/web/project/formTapas_script.jsp

    r503 r504  
    77        /** *********** CONTAINERS *********** **/ 
    88        this.containerForm = $( "#formulaire" ); 
    9         this.containerErrors = $( "#errForm" ); 
     9        //this.containerErrors = $( "#errForm" ); 
     10        //this.divE= $( "#divErreurs"); 
    1011        this.containerCenter = $( "#containerCenter" ); 
    1112        this.containerTabs = $( "#tab" ); 
     
    3637        // Buttons 
    3738        var submitButton = new Button( {value:tapasTexts["label.submitButton"], parent:this.containerCenter, id:"button_submit", className: "red_button", classNameText:"red_button_text", onClick:jQuery.proxy( this.onClickSubmit, this )} ); 
    38         this.addRequestButton = new Button( {value:tapasTexts["label.addButton"], parent:this.containerCenter, id:"button_add", className: "positive", onClick:jQuery.proxy( this.onClickAdd, this )} ); 
    39         this.delRequestButton = new Button( {value:tapasTexts["label.delButton"], parent:this.containerCenter, id:"button_del", className: "negative", onClick:jQuery.proxy( this.onClickDel, this )} ); 
     39        this.addRequestButton = new Button( {title:tapasTexts["label.title.add"],value:tapasTexts["label.addButton"], parent:this.containerCenter, id:"button_add", className: "positive", onClick:jQuery.proxy( this.onClickAdd, this )} ); 
     40        this.delRequestButton = new Button( {title:tapasTexts["label.title.del"],value:tapasTexts["label.delButton"], parent:this.containerCenter, id:"button_del", className: "negative", onClick:jQuery.proxy( this.onClickDel, this )} ); 
    4041        this.delRequestButton.disable(); 
    4142 
    4243        this.createForm(); 
    4344        this.tabActive = this.createTab(); 
    44  
    45         this.containerErrors.hide(); 
    46     }, 
    47  
     45        this.divE = $( document.createElement( "div" ) ); 
     46        this.divE.attr( {id:"divErrors", class:"errorsForm"} ); 
     47        /*var fieldSetE = $( document.createElement( "fieldset" ) ); 
     48         fieldSetE.addClass( "cfs3" ); 
     49         this.divE.append( fieldSetE );*/ 
     50 
     51        this.containerForm.append( this.divE ); 
     52        //this.containerErrors.hide(); 
     53        this.divE.hide(); 
     54 
     55 
     56    }, 
    4857 
    4958 
     
    9099        if( !currentDate ) 
    91100            currentDate = new Date(); 
     101 
    92102        $( "#" + inputDateId ).val( this.calendarConverter.format( currentDate ) ); 
    93103        $( "#" + inputDateId ).addClass( "calendar" ); 
     
    254264                error: jQuery.proxy( this.showErrors, this ) 
    255265            } ); 
     266 
    256267    }, 
    257268 
     
    260271    handleCreateXML: function( result ) 
    261272    { 
    262         // TODO : gérer le bob ?? 
    263         var bob = jQuery.parseJSON( result ).result; 
    264         alert( bob ); 
     273        var res = jQuery.parseJSON( result ).result; 
     274        alert( res ); 
    265275    }, 
    266276 
     
    269279    onClickSubmit: function() 
    270280    { 
    271 //        if( this.validFields() ) 
    272 //        { 
    273 //            if( confirm( tapasTexts["confirm"] ) ) 
    274 //            { 
    275 //                this.containerErrors.hide(); 
    276         this.requestCreateXML(); 
    277 //            } 
    278 //        } 
     281        if( this.validFields() ) 
     282        { 
     283            this.divE.hide(); 
     284            if( confirm( tapasTexts["confirm"] ) ) 
     285                this.requestCreateXML(); 
     286        } 
    279287    }, 
    280288 
     
    282290    onClickAdd: function() 
    283291    { 
    284         this.containerErrors.hide(); 
     292        this.divE.hide(); 
    285293        this.nbRequest++; 
    286294 
     
    300308    onClickDel: function() 
    301309    { 
    302         // TODO : enlever le pouet 
    303         if( confirm( "pouet" ) ) 
     310        if( confirm( tapasTexts["label.confirm.del"] ) ) 
    304311        { 
    305312            var numCurrent = this.numRequest; 
     
    458465    createForm: function() 
    459466    { 
    460         this.divErreurs = $( document.createElement( "div" ) ); 
    461         this.divErreurs.addClass( "errorsForm" ); 
    462         this.divErreurs.hide(); 
    463467 
    464468        var divAll = $( document.createElement( "div" ) ); 
     
    514518 
    515519        this.containerForm.append( divAll ); 
    516         this.containerForm.append( this.divErreurs ); 
     520        this.containerForm.append( this.divE ); 
    517521        //this.tabInput = new Array(3); 
    518522 
     
    653657    validFields: function() 
    654658    { 
    655         var testOk = isSup( this.selectObservatories.getValue(), 0 ); 
    656         if( !testOk ) 
     659        for( var i = 1; i <= this.nbRequest; i++ ) 
    657660        { 
    658             this.containerErrors.html( tapasTexts["label.observatory"] + " : " + tapasTexts["text.toselect"] ); 
    659             this.containerErrors.show(); 
    660             return false; 
     661 
     662            var chaine = tapasTexts["text.erreur.saisie"] + " " + i + "<br>"; 
     663            var testOk = isSup( this.selectObservatoriesList[i].getValue(), 0 ); 
     664            if( !testOk ) 
     665            { 
     666                this.divE.html( chaine + tapasTexts["label.observatory"] + " : " + tapasTexts["text.toselect"] ); 
     667                this.divE.show(); 
     668                return false; 
     669            } 
     670 
     671            testOk = isDiff( this.selectSpectralUnitsList[i].getValue(), -1 ); 
     672            if( !testOk ) 
     673            { 
     674                this.divE.html( chaine + tapasTexts["label.spectralUnit"] + " : " + tapasTexts["text.toselect"] ); 
     675                this.divE.show(); 
     676                return false; 
     677            } 
     678 
     679            testOk = isValidRange( $( "#iminspectral_ranger_" + i ).val(), $( "#imaxspectral_ranger_" + i ).val(), this.selectSpectralUnitsList[i].getValue() ); 
     680            if( !testOk ) 
     681            { 
     682                this.divE.html( chaine + tapasTexts["label.spectralRange"] + " : " + tapasTexts["text.badvalue"] ); 
     683                this.divE.show(); 
     684                return false; 
     685            } 
     686 
     687            testOk = isDeg( $( "#ide_" + i ).val() ); 
     688            if( !testOk ) 
     689            { 
     690                this.divE.html( chaine + tapasTexts["label.ide"] + " : " + tapasTexts["text.badvalue"] ); 
     691                this.divE.show(); 
     692                return false; 
     693            } 
     694 
     695            testOk = isValidNum( $( "#iza_" + i ).val() ); 
     696            if( !testOk ) 
     697            { 
     698                this.divE.html( chaine + tapasTexts["label.iza"] + " : " + tapasTexts["text.badvalue"] ); 
     699                this.divE.show(); 
     700                return false; 
     701            } 
     702 
     703            testOk = isBetween( $( "#iza_" + i ).val(), 0, 90 ); 
     704            if( !testOk ) 
     705            { 
     706                this.divE.html( chaine + tapasTexts["label.iza"] + " : " + tapasTexts["text.badvalue"] ); 
     707                this.divE.show(); 
     708                return false; 
     709            } 
     710 
     711            testOk = isValidNum( $( "#irp_" + i ).val() ); 
     712            if( !testOk ) 
     713            { 
     714                this.divE.html( chaine + tapasTexts["label.resolution"] + " : " + tapasTexts["text.badvalue"] ); 
     715                this.divE.show(); 
     716                return false; 
     717            } 
     718 
     719            testOk = isSup( $( "#irp_" + i ).val(), 1 ); 
     720            if( !testOk ) 
     721            { 
     722                this.divE.html( chaine + tapasTexts["label.resolution"] + " : " + tapasTexts["text.badvalue"] ); 
     723                this.divE.show(); 
     724                return false; 
     725            } 
     726 
     727            testOk = isValidNum( $( "#isr_" + i ).val() ); 
     728            if( !testOk ) 
     729            { 
     730                this.divE.html( chaine + tapasTexts["label.ratio"] + " : " + tapasTexts["text.badvalue"] ); 
     731                this.divE.show(); 
     732                return false; 
     733            } 
     734 
     735            testOk = isSup( $( "#isr_" + i ).val(), 1 ); 
     736            if( !testOk ) 
     737            { 
     738                this.divE.html( chaine + tapasTexts["label.ratio"] + " : " + tapasTexts["text.badvalue"] ); 
     739                this.divE.show(); 
     740                return false; 
     741            } 
    661742        } 
    662743 
    663         testOk = isDiff( this.selectSpectralUnits.getValue(), -1 ); 
    664         if( !testOk ) 
    665         { 
    666             this.containerErrors.html( tapasTexts["label.spectralUnit"] + " : " + tapasTexts["text.toselect"] ); 
    667             this.containerErrors.show(); 
    668             return false; 
    669         } 
    670  
    671         testOk = isValidRange( $( "#iminspectral_ranger" ).val(), $( "#imaxspectral_ranger" ).val(), this.selectSpectralUnits.getValue() ); 
    672         if( !testOk ) 
    673         { 
    674             this.containerErrors.html( tapasTexts["label.spectralRange"] + " : " + tapasTexts["text.badvalue"] ); 
    675             this.containerErrors.show(); 
    676             return false; 
    677         } 
    678  
    679         testOk = isDeg( $( "#ide" ).val() ); 
    680         if( !testOk ) 
    681         { 
    682             this.containerErrors.html( tapasTexts["label.ide"] + " : " + tapasTexts["text.badvalue"] ); 
    683             this.containerErrors.show(); 
    684             return false; 
    685         } 
    686  
    687         testOk = isValidNum( $( "#iza" ).val() ); 
    688         if( !testOk ) 
    689         { 
    690             this.containerErrors.html( tapasTexts["label.iza"] + " : " + tapasTexts["text.badvalue"] ); 
    691             this.containerErrors.show(); 
    692             return false; 
    693         } 
    694  
    695         testOk = isBetween( $( "#iza" ).val(), 0, 90 ); 
    696         if( !testOk ) 
    697         { 
    698             this.containerErrors.html( tapasTexts["label.iza"] + " : " + tapasTexts["text.badvalue"] ); 
    699             this.containerErrors.show(); 
    700             return false; 
    701         } 
    702  
    703         testOk = isValidNum( $( "#irp" ).val() ); 
    704         if( !testOk ) 
    705         { 
    706             this.containerErrors.html( tapasTexts["label.resolution"] + " : " + tapasTexts["text.badvalue"] ); 
    707             this.containerErrors.show(); 
    708             return false; 
    709         } 
    710  
    711         testOk = isSup( $( "#irp" ).val(), 1 ); 
    712         if( !testOk ) 
    713         { 
    714             this.containerErrors.html( tapasTexts["label.resolution"] + " : " + tapasTexts["text.badvalue"] ); 
    715             this.containerErrors.show(); 
    716             return false; 
    717         } 
    718  
    719         testOk = isValidNum( $( "#isr" ).val() ); 
    720         if( !testOk ) 
    721         { 
    722             this.containerErrors.html( tapasTexts["label.ratio"] + " : " + tapasTexts["text.badvalue"] ); 
    723             this.containerErrors.show(); 
    724             return false; 
    725         } 
    726  
    727         testOk = isSup( $( "#isr" ).val(), 1 ); 
    728         if( !testOk ) 
    729         { 
    730             this.containerErrors.html( tapasTexts["label.ratio"] + " : " + tapasTexts["text.badvalue"] ); 
    731             this.containerErrors.show(); 
    732             return false; 
    733         } 
     744        return true; 
    734745    }, 
    735746 
     
    741752            this.delRequestButton.disable(); 
    742753 
    743         if( 9 <= this.nbRequest ) 
     754        if( 10 <= this.nbRequest ) 
    744755            this.addRequestButton.disable(); 
    745756        else 
Note: See TracChangeset for help on using the changeset viewer.