← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 19358: Data entry, future open periods fix

 

------------------------------------------------------------
revno: 19358
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2015-06-11 12:25:44 +0200
message:
  Data entry, future open periods fix
modified:
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java
  dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js


--
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-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java	2015-06-10 20:22:17 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java	2015-06-11 10:25:44 +0000
@@ -590,6 +590,7 @@
         executeSql( "UPDATE dataset SET novaluerequirescomment = false WHERE novaluerequirescomment IS NULL" );
         executeSql( "UPDATE dataset SET openfutureperiods = 12 where allowfutureperiods is true" );
         executeSql( "UPDATE dataset SET openfutureperiods = 0 where allowfutureperiods is false" );
+        executeSql( "ALTER TABLE dataset DROP COLUMN allowfutureperiods" );
 
         executeSql( "UPDATE categorycombo SET skiptotal = false WHERE skiptotal IS NULL" );
 

=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js	2015-06-10 20:22:17 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js	2015-06-11 10:25:44 +0000
@@ -1164,7 +1164,7 @@
     var previousDataSetValid = ( dhis2.de.currentDataSetId && dhis2.de.currentDataSetId != -1 );
     var previousDataSet = !!previousDataSetValid ? dhis2.de.dataSets[dhis2.de.currentDataSetId] : undefined;
     var previousPeriodType = previousDataSet ? previousDataSet.periodType : undefined;
-    var previousOpenFuturePeriods = previousDataSet ? previousDataSet.openFuturePeriods : false;
+    var previousOpenFuturePeriods = previousDataSet ? previousDataSet.openFuturePeriods : 0;
 
     dhis2.de.currentDataSetId = $( '#selectedDataSetId' ).val();
     
@@ -1177,8 +1177,7 @@
         var periodType = dhis2.de.dataSets[dhis2.de.currentDataSetId].periodType;
         var openFuturePeriods = dhis2.de.dataSets[dhis2.de.currentDataSetId].openFuturePeriods;
 
-        var previousSelectionValid = !!( periodType == previousPeriodType && 
-        	( openFuturePeriods == previousOpenFuturePeriods || dhis2.de.currentPeriodOffset <= 0 ) );
+        var previousSelectionValid = !!( periodType == previousPeriodType && openFuturePeriods == previousOpenFuturePeriods );
         
         dhis2.de.currentCategories = dhis2.de.getCategories( dhis2.de.currentDataSetId );