From c7a777163c1da20767ba016b2290793b82c5fae4 Mon Sep 17 00:00:00 2001 From: Vincent Augagneur Date: Mon, 16 Sep 2013 17:14:08 +0200 Subject: [PATCH] //small fix --- controllers/admin/AdminStatsTabController.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/controllers/admin/AdminStatsTabController.php b/controllers/admin/AdminStatsTabController.php index fbe0c831c..eeb70e0a7 100644 --- a/controllers/admin/AdminStatsTabController.php +++ b/controllers/admin/AdminStatsTabController.php @@ -206,7 +206,7 @@ abstract class AdminStatsTabControllerCore extends AdminPreferencesControllerCor { $this->context = Context::getContext(); - $this->ajaxProcessSetDashboardDateRange(); + $this->processDateRange(); if (Tools::getValue('submitSettings')) { @@ -222,7 +222,7 @@ abstract class AdminStatsTabControllerCore extends AdminPreferencesControllerCor } } - public function ajaxProcessSetDashboardDateRange() + public function processDateRange() { if (Tools::isSubmit('submitDatePicker')) { @@ -267,8 +267,15 @@ abstract class AdminStatsTabControllerCore extends AdminPreferencesControllerCor $this->context->employee->stats_date_from = $from; $this->context->employee->stats_date_to = $to; $this->context->employee->update(); - Tools::redirectAdmin($_SERVER['REQUEST_URI']); + if (!$this->isXmlHttpRequest()) + Tools::redirectAdmin($_SERVER['REQUEST_URI']); } + } + + public function ajaxProcessSetDashboardDateRange() + { + $this->processDateRange(); + if ($this->isXmlHttpRequest()) { if (is_array($this->errors) && count($this->errors))