Add employee number option to custom report

This commit is contained in:
snipe 2016-11-23 05:17:54 -08:00
parent 1d2ae84572
commit 45c789021e
2 changed files with 19 additions and 1 deletions
app/Http/Controllers
resources/views/reports

View file

@ -561,6 +561,9 @@ class ReportsController extends Controller
if (e(Input::get('username')) == '1') {
$header[] = 'Username';
}
if (e(Input::get('employee_num')) == '1') {
$header[] = 'Employee No.';
}
if (e(Input::get('status')) == '1') {
$header[] = 'Status';
}
@ -679,6 +682,14 @@ class ReportsController extends Controller
}
}
if (e(Input::get('employee_num')) == '1') {
if ($asset->assigneduser) {
$row[] = '"' .e($asset->assigneduser->employee_num). '"';
} else {
$row[] = ''; // Empty string if unassigned
}
}
if (e(Input::get('status')) == '1') {
if (( $asset->status_id == '0' ) && ( $asset->assigned_to == '0' )) {
$row[] = trans('general.ready_to_deploy');

View file

@ -128,6 +128,13 @@
</label>
</div>
<div class="checkbox col-md-12">
<label>
{{ Form::checkbox('employee_num', '1') }}
{{ trans('admin/users/table.employee_num') }}
</label>
</div>
<div class="checkbox col-md-12">
<label>
{{ Form::checkbox('status', '1') }}
@ -168,7 +175,7 @@
<div class="col-md-7">
<p>Select the fields you'd like to include in your custom report, and click Generate. The file (report.csv) will download automatically, and you can open it in Excel.</p>
<p>Select the fields you'd like to include in your custom report, and click Generate. The file (YYYY-mm-dd-his-custom-asset-report.csv) will download automatically, and you can open it in Excel.</p>
</div>
</div>