Add title column to custom reports

This commit is contained in:
Ivan Nieto Vivanco 2021-12-13 20:27:23 -06:00
parent 503c802d70
commit 0037cdb00c
2 changed files with 19 additions and 0 deletions

View file

@ -513,6 +513,10 @@ class ReportsController extends Controller
$header[] = trans('general.department');
}
if ($request->filled('title')) {
$header[] = trans('admin/users/table.title');
}
if ($request->filled('status')) {
$header[] = trans('general.status');
}
@ -756,6 +760,14 @@ class ReportsController extends Controller
}
}
if ($request->filled('title')) {
if ($asset->checkedOutToUser()) {
$row[] = ($asset->assignedto) ? $asset->assignedto->jobtitle : '';
} else {
$row[] = ''; // Empty string if unassigned
}
}
if ($request->filled('status')) {
$row[] = ($asset->assetstatus) ? $asset->assetstatus->name.' ('.$asset->present()->statusMeta.')' : '';
}

View file

@ -235,6 +235,13 @@
</label>
</div>
<div class="checkbox col-md-12">
<label>
{{ Form::checkbox('title', '1', '1', ['class' => 'minimal']) }}
{{ trans('admin/users/table.title') }}
</label>
</div>