← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 9714: DV, fixed bug, favorite did not load when no relative periods

 

------------------------------------------------------------
revno: 9714
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2013-02-04 19:49:15 +0200
message:
  DV, fixed bug, favorite did not load when no relative periods
modified:
  dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/scripts/app.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-visualizer/src/main/webapp/dhis-web-visualizer/app/scripts/app.js'
--- dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/scripts/app.js	2013-02-02 11:53:31 +0000
+++ dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/scripts/app.js	2013-02-04 17:49:15 +0000
@@ -1630,14 +1630,16 @@
 							}
 						}
 
-						f.relativePeriods.reportingMonth = f.relativePeriods.lastMonth;
-						f.relativePeriods.reportingQuarter = f.relativePeriods.lastQuarter;
-						delete f.relativePeriods.lastMonth;
-						delete f.relativePeriods.lastQuarter;
-
-						DV.c.relativeperiod.rp = f.relativePeriods;
-						DV.c.relativeperiod.rewind = f.rewindRelativePeriods;
-
+						if (f.relativePeriods) {
+							f.relativePeriods.reportingMonth = f.relativePeriods.lastMonth;
+							f.relativePeriods.reportingQuarter = f.relativePeriods.lastQuarter;
+							delete f.relativePeriods.lastMonth;
+							delete f.relativePeriods.lastQuarter;
+	
+							DV.c.relativeperiod.rp = f.relativePeriods;
+							DV.c.relativeperiod.rewind = f.rewindRelativePeriods;
+						}
+						
 						if (f.periods) {
 							for (var i = 0; i < f.periods.length; i++) {
 								DV.c.fixedperiod.records.push({id: f.periods[i].id, name: DV.conf.util.jsonEncodeString(f.periods[i].name)});