dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #20750
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 9634: [mobile] fix the light module. Follow the desktop change
------------------------------------------------------------
revno: 9634
committer: Long <Long@Long-Laptop>
branch nick: dhis2
timestamp: Mon 2013-01-28 16:42:58 +0700
message:
[mobile] fix the light module. Follow the desktop change
modified:
dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/beneficiaryenrollment/action/GetProgramEnrollmentFormAction.java
dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/action/GetSectionFormAction.java
dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/GetPatientProgramListAction.java
dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/GetProgramStageListAction.java
dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/SaveProgramStageFormAction.java
dhis-2/dhis-web/dhis-web-light/src/main/resources/struts.xml
dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/namebased/beneficiaryProgramList.vm
dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/namebased/beneficiaryProgramStageList.vm
--
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/beneficiaryenrollment/action/GetProgramEnrollmentFormAction.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/beneficiaryenrollment/action/GetProgramEnrollmentFormAction.java 2012-10-03 07:23:08 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/beneficiaryenrollment/action/GetProgramEnrollmentFormAction.java 2013-01-28 09:42:58 +0000
@@ -149,12 +149,20 @@
this.patientAttributes = patientAttributes;
}
+ public static final String REDIRECT = "redirect";
+
@Override
public String execute()
throws Exception
{
patient = patientService.getPatient( patientId );
program = programService.getProgram( programId );
+
+ if ( this.program.isSingleEvent() )
+ {
+ return REDIRECT;
+ }
+
patientAttributes = program.getPatientAttributes();
patientIdentifierTypes = program.getPatientIdentifierTypes();
now = new SimpleDateFormat( "yyyy-MM-dd" ).format( new Date() );
=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/action/GetSectionFormAction.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/action/GetSectionFormAction.java 2012-04-07 10:23:28 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/action/GetSectionFormAction.java 2013-01-28 09:42:58 +0000
@@ -253,6 +253,7 @@
{
for ( DataElementOperand operand : section.getGreyedFields() )
{
+ System.out.println("Grey field:" + operand.getDataElement().getId() + ":" + operand.getCategoryOptionCombo().getId());
greyedFields.put( operand.getDataElement().getId() + ":" + operand.getCategoryOptionCombo().getId(),
true );
}
=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/GetPatientProgramListAction.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/GetPatientProgramListAction.java 2012-09-27 06:54:00 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/GetPatientProgramListAction.java 2013-01-28 09:42:58 +0000
@@ -68,9 +68,9 @@
{
this.programInstanceService = programInstanceService;
}
-
+
private PatientIdentifierService patientIdentifierService;
-
+
public PatientIdentifierService getPatientIdentifierService()
{
return patientIdentifierService;
@@ -128,9 +128,9 @@
{
this.relationshipService = relationshipService;
}
-
+
public RelationshipTypeService relationshipTypeService;
-
+
public RelationshipTypeService getRelationshipTypeService()
{
return relationshipTypeService;
@@ -192,9 +192,9 @@
{
this.enrollmentProgramList = enrollmentProgramList;
}
-
- private Map<Relationship,Patient> relatedPeople;
-
+
+ private Map<Relationship, Patient> relatedPeople;
+
public Map<Relationship, Patient> getRelatedPeople()
{
return relatedPeople;
@@ -206,7 +206,7 @@
}
private Collection<RelationshipType> relationshipTypes;
-
+
public Collection<RelationshipType> getRelationshipTypes()
{
return relationshipTypes;
@@ -216,9 +216,9 @@
{
this.relationshipTypes = relationshipTypes;
}
-
+
private Boolean validated;
-
+
public Boolean getValidated()
{
return validated;
@@ -228,9 +228,9 @@
{
this.validated = validated;
}
-
+
private Collection<PatientIdentifier> patientIdentifiers;
-
+
public Collection<PatientIdentifier> getPatientIdentifiers()
{
return patientIdentifiers;
@@ -240,9 +240,9 @@
{
this.patientIdentifiers = patientIdentifiers;
}
-
+
private List<ProgramInstance> listOfCompletedProgram;
-
+
public List<ProgramInstance> getListOfCompletedProgram()
{
return listOfCompletedProgram;
@@ -258,7 +258,7 @@
patient = patientService.getPatient( patientId );
for ( ProgramInstance programInstance : programInstanceService.getProgramInstances( patient ) )
{
- if ( !programInstance.getProgram().isSingleEvent() && !programInstance.isCompleted())
+ if ( !programInstance.isCompleted() )
{
programInstances.add( programInstance );
}
@@ -271,31 +271,31 @@
{
if ( relationship.getPatientA().getId() != patient.getId() )
{
- relatedPeople.put( relationship, relationship.getPatientA());
+ relatedPeople.put( relationship, relationship.getPatientA() );
}
if ( relationship.getPatientB().getId() != patient.getId() )
{
- relatedPeople.put( relationship, relationship.getPatientB());
+ relatedPeople.put( relationship, relationship.getPatientB() );
}
}
-
+
relationshipTypes = relationshipTypeService.getAllRelationshipTypes();
-
+
patientIdentifiers = patientIdentifierService.getPatientIdentifiers( patient );
-
+
Collection<ProgramInstance> listOfProgramInstance = programInstanceService.getProgramInstances( patient );
-
+
this.listOfCompletedProgram = new ArrayList<ProgramInstance>();
-
- for( ProgramInstance each: listOfProgramInstance )
+
+ for ( ProgramInstance each : listOfProgramInstance )
{
- if( each.isCompleted() )
+ if ( each.isCompleted() )
{
this.listOfCompletedProgram.add( each );
}
}
-
+
return SUCCESS;
}
@@ -305,7 +305,7 @@
for ( Program program : programService.getPrograms( patient.getOrganisationUnit() ) )
{
- if ( !program.isSingleEvent() )
+ if ( (program.isSingleEvent() && program.isRegistration()) || !program.isSingleEvent() )
{
if ( programInstanceService.getProgramInstances( patient, program ).size() == 0 )
{
=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/GetProgramStageListAction.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/GetProgramStageListAction.java 2012-07-16 07:53:40 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/GetProgramStageListAction.java 2013-01-28 09:42:58 +0000
@@ -177,16 +177,30 @@
{
return new SimpleDateFormat( "yyyy-MM-dd" );
}
+
+ private ProgramInstance programInstance;
+
+ public ProgramInstance getProgramInstance()
+ {
+ return programInstance;
+ }
+
+ public void setProgramInstance( ProgramInstance programInstance )
+ {
+ this.programInstance = programInstance;
+ }
@Override
public String execute()
throws Exception
{
- ProgramInstance programInstance = programInstanceService.getProgramInstance( programInstanceId );
+ programInstance = programInstanceService.getProgramInstance( programInstanceId );
+
exclusedRepeatableStages = new HashMap<Integer, ProgramStage>();
patient = patientService.getPatient( patientId );
programStageInstances = programInstance.getProgramStageInstances();
repeatableStages = new HashSet<ProgramStage>();
+
Set<ProgramStage> programStages = programInstance.getProgram().getProgramStages();
for ( ProgramStage programStage : programStages )
@@ -199,6 +213,7 @@
for ( ProgramStageInstance programStageInstance : programStageInstances )
{
+
ProgramStage programStage = programStageInstance.getProgramStage();
if ( programStage.getIrregular() && !programStageInstance.isCompleted() )
{
=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/SaveProgramStageFormAction.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/SaveProgramStageFormAction.java 2013-01-16 10:29:01 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/SaveProgramStageFormAction.java 2013-01-28 09:42:58 +0000
@@ -554,6 +554,7 @@
}
programStageInstance.setCompleted( true );
+ programStageInstance.setExecutionDate( new Date() );
programStageInstanceService.updateProgramStageInstance( programStageInstance );
}
=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-light/src/main/resources/struts.xml 2012-12-18 08:47:37 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/resources/struts.xml 2013-01-28 09:42:58 +0000
@@ -330,7 +330,8 @@
<action name="showProgramEnrollmentForm"
class="org.hisp.dhis.light.beneficiaryenrollment.action.GetProgramEnrollmentFormAction">
- <result name="success" type="velocity">/dhis-web-light/main.vm</result>
+ <result name="success" type="velocity">/dhis-web-light/main.vm</result>
+ <result name="redirect" type="redirect">/light/showSingleEventForm.action?programId=${program.getId()}&patientId=${patient.getId()}&organisationUnitId=${patient.getOrganisationUnit().getId()}&isEditing=false</result>
<param name="page">/dhis-web-light/enrollment/programEnrollmentForm.vm</param>
</action>
@@ -366,7 +367,7 @@
<action name="saveSingleEvent"
class="org.hisp.dhis.light.singleevent.action.SaveSingleEventAction">
<result name="success" type="redirect">
- /light/selectSingleEventBeneficiary.action?programId=${programId}&organisationUnitId=${organisationUnitId}&validated=true
+ /light/showPatientProgramList.action?patientId=${patientId}
</result>
<result name="error" type="velocity">/dhis-web-light/main.vm</result>
<result name="redirect" type="redirect">findSingleEventOptionSet.action?keyword=${keyword}&dataElementIdForSearching=${dataElementIdForSearching}&organisationUnitId=${organisationUnitId}&patientId=${patientId}&programId=${programId}&programStageInstanceId=${programStageInstanceId}&isEditing=${isEditing}</result>
=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/namebased/beneficiaryProgramList.vm'
--- dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/namebased/beneficiaryProgramList.vm 2012-10-12 09:22:44 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/namebased/beneficiaryProgramList.vm 2013-01-28 09:42:58 +0000
@@ -10,21 +10,25 @@
<ul>
#if( $programInstances.size() > 0)
#foreach( $programInstance in $programInstances )
- <li>
- <a href="showPatientProgramStageList.action?patientId=$patientId&programInstanceId=$programInstance.getId()&programId=$programInstance.getProgram().getId()&validated=false">
- $programInstance.getProgram().getName()
- </a>
- </li>
-
- #set($nextStage = false)
- #set($nextStage = $util.getNextStage( $programInstance.getProgramStageInstances()))
-
- #if($nextStage)
- <li>
- <a href="showProgramStageSection.action?programId=$programInstance.getProgram().getId()&programStageId=$nextStage.getProgramStage().getId()&programStageInstanceId=$nextStage.getId()&patientId=$patient.getId()&programInstanceId=$programInstance.getId()&orgUnitId=0"> - Next: $nextStage.getProgramStage().getName()</a>
+ #if($programInstance.getProgram().isSingleEvent())
+ <li><a href="showSingleEventForm.action?programId=$programInstance.getProgram().getId()&patientId=$patientId&organisationUnitId=$patient.getOrganisationUnit().getId()&isEditing=true">$programInstance.getProgram().getName()</a></li>
+ #else
+ <li>
+ <a href="showPatientProgramStageList.action?patientId=$patientId&programInstanceId=$programInstance.getId()&programId=$programInstance.getProgram().getId()&validated=false">
+ $programInstance.getProgram().getName()
+ </a>
</li>
- #end
- #end
+
+ #set($nextStage = false)
+ #set($nextStage = $util.getNextStage( $programInstance.getProgramStageInstances()))
+
+ #if($nextStage)
+ <li>
+ <a href="showProgramStageSection.action?programId=$programInstance.getProgram().getId()&programStageId=$nextStage.getProgramStage().getId()&programStageInstanceId=$nextStage.getId()&patientId=$patient.getId()&programInstanceId=$programInstance.getId()&orgUnitId=0"> - Next: $nextStage.getProgramStage().getName()</a>
+ </li>
+ #end
+ #end
+ #end
#else
<li>$i18n.getString("no_enrolled_programs")</li>
#end
@@ -35,11 +39,15 @@
<ul>
#if( $listOfCompletedProgram.size() != 0 )
#foreach( $programInstance in $listOfCompletedProgram )
- #if( $programInstance.getProgram().getProgramStages().size() > 1)
- $programInstance.getProgram().getName()
- #else
- <a href="showSingleEventForm.action?programId=$programInstance.program.id&patientId=$patient.id&organisationUnitId=$patient.organisationUnit.id&isEditing=true">$programInstance.getProgram().getName()</a>
- #end
+ #if($programInstance.getProgram().isSingleEvent())
+ <li><a href="showSingleEventForm.action?programId=$programInstance.getProgram().getId()&patientId=$patientId&organisationUnitId=$patient.getOrganisationUnit().getId()&isEditing=true">$programInstance.getProgram().getName()</a></li>
+
+ #else
+ <li><a href="showPatientProgramStageList.action?patientId=$patientId&programInstanceId=$programInstance.getId()&programId=$programInstance.getProgram().getId()&validated=false">
+ $programInstance.getProgram().getName()
+ </a></li>
+ #end
+
#end
#else
<li>$i18n.getString("no_completed_programs")</li>
=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/namebased/beneficiaryProgramStageList.vm'
--- dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/namebased/beneficiaryProgramStageList.vm 2012-10-25 08:59:17 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/namebased/beneficiaryProgramStageList.vm 2013-01-28 09:42:58 +0000
@@ -13,17 +13,25 @@
#foreach( $programStageInstance in $programStageInstances )
#set($programInstanceId = $programStageInstance.getProgramInstance().getId())
#set($i = $i + 1)
+ #set($blockEntryForm = $programInstance.getProgram().getBlockEntryForm())
#if ($i == $programStageInstances.size() - 1)
#set($currentProgramStageInstanceId = $programStageInstance.getId())
#end
<li>
- #if( $programStageInstance.isCompleted() == true )
- <a href="showProgramStageSection.action?programId=$programId&programStageId=$programStageInstance.getProgramStage().getId()&programStageInstanceId=$programStageInstance.getId()&patientId=$patient.getId()&programInstanceId=$programStageInstance.getProgramInstance().getId()&orgUnitId=0&validated=false">
- $programStageInstance.getProgramStage().getName() (${dateFormat.format( $programStageInstance.executionDate )}) <img src="../dhis-web-light/images/checkmark.jpg" /></a>
- #else
- <a href="showProgramStageSection.action?programId=$programId&programStageId=$programStageInstance.getProgramStage().getId()&programStageInstanceId=$programStageInstance.getId()&patientId=$patient.getId()&programInstanceId=$programStageInstance.getProgramInstance().getId()&orgUnitId=0&validated=false">
- $programStageInstance.getProgramStage().getName() (${dateFormat.format( $programStageInstance.dueDate)})</a>
- #end
+
+ #if ($programStageInstance.executionDate)
+ #set($displayDate = ${dateFormat.format( $programStageInstance.executionDate )})
+ #else
+ #set($displayDate = ${dateFormat.format( $programStageInstance.dueDate)})
+ #end
+
+ #if($programInstance.isCompleted() && $programInstance.getProgram().getBlockEntryForm())
+ $programStageInstance.getProgramStage().getName() ($displayDate) #if ($programStageInstance.isCompleted() == true) <img src="../dhis-web-light/images/checkmark.jpg" /> #end
+ #else
+ <a href="showProgramStageSection.action?programId=$programId&programStageId=$programStageInstance.getProgramStage().getId()&programStageInstanceId=$programStageInstance.getId()&patientId=$patient.getId()&programInstanceId=$programStageInstance.getProgramInstance().getId()&orgUnitId=0&validated=false">
+ $programStageInstance.getProgramStage().getName() ($displayDate) #if ($programStageInstance.isCompleted() == true) <img src="../dhis-web-light/images/checkmark.jpg" /> #end </a>
+ #end
+
</li>
#end
<br/>