mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-24 21:24:13 -08:00
Added department to custom asset export
This commit is contained in:
parent
a6fc7ba07a
commit
5948a0b235
|
@ -529,6 +529,10 @@ class ReportsController extends Controller
|
|||
$header[] = 'Employee No.';
|
||||
}
|
||||
|
||||
if ($request->has('department')) {
|
||||
$header[] = trans('general.department');
|
||||
}
|
||||
|
||||
if ($request->has('status')) {
|
||||
$header[] = trans('general.status');
|
||||
}
|
||||
|
@ -729,6 +733,15 @@ class ReportsController extends Controller
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
if ($request->has('department')) {
|
||||
if ($asset->checkedOutToUser()) {
|
||||
$row[] = (($asset->assignedto) && ($asset->assignedto->department)) ? $asset->assignedto->department->name : '';
|
||||
} else {
|
||||
$row[] = ''; // Empty string if unassigned
|
||||
}
|
||||
}
|
||||
|
||||
if ($request->has('status')) {
|
||||
$row[] = ($asset->assetstatus) ? $asset->assetstatus->name.' ('.$asset->present()->statusMeta.')' : '';
|
||||
}
|
||||
|
|
|
@ -135,25 +135,7 @@
|
|||
</label>
|
||||
</div>
|
||||
|
||||
<div class="checkbox col-md-12">
|
||||
<label>
|
||||
{{ Form::checkbox('assigned_to', '1', '1', ['class' => 'minimal']) }}
|
||||
{{ trans('admin/licenses/table.assigned_to') }}
|
||||
</label>
|
||||
</div>
|
||||
<div class="checkbox col-md-12">
|
||||
<label>
|
||||
{{ Form::checkbox('username', '1', '1', ['class' => 'minimal']) }}
|
||||
{{ trans('admin/users/table.username') }}
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="checkbox col-md-12">
|
||||
<label>
|
||||
{{ Form::checkbox('employee_num', '1', '1', ['class' => 'minimal']) }}
|
||||
{{ trans('admin/users/table.employee_num') }}
|
||||
</label>
|
||||
</div>
|
||||
<div class="checkbox col-md-12">
|
||||
<label>
|
||||
{{ Form::checkbox('status', '1', '1', ['class' => 'minimal']) }}
|
||||
|
@ -215,6 +197,40 @@
|
|||
</label>
|
||||
</div>
|
||||
|
||||
<!-- User fields -->
|
||||
<div class="checkbox col-md-12">
|
||||
<h4>Checked Out To Fields:</h4>
|
||||
</div>
|
||||
<div class="checkbox col-md-12">
|
||||
<label>
|
||||
{{ Form::checkbox('assigned_to', '1', '1', ['class' => 'minimal']) }}
|
||||
{{ trans('admin/licenses/table.assigned_to') }}
|
||||
</label>
|
||||
</div>
|
||||
<div class="checkbox col-md-12">
|
||||
<label>
|
||||
{{ Form::checkbox('username', '1', '1', ['class' => 'minimal']) }}
|
||||
{{ trans('admin/users/table.username') }}
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="checkbox col-md-12">
|
||||
<label>
|
||||
{{ Form::checkbox('employee_num', '1', '1', ['class' => 'minimal']) }}
|
||||
{{ trans('admin/users/table.employee_num') }}
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="checkbox col-md-12">
|
||||
<label>
|
||||
{{ Form::checkbox('department', '1', '1', ['class' => 'minimal']) }}
|
||||
{{ trans('general.department') }}
|
||||
</label>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
@if ($customfields->count() > 0)
|
||||
<div class="checkbox col-md-12">
|
||||
<h4>Custom Fields:</h4>
|
||||
|
|
Loading…
Reference in a new issue