diff --git a/admin-dev/themes/default/template/header.tpl b/admin-dev/themes/default/template/header.tpl
index df67e525d..db2d00ad2 100644
--- a/admin-dev/themes/default/template/header.tpl
+++ b/admin-dev/themes/default/template/header.tpl
@@ -111,7 +111,7 @@
-
diff --git a/classes/Dispatcher.php b/classes/Dispatcher.php
index 17acd932b..e6aab3c95 100644
--- a/classes/Dispatcher.php
+++ b/classes/Dispatcher.php
@@ -205,7 +205,13 @@ class DispatcherCore
{
$this->front_controller = self::FC_ADMIN;
$this->controller_not_found = 'adminnotfound';
- $this->default_controller = 'admindashboard';
+ if (isset(Context::getContext()->employee) && Validate::isLoadedObject(Context::getContext()->employee) && isset(Context::getContext()->employee->default_tab))
+ {
+ $tab = new Tab((int)Context::getContext()->employee->default_tab);
+ $this->default_controller = $tab->class_name;
+ }
+ else
+ $this->default_controller = 'admindashboard';
}
elseif (Tools::getValue('fc') == 'module')
{
diff --git a/classes/controller/AdminController.php b/classes/controller/AdminController.php
index 7989a17a1..17f405966 100644
--- a/classes/controller/AdminController.php
+++ b/classes/controller/AdminController.php
@@ -1502,7 +1502,7 @@ class AdminControllerCore extends Controller
if (Validate::isLoadedObject($this->context->employee))
{
$accesses = Profile::getProfileAccesses($this->context->employee->id_profile, 'class_name');
-
+ $default_tab = new Tab((int)Context::getContext()->employee->default_tab);
/* Hooks are volontary out the initialize array (need those variables already assigned) */
$bo_color = empty($this->context->employee->bo_color) ? '#FFFFFF' : $this->context->employee->bo_color;
$this->context->smarty->assign(array(
@@ -1516,7 +1516,7 @@ class AdminControllerCore extends Controller
'show_new_customers' => Configuration::get('PS_SHOW_NEW_CUSTOMERS') && $accesses['AdminCustomers']['view'],
'show_new_messages' => Configuration::get('PS_SHOW_NEW_MESSAGES') && $accesses['AdminCustomerThreads']['view'],
'first_name' => Tools::substr($this->context->employee->firstname, 0, 1),
- 'last_name' => htmlentities($this->context->employee->lastname, ENT_COMPAT, 'UTF-8'),
+ 'last_name' => Tools::safeOutput($this->context->employee->lastname),
'employee' => $this->context->employee,
'search_type' => Tools::getValue('bo_search_type'),
'bo_query' => Tools::safeOutput(Tools::stripslashes(Tools::getValue('bo_query'))),
@@ -1529,9 +1529,13 @@ class AdminControllerCore extends Controller
'tabs' => $tabs,
'is_multishop' => $is_multishop,
'multishop_context' => $this->multishop_context,
+ 'default_tab_link' => $this->context->link->getAdminLink($default_tab->class_name),
'employee_avatar' => ImageManager::thumbnail($this->context->employee->getImage(), 'employee'.'_'.(int)$this->context->employee->id.'.'.$this->imageType, 150, $this->imageType, true, true)
));
}
+ else
+ $this->context->smarty->assign('default_tab_link', $this->context->link->getAdminLink('AdminDashboard'));
+
$this->context->smarty->assign(array(
'img_dir' => _PS_IMG_,
'iso' => $this->context->language->iso_code,