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