Better fix for javascript formatter for employee number

This commit is contained in:
snipe 2017-07-26 16:47:47 -07:00
parent 7d6bf4ac24
commit ee7348d0d5
2 changed files with 10 additions and 1 deletions

View file

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

View file

@ -321,6 +321,14 @@ $('.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;
}
}
function orderNumberObjFilterFormatter(value, row) {
if (value) {
return '<a href="{{ url('/') }}/hardware/?order_number=' + row.order_number + '"> ' + row.order_number + '</a>';