dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #21759
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 10392: [mobile] minor fix
------------------------------------------------------------
revno: 10392
committer: Long <Long@Long-Laptop>
branch nick: dhis2
timestamp: Fri 2013-03-22 10:45:13 +0700
message:
[mobile] minor fix
modified:
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/resources/META-INF/dhis/beans.xml
--
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-19 09:04:05 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/anonymous/action/GetAllAnonymousProgramAction.java 2013-03-22 03:45:13 +0000
@@ -30,9 +30,9 @@
import java.util.ArrayList;
import java.util.Collection;
+import org.hisp.dhis.organisationunit.OrganisationUnitService;
import org.hisp.dhis.program.Program;
import org.hisp.dhis.program.ProgramService;
-
import com.opensymphony.xwork2.Action;
/**
@@ -89,6 +89,18 @@
{
this.orgUnitId = orgUnitId;
}
+
+ private OrganisationUnitService organisationUnitService;
+
+ public OrganisationUnitService getOrganisationUnitService()
+ {
+ return organisationUnitService;
+ }
+
+ public void setOrganisationUnitService( OrganisationUnitService organisationUnitService )
+ {
+ this.organisationUnitService = organisationUnitService;
+ }
// -------------------------------------------------------------------------
// Implementation Action
@@ -101,7 +113,7 @@
programs = new ArrayList<Program>();
for ( Program program : programService.getProgramsByCurrentUser() )
{
- if ( program.isSingleEvent() && !program.isRegistration() )
+ if ( program.isSingleEvent() && !program.isRegistration() && program.getOrganisationUnits().contains( organisationUnitService.getOrganisationUnit( orgUnitId ) ) )
{
programs.add( program );
}
=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-light/src/main/resources/META-INF/dhis/beans.xml 2013-03-20 07:14:26 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/resources/META-INF/dhis/beans.xml 2013-03-22 03:45:13 +0000
@@ -535,6 +535,7 @@
class="org.hisp.dhis.light.anonymous.action.GetAllAnonymousProgramAction"
scope="prototype">
<property name="programService" ref="org.hisp.dhis.program.ProgramService" />
+ <property name="organisationUnitService" ref="org.hisp.dhis.organisationunit.OrganisationUnitService" />
</bean>
<bean id="org.hisp.dhis.light.anonymous.action.ShowAnonymousFormAction"