=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/resources/org/hisp/dhis/reporting/i18n_module.properties' --- dhis-2/dhis-web/dhis-web-reporting/src/main/resources/org/hisp/dhis/reporting/i18n_module.properties 2016-02-09 21:30:25 +0000 +++ dhis-2/dhis-web/dhis-web-reporting/src/main/resources/org/hisp/dhis/reporting/i18n_module.properties 2016-03-04 15:23:40 +0000 @@ -265,4 +265,6 @@ approval_entity=Approval entity approval_status=Approval status please_make_selection=Please make a selection below -data_criteria=Data criteria \ No newline at end of file +data_criteria=Data criteria +approval_level=Approval level +not_yet_approved=Not yet approved \ No newline at end of file === modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/dataApprovalForm.vm' --- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/dataApprovalForm.vm 2016-02-17 19:02:47 +0000 +++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/dataApprovalForm.vm 2016-03-04 15:23:40 +0000 @@ -19,6 +19,8 @@ var i18n_select_items_for = '$encoder.jsEscape( $i18n.getString( "select_items_for" ), "'")'; var i18n_item = '$encoder.jsEscape( $i18n.getString( "item" ), "'")'; var i18n_organisation_unit = '$encoder.jsEscape( $i18n.getString( "organisation_unit" ), "'")'; +var i18n_approval_level = '$encoder.jsEscape( $i18n.getString( "approval_level" ), "'")'; +var i18n_not_yet_approved = '$encoder.jsEscape( $i18n.getString( "not_yet_approved" ), "'")'; var i18n_action = '$encoder.jsEscape( $i18n.getString( "action" ), "'")'; var i18n_generating_report = '$encoder.jsEscape( $i18n.getString( "generating_report" ), "'")'; var i18n_select_option_view_all = '$encoder.jsEscape( $i18n.getString( "select_option_view_all" ) , "'")'; === modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/dataApproval.js' --- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/dataApproval.js 2016-03-04 14:43:52 +0000 +++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/dataApproval.js 2016-03-04 15:23:40 +0000 @@ -4,6 +4,7 @@ dhis2.appr.currentPeriodOffset = 0; dhis2.appr.permissions = null; dhis2.appr.dataSets = {}; +dhis2.appr.dataApprovalLevels = {}; /** * Object with properties: ds, pe, ou, array of approvals with aoc, ou. @@ -33,6 +34,12 @@ $( "#dataSetId" ).html( dsHtml ); } ); + + $.getJSON( "../api/dataApprovalLevels.json", function( json ) { + $.each( json.dataApprovalLevels, function( inx, al ) { + dhis2.appr.dataApprovalLevels[al.id] = al; + } ); + } ); } ); /** @@ -120,19 +127,28 @@ $.getJSON( apUrl, function( approvals ) { html = ""; - html += ""; + html += ""; + html += ""; $.each( approvals, function( inx, ap ) { var cocName = cocs[ap.id].displayName, - pm = ap.permissions; + pm = ap.permissions, + level, + levelName = i18n_not_yet_approved; + + if ( ap.level && ap.level.hasOwnProperty( "level" ) ) { + level = dhis2.appr.dataApprovalLevels[ap.level.id]; + levelName = level && level.displayName ? level.displayName : levelName; + } if ( cocName && pm ) { html += ""; html += ""; + html += "data-approve='" + pm.mayApprove + "' data-unapprove='" + pm.mayUnapprove + "' data-accept='" + pm.mayAccept + "' data-unaccept='" + pm.mayUnaccept + "'>"; + html += ""; html += ""; + html += ""; html += ""; html += ""; } === modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/style/dhis-web-reporting.css' --- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/style/dhis-web-reporting.css 2016-03-03 18:48:22 +0000 +++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/style/dhis-web-reporting.css 2016-03-04 15:23:40 +0000 @@ -31,9 +31,21 @@ #attributeOptionComboTable { + border-collapse: collapse; width: 97%; } +#attributeOptionComboTable th +{ + padding: 2px 3px 2px 3px; +} + +#attributeOptionComboTable td +{ + padding: 5px 3px 6px 3px; + border-bottom: 1px solid #e0e0e0; +} + #attributeOptionComboItemDiv { height: 460px;
" + i18n_item + "" + i18n_organisation_unit + "" + i18n_action + "
" + i18n_item + "" + i18n_organisation_unit + "" + i18n_approval_level + "" + i18n_action + "
"; - html += "" + ap.ouName + "" + levelName + "" + dhis2.appr.getPermissions( ap ) + "