← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 16438: new property - preGenerateUID - for program stage. If set to true, DHIS automatically generates t...

 

------------------------------------------------------------
revno: 16438
committer: Abyot Asalefew Gizaw <abyota@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2014-08-18 16:21:48 +0200
message:
  new property - preGenerateUID - for program stage. If set to true, DHIS automatically generates the UID during data entry so that users can write it down on corresponding paper forms. This helps to link paper forms with captured events.
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStage.java
  dhis-2/dhis-services/dhis-service-tracker/src/main/resources/org/hisp/dhis/program/hibernate/ProgramStage.hbm.xml
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonProgramStage.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programstage/AddProgramStageAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programstage/UpdateProgramStageAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/resources/org/hisp/dhis/trackedentity/i18n_module.properties
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/addProgramStageForm.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/javascript/programStage.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/programStage.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/updateProgramStageForm.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-api/src/main/java/org/hisp/dhis/program/ProgramStage.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStage.java	2014-08-15 07:40:20 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStage.java	2014-08-18 14:21:48 +0000
@@ -99,6 +99,8 @@
     private Boolean captureCoordinates = false;
 
     private Boolean blockEntryForm = false;
+    
+    private Boolean preGenerateUID = false;
 
     /**
      * Enabled this property to show a pop-up for confirming Complete a program
@@ -438,6 +440,19 @@
         this.programIndicators = programIndicators;
     }
 
+    @JsonProperty
+    @JsonView( { DetailedView.class, ExportView.class } )
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
+    public Boolean getPreGenerateUID()
+    {
+        return preGenerateUID;
+    }
+
+    public void setPreGenerateUID( Boolean preGenerateUID )
+    {
+        this.preGenerateUID = preGenerateUID;
+    }
+    
     @Override
     public void mergeWith( IdentifiableObject other )
     {
@@ -464,6 +479,7 @@
             allowGenerateNextVisit = programStage.getAllowGenerateNextVisit();
             openAfterEnrollment = programStage.getOpenAfterEnrollment();
             reportDateToUse = programStage.getReportDateToUse();
+            preGenerateUID = programStage.getPreGenerateUID();
 
             programStageDataElements.clear();
             programStageDataElements.addAll( programStage.getProgramStageDataElements() );

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/main/resources/org/hisp/dhis/program/hibernate/ProgramStage.hbm.xml'
--- dhis-2/dhis-services/dhis-service-tracker/src/main/resources/org/hisp/dhis/program/hibernate/ProgramStage.hbm.xml	2014-07-29 17:14:27 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/main/resources/org/hisp/dhis/program/hibernate/ProgramStage.hbm.xml	2014-08-18 14:21:48 +0000
@@ -71,6 +71,8 @@
 
     <property name="reportDateToUse" />
     
+    <property name="preGenerateUID" />
+    
     <list name="programIndicators" table="programstage_programindicators">
       <key column="programStageid" />
       <list-index column="sort_order" base="1" />

=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonProgramStage.vm'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonProgramStage.vm	2014-06-13 10:58:05 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonProgramStage.vm	2014-08-18 14:21:48 +0000
@@ -13,6 +13,7 @@
 	"allowGenerateNextVisit": "$!programStage.allowGenerateNextVisit",
 	"generatedByEnrollmentDate": "$!programStage.generatedByEnrollmentDate",
 	"openAfterEnrollment": "$!programStage.openAfterEnrollment",
+	"preGenerateUID": "$!programStage.preGenerateUID",
 	"reportDateToUse": "$!programStage.reportDateToUse",
 	"reminders":[
 	#foreach($reminder in $programStage.reminders)

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programstage/AddProgramStageAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programstage/AddProgramStageAction.java	2014-08-15 07:40:20 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programstage/AddProgramStageAction.java	2014-08-18 14:21:48 +0000
@@ -320,6 +320,13 @@
     {
         this.selectedIndicators = selectedIndicators;
     }
+    
+    private Boolean preGenerateUID;
+
+    public void setPreGenerateUID( Boolean preGenerateUID )
+    {
+        this.preGenerateUID = preGenerateUID;
+    }
 
     // -------------------------------------------------------------------------
     // Action implementation
@@ -340,6 +347,7 @@
         remindCompleted = (remindCompleted == null) ? false : remindCompleted;
         allowGenerateNextVisit = (allowGenerateNextVisit == null) ? false : allowGenerateNextVisit;
         openAfterEnrollment = (openAfterEnrollment == null) ? false : openAfterEnrollment;
+        preGenerateUID = (preGenerateUID == null) ? false : preGenerateUID;
 
         ProgramStage programStage = new ProgramStage();
         Program program = programService.getProgram( id );
@@ -368,6 +376,7 @@
         programStage.setAllowGenerateNextVisit( allowGenerateNextVisit );
         programStage.setOpenAfterEnrollment( openAfterEnrollment );
         programStage.setReportDateToUse( reportDateToUse );
+        programStage.setPreGenerateUID( preGenerateUID );
 
         // Program indicators
 

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programstage/UpdateProgramStageAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programstage/UpdateProgramStageAction.java	2014-08-15 07:40:20 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programstage/UpdateProgramStageAction.java	2014-08-18 14:21:48 +0000
@@ -315,6 +315,13 @@
     {
         this.selectedIndicators = selectedIndicators;
     }
+    
+    private Boolean preGenerateUID;
+
+    public void setPreGenerateUID( Boolean preGenerateUID )
+    {
+        this.preGenerateUID = preGenerateUID;
+    }
 
     @Autowired
     private ProgramIndicatorService programIndicatorService;
@@ -338,6 +345,7 @@
         remindCompleted = (remindCompleted == null) ? false : remindCompleted;
         allowGenerateNextVisit = (allowGenerateNextVisit == null) ? false : allowGenerateNextVisit;
         openAfterEnrollment = (openAfterEnrollment == null) ? false : openAfterEnrollment;
+        preGenerateUID = (preGenerateUID == null) ? false : preGenerateUID;
 
         ProgramStage programStage = programStageService.getProgramStage( id );
 
@@ -355,6 +363,7 @@
         programStage.setAllowGenerateNextVisit( allowGenerateNextVisit );
         programStage.setOpenAfterEnrollment( openAfterEnrollment );
         programStage.setReportDateToUse( reportDateToUse );
+        programStage.setPreGenerateUID( preGenerateUID );
 
         if ( programStage.getProgram().isSingleEvent() )
         {

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/resources/org/hisp/dhis/trackedentity/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/resources/org/hisp/dhis/trackedentity/i18n_module.properties	2014-08-11 12:53:29 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/resources/org/hisp/dhis/trackedentity/i18n_module.properties	2014-08-18 14:21:48 +0000
@@ -304,6 +304,7 @@
 complete_allowed_only_if_validation_passes = Complete allowed only if validation passes
 skip_to_generate_overdue_events = Skip generation of events that are overdue (before enrollment date)
 display_generate_event_box_after_completed = Display generate event box after completed
+pre_generate_event_uid = Pre-generate event UID
 calculated = Calculated
 enrollment_date = Enrollment date
 current_date = Current date

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/addProgramStageForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/addProgramStageForm.vm	2014-08-06 15:20:54 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/addProgramStageForm.vm	2014-08-18 14:21:48 +0000
@@ -136,6 +136,11 @@
 	</tr>
 	
 	<tr>
+		<td><label for="preGenerateUID">$i18n.getString( "pre_generate_event_uid" )</label></td>
+		<td><input type="checkbox" id="preGenerateUID" name="preGenerateUID" value="true" /></td>
+	</tr>
+	
+	<tr>
 		<td><label for="reportDateDescription">$i18n.getString( "report_date_description" ) <em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
 		<td><input type="text" id="reportDateDescription" name="reportDateDescription" value="$i18n.getString( 'report_date' )" /></td>
 	</tr>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/javascript/programStage.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/javascript/programStage.js	2014-07-27 12:49:21 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/javascript/programStage.js	2014-08-18 14:21:48 +0000
@@ -91,7 +91,10 @@
 		setInnerHTML( 'allowGenerateNextVisitField', allowGenerateNextVisit );   	
 		
 		var openAfterEnrollment = ( json.programStage.openAfterEnrollment == 'true') ? i18n_yes : i18n_no;
-		setInnerHTML( 'openAfterEnrollmentField', openAfterEnrollment );   	
+		setInnerHTML( 'openAfterEnrollmentField', openAfterEnrollment );
+		
+		var preGenerateUID = ( json.programStage.preGeneateUID == 'true') ? i18n_yes : i18n_no;
+		setInnerHTML( 'preGenerateUIDField', preGenerateUID );    	
 		
 		setInnerHTML( 'reportDateToUseField', json.programStage.reportDateToUse );   	
 		

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/programStage.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/programStage.vm	2014-07-28 09:24:17 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/programStage.vm	2014-08-18 14:21:48 +0000
@@ -70,6 +70,7 @@
 				<p><label class="bold">$i18n.getString( "capture_coordinates" ):</label><br><span id="captureCoordinatesField"></span></p>
 				<p><label class="bold">$i18n.getString( "complete_allowed_only_if_validation_passes" ):</label><br><span id="validCompleteOnlyField"></span></p>
 				<p><label class="bold">$i18n.getString( "report_date_description" ):</label><br><span id="reportDateDescriptionField"></span></p>
+				<p><label class="bold">$i18n.getString( "pre_generate_event_uid" ):</label><br><span id="preGenerateUIDField"></span></p>				
 				<p><label class="bold">$i18n.getString( "open_data_entry_form_after_enrolment" ):</label><br><span id="openAfterEnrollmentField"></span></p>
 				<p><label class="bold">$i18n.getString( "report_date_to_use" ):</label><br><span id="reportDateToUseField"></span></p>
 				<p><label class="bold">$i18n.getString( "no_of_dataelements" ):</label><br><span id="dataElementCountField"></span></p>		

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/updateProgramStageForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/updateProgramStageForm.vm	2014-08-06 15:20:54 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/updateProgramStageForm.vm	2014-08-18 14:21:48 +0000
@@ -144,6 +144,11 @@
 			</tr>
 			
 			<tr>
+				<td><label for="preGenerateUID">$i18n.getString( "pre_generate_event_uid" )</label></td>
+				<td><input type="checkbox" id="preGenerateUID" name="preGenerateUID" value='true' #if( $programStage.preGenerateUID && $programStage.preGenerateUID=='true' ) checked #end /></td>
+			</tr>
+			
+			<tr>
 				<td><label for="reportDateDescription">$i18n.getString( "report_date_description" )<em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
 				<td><input type="text" id="reportDateDescription" name="reportDateDescription" value='$!programStage.reportDateDescription' class="{validate:{required:true}}" /></td>
 			</tr>