=== modified file 'dhis-2/dhis-web/dhis-web-visualizer/src/main/java/org/hisp/dhis/visualizer/action/AddOrUpdateChartAction.java' --- dhis-2/dhis-web/dhis-web-visualizer/src/main/java/org/hisp/dhis/visualizer/action/AddOrUpdateChartAction.java 2012-07-24 04:04:14 +0000 +++ dhis-2/dhis-web/dhis-web-visualizer/src/main/java/org/hisp/dhis/visualizer/action/AddOrUpdateChartAction.java 2012-07-25 00:20:50 +0000 @@ -258,6 +258,13 @@ this.last5Years = last5Years; } + private boolean rewind; + + public void setRewind( boolean rewind ) + { + this.rewind = rewind; + } + private List periodIds; public void setPeriodIds( List periodIds ) @@ -454,6 +461,8 @@ chart.setRelatives( rp ); } + chart.setRewindRelativePeriods( rewind ); + if ( periodIds != null ) { List periods = new ArrayList(); === 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 2012-07-24 04:04:14 +0000 +++ dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/scripts/app.js 2012-07-25 00:20:50 +0000 @@ -1642,6 +1642,7 @@ DV.c.dataelement.records = DV.util.dimension.dataelement.getRecords(); DV.c.dataset.records = DV.util.dimension.dataset.getRecords(); DV.c.relativeperiod.rp = DV.util.dimension.relativeperiod.getRelativePeriodObject(); + DV.c.relativeperiod.rewind = DV.cmp.dimension.relativeperiod.rewind.getValue(); DV.c.fixedperiod.records = DV.util.dimension.fixedperiod.getRecords(); DV.c.organisationunit.records = DV.util.dimension.organisationunit.getRecords(); DV.c.organisationunit.groupsetid = DV.util.dimension.organisationunit.getGroupSetId(); @@ -1698,7 +1699,6 @@ } }, setOptions: function() { - DV.c.relativeperiod.rewind = DV.cmp.dimension.relativeperiod.rewind.getValue(); DV.c.hidesubtitle = DV.cmp.favorite.hidesubtitle.getValue(); DV.c.hidelegend = DV.cmp.favorite.hidelegend.getValue(); DV.c.trendline = DV.cmp.favorite.trendline.getValue(); @@ -1746,6 +1746,9 @@ p.dataElementIds = DV.c.dataelement.ids; p.dataSetIds = DV.c.dataset.ids; p = Ext.Object.merge(p, DV.c.relativeperiod.rp); + if (DV.c.relativeperiod.rewind) { + p.rewind = true; + } p.periodIds = DV.c.fixedperiod.ids; p.organisationUnitIds = DV.c.organisationunit.ids; if (DV.c.organisationunit.groupsetid) { @@ -1800,6 +1803,7 @@ } DV.util.checkbox.setRelativePeriods(DV.c.period.rp); + DV.cmp.dimension.relativeperiod.rewind.setValue(DV.c.relativeperiod.rewind); DV.store.fixedperiod.selected.removeAll(); if (DV.c.fixedperiod.records) { @@ -2091,7 +2095,6 @@ dataelement: {}, dataset: {}, relativeperiod: {}, - rewind: false, fixedperiod: {}, organisationunit: {}, hidesubtitle: false, @@ -2118,7 +2121,8 @@ this.model.indicator = {}; this.model.dataelement = {}; this.model.dataset = {}; - this.model.period = {}; + this.model.relativeperiod = {}; + this.model.fixedperiod = {}; this.model.organisationunit = {}; this.model.hidesubtitle = false; this.model.hidelegend = false;