← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 13496: Approval, minor

 

------------------------------------------------------------
revno: 13496
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2013-12-30 17:18:17 +0100
message:
  Approval, minor
modified:
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/DataApprovalController.java
  dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/dataSetReport.js


--
lp:dhis2
https://code.launchpad.net/~dhis2-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
=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/DataApprovalController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/DataApprovalController.java	2013-12-30 14:07:06 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/DataApprovalController.java	2013-12-30 16:18:17 +0000
@@ -142,10 +142,10 @@
             mayUnapprove = dataApprovalService.mayUnapprove( approval );
         }
         
-        Map<String, String> approvalState = new HashMap<String, String>();
+        Map<String, Object> approvalState = new HashMap<String, Object>();
         approvalState.put( APPROVAL_STATE, state.toString() );
-        approvalState.put( APPROVAL_MAY_APPROVE, String.valueOf( mayApprove ) );
-        approvalState.put( APPROVAL_MAY_UNAPPROVE, String.valueOf( mayUnapprove ) );
+        approvalState.put( APPROVAL_MAY_APPROVE, mayApprove );
+        approvalState.put( APPROVAL_MAY_UNAPPROVE, mayUnapprove );
         
         JacksonUtils.toJson( response.getOutputStream(), approvalState );
     }

=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/dataSetReport.js'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/dataSetReport.js	2013-12-30 16:04:54 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/dataSetReport.js	2013-12-30 16:18:17 +0000
@@ -352,7 +352,7 @@
 		if ( "READY_FOR_APPROVAL" == state ) {
 			$( "#approvalNotification" ).show().html( i18n_ready_for_approval );
 			
-			if ( json.mayApprove == "true" ) {
+			if ( json.mayApprove ) {
 				$( "#approvalDiv" ).show();
 				$( "#approveButton" ).prop( "disabled", false );
 				$( "#unapproveButton" ).prop( "disabled", true );
@@ -361,7 +361,7 @@
 		else if ( "APPROVED" == state ) {
 			$( "#approvalNotification" ).show().html( i18n_approved );
 			
-			if ( json.mayUnapprove == "true") {
+			if ( json.mayUnapprove ) {
 				$( "#approvalDiv" ).show();
 				$( "#approveButton" ).prop( "disabled", true );
 				$( "#unapproveButton" ).prop( "disabled", false );