dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #19078
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 8182: Load health-workers list in add new person for relationship form.
------------------------------------------------------------
revno: 8182
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2012-09-21 17:27:45 +0700
message:
Load health-workers list in add new person for relationship form.
modified:
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/ShowAddRelationshipPatientAction.java
dhis-2/dhis-web/dhis-web-caseentry/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-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/ShowAddRelationshipPatientAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/ShowAddRelationshipPatientAction.java 2012-09-20 11:02:49 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/ShowAddRelationshipPatientAction.java 2012-09-21 10:27:45 +0000
@@ -30,9 +30,10 @@
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
-import java.util.List;
import java.util.Map;
+import org.hisp.dhis.organisationunit.OrganisationUnit;
+import org.hisp.dhis.ouwt.manager.OrganisationUnitSelectionManager;
import org.hisp.dhis.patient.Patient;
import org.hisp.dhis.patient.PatientAttribute;
import org.hisp.dhis.patient.PatientAttributeGroup;
@@ -47,6 +48,7 @@
import org.hisp.dhis.program.ProgramService;
import org.hisp.dhis.relationship.RelationshipType;
import org.hisp.dhis.relationship.RelationshipTypeService;
+import org.hisp.dhis.user.User;
import com.opensymphony.xwork2.Action;
@@ -74,6 +76,8 @@
private ProgramService programService;
+ private OrganisationUnitSelectionManager selectionManager;
+
// -------------------------------------------------------------------------
// Input/Output
// -------------------------------------------------------------------------
@@ -94,6 +98,8 @@
private Map<PatientAttributeGroup, Collection<PatientAttribute>> attributeGroupsMap = new HashMap<PatientAttributeGroup, Collection<PatientAttribute>>();
+ private Collection<User> healthWorkers;
+
// -------------------------------------------------------------------------
// Action implementation
// -------------------------------------------------------------------------
@@ -166,6 +172,9 @@
}
}
+ OrganisationUnit organisationUnit = selectionManager.getSelectedOrganisationUnit();
+ healthWorkers = organisationUnit.getUsers();
+
return SUCCESS;
}
@@ -173,11 +182,21 @@
// Getter/Setter
// -------------------------------------------------------------------------
+ public void setSelectionManager( OrganisationUnitSelectionManager selectionManager )
+ {
+ this.selectionManager = selectionManager;
+ }
+
public void setProgramService( ProgramService programService )
{
this.programService = programService;
}
+ public Collection<User> getHealthWorkers()
+ {
+ return healthWorkers;
+ }
+
public Map<PatientAttributeGroup, Collection<PatientAttribute>> getAttributeGroupsMap()
{
return attributeGroupsMap;
@@ -192,7 +211,7 @@
{
return identifierTypes;
}
-
+
public Collection<PatientAttribute> getNoGroupAttributes()
{
return noGroupAttributes;
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml 2012-09-20 13:04:02 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml 2012-09-21 10:27:45 +0000
@@ -778,6 +778,8 @@
<ref bean="org.hisp.dhis.relationship.RelationshipTypeService" />
</property>
<property name="programService" ref="org.hisp.dhis.program.ProgramService" />
+ <property name="selectionManager"
+ ref="org.hisp.dhis.ouwt.manager.OrganisationUnitSelectionManager" />
</bean>
<bean