Fixed #8928 - add URL and ID to custom asset report

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2022-08-10 13:51:47 -07:00
parent f66df4d468
commit 637604dfaf
2 changed files with 28 additions and 2 deletions

View file

@ -422,6 +422,9 @@ class ReportsController extends Controller
$header = [];
if ($request->filled('id')) {
$header[] = trans('general.id');
}
if ($request->filled('company')) {
$header[] = trans('general.company');
@ -568,6 +571,10 @@ class ReportsController extends Controller
$header[] = trans('general.notes');
}
if ($request->filled('notes')) {
$header[] = trans('admin/manufacturers/table.url');
}
foreach ($customfields as $customfield) {
if ($request->input($customfield->db_column_name()) == '1') {
@ -662,7 +669,11 @@ class ReportsController extends Controller
foreach ($assets as $asset) {
$count++;
$row = [];
if ($request->filled('id')) {
$row[] = ($asset->id) ? $asset->id : '';
}
if ($request->filled('company')) {
$row[] = ($asset->company) ? $asset->company->name : '';
}
@ -834,6 +845,10 @@ class ReportsController extends Controller
$row[] = ($asset->notes) ? $asset->notes : '';
}
if ($request->filled('url')) {
$row[] = config('app.url').'/hardware/'.$asset->id ;
}
foreach ($customfields as $customfield) {
$column_name = $customfield->db_column_name();
if ($request->filled($customfield->db_column_name())) {

View file

@ -37,6 +37,12 @@
{{ trans('general.select_all') }}
</label>
</div>
<div class="checkbox col-md-12">
<label>
{{ Form::checkbox('id', '1', '1', ['class' => 'minimal']) }}
{{ trans('general.id') }}
</label>
</div>
<div class="checkbox col-md-12">
<label>
{{ Form::checkbox('company', '1', '1', ['class' => 'minimal']) }}
@ -135,7 +141,6 @@
</label>
</div>
<div class="checkbox col-md-12">
<label>
{{ Form::checkbox('status', '1', '1', ['class' => 'minimal']) }}
@ -203,6 +208,12 @@
{{ trans('general.notes') }}
</label>
</div>
<div class="checkbox col-md-12">
<label>
{{ Form::checkbox('url', '1', '1', ['class' => 'minimal']) }}
- {{ trans('admin/manufacturers/table.url') }}
</label>
</div>
<!-- User fields -->
<div class="checkbox col-md-12">