Merge pull request #10432 from inietov/features/adding_title_to_custom_report

Add title column to custom reports
This commit is contained in:
snipe 2021-12-14 10:28:02 -08:00 committed by GitHub
commit 59555483f3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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>