← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 12522: Only load programs which belong to user in Add/Find person function.

 

------------------------------------------------------------
revno: 12522
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2013-10-09 13:58:10 +0700
message:
  Only load programs which belong to user in Add/Find person function.
modified:
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/SelectAction.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-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/SelectAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/SelectAction.java	2013-09-05 19:12:06 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/SelectAction.java	2013-10-09 06:58:10 +0000
@@ -118,9 +118,11 @@
 
         patientAttributes = patientAttributeService.getAllPatientAttributes();
 
-        programs = new ArrayList<Program>( programService.getProgramsByCurrentUser() );
+        programs = new ArrayList<Program>( programService.getProgramsByDisplayOnAllOrgunit( true, null ) );
+        programs.addAll( programService.getProgramsByDisplayOnAllOrgunit( false, organisationUnit ) );
+        programs.retainAll( programService.getProgramsByCurrentUser() );
         programs.removeAll( programService.getPrograms( Program.SINGLE_EVENT_WITHOUT_REGISTRATION ) );
-
+        
         Collections.sort( programs, IdentifiableObjectNameComparator.INSTANCE );
 
         return SUCCESS;