← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 21356: new program stage property - hideDueDate. This is false by defualt. If users are designing a prog...

 

------------------------------------------------------------
revno: 21356
committer: Abyot Asalefew Gizaw <abyota@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2015-12-07 14:12:15 +0100
message:
  new program stage property - hideDueDate. This is false by defualt. If users are designing a program where due date is not necessary, they can set this to true.
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStage.java
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/trackedentity/startup/TableAlteror.java
  dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/program/hibernate/ProgramStage.hbm.xml
  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/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	2015-11-19 04:01:09 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStage.java	2015-12-07 13:12:15 +0000
@@ -115,6 +115,8 @@
     private Integer sortOrder;
 
     private PeriodType periodType;
+    
+    private Boolean hideDueDate = false;
 
     // -------------------------------------------------------------------------
     // Constructors
@@ -481,6 +483,19 @@
     {
         this.periodType = periodType;
     }
+    
+    @JsonProperty
+    @JsonView( { DetailedView.class, ExportView.class } )
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
+    public Boolean getHideDueDate()
+    {
+        return hideDueDate;
+    }
+
+    public void setHideDueDate( Boolean hideDueDate )
+    {
+        this.hideDueDate = hideDueDate;
+    }
 
     @Override
     public void mergeWith( IdentifiableObject other, MergeStrategy strategy )
@@ -513,6 +528,7 @@
                 openAfterEnrollment = programStage.getOpenAfterEnrollment();
                 reportDateToUse = programStage.getReportDateToUse();
                 preGenerateUID = programStage.getPreGenerateUID();
+                hideDueDate = programStage.getHideDueDate();
             }
             else if ( strategy.isMerge() )
             {
@@ -544,6 +560,7 @@
                     .getReportDateToUse();
                 preGenerateUID = programStage.getPreGenerateUID() == null ? preGenerateUID : programStage
                     .getPreGenerateUID();
+                hideDueDate = programStage.getHideDueDate() == null ? hideDueDate : programStage.getHideDueDate();
             }
 
             programStageDataElements.clear();

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/trackedentity/startup/TableAlteror.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/trackedentity/startup/TableAlteror.java	2015-12-03 16:47:14 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/trackedentity/startup/TableAlteror.java	2015-12-07 13:12:15 +0000
@@ -180,6 +180,7 @@
         executeSql( "UPDATE program SET dataEntryMethod=false WHERE dataEntryMethod is null" );
         executeSql( "UPDATE programstage SET allowGenerateNextVisit=false WHERE allowGenerateNextVisit is null" );
         executeSql( "update programstage set openAfterEnrollment=false where openAfterEnrollment is null" );
+        executeSql( "update programstage set hideduedate=false where hideduedate is null" );
 
         executeSql( "update programstageinstance set status=0 where status is null" );
         executeSql( "ALTER TABLE program DROP COLUMN facilityLB" );

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/program/hibernate/ProgramStage.hbm.xml'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/program/hibernate/ProgramStage.hbm.xml	2015-11-23 06:52:49 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/program/hibernate/ProgramStage.hbm.xml	2015-12-07 13:12:15 +0000
@@ -69,6 +69,8 @@
     <property name="reportDateToUse" />
 
     <property name="preGenerateUID" />
+    
+    <property name="hideDueDate" />
 
     <property name="sortOrder" column="sort_order" />
 

=== 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	2015-11-23 06:52:49 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programstage/AddProgramStageAction.java	2015-12-07 13:12:15 +0000
@@ -339,6 +339,13 @@
     {
         this.jsonAttributeValues = jsonAttributeValues;
     }
+    
+    private Boolean hideDueDate;
+
+    public void setHideDueDate( Boolean hideDueDate )
+    {
+        this.hideDueDate = hideDueDate;
+    }
 
     // -------------------------------------------------------------------------
     // Action implementation
@@ -361,6 +368,7 @@
         allowGenerateNextVisit = (allowGenerateNextVisit == null) ? false : allowGenerateNextVisit;
         openAfterEnrollment = (openAfterEnrollment == null) ? false : openAfterEnrollment;
         preGenerateUID = (preGenerateUID == null) ? false : preGenerateUID;
+        hideDueDate = (hideDueDate == null) ? false : hideDueDate;
 
         ProgramStage programStage = new ProgramStage();
         Program program = programService.getProgram( id );
@@ -405,6 +413,7 @@
         programStage.setReportDateToUse( reportDateToUse );
         programStage.setPreGenerateUID( preGenerateUID );
         programStage.setSortOrder( program.getProgramStages().size() + 1 );
+        programStage.setHideDueDate( hideDueDate );
 
         // SMS Reminder
 

=== 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	2015-12-04 15:47:02 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programstage/UpdateProgramStageAction.java	2015-12-07 13:12:15 +0000
@@ -337,6 +337,13 @@
     {
         this.jsonAttributeValues = jsonAttributeValues;
     }
+    
+    private Boolean hideDueDate;
+
+    public void setHideDueDate( Boolean hideDueDate )
+    {
+        this.hideDueDate = hideDueDate;
+    }
 
     // -------------------------------------------------------------------------
     // Action implementation
@@ -359,6 +366,7 @@
         allowGenerateNextVisit = (allowGenerateNextVisit == null) ? false : allowGenerateNextVisit;
         openAfterEnrollment = (openAfterEnrollment == null) ? false : openAfterEnrollment;
         preGenerateUID = (preGenerateUID == null) ? false : preGenerateUID;
+        hideDueDate = (hideDueDate == null) ? false : hideDueDate;
 
         ProgramStage programStage = programStageService.getProgramStage( id );
 
@@ -377,6 +385,7 @@
         programStage.setOpenAfterEnrollment( openAfterEnrollment );
         programStage.setReportDateToUse( reportDateToUse );
         programStage.setPreGenerateUID( preGenerateUID );
+        programStage.setHideDueDate( hideDueDate );
 
         periodTypeName = StringUtils.trimToNull( periodTypeName );
 

=== 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	2015-12-03 16:47:14 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/resources/org/hisp/dhis/trackedentity/i18n_module.properties	2015-12-07 13:12:15 +0000
@@ -201,6 +201,7 @@
 after_due_date=After due date
 after_or_equals_to_due_date=After or equal to due date
 in_range_due_date=In range due date
+hide_due_date=Hide due date
 data_element=Data element
 condition=Condition
 no_date_data_element_in_selected_program_stage=No data elements of type date in the selected program stage

=== 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	2015-10-23 08:32:36 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/addProgramStageForm.vm	2015-12-07 13:12:15 +0000
@@ -203,6 +203,7 @@
 		<td></td>
 	</tr>
 	
+	#if($program.programType.value=="with_registration")
 	<tr>
 		<td><label for="remindCompleted">$i18n.getString( "ask_user_to_complete_program_when_stage_complete" )</label></td>
 		<td><input type="checkbox" id="remindCompleted" name="remindCompleted" value='true' ></td>
@@ -215,12 +216,17 @@
 		<td></td>
 	</tr>
 	
-	#if($program.programType.value=="with_registration")
 	<tr>
 		<td><label for="generatedByEnrollmentDate">$i18n.getString( "generate_events_based_on_enrollment_date" ) <span class="tipText">($i18n.getString( "not_incident_date" ))</label></td>
 		<td><input type="checkbox" id="generatedByEnrollmentDate" name="generatedByEnrollmentDate" value='true'></td>
 		<td></td>
 	</tr>
+	
+	<tr>
+		<td><label for="hideDueDate">$i18n.getString( "hide_due_date" )</label></td>
+		<td><input type="checkbox" id="hideDueDate" name="hideDueDate" value='true' ></td>
+		<td></td>
+	</tr>
 	#end
 	
 	<tr>

=== 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	2015-10-23 08:32:36 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/updateProgramStageForm.vm	2015-12-07 13:12:15 +0000
@@ -237,6 +237,7 @@
 				<td></td>
 			</tr>
 			
+			#if($programStage.program.programType.value=="with_registration")
 			<tr>
 				<td><label for="remindCompleted">$i18n.getString( "ask_user_to_complete_program_when_stage_complete" )</label></td>
 				<td><input type="checkbox" id="remindCompleted" name="remindCompleted" value='true' #if( $programStage.remindCompleted=='true' ) checked #end ></td>
@@ -249,12 +250,16 @@
 				<td></td>
 			</tr>
 			
-			#if($programStage.program.programType.value=="with_registration")
 			<tr>
 				<td><label for="generatedByEnrollmentDate">$i18n.getString( "generate_events_based_on_enrollment_date" ) <span class="tipText">($i18n.getString( "not_incident_date" ))</span></label></td>
 				<td><input type="checkbox" id="generatedByEnrollmentDate" name="generatedByEnrollmentDate" value='true' #if($programStage.generatedByEnrollmentDate=='true') checked #end #if( $programStage.program.programType.value=="without_registration" ) disabled #end ></td>
 				<td></td>
 			</tr>
+			<tr>
+        		<td><label for="hideDueDate">$i18n.getString( "hide_due_date" )</label></td>
+        		<td><input type="checkbox" id="hideDueDate" name="hideDueDate" value='true' #if( $programStage.hideDueDate=='true' ) checked #end ></td>
+        		<td></td>
+        	</tr>
 			#end
 		
 			<tr>