"checkbox",
"checkbox" => true
],
[
"field" => "id",
"searchable" => false,
"sortable" => true,
"switchable" => true,
"title" => trans('general.id'),
"visible" => false
],
[
"field" => "company",
"searchable" => true,
"sortable" => true,
"switchable" => true,
"title" => trans('admin/companies/table.title'),
"visible" => false,
"formatter" => "companiesLinkObjFormatter"
],
[
"field" => "name",
"searchable" => true,
"sortable" => true,
"title" => trans('admin/users/table.name'),
"visible" => true,
"formatter" => "usersLinkFormatter"
],
[
"field" => "jobtitle",
"searchable" => true,
"sortable" => true,
"switchable" => true,
"title" => trans('admin/users/table.title'),
"visible" => true,
"formatter" => "usersLinkFormatter"
],
[
"field" => "email",
"searchable" => true,
"sortable" => true,
"switchable" => true,
"title" => trans('admin/users/table.email'),
"visible" => true,
"formatter" => "emailFormatter"
],
[
"field" => "username",
"searchable" => true,
"sortable" => true,
"switchable" => true,
"title" => trans('admin/users/table.username'),
"visible" => true,
"formatter" => "usersLinkFormatter"
],
[
"field" => "employee_num",
"searchable" => true,
"sortable" => true,
"switchable" => true,
"title" => trans('admin/users/table.employee_num'),
"visible" => false
],
[
"field" => "location",
"searchable" => true,
"sortable" => true,
"switchable" => true,
"title" => trans('admin/users/table.location'),
"visible" => true,
"formatter" => "locationsLinkObjFormatter"
],
[
"field" => "manager",
"searchable" => true,
"sortable" => true,
"title" => trans('admin/users/table.manager'),
"visible" => true,
"formatter" => "usersLinkObjFormatter"
],
[
"field" => "assets_count",
"searchable" => false,
"sortable" => false,
"switchable" => true,
"title" => ' Assets'
.'',
"visible" => true,
],
[
"field" => "licenses_count",
"searchable" => false,
"sortable" => false,
"switchable" => true,
"title" => ' Licenses'
.'',
"visible" => true,
],
[
"field" => "consumables_count",
"searchable" => false,
"sortable" => false,
"switchable" => true,
"title" => ' Consumables'
.'',
"visible" => true,
],
[
"field" => "accessories_count",
"searchable" => false,
"sortable" => false,
"switchable" => true,
"title" => ' Accessories'
.'',
"visible" => true,
],
[
"field" => "notes",
"searchable" => true,
"sortable" => true,
"switchable" => true,
"title" => trans('general.notes'),
"visible" => true,
],
[
"field" => "groups",
"searchable" => false,
"sortable" => false,
"switchable" => true,
"title" => trans('general.groups'),
"visible" => true,
'formatter' => 'groupsFormatter'
],
[
"field" => "two_factor_enrolled",
"searchable" => false,
"sortable" => false,
"switchable" => true,
"title" => trans('admin/users/general.two_factor_enrolled'),
"visible" => false,
'formatter' => 'trueFalseFormatter'
],
[
"field" => "two_factor_active",
"searchable" => false,
"sortable" => false,
"switchable" => true,
"title" => trans('admin/users/general.two_factor_active'),
"visible" => false,
'formatter' => 'trueFalseFormatter'
],
[
"field" => "activated",
"searchable" => false,
"sortable" => true,
"switchable" => true,
"title" => trans('general.activated'),
"visible" => true,
'formatter' => 'trueFalseFormatter'
],
[
"field" => "created_at",
"searchable" => true,
"sortable" => true,
"switchable" => true,
"title" => trans('general.created_at'),
"visible" => false,
'formatter' => 'dateDisplayFormatter'
],
[
"field" => "last_login",
"searchable" => false,
"sortable" => true,
"switchable" => true,
"title" => trans('general.last_login'),
"visible" => false,
'formatter' => 'dateDisplayFormatter'
],
[
"field" => "actions",
"searchable" => false,
"sortable" => false,
"switchable" => false,
"title" => trans('table.actions'),
"visible" => true,
"formatter" => "usersActionsFormatter",
]
];
return json_encode($layout);
}
public function emailLink()
{
if ($this->email) {
return ''.$this->email.''
.'';
}
return '';
}
/**
* Returns the user full name, it simply concatenates
* the user first and last name.
*
* @return string
*/
public function fullName()
{
return "{$this->first_name} {$this->last_name}";
}
/**
* Standard accessor.
* @TODO Remove presenter::fullName() entirely?
* @return string
*/
public function name()
{
return $this->fullName();
}
/**
* Returns the user Gravatar image url.
*
* @return string
*/
public function gravatar()
{
if ($this->avatar) {
return config('app.url').'/uploads/avatars/'.$this->avatar;
}
if ((Setting::getSettings()->load_remote=='1') && ($this->email!='')) {
$gravatar = md5(strtolower(trim($this->email)));
return "//gravatar.com/avatar/".$gravatar;
}
return false;
}
/**
* Formatted url for use in tables.
* @return string
*/
public function nameUrl()
{
return (string) link_to_route('users.show', $this->fullName(), $this->id);
}
/**
* Url to view this item.
* @return string
*/
public function viewUrl()
{
return route('users.show', $this->id);
}
public function glyph()
{
return '';
}
}