Skip to content
Snippets Groups Projects
Commit c4c65d3f authored by Ian Hardy's avatar Ian Hardy Committed by Robert Lange
Browse files

FOLIO set is_holdable to false based on configured list of locations (#1638)

parent ca43231b
No related merge requests found
...@@ -101,6 +101,13 @@ extraHoldFields = requiredByDate:pickUpLocation ...@@ -101,6 +101,13 @@ extraHoldFields = requiredByDate:pickUpLocation
; "Recall" if a recall is preferred. ; "Recall" if a recall is preferred.
;default_request = Hold ;default_request = Hold
; Hide the place hold/recall/page link when an item is in the configured
; list of locations. Ideally, this would not be needed and FOLIO would include an
; indicator of whether or not an item is holdable with item details.
; See https://issues.folio.org/browse/UXPROD-2422.
;excludeHoldLocations[] = "24 Hour Reserve"
;excludeHoldLocations[] = "Reference Collection"
; When a request is cancelled through VuFind, use this cancellation reason ID. Most users ; When a request is cancelled through VuFind, use this cancellation reason ID. Most users
; will not have to change this ID unless they have replaced the cancellation reason ; will not have to change this ID unless they have replaced the cancellation reason
; reference data in mod-circulation-storage, or would prefer to use a cancellation ; reference data in mod-circulation-storage, or would prefer to use a cancellation
......
...@@ -400,6 +400,22 @@ class Folio extends AbstractAPI implements ...@@ -400,6 +400,22 @@ class Folio extends AbstractAPI implements
return $this->config[$function] ?? false; return $this->config[$function] ?? false;
} }
/**
* Check item location against list of configured locations
* where holds should be offered
*
* @param string $locationName locationName from getHolding
*
* @return bool
*/
protected function isHoldable($locationName)
{
return !in_array(
$locationName,
(array)($this->config['Holds']['excludeHoldLocations'] ?? [])
);
}
/** /**
* This method queries the ILS for holding information. * This method queries the ILS for holding information.
* *
...@@ -450,6 +466,7 @@ class Folio extends AbstractAPI implements ...@@ -450,6 +466,7 @@ class Folio extends AbstractAPI implements
'barcode' => $item->barcode ?? '', 'barcode' => $item->barcode ?? '',
'status' => $item->status->name, 'status' => $item->status->name,
'availability' => $item->status->name == 'Available', 'availability' => $item->status->name == 'Available',
'is_holdable' => $this->isHoldable($locationName),
'notes' => array_map($notesFormatter, $item->notes ?? []), 'notes' => array_map($notesFormatter, $item->notes ?? []),
'callnumber' => $holding->callNumber ?? '', 'callnumber' => $holding->callNumber ?? '',
'location' => $locationName, 'location' => $locationName,
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment