=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/resources/struts.xml' --- dhis-2/dhis-web/dhis-web-dataentry/src/main/resources/struts.xml 2010-10-08 11:12:29 +0000 +++ dhis-2/dhis-web/dhis-web-dataentry/src/main/resources/struts.xml 2010-10-12 08:22:10 +0000 @@ -26,9 +26,11 @@ /dhis-web-dataentry/select.vm /dhis-web-dataentry/menu.vm 420 - ../dhis-web-commons/ouwt/ouwt.js,javascript/general.js,javascript/form.js, - ../dhis-web-commons/util/validate/jquery.validate.js,../dhis-web-commons/util/jquery.metadata.js - ,../dhis-web-commons/util/validate/additional-methods.js,../dhis-web-commons/util/validate/messages_locale.js + + ../dhis-web-commons/ouwt/ouwt.js, + javascript/general.js, + javascript/form.js + style/dhis-web-dataentry.css,style/custom_data_entry_form_styles.css @@ -53,9 +55,7 @@ javascript/general.js,javascript/form.js, ../dhis-web-commons/calendar/calendar.js, ../dhis-web-commons/calendar/calendar-lang.js, - ../dhis-web-commons/calendar/calendar-setup.js, - ../dhis-web-commons/util/validate/jquery.validate.js,../dhis-web-commons/util/jquery.metadata.js - ,../dhis-web-commons/util/validate/additional-methods.js,../dhis-web-commons/util/validate/messages_locale.js + ../dhis-web-commons/calendar/calendar-setup.js style/dhis-web-dataentry.css,style/custom_data_entry_form_styles.css @@ -71,8 +71,7 @@ javascript/general.js,javascript/form.js,javascript/section.js,javascript/multidimensional.js, ../dhis-web-commons/calendar/calendar.js, ../dhis-web-commons/calendar/calendar-lang.js, - ../dhis-web-commons/calendar/calendar-setup.js,../dhis-web-commons/util/validate/jquery.validate.js,../dhis-web-commons/util/jquery.metadata.js - ,../dhis-web-commons/util/validate/additional-methods.js,../dhis-web-commons/util/validate/messages_locale.js + ../dhis-web-commons/calendar/calendar-setup.js style/dhis-web-dataentry.css === modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/multidimensional.js' --- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/multidimensional.js 2010-10-07 11:14:36 +0000 +++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/multidimensional.js 2010-10-12 08:22:10 +0000 @@ -21,15 +21,10 @@ // Comments // ----------------------------------------------------------------------------- -// ----------------------------------------------------------------------------- -// Comments -// ----------------------------------------------------------------------------- - function commentSelected( dataElementId, optionComboId ) -{ - var commentSelector = document.getElementById( 'value[' + dataElementId + ':' + optionComboId + '].comments' ); - var commentField = document.getElementById( 'value[' + dataElementId + ':' + optionComboId + '].comment' ); - +{ + var commentSelector = byId( 'value[' + dataElementId + ':' + optionComboId + '].comments' ); + var commentField = byId( 'value[' + dataElementId + ':' + optionComboId + '].comment' ); var value = commentSelector.options[commentSelector.selectedIndex].value; if ( value == 'custom' ) @@ -44,14 +39,14 @@ { commentField.value = value; - saveComment( dataElementId, value ); + saveComment( dataElementId, optionComboId, value ); } } function commentLeft( dataElementId, optionComboId ) { - var commentField = document.getElementById( 'value[' + dataElementId + ':' + optionComboId + '].comment' ); - var commentSelector = document.getElementById( 'value[' + dataElementId + ':' + optionComboId + '].comments' ); + var commentField = byId( 'value[' + dataElementId + ':' + optionComboId + '].comment' ); + var commentSelector = byId( 'value[' + dataElementId + ':' + optionComboId + '].comments' ); saveComment( dataElementId, optionComboId, commentField.value ); @@ -60,6 +55,7 @@ if ( value == '' ) { commentField.style.display = 'none'; + commentSelector.style.css = "combobox"; commentSelector.style.display = 'inline'; commentSelector.selectedIndex = 0; @@ -72,8 +68,8 @@ function saveValue( dataElementId, optionComboId, dataElementName, zeroValueSaveMode ) { - var field = document.getElementById( 'value[' + dataElementId + '].value' + ':' + 'value[' + optionComboId + '].value'); - var type = document.getElementById( 'value[' + dataElementId + '].type' ).innerHTML; + var field = byId( 'value[' + dataElementId + '].value' + ':' + 'value[' + optionComboId + '].value'); + var type = byId( 'value[' + dataElementId + '].type' ).innerHTML; var organisationUnitId = getFieldValue( 'organisationUnitId' ); field.style.backgroundColor = '#ffffcc'; @@ -89,9 +85,8 @@ window.alert( i18n_saving_zero_values_unnecessary ); field.select(); field.focus(); - - return; - + + return; } if ( !isInt( field.value )) @@ -108,8 +103,8 @@ else { - var minString = document.getElementById( 'value[' + dataElementId + ':' + optionComboId + '].min' ).innerHTML; - var maxString = document.getElementById( 'value[' + dataElementId + ':' + optionComboId + '].max' ).innerHTML; + var minString = byId( 'value[' + dataElementId + ':' + optionComboId + '].min' ).innerHTML; + var maxString = byId( 'value[' + dataElementId + ':' + optionComboId + '].max' ).innerHTML; if ( minString.length != 0 && maxString.length != 0 ) { @@ -167,8 +162,8 @@ function saveComment( dataElementId, optionComboId, commentValue ) { - var field = document.getElementById( 'value[' + dataElementId + ':' + optionComboId + '].comment' ); - var select = document.getElementById( 'value[' + dataElementId + ':' + optionComboId + '].comments' ); + var field = byId( 'value[' + dataElementId + ':' + optionComboId + '].comment' ); + var select = byId( 'value[' + dataElementId + ':' + optionComboId + '].comments' ); var organisationUnitId = getFieldValue( 'organisationUnitId' ); field.style.backgroundColor = '#ffffcc'; @@ -246,12 +241,12 @@ function markValue( color ) { - var type = document.getElementById( 'value[' + dataElementId + '].type' ).innerText; + var type = byId( 'value[' + dataElementId + '].type' ).innerText; var element; if ( type == 'bool' ) { - element = document.getElementById( 'value[' + dataElementId + '].boolean' ); + element = byId( 'value[' + dataElementId + '].boolean' ); } else if( selectedOption ) { @@ -259,9 +254,8 @@ } else { - element = document.getElementById( 'value[' + dataElementId + '].value' + ':' + 'value[' + optionComboId + '].value'); + element = byId( 'value[' + dataElementId + '].value' + ':' + 'value[' + optionComboId + '].value'); } - element.style.backgroundColor = color; } @@ -311,8 +305,8 @@ function markComment( color ) { - var field = document.getElementById( 'value[' + dataElementId + ':' + optionComboId + '].comment' ); - var select = document.getElementById( 'value[' + dataElementId + ':' + optionComboId + '].comments' ); + var field = byId( 'value[' + dataElementId + ':' + optionComboId + '].comment' ); + var select = byId( 'value[' + dataElementId + ':' + optionComboId + '].comments' ); field.style.backgroundColor = color; select.style.backgroundColor = color; @@ -350,11 +344,11 @@ for ( dataElementId in factorMap ) { - dataElementValue = document.getElementById( 'value[' + dataElementId + '].value' ).value; + dataElementValue = byId( 'value[' + dataElementId + '].value' ).value; value += ( dataElementValue * factorMap[dataElementId] ); } - document.getElementById( 'value[' + cdeId + '].value' ).value = value; + byId( 'value[' + cdeId + '].value' ).value = value; } /** @@ -373,7 +367,6 @@ { return cdeId; } - } return null; @@ -399,7 +392,7 @@ { dataElementId = value.getAttribute('dataElementId'); value = value.firstChild.nodeValue; - document.getElementById( 'value[' + dataElementId + '].value' ).value = value; + byId( 'value[' + dataElementId + '].value' ).value = value; } unLockScreen(); @@ -438,7 +431,6 @@ setInnerHTML('value[' + deId + ':' + ocId + '].min', getElementValue( dataElements[i], 'minLimit')); setInnerHTML('value[' + deId + ':' + ocId + '].max', getElementValue( dataElements[i], 'maxLimit')); } - } function handleHttpError( errorCode ) @@ -446,7 +438,6 @@ window.alert( i18n_saving_minmax_failed_error_code + '\n\n' + errorCode ); } - function getElementValue( parentElement, childElementName ) { var textNode = parentElement.getElementsByTagName( childElementName )[0].firstChild; === modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/section/dataElement.vm' --- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/section/dataElement.vm 2010-09-17 07:21:45 +0000 +++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/section/dataElement.vm 2010-10-12 08:22:10 +0000 @@ -1,11 +1,11 @@ - - - - - - - + + + + + + + === modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/section/form.vm' --- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/section/form.vm 2010-09-27 10:40:07 +0000 +++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/section/form.vm 2010-10-12 08:22:10 +0000 @@ -18,13 +18,13 @@
@@ -53,6 +53,7 @@ var i18n_saving_value_failed_status_code = '$encoder.jsEscape( $i18n.getString( "saving_value_failed_status_code" ) , "'")'; var i18n_saving_comment_failed_status_code = '$encoder.jsEscape( $i18n.getString( "saving_comment_failed_status_code" ) , "'")'; var i18n_saving_minmax_failed_error_code = '$encoder.jsEscape( $i18n.getString( "saving_minmax_failed_error_code" ) , "'")'; + var i18n_saving_zero_values_unnecessary = '$encoder.jsEscape( $i18n.getString( "saving_zero_values_unnecessary" ) , "'")'; var calculatedDataElementMap = { #set( $count = 1 ) === modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/select.vm' --- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/select.vm 2010-10-07 11:14:36 +0000 +++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/select.vm 2010-10-12 08:22:10 +0000 @@ -4,7 +4,7 @@
#if ( $organisationUnit ) $encoder.htmlEncode( $organisationUnit.name )#else $i18n.getString( "no_organisationunit_selected" ) #end - - #if ( $period ) $format.formatPeriod( $period ) #else $i18n.getString( "no_period_selected" ) #end
+ #if ( $period ) $format.formatPeriod( $period ) #else $i18n.getString( "no_period_selected" ) #end
$i18n.getString( "no_dataelement_selected" ) - $i18n.getString( "no_option_selected" )
@@ -13,12 +13,12 @@
-
-
-
-
+
+
+
+
-
+
-
+ onclick="document.getElementById( 'selectForm' ).submit();"/> +
-
+ onclick="document.getElementById( 'selectForm' ).submit();"/> +
-

+ onclick="document.getElementById( 'selectForm' ).submit();"/> +

@@ -53,7 +53,7 @@ - + @@ -71,8 +71,8 @@
-

$encoder.htmlEncode( $section.title )

+

$encoder.htmlEncode( $section.name )

- + #set( $isMultiDimensional = $sectionIsMultiDimensional.get( $section.id ) ) #if($isMultiDimensional == true ) @@ -32,7 +32,7 @@ #else #parse( "/dhis-web-dataentry/section/dataElement.vm" ) #end - +
- -
+ +