From 0037cdb00cfb6779bf7057400a2219f52f2405aa Mon Sep 17 00:00:00 2001 From: Ivan Nieto Vivanco Date: Mon, 13 Dec 2021 20:27:23 -0600 Subject: [PATCH] Add title column to custom reports --- app/Http/Controllers/ReportsController.php | 12 ++++++++++++ resources/views/reports/custom.blade.php | 7 +++++++ 2 files changed, 19 insertions(+) diff --git a/app/Http/Controllers/ReportsController.php b/app/Http/Controllers/ReportsController.php index 1665ef3d15..3b242f093e 100644 --- a/app/Http/Controllers/ReportsController.php +++ b/app/Http/Controllers/ReportsController.php @@ -513,6 +513,10 @@ class ReportsController extends Controller $header[] = trans('general.department'); } + if ($request->filled('title')) { + $header[] = trans('admin/users/table.title'); + } + if ($request->filled('status')) { $header[] = trans('general.status'); } @@ -756,6 +760,14 @@ class ReportsController extends Controller } } + if ($request->filled('title')) { + if ($asset->checkedOutToUser()) { + $row[] = ($asset->assignedto) ? $asset->assignedto->jobtitle : ''; + } 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 23851e0a85..ab9a4074b4 100644 --- a/resources/views/reports/custom.blade.php +++ b/resources/views/reports/custom.blade.php @@ -235,6 +235,13 @@ +
+ +
+