// employee avatar on the logs listing

This commit is contained in:
rGaillard
2013-12-05 19:16:43 +01:00
parent 0067eff263
commit 5e18a94d2a
+47 -8
View File
@@ -35,14 +35,47 @@ class AdminLogsControllerCore extends AdminController
$this->noLink = true;
$this->fields_list = array(
'id_log' => array('title' => $this->l('ID'), 'align' => 'center', 'class' => 'fixed-width-xs'),
'employee' => array('title' => $this->l('Employee'), 'align' => 'center', 'havingFilter' => true),
'severity' => array('title' => $this->l('Severity (1-4)'), 'align' => 'center', 'class' => 'fixed-width-xs'),
'message' => array('title' => $this->l('Message')),
'object_type' => array('title' => $this->l('Object type'), 'class' => 'fixed-width-sm'),
'object_id' => array('title' => $this->l('Object ID'), 'align' => 'center', 'class' => 'fixed-width-xs'),
'error_code' => array('title' => $this->l('Error code'), 'align' => 'center', 'prefix' => '0x', 'class' => 'fixed-width-xs'),
'date_add' => array('title' => $this->l('Date'), 'width' => 150, 'align' => 'right', 'type' => 'datetime')
'id_log' => array(
'title' => $this->l('ID'),
'align' => 'center',
'class' => 'fixed-width-xs'
),
'employee' => array(
'title' => $this->l('Employee'),
'align' => 'left',
'havingFilter' => true,
'callback' => 'displayEmployee',
'callback_object' => $this
),
'severity' => array(
'title' => $this->l('Severity (1-4)'),
'align' => 'center',
'class' => 'fixed-width-xs'
),
'message' => array(
'title' => $this->l('Message')
),
'object_type' => array(
'title' => $this->l('Object type'),
'class' => 'fixed-width-sm'
),
'object_id' => array(
'title' => $this->l('Object ID'),
'align' => 'center',
'class' => 'fixed-width-xs'
),
'error_code' => array(
'title' => $this->l('Error code'),
'align' => 'center',
'prefix' => '0x',
'class' => 'fixed-width-xs'
),
'date_add' => array(
'title' => $this->l('Date'),
'width' => 150,
'align' => 'right',
'type' => 'datetime'
)
);
$this->fields_options = array(
@@ -81,6 +114,12 @@ class AdminLogsControllerCore extends AdminController
);
unset($this->toolbar_btn['new']);
}
public function displayEmployee($value, $tr)
{
$employee = new Employee((int)$tr['id_employee']);
return ImageManager::thumbnail($employee->getImage(), $this->table.'_mini_'.$value.'_'.$this->context->shop->id.'.'.$this->imageType, 45, $this->imageType).' '.$value;
}
}
?>