← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 15080: include system calendar name in cacheManifest, needed to make sure that the calendar is updated i...

 

------------------------------------------------------------
revno: 15080
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2014-04-29 09:19:48 +0545
message:
  include system calendar name in cacheManifest, needed to make sure that the calendar is updated if system settings change (shouldn't really happen, but good to make sure, also good for dev)
modified:
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/cacheManifest.vm
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.period.js
  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-web/dhis-web-commons-resources/src/main/webapp/cacheManifest.vm'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/cacheManifest.vm	2014-04-22 15:46:19 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/cacheManifest.vm	2014-04-29 03:34:48 +0000
@@ -1,7 +1,7 @@
 CACHE MANIFEST
 # 2.16 $!systemInfo.revision
 # appcache for user: $username
-
+# system calendar: $keyCalendar
 NETWORK:
 *
 CACHE:

=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.period.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.period.js	2014-04-28 12:21:02 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.period.js	2014-04-29 03:34:48 +0000
@@ -41,7 +41,7 @@
  *  - dhis2.period.calendar   The currently selected system calendar
  *  - dhis2.period.generator  An instance of this class using the system calendar
  *
- * @param calendar Calendar to use, this must coming from $.calendars.instance(chronology).
+ * @param calendar Calendar to use, this must come from $.calendars.instance(chronology).
  * @param format Date format to use for formatting, will default to ISO 8601
  * @constructor
  */
@@ -76,7 +76,7 @@
 };
 
 /**
- * @returns All available period generators
+ * @returns Object All available period generators
  */
 dhis2.period.PeriodGenerator.prototype.getAll = function() {
   return this.periodTypes;

=== 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	2014-04-25 11:10:13 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js	2014-04-29 03:34:48 +0000
@@ -61,9 +61,6 @@
 // Username of user who marked the current data set as complete if any
 dhis2.de.currentCompletedByUser = null;
 
-// Period type object
-dhis2.de.periodTypeFactory = new PeriodType();
-
 // Instance of the StorageManager
 dhis2.de.storageManager = new StorageManager();
 
@@ -909,13 +906,12 @@
     {
 	    var periodType = dhis2.de.dataSets[dataSetId].periodType;
 	    var allowFuturePeriods = dhis2.de.dataSets[dataSetId].allowFuturePeriods;
-	    var periods = dhis2.de.periodTypeFactory.get( periodType ).generatePeriods( dhis2.de.currentPeriodOffset );
-	    periods = dhis2.de.periodTypeFactory.reverse( periods );
-	    
-	    if ( allowFuturePeriods == false )
-	    {
-	    	periods = dhis2.de.periodTypeFactory.filterFuturePeriods( periods );
-	    }
+      var periods = dhis2.period.generator.generateReversedPeriods(periodType, dhis2.de.currentPeriodOffset);
+
+      if( allowFuturePeriods == false )
+      {
+        periods = dhis2.period.generator.filterFuturePeriods(periods);
+      }
 
         clearListById( 'selectedPeriodId' );
         clearSectionFilters();
@@ -1007,12 +1003,11 @@
     var dataSetId = $( '#selectedDataSetId' ).val();
     var periodType = dhis2.de.dataSets[dataSetId].periodType;
     var allowFuturePeriods = dhis2.de.dataSets[dataSetId].allowFuturePeriods;
-    var periods = dhis2.de.periodTypeFactory.get( periodType ).generatePeriods( dhis2.de.currentPeriodOffset );
-    periods = dhis2.de.periodTypeFactory.reverse( periods );
-    
+    var periods = dhis2.period.generator.generateReversedPeriods(periodType, dhis2.de.currentPeriodOffset);
+
     if ( allowFuturePeriods == false )
     {
-    	periods = dhis2.de.periodTypeFactory.filterFuturePeriods( periods );
+      periods = dhis2.period.generator.filterFuturePeriods(periods);
     }
 
     clearListById( 'selectedPeriodId' );