From 7605d6653f086c8a96c3e79cb3cf60e08494bf10 Mon Sep 17 00:00:00 2001 From: Daniel Camargo Date: Fri, 12 Jul 2013 16:41:59 -0300 Subject: [PATCH] fixed a problem with the charts --- include/library/Crunchbutton/Chart.php | 5 +++++ include/views/default/cockpit/home/index.phtml | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/include/library/Crunchbutton/Chart.php b/include/library/Crunchbutton/Chart.php index 3628899c1..ce99a988c 100644 --- a/include/library/Crunchbutton/Chart.php +++ b/include/library/Crunchbutton/Chart.php @@ -76,6 +76,11 @@ class Crunchbutton_Chart extends Cana_Model { public function processInterval( $interval ){ + $param_interval = $_REQUEST[ 'interval' ]; + if( $interval != $param_interval ){ + $interval = $param_interval; + } + switch ( $interval ) { case 'day': diff --git a/include/views/default/cockpit/home/index.phtml b/include/views/default/cockpit/home/index.phtml index c844928a4..358038001 100644 --- a/include/views/default/cockpit/home/index.phtml +++ b/include/views/default/cockpit/home/index.phtml @@ -162,8 +162,8 @@
-   - +
@@ -277,7 +277,7 @@ var chart = $( this ); if( chart.attr( 'opened' ) == 'true' ){ var permalink = chart.attr( 'data-permalink' ); - var params = { 'divId' : chart.attr( 'id' ), 'permalink' : permalink, 'force' : true }; + var params = { 'divId' : chart.attr( 'id' ), 'permalink' : permalink, 'force' : true, 'interval' : 'week' }; loadChart( params ); $( '#button-reload' ).find( 'i' ).addClass( 'icon-spin ' ); setTimeout( function(){