diff --git a/admin-dev/themes/default/template/controllers/dashboard/helpers/view/view.tpl b/admin-dev/themes/default/template/controllers/dashboard/helpers/view/view.tpl index 8b2848702..73e662a44 100644 --- a/admin-dev/themes/default/template/controllers/dashboard/helpers/view/view.tpl +++ b/admin-dev/themes/default/template/controllers/dashboard/helpers/view/view.tpl @@ -34,6 +34,11 @@
+
+
+ {include file="../../../../form_date_range_picker.tpl"} +
+
{$hookDashboardZoneOne} diff --git a/admin-dev/themes/default/template/controllers/stats/calendar.tpl b/admin-dev/themes/default/template/controllers/stats/calendar.tpl index 54808fde3..cb74bbc40 100644 --- a/admin-dev/themes/default/template/controllers/stats/calendar.tpl +++ b/admin-dev/themes/default/template/controllers/stats/calendar.tpl @@ -24,53 +24,4 @@ *}
-
-
-
-
-
- - - - - - -
-
-
-
-
-
-
-
- - -
-
-
-
- - -
-
-
-
-
- -
-
-
-
-
- - -
\ No newline at end of file + {include file="../../form_date_range_picker.tpl"} \ No newline at end of file diff --git a/admin-dev/themes/default/template/form_date_range_picker.tpl b/admin-dev/themes/default/template/form_date_range_picker.tpl new file mode 100644 index 000000000..2922effde --- /dev/null +++ b/admin-dev/themes/default/template/form_date_range_picker.tpl @@ -0,0 +1,49 @@ +
+
+
+
+
+ + + + + + +
+
+
+
+
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+
+ +
+
+
+
+
+ +
\ No newline at end of file diff --git a/controllers/admin/AdminDashboardController.php b/controllers/admin/AdminDashboardController.php index 6adc71247..d97a14e85 100644 --- a/controllers/admin/AdminDashboardController.php +++ b/controllers/admin/AdminDashboardController.php @@ -38,6 +38,7 @@ class AdminDashboardControllerCore extends AdminController $admin_webpath = str_ireplace(_PS_ROOT_DIR_, '', _PS_ADMIN_DIR_); $admin_webpath = preg_replace('/^'.preg_quote(DIRECTORY_SEPARATOR, '/').'/', '', $admin_webpath); parent::setMedia(); + $this->addJqueryUI('ui.datepicker'); $this->addJS(array( __PS_BASE_URI__.$admin_webpath.'/themes/'.$this->bo_theme.'/js/vendor/d3.js', __PS_BASE_URI__.$admin_webpath.'/themes/'.$this->bo_theme.'/js/vendor/nv.d3.js', @@ -50,9 +51,23 @@ class AdminDashboardControllerCore extends AdminController public function renderView() { + $translations = array( + 'Calendar' => $this->l('Calendar', 'AdminStatsTab'), + 'Day' => $this->l('Day', 'AdminStatsTab'), + 'Month' => $this->l('Month', 'AdminStatsTab'), + 'Year' => $this->l('Year', 'AdminStatsTab'), + 'From' => $this->l('From:', 'AdminStatsTab'), + 'To' => $this->l('To:', 'AdminStatsTab'), + 'Save' => $this->l('Save', 'AdminStatsTab') + ); + $this->tpl_view_vars = array( 'hookDashboardZoneOne' => Hook::exec('dashboardZoneOne'), 'hookDashboardZoneTwo' => Hook::exec('dashboardZoneTwo'), + 'translations' => $translations, + 'action' => '#', + 'datepickerFrom' => Tools::getValue('datepickerFrom', $this->context->employee->stats_date_from), + 'datepickerTo' => Tools::getValue('datepickerTo', $this->context->employee->stats_date_to) ); return parent::renderView(); } diff --git a/controllers/admin/AdminStatsTabController.php b/controllers/admin/AdminStatsTabController.php index 8f6895ba7..b5f5f4e40 100644 --- a/controllers/admin/AdminStatsTabController.php +++ b/controllers/admin/AdminStatsTabController.php @@ -75,6 +75,7 @@ abstract class AdminStatsTabControllerCore extends AdminPreferencesControllerCor public static function displayCalendarForm($translations, $token, $action = null, $table = null, $identifier = null, $id = null) { $context = Context::getContext(); + $tpl = $context->controller->createTemplate('calendar.tpl'); $context->controller->addJqueryUI('ui.datepicker'); @@ -84,7 +85,13 @@ abstract class AdminStatsTabControllerCore extends AdminPreferencesControllerCor $identifier = 'module'; $id = Tools::getValue('module'); } - + + $action = Context::getContext()->link->getAdminLink('AdminStatsTab'); + $action .= ($action && $table ? '&'.Tools::safeOutput($action) : ''); + $action .= ($identifier && $id ? '&'.Tools::safeOutput($identifier).'='.(int)$id : ''); + $action .= ($module = Tools::getValue('module') ? '&module='.Tools::safeOutput($module) : ''); + $action .= ($id_product = Tools::getValue('id_product') ? '&id_product='.Tools::safeOutput($id_product) : ''); + $tpl->assign(array( 'current' => self::$currentIndex, 'token' => $token,