diff --git a/module/VuFind/src/VuFind/ILS/Driver/VoyagerRestful.php b/module/VuFind/src/VuFind/ILS/Driver/VoyagerRestful.php index 59510aef2dfe0ec4ccedeae8de369ef0b004708c..ba63a74fc67b63bac4994bc5ff62c9c69c5fe085 100644 --- a/module/VuFind/src/VuFind/ILS/Driver/VoyagerRestful.php +++ b/module/VuFind/src/VuFind/ILS/Driver/VoyagerRestful.php @@ -1487,7 +1487,8 @@ EOT; // Build request $xml = <<<EOT <?xml version="1.0" encoding="UTF-8"?> -<ser:serviceParameters xmlns:ser="http://www.endinfosys.com/Voyager/serviceParameters"> +<ser:serviceParameters + xmlns:ser="http://www.endinfosys.com/Voyager/serviceParameters"> <ser:parameters> <ser:parameter key="bibDbCode"> <ser:value>LOCAL</ser:value> @@ -1514,20 +1515,27 @@ EOT; } $xml .= <<<EOT </ser:parameters> - <ser:patronIdentifier lastName="$lastname" patronHomeUbId="$localUbId" patronId="$patronId"> + <ser:patronIdentifier lastName="$lastname" patronHomeUbId="$localUbId" + patronId="$patronId"> <ser:authFactor type="B">$barcode</ser:authFactor> </ser:patronIdentifier> </ser:serviceParameters> EOT; - $response = $this->makeRequest(array('SendPatronRequestService' => false), array(), 'POST', $xml); + $response = $this->makeRequest( + array('SendPatronRequestService' => false), array(), 'POST', $xml + ); if ($response === false) { return $this->holdError('hold_error_system'); } // Process - $response->registerXPathNamespace('ser', 'http://www.endinfosys.com/Voyager/serviceParameters'); - $response->registerXPathNamespace('req', 'http://www.endinfosys.com/Voyager/requests'); + $response->registerXPathNamespace( + 'ser', 'http://www.endinfosys.com/Voyager/serviceParameters' + ); + $response->registerXPathNamespace( + 'req', 'http://www.endinfosys.com/Voyager/requests' + ); foreach ($response->xpath('//ser:message') as $message) { if ($message->attributes()->type == 'success') { return array( @@ -1867,13 +1875,12 @@ EOT; // Optional check that the bib has items if ($this->checkItemsExist) { - if (!$this->itemsExist( + $exist = $this->itemsExist( $bibId, isset($holdDetails['requestGroupId']) - ? $holdDetails['requestGroupId'] - : null - ) - ) { + ? $holdDetails['requestGroupId'] : null + ); + if (!$exist) { return $this->holdError('hold_no_items'); } } @@ -1881,25 +1888,19 @@ EOT; // Optional check that the bib has no available items if ($this->checkItemsNotAvailable) { $disabledGroups = array(); - if (isset( - $this->config['Holds']['disableAvailabilityCheckForRequestGroups'] - )) { - $disabledGroups = explode( - ':', - $this->config['Holds'] - ['disableAvailabilityCheckForRequestGroups'] - ); + $key = 'disableAvailabilityCheckForRequestGroups'; + if (isset($this->config['Holds'][$key])) { + $disabledGroups = explode(':', $this->config['Holds'][$key]); } if (!isset($holdDetails['requestGroupId']) || !in_array($holdDetails['requestGroupId'], $disabledGroups) ) { - if ($this->itemsAvailable( + $available = $this->itemsAvailable( $bibId, isset($holdDetails['requestGroupId']) - ? $holdDetails['requestGroupId'] - : null - ) - ) { + ? $holdDetails['requestGroupId'] : null + ); + if ($available) { return $this->holdError('hold_items_available'); } } diff --git a/themes/blueprint/js/hold.js b/themes/blueprint/js/hold.js index 33d785d3cbde8edb3409e9a1c4496342478336fc..486506db6f04bb313e9e2260402a59a4caf4c5d6 100644 --- a/themes/blueprint/js/hold.js +++ b/themes/blueprint/js/hold.js @@ -1,3 +1,4 @@ +/*global path */ function setUpHoldRequestForm(recordId) { $('#requestGroupId').change(function() { var $emptyOption = $("#pickUpLocation option[value='']"); diff --git a/themes/bootstrap/js/hold.js b/themes/bootstrap/js/hold.js index 70a0fbdd1536d2c74bce427dc937aec8ee17fe78..ecbed323dd7114ebf2a06955af9a77e52804a519 100644 --- a/themes/bootstrap/js/hold.js +++ b/themes/bootstrap/js/hold.js @@ -1,3 +1,4 @@ +/*global path */ function setUpHoldRequestForm(recordId) { $('#requestGroupId').change(function() { var $emptyOption = $("#pickUpLocation option[value='']"); diff --git a/themes/jquerymobile/js/hold.js b/themes/jquerymobile/js/hold.js index ae84317ff62ecb644aa83bda0606ae5507566454..67a3c307240461e835d301282e1651317a783846 100644 --- a/themes/jquerymobile/js/hold.js +++ b/themes/jquerymobile/js/hold.js @@ -1,3 +1,4 @@ +/*global path */ function setUpHoldRequestForm(recordId) { $('#requestGroupId').change(function() { var $emptyOption = $("#pickUpLocation option[value='']");