diff --git a/config/vufind/VoyagerRestful.ini b/config/vufind/VoyagerRestful.ini index 46ff405127e2c97fa7c139bfd1fea40f40c3b24e..3325b06656ced04be49baa144cdfdcd5605ae0c0 100644 --- a/config/vufind/VoyagerRestful.ini +++ b/config/vufind/VoyagerRestful.ini @@ -96,9 +96,11 @@ defaultRequiredDate = 0:1:0 extraHoldFields = comments:requiredByDate:pickUpLocation ; A Pick Up Location Code used to pre-select the pick up location drop down list and -; provide a default option if others are not available. Must correspond with one of -; the Location IDs returned by getPickUpLocations() -defaultPickUpLocation = "1" +; provide a default option if others are not available. Must be one of the following: +; 1) empty string to indicate that the first location is default (default setting) +; 2) 0 to indicate that the user always has to choose the location +; 3) a value within the Location IDs returned by getPickUpLocations() +defaultPickUpLocation = "" ; The maximum number of holding items to generate request links for. The process of ; checking the API for a valid hold is intensive. Any hold items above this this diff --git a/languages/en.ini b/languages/en.ini index 686715cb57ac1bf045d228e0722a06878e1d15df..1633a258769a92768db20ab286ba39c7862e2f78 100644 --- a/languages/en.ini +++ b/languages/en.ini @@ -691,6 +691,7 @@ Select this record = "Select this record" Select your carrier = "Select your carrier" Selected = "Selected" select_page = "Select Page" +select_pickup_location = "Select Pick Up Location" Send = Send Send us your feedback! = "Send us your feedback!" Sensor Image = "Sensor Image" diff --git a/languages/fi.ini b/languages/fi.ini index dd18a0b59308f0ff2b04f5b550759e25213707c3..0ccb4f63e9b44d01f7f11e6fc4b088dc6e78c0a8 100644 --- a/languages/fi.ini +++ b/languages/fi.ini @@ -693,6 +693,7 @@ Select this record = "Valitse tämä tietue" Select your carrier = "Valitse operaattori" Selected = "Valittu" select_page = "Valitse sivu" +select_pickup_location = "Valitse noutopaikka" Send = "Lähetä" Send us your feedback! = "Lähetä meille palautetta" Sensor Image = "Kaukokartoituskuva" diff --git a/languages/sv.ini b/languages/sv.ini index b1682c79e249c4a4c88bb745cee4fe7b6fa28c86..7efb219f82ba1ac931ee3e5342eca533f10af320 100644 --- a/languages/sv.ini +++ b/languages/sv.ini @@ -693,6 +693,7 @@ Select this record = "Välj denna post" Select your carrier = "Välj teleoperatör" Selected = "Vald" select_page = "Välj sida" +select_pickup_location = "Välj avhämtningsplats" Send = "Skicka" Send us your feedback! = "Skicka os din feedback" Sensor Image = "Fjärranalysbild" diff --git a/module/VuFind/src/VuFind/ILS/Driver/VoyagerRestful.php b/module/VuFind/src/VuFind/ILS/Driver/VoyagerRestful.php index 1126779d506e90d53a0efd0c42eff56896425138..9d3001f823c81b71691704409e5a61454ed58336 100644 --- a/module/VuFind/src/VuFind/ILS/Driver/VoyagerRestful.php +++ b/module/VuFind/src/VuFind/ILS/Driver/VoyagerRestful.php @@ -197,7 +197,12 @@ class VoyagerRestful extends Voyager implements \VuFindHttp\HttpServiceAwareInte = (isset($this->config['pickUpLocations'])) ? $this->config['pickUpLocations'] : false; $this->defaultPickUpLocation - = $this->config['Holds']['defaultPickUpLocation']; + = isset($this->config['Holds']['defaultPickUpLocation']) + ? $this->config['Holds']['defaultPickUpLocation'] + : ''; + if ($this->defaultPickUpLocation == '0') { + $this->defaultPickUpLocation = false; + } $this->holdCheckLimit = isset($this->config['Holds']['holdCheckLimit']) ? $this->config['Holds']['holdCheckLimit'] : "15"; @@ -1692,8 +1697,15 @@ EOT; $mfhdId = isset($details['holdings_id']) ? $details['holdings_id'] : false; $comment = $details['comment']; $bibId = $details['id']; - $pickUpLocation = !empty($details['pickUpLocation']) - ? $details['pickUpLocation'] : ''; + + // Make Sure Pick Up Location is Valid + if (isset($details['pickUpLocation']) + && !$this->pickUpLocationIsValid( + $details['pickUpLocation'], $patron, $details + ) + ) { + return $this->holdError("hold_invalid_pickup"); + } // Attempt Request $hierarchy = array(); @@ -1723,18 +1735,18 @@ EOT; 'dbkey' => $this->ws_dbKey, 'mfhdId' => $mfhdId ); - if ($pickUpLocation) { + if (isset($details['pickUpLocation'])) { $xml['call-slip-title-parameters']['pickup-location'] - = $pickUpLocation; + = $details['pickUpLocation']; } } else { $xml['call-slip-parameters'] = array( 'comment' => $comment, 'dbkey' => $this->ws_dbKey ); - if ($pickUpLocation) { + if (isset($details['pickUpLocation'])) { $xml['call-slip-parameters']['pickup-location'] - = $pickUpLocation; + = $details['pickUpLocation']; } } diff --git a/themes/blueprint/templates/record/hold.phtml b/themes/blueprint/templates/record/hold.phtml index 3864e1310e0a0bdbb3d327047b12c25893c7cd9d..0d5ec0b35d657ea451781c197beff192a3519673 100644 --- a/themes/blueprint/templates/record/hold.phtml +++ b/themes/blueprint/templates/record/hold.phtml @@ -40,6 +40,11 @@ ?> <strong><?=$this->transEsc("pick_up_location")?>:</strong><br/> <select name="gatheredDetails[pickUpLocation]"> + <? if ($selected === false): ?> + <option value="" selected="selected"> + <?=$this->transEsc('select_pickup_location')?> + </option> + <? endif; ?> <? foreach ($this->pickup as $lib): ?> <option value="<?=$this->escapeHtml($lib['locationID'])?>"<?=($selected == $lib['locationID']) ? ' selected="selected"' : ''?>> <?=$this->escapeHtml($lib['locationDisplay'])?> diff --git a/themes/blueprint/templates/record/storageretrievalrequest.phtml b/themes/blueprint/templates/record/storageretrievalrequest.phtml index 866a1526bbe87e3740b63b5bfa0aafbac66a1fd0..ae4eeaba60edea40c76e0aa0f90edd943c3b8fc6 100644 --- a/themes/blueprint/templates/record/storageretrievalrequest.phtml +++ b/themes/blueprint/templates/record/storageretrievalrequest.phtml @@ -51,6 +51,11 @@ ?> <strong><?=$this->transEsc("pick_up_location")?>:</strong><br/> <select name="gatheredDetails[pickUpLocation]"> + <? if ($selected === false): ?> + <option value="" selected="selected"> + <?=$this->transEsc('select_pickup_location')?> + </option> + <? endif; ?> <? foreach ($this->pickup as $lib): ?> <option value="<?=$this->escapeHtml($lib['locationID'])?>"<?=($selected == $lib['locationID']) ? ' selected="selected"' : ''?>> <?=$this->escapeHtml($lib['locationDisplay'])?> diff --git a/themes/bootstrap/templates/record/hold.phtml b/themes/bootstrap/templates/record/hold.phtml index 741be749a452ce641895c346dd88cfa5c3af08ae..131362674bbcce69e951a93efc807db181e52f05 100644 --- a/themes/bootstrap/templates/record/hold.phtml +++ b/themes/bootstrap/templates/record/hold.phtml @@ -45,6 +45,11 @@ <label class="control-label"><?=$this->transEsc("pick_up_location")?>:</label> <div class="controls"> <select name="gatheredDetails[pickUpLocation]"> + <? if ($selected === false): ?> + <option value="" selected="selected"> + <?=$this->transEsc('select_pickup_location')?> + </option> + <? endif; ?> <? foreach ($this->pickup as $lib): ?> <option value="<?=$this->escapeHtml($lib['locationID'])?>"<?=($selected == $lib['locationID']) ? ' selected="selected"' : ''?>> <?=$this->escapeHtml($lib['locationDisplay'])?> diff --git a/themes/bootstrap/templates/record/storageretrievalrequest.phtml b/themes/bootstrap/templates/record/storageretrievalrequest.phtml index 00e36e93c2d83efe2033c82727acd3be4ee06baa..c4623895309576654cd3b4a29378d5b4d0b194a8 100644 --- a/themes/bootstrap/templates/record/storageretrievalrequest.phtml +++ b/themes/bootstrap/templates/record/storageretrievalrequest.phtml @@ -66,6 +66,11 @@ <label class="control-label"><?=$this->transEsc("pick_up_location")?>:</label> <div class="controls"> <select name="gatheredDetails[pickUpLocation]"> + <? if ($selected === false): ?> + <option value="" selected="selected"> + <?=$this->transEsc('select_pickup_location')?> + </option> + <? endif; ?> <? foreach ($this->pickup as $lib): ?> <option value="<?=$this->escapeHtml($lib['locationID'])?>"<?=($selected == $lib['locationID']) ? ' selected="selected"' : ''?>> <?=$this->escapeHtml($lib['locationDisplay'])?> diff --git a/themes/jquerymobile/templates/record/hold.phtml b/themes/jquerymobile/templates/record/hold.phtml index 8bd21e35d8f3e33556a2d98a7200b3b9d06b0629..b2e248d0b23201ef11f56b67faf6c81b56b6562f 100644 --- a/themes/jquerymobile/templates/record/hold.phtml +++ b/themes/jquerymobile/templates/record/hold.phtml @@ -39,6 +39,11 @@ ?> <strong><?=$this->transEsc("pick_up_location")?>:</strong><br/> <select name="gatheredDetails[pickUpLocation]"> + <? if ($selected === false): ?> + <option value="" selected="selected"> + <?=$this->transEsc('select_pickup_location')?> + </option> + <? endif; ?> <? foreach ($this->pickup as $lib): ?> <option value="<?=$this->escapeHtml($lib['locationID'])?>"<?=($selected == $lib['locationID']) ? ' selected="selected"' : ''?>> <?=$this->escapeHtml($lib['locationDisplay'])?>