← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 17818: Approvals: determine when waiting for first approval at a higher-level org unit.

 

------------------------------------------------------------
revno: 17818
committer: jimgrace@xxxxxxxxx
branch nick: dhis2
timestamp: Sun 2014-12-28 21:05:12 -0500
message:
  Approvals: determine when waiting for first approval at a higher-level org unit.
modified:
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataapproval/hibernate/HibernateDataApprovalStore.java


--
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-services/dhis-service-core/src/main/java/org/hisp/dhis/dataapproval/hibernate/HibernateDataApprovalStore.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataapproval/hibernate/HibernateDataApprovalStore.java	2014-12-28 23:40:22 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataapproval/hibernate/HibernateDataApprovalStore.java	2014-12-29 02:05:12 +0000
@@ -31,6 +31,7 @@
 import static org.hisp.dhis.dataapproval.DataApprovalState.ACCEPTED_HERE;
 import static org.hisp.dhis.dataapproval.DataApprovalState.APPROVED_ABOVE;
 import static org.hisp.dhis.dataapproval.DataApprovalState.APPROVED_HERE;
+import static org.hisp.dhis.dataapproval.DataApprovalState.UNAPPROVED_ABOVE;
 import static org.hisp.dhis.dataapproval.DataApprovalState.UNAPPROVED_READY;
 import static org.hisp.dhis.dataapproval.DataApprovalState.UNAPPROVED_WAITING;
 import static org.hisp.dhis.setting.SystemSettingManager.KEY_ACCEPTANCE_REQUIRED_FOR_APPROVAL;
@@ -418,9 +419,11 @@
 
                 DataApprovalState state = (
                     statusLevel == null ?
-                        readyBelow ?
-                            UNAPPROVED_READY :
-                            UNAPPROVED_WAITING :
+                        lowestApprovalLevelForOrgUnit == null ?
+                            UNAPPROVED_ABOVE :
+                            readyBelow ?
+                                UNAPPROVED_READY :
+                                UNAPPROVED_WAITING :
                         approvedAbove ?
                             APPROVED_ABOVE :
                             accepted ?