dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #41428
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 21109: New property to programs so that users can decide whether to skip offline or not for a given prog...
------------------------------------------------------------
revno: 21109
committer: Abyot Asalefew Gizaw <abyota@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2015-11-18 15:08:06 +0100
message:
New property to programs so that users can decide whether to skip offline or not for a given program.
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/Program.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/Program.hbm.xml
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/program/AddProgramAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/program/UpdateProgramAction.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/addProgramForm.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/updateProgramForm.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/Program.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/Program.java 2015-11-02 04:27:25 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/Program.java 2015-11-18 14:08:06 +0000
@@ -132,6 +132,12 @@
* The CategoryCombo used for data attributes.
*/
private DataElementCategoryCombo categoryCombo;
+
+ /**
+ * Property indicating whether offline storage is enabled for this program
+ * or not
+ */
+ private boolean skipOffline;
// -------------------------------------------------------------------------
// Constructors
@@ -678,6 +684,19 @@
{
return categoryCombo != null && !DataElementCategoryCombo.DEFAULT_CATEGORY_COMBO_NAME.equals( categoryCombo.getName() );
}
+
+ @JsonProperty
+ @JsonView( { DetailedView.class, ExportView.class } )
+ @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
+ public boolean isSkipOffline()
+ {
+ return skipOffline;
+ }
+
+ public void setSkipOffline( boolean skipOffline )
+ {
+ this.skipOffline = skipOffline;
+ }
@Override
public void mergeWith( IdentifiableObject other, MergeStrategy strategy )
=== 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-10-30 06:44:03 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/trackedentity/startup/TableAlteror.java 2015-11-18 14:08:06 +0000
@@ -154,8 +154,9 @@
executeSql( "update caseaggregationcondition set \"operator\"='times' where \"operator\"='SUM'" );
executeSql( "update prorgam set \"operator\"='times' where \"operator\"='SUM'" );
-
executeSql( "update program set remindCompleted=false where remindCompleted is null" );
+ executeSql( "UPDATE program SET skipoffline=false where skipoffline is null" );
+
executeSql( "UPDATE programinstance SET followup=false where followup is null" );
updateProgramInstanceStatus();
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/program/hibernate/Program.hbm.xml'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/program/hibernate/Program.hbm.xml 2015-11-02 04:27:25 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/program/hibernate/Program.hbm.xml 2015-11-18 14:08:06 +0000
@@ -47,6 +47,8 @@
<property name="displayIncidentDate" />
<property name="onlyEnrollOnce" />
+
+ <property name="skipOffline" />
<list name="programAttributes" cascade="all-delete-orphan">
<key column="programid" />
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/program/AddProgramAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/program/AddProgramAction.java 2015-11-18 06:20:27 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/program/AddProgramAction.java 2015-11-18 14:08:06 +0000
@@ -249,6 +249,13 @@
{
this.categoryComboId = categoryComboId;
}
+
+ private boolean skipOffline;
+
+ public void setSkipOffline( boolean skipOffline )
+ {
+ this.skipOffline = skipOffline;
+ }
// -------------------------------------------------------------------------
// Action implementation
@@ -278,6 +285,7 @@
program.setSelectEnrollmentDatesInFuture( selectEnrollmentDatesInFuture );
program.setSelectIncidentDatesInFuture( selectIncidentDatesInFuture );
program.setDataEntryMethod( dataEntryMethod );
+ program.setSkipOffline( skipOffline );
if ( programType == ProgramType.WITH_REGISTRATION )
{
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/program/UpdateProgramAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/program/UpdateProgramAction.java 2015-11-18 06:20:27 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/program/UpdateProgramAction.java 2015-11-18 14:08:06 +0000
@@ -271,6 +271,13 @@
{
this.categoryComboId = categoryComboId;
}
+
+ private boolean skipOffline;
+
+ public void setSkipOffline( boolean skipOffline )
+ {
+ this.skipOffline = skipOffline;
+ }
// -------------------------------------------------------------------------
// Action implementation
@@ -301,6 +308,7 @@
program.setSelectEnrollmentDatesInFuture( selectEnrollmentDatesInFuture );
program.setSelectIncidentDatesInFuture( selectIncidentDatesInFuture );
program.setDataEntryMethod( dataEntryMethod );
+ program.setSkipOffline( skipOffline );
if ( program.isRegistration() )
{
=== 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-11-06 11:51:47 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/resources/org/hisp/dhis/trackedentity/i18n_module.properties 2015-11-18 14:08:06 +0000
@@ -537,4 +537,5 @@
tracked_entity_instance=Tracked entity instance
event_output_type=Event output type
category_combo=Combination of categories
-missing_value_replacement=Missing value replacement
\ No newline at end of file
+missing_value_replacement=Missing value replacement
+skip_offline=Skip offline
\ No newline at end of file
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/addProgramForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/addProgramForm.vm 2015-11-02 04:27:25 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/addProgramForm.vm 2015-11-18 14:08:06 +0000
@@ -130,6 +130,16 @@
</td>
</tr>
+ <tr>
+ <td><label>$i18n.getString( "skip_offline" )</label></td>
+ <td>
+ <select id="skipOffline" name="skipOffline">
+ <option value="false">$i18n.getString( "no" )</option>
+ <option value="true">$i18n.getString( "yes" )</option>
+ </select>
+ </td>
+ </tr>
+
<tr name='nonAnonymous'><td> </td></tr>
<tr name='nonAnonymous'>
<th colspan="2">$i18n.getString( "enrollment_details" )</th>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/updateProgramForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/updateProgramForm.vm 2015-11-02 04:27:25 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/updateProgramForm.vm 2015-11-18 14:08:06 +0000
@@ -132,6 +132,7 @@
</td>
<td></td>
</tr>
+
<tr>
<td><label>$i18n.getString( "category_combo" )</label></td>
<td>
@@ -143,6 +144,16 @@
</td>
</tr>
+ <tr>
+ <td><label>$i18n.getString( "skip_offline" )</label></td>
+ <td>
+ <select id="skipOffline" name="skipOffline">
+ <option value="false">$i18n.getString( "no" )</option>
+ <option value="true"#if( $program.skipOffline == true ) selected="selected"#end>$i18n.getString( "yes" )</option>
+ </select>
+ </td>
+ </tr>
+
<tr name='nonAnonymous'><td> </td></tr>
<tr name='nonAnonymous'>