Literally have no idea how this ever worked

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2022-08-31 19:20:35 -07:00
parent e86e96e159
commit ae505ef44d

View file

@ -757,7 +757,7 @@ class ReportsController extends Controller
if ($request->filled('username')) {
// Only works if we're checked out to a user, not anything else.
if ($asset->checkedOutToUser()) {
$row[] = ($asset->assignedto) ? $asset->assignedto->username : '';
$row[] = ($asset->assignedTo) ? $asset->assignedTo->username : '';
} else {
$row[] = ''; // Empty string if unassigned
}
@ -766,7 +766,7 @@ class ReportsController extends Controller
if ($request->filled('employee_num')) {
// Only works if we're checked out to a user, not anything else.
if ($asset->checkedOutToUser()) {
$row[] = ($asset->assignedto) ? $asset->assignedto->employee_num : '';
$row[] = ($asset->assignedTo) ? $asset->assignedTo->employee_num : '';
} else {
$row[] = ''; // Empty string if unassigned
}
@ -774,7 +774,7 @@ class ReportsController extends Controller
if ($request->filled('manager')) {
if ($asset->checkedOutToUser()) {
$row[] = (($asset->assignedto) && ($asset->assignedto->manager)) ? $asset->assignedto->manager->present()->fullName : '';
$row[] = (($asset->assignedTo) && ($asset->assignedTo->manager)) ? $asset->assignedTo->manager->present()->fullName : '';
} else {
$row[] = ''; // Empty string if unassigned
}
@ -782,7 +782,7 @@ class ReportsController extends Controller
if ($request->filled('department')) {
if ($asset->checkedOutToUser()) {
$row[] = (($asset->assignedto) && ($asset->assignedto->department)) ? $asset->assignedto->department->name : '';
$row[] = (($asset->assignedTo) && ($asset->assignedTo->department)) ? $asset->assignedTo->department->name : '';
} else {
$row[] = ''; // Empty string if unassigned
}
@ -790,7 +790,7 @@ class ReportsController extends Controller
if ($request->filled('title')) {
if ($asset->checkedOutToUser()) {
$row[] = ($asset->assignedto) ? $asset->assignedto->jobtitle : '';
$row[] = ($asset->assignedTo) ? $asset->assignedTo->jobtitle : '';
} else {
$row[] = ''; // Empty string if unassigned
}