// employee avatar on the logs listing

This commit is contained in:
rGaillard committed 2013-12-05 19:16:43 +01:00
1 parent 0067eff263
commit 5e18a94d2a
1 file changed
+47 -8
+47 -8
View File
@@ -35,14 +35,47 @@ class AdminLogsControllerCore extends AdminController
$this->noLink = true; $this->noLink = true;
$this->fields_list = array( $this->fields_list = array(
'id_log' => array('title' => $this->l('ID'), 'align' => 'center', 'class' => 'fixed-width-xs'), 'id_log' => array(
'employee' => array('title' => $this->l('Employee'), 'align' => 'center', 'havingFilter' => true), 'title' => $this->l('ID'),
'severity' => array('title' => $this->l('Severity (1-4)'), 'align' => 'center', 'class' => 'fixed-width-xs'), 'align' => 'center',
'message' => array('title' => $this->l('Message')), 'class' => 'fixed-width-xs'
'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'), 'employee' => array(
'error_code' => array('title' => $this->l('Error code'), 'align' => 'center', 'prefix' => '0x', 'class' => 'fixed-width-xs'), 'title' => $this->l('Employee'),
'date_add' => array('title' => $this->l('Date'), 'width' => 150, 'align' => 'right', 'type' => 'datetime') '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( $this->fields_options = array(
@@ -81,6 +114,12 @@ class AdminLogsControllerCore extends AdminController
); );
unset($this->toolbar_btn['new']); 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;
}
} }
?> ?>