=== modified file 'local/vn/dhis-web-dataentry-hospital/src/main/resources/org/hisp/dhis/de/i18n_module.properties' --- local/vn/dhis-web-dataentry-hospital/src/main/resources/org/hisp/dhis/de/i18n_module.properties 2012-07-06 19:43:15 +0000 +++ local/vn/dhis-web-dataentry-hospital/src/main/resources/org/hisp/dhis/de/i18n_module.properties 2012-08-08 10:57:13 +0000 @@ -107,6 +107,7 @@ hide_export_params = Hide export params disconnect_server = Disconnect to server please_select_organisation_unit = Please select organisation unit +please_select_data_set = Please select data set show_icd_report = Show ICD report get_report_as_csv = Get report as CSV get_report_as_xls = Get report as XLS @@ -133,4 +134,5 @@ chapter = Chapter select_chapter = Select chapter explore_icd_report_result = Explore ICD report result -collapse_icd_report_result = Collapse ICD report result \ No newline at end of file +collapse_icd_report_result = Collapse ICD report result +disease = Disease \ No newline at end of file === modified file 'local/vn/dhis-web-dataentry-hospital/src/main/resources/org/hisp/dhis/de/i18n_module_vi_VN.properties' --- local/vn/dhis-web-dataentry-hospital/src/main/resources/org/hisp/dhis/de/i18n_module_vi_VN.properties 2012-07-06 19:43:15 +0000 +++ local/vn/dhis-web-dataentry-hospital/src/main/resources/org/hisp/dhis/de/i18n_module_vi_VN.properties 2012-08-08 10:57:13 +0000 @@ -113,6 +113,7 @@ hide_export_params = \u1ea8n khung ch\u1ecdn disconnect_server = Kh\u00f4ng th\u1ec3 k\u1ebft n\u1ed1i t\u1edbi m\u00e1y ch\u1ee7 please_select_organisation_unit = H\u00e3y ch\u1ecdn \u0111\u01a1n v\u1ecb +please_select_data_set = H\u00e3y ch\u1ecdn m\u1eabu nh\u1eadp show_icd_report = Xu\u1ea5t b\u00e1o c\u00e1o ICD get_report_as_csv = Xu\u1ea5t b\u00e1o c\u00e1o d\u1ea1ng CSV get_report_as_xls = Xu\u1ea5t b\u00e1o c\u00e1o d\u1ea1ng XLS @@ -139,4 +140,5 @@ chapter = Ch\u01b0\u01a1ng select_chapter = Ch\u1ecdn ch\u01b0\u01a1ng explore_icd_report_result = Hi\u1ec3n th\u1ecb k\u1ebft qu\u1ea3 b\u00e1o c\u00e1o ICD -collapse_icd_report_result = Thu nh\u1ecf k\u1ebft qu\u1ea3 b\u00e1o c\u00e1o ICD \ No newline at end of file +collapse_icd_report_result = Thu nh\u1ecf k\u1ebft qu\u1ea3 b\u00e1o c\u00e1o ICD +disease = B\u1ec7nh \ No newline at end of file === modified file 'local/vn/dhis-web-dataentry-hospital/src/main/webapp/dhis-web-dataentry-hospital/javascript/form.js' --- local/vn/dhis-web-dataentry-hospital/src/main/webapp/dhis-web-dataentry-hospital/javascript/form.js 2012-07-06 19:43:15 +0000 +++ local/vn/dhis-web-dataentry-hospital/src/main/webapp/dhis-web-dataentry-hospital/javascript/form.js 2012-08-08 10:57:13 +0000 @@ -37,6 +37,9 @@ // Currently selected data set identifier var currentDataSetId = null; +// Currently selected period type name +var currentPeriodType = ""; + // Current offset, next or previous corresponding to increasing or decreasing // value with one var currentPeriodOffset = 0; @@ -110,24 +113,36 @@ //async: false, success: function( json ) { - var dataSetList = json.dataSets; - - $( '#selectedDataSetId' ).removeAttr( 'disabled' ); - - var dataSetId = $( '#selectedDataSetId option:selected' ).val(); - var periodId = $( '#selectedPeriodId option:selected' ).val(); - clearListById( 'selectedDataSetId' ); - //addOptionById( 'selectedDataSetId', '-1', '[ ' + i18n_select_data_set + ' ]' ); - - var dataSetValid = false; - - for ( i in dataSetList ) + + if ( json.dataSets.length > 0 ) { - $('#selectedDataSetId').append(''); + $( '#selectedDataSetId' ).removeAttr( 'disabled' ); + + addOptionById( 'selectedDataSetId', '-1', '[ ' + i18n_select_data_set + ' ]' ); + + jQuery.each( json.dataSets, function( i, item ) + { + if ( item.id == currentDataSetId ) + { + $('#selectedDataSetId').append(''); + } + else + { + $('#selectedDataSetId').append(''); + } + } ); + + enable( 'selectedDataSetId' ); + var periodType = $( '#selectedDataSetId option:selected' ).attr( 'periodType' ); + + if ( currentPeriodType && currentPeriodType != -1 && currentPeriodType == periodType ) + { + loadForm( currentDataSetId, getFieldValue( 'valueInput' ) ); + } + } else { + resetCriteriaDiv(); } - - enable('selectedDataSetId'); } }); } @@ -198,9 +213,19 @@ } ); } -function clearPeriod() +function resetCriteriaDiv() { - clearListById( 'selectedPeriodId' ); + currentDataSetId = null; + currentPeriodType = null; + + clearListById( 'selectedPeriodId' ); + + hideById( 'chapterTR' ); + hideById( 'attributeTR' ); + + byId( 'inputCriteria' ).style.width = '504px'; + byId( 'inputCriteria' ).style.height = '80px'; + clearEntryForm(); } @@ -218,7 +243,7 @@ function loadForm( dataSetId, value ) { - hideExportDiv(); + //hideExportDiv(); showLoader(); $( '#contentDiv' ).load( 'loadForm.action', @@ -326,6 +351,8 @@ clearListById( 'selectedPeriodId' ); + addOptionById( 'selectedPeriodId', '-1', '[ ' + i18n_select_period + ' ]' ); + for ( i in periods ) { addOptionById( 'selectedPeriodId', periods[i].id, periods[i].name ); @@ -348,6 +375,7 @@ $( '#prevButton' ).removeAttr( 'disabled' ); $( '#nextButton' ).removeAttr( 'disabled' ); $( '#valueInput' ).val(''); + var dataSetId = $( '#selectedDataSetId option:selected' ).val(); var periodId = $( '#selectedPeriodId option:selected' ).val(); var periodType = $( '#selectedDataSetId option:selected' ).attr('periodType'); @@ -356,14 +384,14 @@ if ( dataSetId != -1 ) { + addOptionById( 'selectedPeriodId', "-1", '[ ' + i18n_select_period + ' ]' ); + for ( i in periods ) { addOptionById( 'selectedPeriodId', periods[i].id, periods[i].name ); } - var previousPeriodType = currentDataSetId ? periodType : null; - - if ( periodId && periodId != -1 && previousPeriodType && previousPeriodType == periodType ) + if ( periodId && periodId != -1 && currentPeriodType && currentPeriodType == periodType ) { $( '#selectedPeriodId' ).val( periodId ); } @@ -373,8 +401,10 @@ } currentDataSetId = dataSetId; + currentPeriodType = periodType; - loadSubDataSets( dataSetId ); + //loadSubDataSets( dataSetId ); + loadAttributeValues( dataSetId ); } } @@ -441,20 +471,25 @@ autoCompletedField(); - byId( 'inputCriteria' ).style.width = '670px'; - byId( 'inputCriteria' ).style.height = '320px'; - - hideById( 'departmentTitleDiv' ); - hideById( 'departmentDiv' ); - showById( 'attributeDiv' ); + byId( 'inputCriteria' ).style.width = '504px'; + byId( 'inputCriteria' ).style.height = '130px'; + + //hideById( 'departmentTitleDiv' ); + //hideById( 'departmentDiv' ); + + showById( 'chapterTR' ); + showById( 'attributeTR' ); } else { - byId( 'inputCriteria' ).style.width = '640px'; - byId( 'inputCriteria' ).style.height = '250px'; + byId( 'inputCriteria' ).style.width = '504px'; + byId( 'inputCriteria' ).style.height = '80px'; - hideById( 'attributeDiv' ); + hideById( 'chapterTR' ); + hideById( 'attributeTR' ); } + + jQuery( '#selectedPeriodId' ).bind( 'change', periodSelected ); } ); } @@ -529,29 +564,34 @@ function periodSelected() { var periodName = $( '#selectedPeriodId option:selected' ).text(); - var dataSetId = $( '#selectedDataSetId option:selected' ).val(); - - $( '#currentPeriod' ).html( periodName ); - - var periodId = getFieldValue( 'selectedPeriodId' ); - - if ( periodId && periodId != -1 ) - { - if ( hasElements( 'subDataSetId' ) && getFieldValue( 'subDataSetId' ) == null ) - { - return; - } - else if ( getFieldValue( 'subDataSetId' ) ) - { - dataSetId = $( '#subDataSetId option:selected' ).val(); - } - - showLoader(); - loadForm( dataSetId, getFieldValue( 'valueInput' ) ); - } - else + var dataSetId = $( '#selectedDataSetId option:selected' ).val(); + + if ( dataSetId && dataSetId != -1 ) { - clearEntryForm(); + $( '#currentPeriod' ).html( periodName ); + + var periodId = getFieldValue( 'selectedPeriodId' ); + + if ( periodId && periodId != -1 ) + { + if ( hasElements( 'subDataSetId' ) && getFieldValue( 'subDataSetId' ) == null ) + { + return; + } + else if ( getFieldValue( 'subDataSetId' ) ) + { + dataSetId = $( '#subDataSetId option:selected' ).val(); + } + + showLoader(); + loadForm( dataSetId, getFieldValue( 'valueInput' ) ); + } + else + { + clearEntryForm(); + } + } else { + setHeaderDelayMessage( i18n_please_select_data_set ); } } === modified file 'local/vn/dhis-web-dataentry-hospital/src/main/webapp/dhis-web-dataentry-hospital/select.vm' --- local/vn/dhis-web-dataentry-hospital/src/main/webapp/dhis-web-dataentry-hospital/select.vm 2012-07-06 19:43:15 +0000 +++ local/vn/dhis-web-dataentry-hospital/src/main/webapp/dhis-web-dataentry-hospital/select.vm 2012-08-08 10:57:13 +0000 @@ -26,65 +26,48 @@ - -
-
+
- - - - - - - + + + + + + + + - - - - - - - - - + + + + + + + - - - - - +
-
- [ $i18n.getString( 'select_from_tree' ) ]
[ $i18n.getString( 'select_from_tree' ) ]
+ +
- -
+
- - -
@@ -144,7 +127,7 @@