dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #17916
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 7328: Minor Fix: improve UI (Tracking Anonymous)
------------------------------------------------------------
revno: 7328
committer: Lai <lai.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2012-06-19 10:45:39 +0700
message:
Minor Fix: improve UI (Tracking Anonymous)
modified:
dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/anonymous/action/SaveAnonymousProgramAction.java
dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/anonymous/action/ShowAnonymousFormAction.java
dhis-2/dhis-web/dhis-web-light/src/main/resources/org/hisp/dhis/light/i18n_module.properties
dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/anonymous/anonymousProgramForm.vm
dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/anonymous/anonymousProgramSelection.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/anonymous/action/SaveAnonymousProgramAction.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/anonymous/action/SaveAnonymousProgramAction.java 2012-06-18 10:29:46 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/anonymous/action/SaveAnonymousProgramAction.java 2012-06-19 03:45:39 +0000
@@ -145,6 +145,22 @@
this.programId = programId;
}
+ private ProgramStage programStage;
+
+ public ProgramStage getProgramStage()
+
+ {
+ return programStage;
+ }
+
+ private Program program;
+
+ public Program getProgram()
+
+ {
+ return program;
+ }
+
List<DataElement> dataElements = new ArrayList<DataElement>();
public List<DataElement> getDataElements()
@@ -181,13 +197,13 @@
throws Exception
{
- Program program = programService.getProgram( programId );
+ program = programService.getProgram( programId );
// -------------------------------------------------------------------------
// Getting all data from UI
// -------------------------------------------------------------------------
- ProgramStage programStage = program.getProgramStages().iterator().next();
+ programStage = program.getProgramStages().iterator().next();
programStageDataElements = new ArrayList<ProgramStageDataElement>( programStage.getProgramStageDataElements() );
@@ -250,23 +266,23 @@
programInstance.setDateOfIncident( new Date() );
programInstance.setProgram( program );
-
+
programInstance.setCompleted( false );
-
+
programInstanceService.addProgramInstance( programInstance );
ProgramStageInstance programStageInstance = new ProgramStageInstance();
-
+
programStageInstance.setProgramInstance( programInstance );
-
+
programStageInstance.setProgramStage( programStage );
-
+
programStageInstance.setDueDate( new Date() );
-
+
programStageInstance.setExecutionDate( new Date() );
-
+
programStageInstance.setCompleted( false );
-
+
programStageInstanceService.addProgramStageInstance( programStageInstance );
for ( ProgramStageDataElement programStageDataElement : programStageDataElements )
@@ -274,19 +290,19 @@
DataElement dataElement = programStageDataElement.getDataElement();
PatientDataValue patientDataValue = new PatientDataValue();
-
+
patientDataValue.setDataElement( dataElement );
-
+
String id = "DE" + dataElement.getId();
-
+
patientDataValue.setValue( parameterMap.get( id ) );
-
+
patientDataValue.setProgramStageInstance( programStageInstance );
-
+
patientDataValue.setProvidedElsewhere( false );
-
+
patientDataValue.setTimestamp( new Date() );
-
+
patientDataValueService.savePatientDataValue( patientDataValue );
}
=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/anonymous/action/ShowAnonymousFormAction.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/anonymous/action/ShowAnonymousFormAction.java 2012-06-18 10:29:46 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/anonymous/action/ShowAnonymousFormAction.java 2012-06-19 03:45:39 +0000
@@ -74,6 +74,22 @@
return programId;
}
+ private ProgramStage programStage;
+
+ public ProgramStage getProgramStage()
+
+ {
+ return programStage;
+ }
+
+ private Program program;
+
+ public Program getProgram()
+
+ {
+ return program;
+ }
+
List<DataElement> dataElements = new ArrayList<DataElement>();
public List<DataElement> getDataElements()
@@ -90,16 +106,13 @@
throws Exception
{
- Program program = programService.getProgram( programId );
+ program = programService.getProgram( programId );
- Collection<ProgramStage> programStages = program.getProgramStages();
+ programStage = program.getProgramStages().iterator().next();
Set<ProgramStageDataElement> programStageDataElement = null;
-
- for( ProgramStage each: programStages )
- {
- programStageDataElement = each.getProgramStageDataElements();
- }
+
+ programStageDataElement = programStage.getProgramStageDataElements();
if( programStageDataElement != null )
{
=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/resources/org/hisp/dhis/light/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-light/src/main/resources/org/hisp/dhis/light/i18n_module.properties 2012-06-11 10:11:21 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/resources/org/hisp/dhis/light/i18n_module.properties 2012-06-19 03:45:39 +0000
@@ -90,4 +90,5 @@
add_relationships=Add Relationships
related_person_search=Related Person Search
related_person_list=Related Person List
-add_relationship=Add Relationship
\ No newline at end of file
+add_relationship=Add Relationship
+anonymous_menu=Anonymous Menu
\ No newline at end of file
=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/anonymous/anonymousProgramForm.vm'
--- dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/anonymous/anonymousProgramForm.vm 2012-06-18 10:29:46 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/anonymous/anonymousProgramForm.vm 2012-06-19 03:45:39 +0000
@@ -1,5 +1,5 @@
-<h2>Anonymous Form</h2>
+<h2>$encoder.htmlEncode( $program.name )</h2>
#set( $typeViolationsSize = $typeViolations.size() )
#if( $typeViolationsSize > 0 )
=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/anonymous/anonymousProgramSelection.vm'
--- dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/anonymous/anonymousProgramSelection.vm 2012-06-18 10:29:46 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/anonymous/anonymousProgramSelection.vm 2012-06-19 03:45:39 +0000
@@ -1,5 +1,5 @@
-<h2>Anonymous Menu</h2>
+<h2>$i18n.getString("anonymous_menu")</h2>
<p>
<ul>
#foreach( $program in $programs)