diff --git a/code/web/RecordDrivers/RecordActionGenerator.php b/code/web/RecordDrivers/RecordActionGenerator.php index 532d1185e7..47f0cc7d21 100644 --- a/code/web/RecordDrivers/RecordActionGenerator.php +++ b/code/web/RecordDrivers/RecordActionGenerator.php @@ -56,7 +56,9 @@ function getSpecificVolumeLocalIllRequestAction($module, $source, $id, $volumeIn 'id' => "actionButton$id", 'onclick' => "return AspenDiscovery.Record.showLocalIllRequest('$module', '$source', '$id', '{$volumeInfo['volumeId']}');", 'requireLogin' => false, - 'type' => 'ils_hold', + 'type' => 'local_ill_request', + 'volumeId' => $volumeInfo['volumeId'], + 'volumeName' => $volumeInfo['volumeName'] ]; } diff --git a/code/web/release_notes/25.01.00.MD b/code/web/release_notes/25.01.00.MD index 74b83eacce..a53951288e 100644 --- a/code/web/release_notes/25.01.00.MD +++ b/code/web/release_notes/25.01.00.MD @@ -1,12 +1,15 @@ ## Aspen LiDA Updates //mark -### Github Updates -- Move Aspen LiDA to it's own repository at https://github.com/Aspen-Discovery/aspen-lida. (*MDN*) +### Account Updates +- Show Volume in holds when applicable. (DIS-34) (*MDN*) +- Show Out of Hold Group Message in holds when applicable. (DIS-34) (*MDN*) ### Local ILL -- Show Out of Hold Group Message when available. (DIS-34) (*MDN*) +- Fixes for placing local ILL requests. (DIS-34) (*MDN*) +- Allow placing local ILL requests for individual volumes of a record. (DIS-34) (*MDN*) ### Other Updates +- Move Aspen LiDA to its own repository at https://github.com/Aspen-Discovery/aspen-lida. (*MDN*) - Add debugging code to aid in diagnosing startup problems. (*MDN*) ## Aspen Discovery Updates diff --git a/code/web/services/API/ItemAPI.php b/code/web/services/API/ItemAPI.php index d220959982..87c7b3ea16 100644 --- a/code/web/services/API/ItemAPI.php +++ b/code/web/services/API/ItemAPI.php @@ -717,6 +717,10 @@ function getAppGroupedWork() { $action['sampleNumber'] = $recordAction['sampleNumber']; } } + + $action['volumeId'] = $recordAction['volumeId'] ?? null; + $action['volumeName'] = $recordAction['volumeName'] ?? null; + $actions[] = $action; } @@ -1125,6 +1129,8 @@ function getVariations() { $actionButtons[$key]['requireLogin'] = $action['requireLogin'] ?? false; $actionButtons[$key]['sampleNumber'] = $action['sampleNumber'] ?? null; $actionButtons[$key]['formatId'] = $action['formatId'] ?? null; + $actionButtons[$key]['volumeId'] = $action['volumeId'] ?? null; + $actionButtons[$key]['volumeName'] = $action['volumeName'] ?? null; if(isset($action['redirectUrl'])) { $actionButtons[$key]['redirectUrl'] = $action['redirectUrl']; @@ -1275,8 +1281,10 @@ function getRecords() { $buttons[$key]['requireLogin'] = $actionButton['requireLogin'] ?? false; $buttons[$key]['sampleNumber'] = $actionButton['sampleNumber'] ?? null; $buttons[$key]['formatId'] = $actionButton['formatId'] ?? null; + $buttons[$key]['volumeId'] = $actionButton['volumeId'] ?? null; + $buttons[$key]['volumeName'] = $actionButton['volumeName'] ?? null; - if(isset($actionButton['redirectUrl'])) { + if (isset($actionButton['redirectUrl'])) { $buttons[$key]['redirectUrl'] = $actionButton['redirectUrl']; } } diff --git a/code/web/services/API/UserAPI.php b/code/web/services/API/UserAPI.php index f85177704e..86d9814440 100644 --- a/code/web/services/API/UserAPI.php +++ b/code/web/services/API/UserAPI.php @@ -1789,11 +1789,11 @@ function renewItem(): array { /** * Renews all items that have been checked out to the user from the ILS. - * Returns a count of the number of items that could be renewed. + * Returns a count of the items that could be renewed. * * Parameters: * * @@ -1869,7 +1869,7 @@ function renewAll(): array { * * Sample Call: * - * https://aspenurl/API/UserAPI?method=renewAll&username=userbarcode&password=userpin&bibId=1004012&pickupBranch=pa + * https://aspenurl/API/UserAPI?method=placeHold&username=userbarcode&password=userpin&bibId=1004012&pickupBranch=pa * * * Sample Response (successful hold): @@ -1923,7 +1923,7 @@ function placeHold(): array { if ($source == 'ils' || $source == null) { if (isset($_REQUEST['pickupBranch']) || isset($_REQUEST['campus'])) { if (isset($_REQUEST['pickupBranch'])) { - if (is_null($_REQUEST['pickupBranch'])) { + if (empty($_REQUEST['pickupBranch'])) { $location = new Location(); $userPickupLocations = $location->getPickupBranches($user); foreach ($userPickupLocations as $tmpLocation) { @@ -1970,6 +1970,7 @@ function placeHold(): array { $action = $result['api']['action'] ?? null; $responseMessage = strip_tags($result['api']['message']); $responseMessage = trim($responseMessage); + $needsIllRequest = isset($hold_result['error_code']) && ($hold_result['error_code'] == 'hatErrorResponse.17286') || ($hold_result['error_code'] == 'hatErrorResponse.447'); return [ 'success' => $result['success'], 'title' => $result['api']['title'], @@ -1978,12 +1979,14 @@ function placeHold(): array { 'confirmationNeeded' => $result['api']['confirmationNeeded'] ?? false, 'confirmationId' => $result['api']['confirmationId'] ?? null, 'shouldBeItemHold' => false, + 'needsIllRequest' => $needsIllRequest ]; } elseif ($holdType == 'volume' && isset($_REQUEST['volumeId'])) { $result = $user->placeVolumeHold($shortId, $_REQUEST['volumeId'], $pickupBranch); $action = $result['api']['action'] ?? null; $responseMessage = strip_tags($result['api']['message']); $responseMessage = trim($responseMessage); + $needsIllRequest = isset($result['error_code']) && ($result['error_code'] == 'hatErrorResponse.17286') || ($result['error_code'] == 'hatErrorResponse.447'); return [ 'success' => $result['success'], 'title' => $result['api']['title'], @@ -1992,6 +1995,7 @@ function placeHold(): array { 'confirmationNeeded' => $result['api']['confirmationNeeded'] ?? false, 'confirmationId' => $result['api']['confirmationId'] ?? null, 'shouldBeItemHold' => false, + 'needsIllRequest' => $needsIllRequest ]; } else { //Make sure that there are not volumes available @@ -2154,6 +2158,7 @@ function getValidPickupLocations(): array { $pickupLocationArray = $pickupLocation->toArray(); $pickupLocationArray['locationId'] = (string)$pickupLocationArray['locationId']; $pickupLocationArray['libraryId'] = (string)$pickupLocationArray['libraryId']; + $pickupLocationArray['locationCode'] = (string)$pickupLocationArray['code']; $pickupLocations[] = $pickupLocationArray; } } diff --git a/code/web/sys/InterLibraryLoan/LocalIllForm.php b/code/web/sys/InterLibraryLoan/LocalIllForm.php index ccb274aa0a..4a784a11a5 100644 --- a/code/web/sys/InterLibraryLoan/LocalIllForm.php +++ b/code/web/sys/InterLibraryLoan/LocalIllForm.php @@ -402,6 +402,21 @@ public function getFormFieldsForApi() : array { 'maxLength' => 20, ]; + $fields['volumeId'] = [ + 'type' => 'text', + 'property' => 'volumeId', + 'display' => 'hide', + 'label' => translate([ + 'text' => 'Volume ID', + 'isPublicFacing' => true, + ]), + 'description' => translate([ + 'text' => 'The volume to be requested', + 'isPublicFacing' => true, + ]), + 'required' => false, + ]; + require_once ROOT_DIR . '/services/API/UserAPI.php'; $user = new UserAPI();