dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #18234
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 7615: (mobile) have due/report date in () on stage list
------------------------------------------------------------
revno: 7615
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2012-07-16 10:53:40 +0300
message:
(mobile) have due/report date in () on stage list
modified:
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/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/namebaseddataentry/action/GetProgramStageListAction.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/GetProgramStageListAction.java 2012-05-31 09:37:26 +0000
+++ 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
@@ -27,17 +27,20 @@
package org.hisp.dhis.light.namebaseddataentry.action;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
+import com.opensymphony.xwork2.Action;
import org.hisp.dhis.patient.Patient;
import org.hisp.dhis.patient.PatientService;
import org.hisp.dhis.program.ProgramInstance;
import org.hisp.dhis.program.ProgramInstanceService;
import org.hisp.dhis.program.ProgramStage;
import org.hisp.dhis.program.ProgramStageInstance;
-import com.opensymphony.xwork2.Action;
+
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
public class GetProgramStageListAction
implements Action
@@ -147,7 +150,7 @@
}
private Set<ProgramStage> repeatableStages;
-
+
public Set<ProgramStage> getRepeatableStages()
{
return repeatableStages;
@@ -157,9 +160,9 @@
{
this.repeatableStages = repeatableStages;
}
-
+
private Map<Integer, ProgramStage> exclusedRepeatableStages;
-
+
public Map<Integer, ProgramStage> getExclusedRepeatableStages()
{
return exclusedRepeatableStages;
@@ -170,6 +173,11 @@
this.exclusedRepeatableStages = exclusedRepeatableStages;
}
+ public DateFormat getDateFormat()
+ {
+ return new SimpleDateFormat( "yyyy-MM-dd" );
+ }
+
@Override
public String execute()
throws Exception
@@ -180,21 +188,24 @@
programStageInstances = programInstance.getProgramStageInstances();
repeatableStages = new HashSet<ProgramStage>();
Set<ProgramStage> programStages = programInstance.getProgram().getProgramStages();
-
- for (ProgramStage programStage : programStages) {
- if (programStage.getIrregular()) {
+
+ for ( ProgramStage programStage : programStages )
+ {
+ if ( programStage.getIrregular() )
+ {
repeatableStages.add( programStage );
}
}
-
+
for ( ProgramStageInstance programStageInstance : programStageInstances )
{
- ProgramStage programStage = programStageInstance.getProgramStage();
- if (programStage.getIrregular() && !programStageInstance.isCompleted()) {
- exclusedRepeatableStages.put( programStage.getId(), programStage );
- }
+ ProgramStage programStage = programStageInstance.getProgramStage();
+ if ( programStage.getIrregular() && !programStageInstance.isCompleted() )
+ {
+ exclusedRepeatableStages.put( programStage.getId(), programStage );
+ }
}
-
+
return SUCCESS;
}
=== 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-05-31 09:37:26 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/namebased/beneficiaryProgramStageList.vm 2012-07-16 07:53:40 +0000
@@ -1,16 +1,14 @@
<h2>$!encoder.htmlEncode( ${patient.getFullName()} )</h2>
#if( $validated == true)
- <div class="header-box">
- <h3 style="text-align: left;">$i18n.getString("successfully_saved")</h3>
- </div>
- #else
-
- #end
-
+ <div class="header-box">
+ <h3 style="text-align: left;">$i18n.getString("successfully_saved")</h3>
+ </div>
+#end
<p>
<ul>
#set($i = 0)
+
#foreach( $programStageInstance in $programStageInstances )
#set($programInstanceId = $programStageInstance.getProgramInstance().getId())
#set($i = $i + 1)
@@ -20,10 +18,10 @@
<li>
#if( $programStageInstance.isCompleted() == true )
<a href="showCompletedProgramStageForm.action?programId=$programId&programStageId=$programStageInstance.getProgramStage().getId()&programStageInstanceId=$programStageInstance.getId()&patientId=$patient.getId()&programInstanceId=$programStageInstance.getProgramInstance().getId()&orgUnitId=0">
- $programStageInstance.getProgramStage().getName()<img src="../dhis-web-light/images/checkmark.jpg" /></a>
+ $programStageInstance.getProgramStage().getName() (${dateFormat.format( $programStageInstance.executionDate )}) <img src="../dhis-web-light/images/checkmark.jpg" /></a>
#else
<a href="showProgramStageForm.action?programId=$programId&programStageId=$programStageInstance.getProgramStage().getId()&programStageInstanceId=$programStageInstance.getId()&patientId=$patient.getId()&programInstanceId=$programStageInstance.getProgramInstance().getId()&orgUnitId=0">
- $programStageInstance.getProgramStage().getName()</a>
+ $programStageInstance.getProgramStage().getName() (${dateFormat.format( $programStageInstance.dueDate)})</a>
#end
</li>
#end