← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 10306: [mobile] load the correct anonymous programs

 

------------------------------------------------------------
revno: 10306
committer: Long <Long@Long-Laptop>
branch nick: dhis2
timestamp: Tue 2013-03-19 16:04:05 +0700
message:
  [mobile] load the correct anonymous programs
modified:
  dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/anonymous/action/GetAllAnonymousProgramAction.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-web/dhis-web-light/src/main/java/org/hisp/dhis/light/anonymous/action/GetAllAnonymousProgramAction.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/anonymous/action/GetAllAnonymousProgramAction.java	2013-03-18 10:02:07 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/anonymous/action/GetAllAnonymousProgramAction.java	2013-03-19 09:04:05 +0000
@@ -77,9 +77,9 @@
     {
         this.validated = validated;
     }
-    
+
     private int orgUnitId;
-    
+
     public int getOrgUnitId()
     {
         return orgUnitId;
@@ -93,12 +93,19 @@
     // -------------------------------------------------------------------------
     // Implementation Action
     // -------------------------------------------------------------------------
-    
+
     @Override
     public String execute()
         throws Exception
     {
-        programs = programService.getProgramsByCurrentUser( Program.SINGLE_EVENT_WITHOUT_REGISTRATION );
+        programs = new ArrayList<Program>();
+        for ( Program program : programService.getProgramsByCurrentUser() )
+        {
+            if ( program.isSingleEvent() && !program.isRegistration() )
+            {
+                programs.add( program );
+            }
+        }
         return SUCCESS;
     }
 }