Added manager to custom report

This commit is contained in:
snipe 2018-06-27 00:45:09 -07:00
parent 5bb4c85ccb
commit d7dc4ae0c0
2 changed files with 20 additions and 0 deletions

View file

@ -400,6 +400,10 @@ class ReportsController extends Controller
$header[] = 'Employee No.';
}
if ($request->has('manager')) {
$header[] = trans('admin/users/table.manager');
}
if ($request->has('department')) {
$header[] = trans('general.department');
}
@ -613,6 +617,14 @@ class ReportsController extends Controller
}
}
if ($request->has('manager')) {
if ($asset->checkedOutToUser()) {
$row[] = (($asset->assignedto) && ($asset->assignedto->manager)) ? $asset->assignedto->manager->present()->fullName : '';
} else {
$row[] = ''; // Empty string if unassigned
}
}
if ($request->has('department')) {
if ($asset->checkedOutToUser()) {

View file

@ -221,6 +221,13 @@
</label>
</div>
<div class="checkbox col-md-12">
<label>
{{ Form::checkbox('manager', '1', '1', ['class' => 'minimal']) }}
{{ trans('admin/users/table.manager') }}
</label>
</div>
<div class="checkbox col-md-12">
<label>
{{ Form::checkbox('department', '1', '1', ['class' => 'minimal']) }}
@ -231,6 +238,7 @@
@if ($customfields->count() > 0)
<div class="checkbox col-md-12">
<h4>Custom Fields:</h4>