mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-11 22:07:29 -08:00
Better fix for javascript formatter for employee number
This commit is contained in:
parent
7d6bf4ac24
commit
ee7348d0d5
|
@ -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",
|
||||
|
|
|
@ -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>';
|
||||
|
|
Loading…
Reference in a new issue