diff --git a/controllers/admin/AdminDashboardController.php b/controllers/admin/AdminDashboardController.php index b6c6da481..56f29fa3c 100644 --- a/controllers/admin/AdminDashboardController.php +++ b/controllers/admin/AdminDashboardController.php @@ -221,10 +221,15 @@ class AdminDashboardControllerCore extends AdminController $calendar_helper->setCompareDateFrom($stats_compare_from); $calendar_helper->setCompareDateTo($stats_compare_to); $calendar_helper->setCompareOption(Tools::getValue('compare_date_option', $this->context->employee->stats_compare_option)); - + + $params = array( + 'date_from' => $this->context->employee->stats_date_from, + 'date_to' => $this->context->employee->stats_date_to + ); + $this->tpl_view_vars = array( - 'hookDashboardZoneOne' => Hook::exec('dashboardZoneOne'), - 'hookDashboardZoneTwo' => Hook::exec('dashboardZoneTwo'), + 'hookDashboardZoneOne' => Hook::exec('dashboardZoneOne', $params), + 'hookDashboardZoneTwo' => Hook::exec('dashboardZoneTwo', $params), 'translations' => $translations, 'action' => '#', 'warning' => $this->getWarningDomainName(), diff --git a/js/admin-dashboard.js b/js/admin-dashboard.js index fd8028fd8..1879477a8 100644 --- a/js/admin-dashboard.js +++ b/js/admin-dashboard.js @@ -240,12 +240,20 @@ function toggleDashConfig(widget) function bindSubmitDashConfig() { - $('.submit_dash_config').on('click', function () { + $('.cancel_dash_config').on('click', function () { saveDashConfig($(this).closest('section.widget').attr('id')); return false; }); } +function bindCancelDashConfig() +{ + $('.cancel_dash_config').on('click', function () { + toggleDashConfig($(this).closest('section.widget').attr('id')); + return false; + }); +} + function saveDashConfig(widget_name) { configs = ''; diff --git a/modules/dashproducts/dashproducts.php b/modules/dashproducts/dashproducts.php index 35551876f..85eb8a509 100644 --- a/modules/dashproducts/dashproducts.php +++ b/modules/dashproducts/dashproducts.php @@ -49,6 +49,7 @@ class Dashproducts extends Module public function hookDashboardZoneTwo($params) { + $this->context->smarty->assign(array('date_from' => Tools::displayDate($params['date_from']), 'date_to' => Tools::displayDate($params['date_to']))); return $this->display(__FILE__, 'dashboard_zone_two.tpl'); } diff --git a/modules/dashproducts/views/templates/hook/dashboard_zone_two.tpl b/modules/dashproducts/views/templates/hook/dashboard_zone_two.tpl index f36be59cb..2ed7d8b96 100644 --- a/modules/dashproducts/views/templates/hook/dashboard_zone_two.tpl +++ b/modules/dashproducts/views/templates/hook/dashboard_zone_two.tpl @@ -72,7 +72,7 @@
-

{l s="Top 10 products"}

+

{l s="Top 10 products"} - {l s="From:"} {$date_from} {l s="to:"} {$date_to}

@@ -81,7 +81,7 @@
-

{l s="Coming soon"}

+

{l s="Most Viewed"} - {l s="From:"} {$date_from} {l s="to:"} {$date_to}

@@ -90,28 +90,13 @@
\ No newline at end of file