Merge branch 'develop'

This commit is contained in:
snipe 2018-02-16 21:39:15 -08:00
commit 99205bf72e
4 changed files with 11 additions and 1 deletions

View file

@ -180,6 +180,7 @@ class AssetPresenter extends Presenter
"sortable" => true,
"visible" => false,
"title" => trans('general.notes'),
], [
"field" => "created_at",
"searchable" => false,

View file

@ -117,6 +117,7 @@ class LicensePresenter extends Presenter
"sortable" => true,
"visible" => false,
"title" => trans('general.notes'),
"formatter" => "notesFormatter"
]
];

View file

@ -51,7 +51,7 @@
<th class="text-right" data-searchable="true" data-visible="true" data-sortable="true" data-field="asset_maintenance_time" data-footer-formatter="sumFormatter">{{ trans('admin/asset_maintenances/form.asset_maintenance_time') }}</th>
<th data-searchable="true" data-sortable="true" data-field="cost" class="text-right" data-footer-formatter="sumFormatter">{{ trans('admin/asset_maintenances/form.cost') }}</th>
<th data-searchable="true" data-visible="true" data-sortable="true" data-field="user_id" data-formatter="usersLinkObjFormatter">{{ trans('general.admin') }}</th>
<th data-searchable="true" data-visible="true" data-sortable="true" data-field="notes">{{ trans('admin/asset_maintenances/form.notes') }}</th>
<th data-searchable="true" data-visible="true" data-sortable="true" data-field="notes" data-formatter="notesFormatter">{{ trans('admin/asset_maintenances/form.notes') }}</th>
@can('update', \App\Models\Asset::class)
<th data-switchable="false" data-searchable="false" data-sortable="false" data-field="actions" data-formatter="maintenanceActions">{{ trans('table.actions') }}</th>
@endcan

View file

@ -252,6 +252,14 @@
}
// Convert line breaks to <br>
function notesFormatter(value) {
if (value) {
return value.replace(/(?:\r\n|\r|\n)/g, '<br />');;
}
}
// We need a special formatter for license seats, since they don't work exactly the same
// Checkouts need the license ID, checkins need the specific seat ID