Skip to content

Commit

Permalink
Manage request fixes when there are no locations for a library
Browse files Browse the repository at this point in the history
  • Loading branch information
mdnoble73 committed Jan 14, 2025
1 parent cacb053 commit cc91a1d
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions code/web/services/MaterialsRequest/ManageRequests.php
Original file line number Diff line number Diff line change
Expand Up @@ -236,14 +236,14 @@ function launch() : void {
while ($rolePermissions->fetch()) {
// Get Available Assignees
$materialsRequestManagers = new User();

if ($materialsRequestManagers->query("SELECT * from user WHERE id IN (SELECT userId FROM user_roles WHERE roleId = $rolePermissions->roleId) AND homeLocationId IN (" . implode(', ', $locationsForLibrary) . ")")) {

while ($materialsRequestManagers->fetch()) {
if (empty($materialsRequestManagers->displayName)) {
$assignees[$materialsRequestManagers->id] = $materialsRequestManagers->firstname . ' ' . $materialsRequestManagers->lastname;
} else {
$assignees[$materialsRequestManagers->id] = $materialsRequestManagers->getDisplayName();
if (count($locationsForLibrary) > 0) {
if ($materialsRequestManagers->query("SELECT * from user WHERE id IN (SELECT userId FROM user_roles WHERE roleId = $rolePermissions->roleId) AND homeLocationId IN (" . implode(', ', $locationsForLibrary) . ")")) {
while ($materialsRequestManagers->fetch()) {
if (empty($materialsRequestManagers->displayName)) {
$assignees[$materialsRequestManagers->id] = $materialsRequestManagers->firstname . ' ' . $materialsRequestManagers->lastname;
} else {
$assignees[$materialsRequestManagers->id] = $materialsRequestManagers->getDisplayName();
}
}
}
}
Expand Down

0 comments on commit cc91a1d

Please sign in to comment.