// employee avatar
This commit is contained in:
@@ -126,6 +126,8 @@ class EmployeeCore extends ObjectModel
|
||||
|
||||
if ($this->id)
|
||||
$this->associated_shops = $this->getAssociatedShops();
|
||||
|
||||
$this->image_dir = _PS_EMPLOYEE_IMG_DIR_;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -347,4 +349,11 @@ class EmployeeCore extends ObjectModel
|
||||
{
|
||||
return $this->id_profile == _PS_ADMIN_PROFILE_;
|
||||
}
|
||||
|
||||
public function getImage()
|
||||
{
|
||||
if (!isset($this->id) || empty($this->id) || !file_exists($this->image_dir.$this->id.'.jpg'))
|
||||
return _PS_IMG_DIR_.'prestashop-avatar.png';
|
||||
return $this->image_dir.$this->id.'.jpg';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1529,6 +1529,7 @@ class AdminControllerCore extends Controller
|
||||
'tabs' => $tabs,
|
||||
'is_multishop' => $is_multishop,
|
||||
'multishop_context' => $this->multishop_context,
|
||||
'employee_avatar' => ImageManager::thumbnail($this->context->employee->getImage(), 'employee'.'_'.(int)$this->context->employee->id.'.'.$this->imageType, 150, $this->imageType, true, true)
|
||||
));
|
||||
}
|
||||
$this->context->smarty->assign(array(
|
||||
|
||||
Reference in New Issue
Block a user