Fixes #3865 - employee number mislabeled in list output

This commit is contained in:
snipe 2017-08-22 21:40:35 -07:00
parent a0cbca85bf
commit 06c5bce3c7
2 changed files with 4 additions and 6 deletions

View file

@ -100,13 +100,12 @@ class AssetPresenter extends Presenter
"visible" => true,
"formatter" => "usersLinkObjFormatter"
], [
"field" => "assigned_to",
"field" => "employee_number",
"searchable" => false,
"sortable" => false,
"title" => trans('admin/users/table.employee_num'),
"visible" => false,
"formatter" => "employeeNumFormatter"
],[
"field" => "location",
"searchable" => true,

View file

@ -322,10 +322,9 @@ $('.snipe-table').bootstrapTable({
}
function employeeNumFormatter(value, row) {
if ((value) && (value.employee_number)) {
return '<a href="{{ url('/') }}/users/' + row.id + '"> ' + value.employee_number + '</a>';
} else {
return value;
if ((row.assigned_to) && ((row.assigned_to.employee_number))) {
return '<a href="{{ url('/') }}/users/' + row.assigned_to.id + '"> ' + row.assigned_to.employee_number + '</a>';
}
}