=== 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 2012-11-14 17:12:21 +0000 +++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js 2012-11-15 11:11:53 +0000 @@ -65,6 +65,7 @@ var FORMTYPE_CUSTOM = 'custom'; var FORMTYPE_SECTION = 'section'; +var FORMTYPE_MULTIORG_SECTION = 'multiorg_section'; var FORMTYPE_DEFAULT = 'default'; var EVENT_FORM_LOADED = "dhis-web-dataentry-form-loaded"; @@ -249,7 +250,7 @@ $( '#sync_button' ).bind( 'click', uploadLocalData ); } } ); - }; + } ( function pushDataValues( array ) { @@ -595,21 +596,6 @@ } } -function resetSectionFilters() -{ - $( '#selectionBox' ).css( 'height', '93px' ); - $( '#filterDataSetSectionTr' ).hide(); - $( '.formSection' ).show(); -} - -function clearSectionFilters() -{ - $( '#filterDataSetSection' ).children().remove(); - $( '#selectionBox' ).css( 'height', '93px' ); - $( '#filterDataSetSectionTr' ).hide(); - $( '.formSection' ).show(); -} - function filterOnSection() { var $filterDataSetSection = $( '#filterDataSetSection' ); @@ -741,16 +727,15 @@ var dataSetList = []; - for ( i in orgUnitDataSets ) - { - var dataSetId = orgUnitDataSets[i]; + $.each(orgUnitDataSets, function(idx, item) { + var dataSetId = orgUnitDataSets[idx]; var dataSetName = dataSets[dataSetId].name; var row = []; row['id'] = dataSetId; row['name'] = dataSetName; - dataSetList[i] = row; - } + dataSetList[idx] = row; + }); dataSetList.sort( function( a, b ) { @@ -780,11 +765,11 @@ found = true; }); - if( !found && formType == 'section' ) + if( !found && formType == FORMTYPE_SECTION ) { filteredDataSetList.push(item); } - }) + }); return filteredDataSetList; } @@ -814,15 +799,14 @@ var dataSetValid = false; - for ( var i in dataSetList ) - { - addOptionById( 'selectedDataSetId', dataSetList[i].id, dataSetList[i].name ); + $.each(dataSetList, function(idx, item) { + addOptionById( 'selectedDataSetId', item.id, item.name ); - if ( dataSetId == dataSetList[i].id ) + if ( dataSetId == item.id ) { dataSetValid = true; } - } + }); if ( children ) { @@ -830,7 +814,7 @@ if( childrenDataSets && childrenDataSets.length > 0 ) { - $('#selectedDataSetId').append('') + $('#selectedDataSetId').append(''); $.each(childrenDataSets, function(idx, item) { $('