// link to employee default tab and not index
This commit is contained in:
@@ -111,7 +111,7 @@
|
||||
<i class="icon-reorder"></i>
|
||||
</button>
|
||||
|
||||
<a id="header_shopname" href="{$link->getAdminLink('AdminDashboard')|escape:'htmlall':'UTF-8'}">
|
||||
<a id="header_shopname" href="{$default_tab_link|escape:'htmlall':'UTF-8'}">
|
||||
<img src="{$img_dir}prestashop-avatar.png" height="15" width="15" />
|
||||
{$shop_name}
|
||||
</a>
|
||||
|
||||
@@ -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')
|
||||
{
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user