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,
|
"visible" => true,
|
||||||
"formatter" => "usersLinkObjFormatter"
|
"formatter" => "usersLinkObjFormatter"
|
||||||
], [
|
], [
|
||||||
"field" => "employee_number",
|
"field" => "assigned_to",
|
||||||
"searchable" => false,
|
"searchable" => false,
|
||||||
"sortable" => false,
|
"sortable" => false,
|
||||||
"title" => trans('admin/users/table.employee_num'),
|
"title" => trans('admin/users/table.employee_num'),
|
||||||
"visible" => false,
|
"visible" => false,
|
||||||
|
"formatter" => "employeeNumFormatter"
|
||||||
|
|
||||||
],[
|
],[
|
||||||
"field" => "location",
|
"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) {
|
function orderNumberObjFilterFormatter(value, row) {
|
||||||
if (value) {
|
if (value) {
|
||||||
return '<a href="{{ url('/') }}/hardware/?order_number=' + row.order_number + '"> ' + row.order_number + '</a>';
|
return '<a href="{{ url('/') }}/hardware/?order_number=' + row.order_number + '"> ' + row.order_number + '</a>';
|
||||||
|
|
Loading…
Reference in a new issue