Skip to content

A free open source IT asset/license management system

added user phone & address fields

spencerrlongg90eb3b86cf75
diff --git a/app/Http/Controllers/ReportsController.php b/app/Http/Controllers/ReportsController.php
index d449d3c444..ebd5bc3c4f 100644
--- a/app/Http/Controllers/ReportsController.php
+++ b/app/Http/Controllers/ReportsController.php
@@ -528,6 +528,30 @@ class ReportsController extends Controller
$header[] = trans('admin/users/table.title');
}
+ if ($request->filled('phone')) {
+ $header[] = trans('admin/users/table.phone');
+ }
+
+ if ($request->filled('user_address')) {
+ $header[] = trans('general.user') .' '. trans('general.address');
+ }
+
+ if ($request->filled('user_city')) {
+ $header[] = trans('general.user') .' '. trans('general.city');
+ }
+
+ if ($request->filled('user_state')) {
+ $header[] = trans('general.user') .' '. trans('general.state');
+ }
+
+ if ($request->filled('user_country')) {
+ $header[] = trans('general.user') .' '. trans('general.country');
+ }
+
+ if ($request->filled('user_zip')) {
+ $header[] = trans('general.user') .' '. trans('general.zip');
+ }
+
if ($request->filled('status')) {
$header[] = trans('general.status');
}
@@ -828,6 +852,54 @@ class ReportsController extends Controller
}
}
+ if ($request->filled('phone')) {
+ if ($asset->checkedOutToUser()) {
+ $row[] = ($asset->assignedto) ? $asset->assignedto->phone : '';
+ } else {
+ $row[] = ''; // Empty string if unassigned
+ }
+ }
+
+ if ($request->filled('user_address')) {
+ if ($asset->checkedOutToUser()) {
+ $row[] = ($asset->assignedto) ? $asset->assignedto->address : '';
+ } else {
+ $row[] = ''; // Empty string if unassigned
+ }
+ }
+
+ if ($request->filled('user_city')) {
+ if ($asset->checkedOutToUser()) {
+ $row[] = ($asset->assignedto) ? $asset->assignedto->city : '';
+ } else {
+ $row[] = ''; // Empty string if unassigned
+ }
+ }
+
+ if ($request->filled('user_state')) {
+ if ($asset->checkedOutToUser()) {
+ $row[] = ($asset->assignedto) ? $asset->assignedto->state : '';
+ } else {
+ $row[] = ''; // Empty string if unassigned
+ }
+ }
+
+ if ($request->filled('user_country')) {
+ if ($asset->checkedOutToUser()) {
+ $row[] = ($asset->assignedto) ? $asset->assignedto->country : '';
+ } else {
+ $row[] = ''; // Empty string if unassigned
+ }
+ }
+
+ if ($request->filled('user_zip')) {
+ if ($asset->checkedOutToUser()) {
+ $row[] = ($asset->assignedto) ? $asset->assignedto->zip : '';
+ } else {
+ $row[] = ''; // Empty string if unassigned
+ }
+ }
+
if ($request->filled('status')) {
$row[] = ($asset->assetstatus) ? $asset->assetstatus->name.' ('.$asset->present()->statusMeta.')' : '';
}
diff --git a/resources/views/reports/custom.blade.php b/resources/views/reports/custom.blade.php
index 959be57c9c..cc0ec158af 100644
--- a/resources/views/reports/custom.blade.php
+++ b/resources/views/reports/custom.blade.php
@@ -221,6 +221,38 @@
{{ trans('admin/users/table.title') }}
</label>
+ <!-- new -->
+
+ <label class="form-control">
+ {{ Form::checkbox('phone', '1', '1') }}
+ {{ trans('admin/users/table.phone') }}
+ </label>
+
+ <label class="form-control">
+ {{ Form::checkbox('user_address', '1', '1') }}
+ {{ trans('general.address') }}
+ </label>
+
+ <label class="form-control">
+ {{Form::checkbox('user_city', '1', '1')}}
+ {{ trans('general.city') }}
+ </label>
+
+ <label class="form-control">
+ {{Form::checkbox('user_state', '1', '1')}}
+ {{ trans('general.state') }}
+ </label>
+
+ <label class="form-control">
+ {{Form::checkbox('user_country', '1', '1')}}
+ {{ trans('general.country') }}
+ </label>
+
+ <label class="form-control">
+ {{Form::checkbox('user_zip', '1', '1')}}
+ {{ trans('general.zip') }}
+ </label>
+
@if ($customfields->count() > 0)