From ef34338d6895fe665478b5f6f31f0daf8e10b6e6 Mon Sep 17 00:00:00 2001 From: rajaro Date: Mon, 21 Oct 2024 11:32:32 +0300 Subject: [PATCH 1/4] Quria: Fix updating holds when pick up location is not changed --- module/Finna/src/Finna/ILS/Driver/Quria.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/module/Finna/src/Finna/ILS/Driver/Quria.php b/module/Finna/src/Finna/ILS/Driver/Quria.php index 6e4d3c0702e..68ca3460826 100644 --- a/module/Finna/src/Finna/ILS/Driver/Quria.php +++ b/module/Finna/src/Finna/ILS/Driver/Quria.php @@ -1412,6 +1412,14 @@ public function updateHolds( if (isset($fields['pickUpLocation'])) { [, $branch] = explode('.', $fields['pickUpLocation'], 2); $updateRequest['pickUpBranchId'] = $branch; + } else { + $locations = $this->getPickUpLocations($patron, ['item_id' => $requestId]); + foreach ($locations as $loc) { + if ($loc['locationDisplay'] === $pickupLocation) { + [, $branch] = explode('.', $loc['locationID'], 2); + $updateRequest['pickUpBranchId'] = $branch; + } + } } $result = $this->doSOAPRequest( $this->reservations_wsdl, From cf36690189ff20ece4a9764cfe54cb3630f98e30 Mon Sep 17 00:00:00 2001 From: rajaro Date: Wed, 23 Oct 2024 14:27:46 +0300 Subject: [PATCH 2/4] Add comments --- module/Finna/src/Finna/ILS/Driver/Quria.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/module/Finna/src/Finna/ILS/Driver/Quria.php b/module/Finna/src/Finna/ILS/Driver/Quria.php index 68ca3460826..cc805895ea8 100644 --- a/module/Finna/src/Finna/ILS/Driver/Quria.php +++ b/module/Finna/src/Finna/ILS/Driver/Quria.php @@ -984,7 +984,7 @@ public function getMyHolds($user) $detailsStr = $reservation->id . '|' . $reservation->validFromDate . '|' . $reservation->validToDate . '|' - . $reservation->pickUpBranchId; + . $reservation->pickUpBranchId; // $reservation->pickUpBranchId actually contains the branch name instead of the ID $updateDetails = ''; $cancelDetails = ''; // TODO: Regional holds are not yet implemented @@ -1413,6 +1413,7 @@ public function updateHolds( [, $branch] = explode('.', $fields['pickUpLocation'], 2); $updateRequest['pickUpBranchId'] = $branch; } else { + // Map the branch name to an actual branch ID $locations = $this->getPickUpLocations($patron, ['item_id' => $requestId]); foreach ($locations as $loc) { if ($loc['locationDisplay'] === $pickupLocation) { From 91b378731229ae6e692229747aba8bc3a39e66c4 Mon Sep 17 00:00:00 2001 From: rajaro Date: Wed, 23 Oct 2024 14:32:16 +0300 Subject: [PATCH 3/4] comment change --- module/Finna/src/Finna/ILS/Driver/Quria.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/module/Finna/src/Finna/ILS/Driver/Quria.php b/module/Finna/src/Finna/ILS/Driver/Quria.php index cc805895ea8..cc1342ea6d9 100644 --- a/module/Finna/src/Finna/ILS/Driver/Quria.php +++ b/module/Finna/src/Finna/ILS/Driver/Quria.php @@ -984,7 +984,8 @@ public function getMyHolds($user) $detailsStr = $reservation->id . '|' . $reservation->validFromDate . '|' . $reservation->validToDate . '|' - . $reservation->pickUpBranchId; // $reservation->pickUpBranchId actually contains the branch name instead of the ID + . $reservation->pickUpBranchId; // $reservation->pickUpBranchId actually + // contains the branch name instead of the ID $updateDetails = ''; $cancelDetails = ''; // TODO: Regional holds are not yet implemented From 060e01b1a454ecec95cd39b3bc754503c00d635a Mon Sep 17 00:00:00 2001 From: rajaro Date: Wed, 23 Oct 2024 14:52:55 +0300 Subject: [PATCH 4/4] comment change --- module/Finna/src/Finna/ILS/Driver/Quria.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/Finna/src/Finna/ILS/Driver/Quria.php b/module/Finna/src/Finna/ILS/Driver/Quria.php index cc1342ea6d9..d6253dfb057 100644 --- a/module/Finna/src/Finna/ILS/Driver/Quria.php +++ b/module/Finna/src/Finna/ILS/Driver/Quria.php @@ -985,7 +985,7 @@ public function getMyHolds($user) $detailsStr = $reservation->id . '|' . $reservation->validFromDate . '|' . $reservation->validToDate . '|' . $reservation->pickUpBranchId; // $reservation->pickUpBranchId actually - // contains the branch name instead of the ID + // contains the branch name instead of the ID $updateDetails = ''; $cancelDetails = ''; // TODO: Regional holds are not yet implemented