← Back to team overview

dhis2-devs team mailing list archive

Re: [Branch ~dhis2-devs-core/dhis2/trunk] Rev 1184: fixed : disabled all input text when data set completed

 

All input fields are now disabled when the complete button is clicked.

Is this the behaviour we want? Should one be able to say that the form is
"reasonably" complete and then be able to enter more data later or is the
form "locked" when the complete button is clicked?




On Wed, Dec 9, 2009 at 4:46 AM, <noreply@xxxxxxxxxxxxx> wrote:

> ------------------------------------------------------------
> revno: 1184
> committer: Tran Thanh Tri <Tran Thanh Tri@compaq>
> branch nick: trunk
> timestamp: Wed 2009-12-09 10:43:38 +0700
> message:
>  fixed : disabled all input text when data set completed
> modified:
>
>  dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/completeRegistration.vm
>
>  dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/form.vm
>
>  dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js
>
>
> --
> lp:dhis2
> https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk<https://code.launchpad.net/%7Edhis2-devs-core/dhis2/trunk>
>
> Your team DHIS 2 developers is subscribed to branch lp:dhis2.
> To unsubscribe from this branch go to
> https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription<https://code.launchpad.net/%7Edhis2-devs-core/dhis2/trunk/+edit-subscription>
> .
>
> === modified file
> 'dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/completeRegistration.vm'
> ---
> dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/completeRegistration.vm
>       2009-03-03 16:46:36 +0000
> +++
> dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/completeRegistration.vm
>       2009-12-09 03:43:38 +0000
> @@ -26,4 +26,11 @@
>  <script type="text/javascript">
>     var i18n_confirm_complete = '$encoder.jsEscape( $i18n.getString(
> "confirm_complete" ) , "'")';
>     var i18n_confirm_undo = '$encoder.jsEscape( $i18n.getString(
> "confirm_undo" ) , "'")';
> +
> +       #if( $registration || $periods.size() == 0 )
> +               disableInputField();
> +       #end
> +
> +
> +
>  </script>
>
> === modified file
> 'dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/form.vm'
> ---
> dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/form.vm
>       2009-11-07 14:09:00 +0000
> +++
> dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/form.vm
>       2009-12-09 03:43:38 +0000
> @@ -6,7 +6,7 @@
>  </script>
>
>  #parse( "/dhis-web-dataentry/select.vm" )
> -
> +<div id="dataEntryForm">
>  #if ( $customDataEntryFormExists && !$useDefaultForm )
>
>                #foreach( $optionCombo in $orderdCategoryOptionCombos )
> @@ -171,7 +171,7 @@
>  #end
>  </table>
>  #end
> -
> +</div>
>  #parse( "/dhis-web-dataentry/completeRegistration.vm" )
>
>  <script type="text/javascript">
>
> === modified file
> 'dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js'
> ---
> dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js
>    2009-03-12 11:40:58 +0000
> +++
> dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js
>    2009-12-09 03:43:38 +0000
> @@ -303,6 +303,7 @@
>        document.getElementById( "undoButton" ).disabled = false;
>     document.getElementById( "dateField" ).disabled = true;
>     document.getElementById( "dateDiv" ).style.display = "none";
> +       disableInputField();
>  }
>
>  function undoCompleteDataSet()
> @@ -325,4 +326,25 @@
>     document.getElementById( "undoButton" ).disabled = true;
>     document.getElementById( "dateField" ).disabled = false;
>     document.getElementById( "dateDiv" ).style.display = "inline";
> +       enableInputField();
> +}
> +
> +function disableInputField()
> +{
> +       var inputList =
> byId("dataEntryForm").getElementsByTagName("input");
> +
> +       for(var i=0;i<inputList.length;i++){
> +               var input = inputList.item(i);
> +               input.disabled = true;
> +       }
> +}
> +
> +function enableInputField()
> +{
> +       var inputList =
> byId("dataEntryForm").getElementsByTagName("input");
> +
> +       for(var i=0;i<inputList.length;i++){
> +               var input = inputList.item(i);
> +               input.disabled = false;
> +       }
>  }
>
>
> _______________________________________________
> Mailing list: https://launchpad.net/~dhis2-devs<https://launchpad.net/%7Edhis2-devs>
> Post to     : dhis2-devs@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~dhis2-devs<https://launchpad.net/%7Edhis2-devs>
> More help   : https://help.launchpad.net/ListHelp
>
>

Follow ups

References