diff --git a/local/dev/config/vufind/FincILS.ini.sample b/local/dev/config/vufind/FincILS.ini.sample index 85038bbfd96b2c3607681526c86f226edcc4d448..3cef938e6117d7f5dc4a017c377068a9da36b7bc 100644 --- a/local/dev/config/vufind/FincILS.ini.sample +++ b/local/dev/config/vufind/FincILS.ini.sample @@ -22,17 +22,17 @@ relative_path = ../../../config/vufind/FincILS.ini ;#################################################################### [DAIA] -baseUrl = http://139.18.19.238:9080/daialibero/daia/ -daiaIdPrefix = "UBL:ppn:" +baseUrl = http://139.18.19.238:9080/daiawachtl/daia/ +daiaIdPrefix = "DE-15:ppn:" ilsIdentifier = "record_id" multiQuery = true daiaResponseFormat = json +[PAIA] +baseUrl = http://139.18.19.238:9080/paiawachtl/paia/DE-15/ +paiaCache = false + [Records] services[] = 'loan' services[] = 'presentation' services[] = 'custom' - -[PAIA] -; base URL of the PAIA server -baseUrl = http://139.18.19.238:9080/paialibero/paia/DE-15/ diff --git a/module/finc/src/finc/ILS/Logic/Holds.php b/module/finc/src/finc/ILS/Logic/Holds.php index 11c48d65e2adef53a77b722f108d182162fb149c..6e6bf38c8c17690826af6f425512daa3fa6ce935 100644 --- a/module/finc/src/finc/ILS/Logic/Holds.php +++ b/module/finc/src/finc/ILS/Logic/Holds.php @@ -28,7 +28,9 @@ * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License * @link https://vufind.org/wiki/development Wiki */ + namespace finc\ILS\Logic; + use VuFind\ILS\Connection as ILSConnection; /** @@ -60,6 +62,7 @@ class Holds extends \VuFind\ILS\Logic\Holds // Handle purchase history alongside other textual fields $textFieldNames = $this->catalog->getHoldingsTextFieldNames(); + // TODO: handle purchase history as is done in super class ?! $textFieldNames[] = 'purchase_history'; foreach ($holdings as $groupKey => $items) { @@ -93,9 +96,14 @@ class Holds extends \VuFind\ILS\Logic\Holds } if (!empty($item[$fieldName])) { - $targetRef = & $retVal[$groupKey]['textfields'][$fieldName]; + $targetRef + = &$retVal[$groupKey]['textfields'][$fieldName]; foreach ((array)$item[$fieldName] as $field) { - if (empty($targetRef) || !in_array($field, $targetRef)) { + if (empty($targetRef) + || !in_array( + $field, $targetRef + ) + ) { $targetRef[] = $field; } } @@ -126,12 +134,12 @@ class Holds extends \VuFind\ILS\Logic\Holds // controller and view to inform the user that these credentials are // needed for hold data. try { - $patron = $this->ilsAuth->storedCatalogLogin(); + $patron = $this->ilsAuth->storedCatalogLogin(); - // Does this ILS Driver handle consortial holdings? - $config = $this->catalog->checkFunction( - 'Holds', compact('id', 'patron') - ); + // Does this ILS Driver handle consortial holdings? + $config = $this->catalog->checkFunction( + 'Holds', compact('id', 'patron') + ); } catch (ILSException $e) { $patron = false; $config = []; @@ -142,26 +150,49 @@ class Holds extends \VuFind\ILS\Logic\Holds $id, $patron ? $patron : null, $ids ); } else { - $result = $this->catalog->getHolding($id, $patron ? $patron : null); + $result = $this->catalog->getHolding( + $id, $patron ? $patron : null + ); } + $grb = 'getRequestBlocks'; // use variable to shorten line below: + $blocks + = $patron + && $this->catalog->checkCapability( + $grb, compact($patron) + ) + ? $this->catalog->getRequestBlocks($patron) : false; + $mode = $this->catalog->getHoldsMode(); if ($mode == "disabled") { $holdings = $this->standardHoldings($result); - } else if ($mode == "driver") { - $holdings = $this->driverHoldings($result, $config); } else { - $holdings = $this->generateHoldings($result, $mode, $config); + if ($mode == "driver") { + $holdings = $this->driverHoldings( + $result, $config, !empty($blocks) + ); + } else { + $holdings = $this->generateHoldings( + $result, $mode, $config + ); + } } $holdings = $this->processStorageRetrievalRequests( - $holdings, $id, $patron + $holdings, $id, $patron, !empty($blocks) + ); + $holdings = $this->processILLRequests( + $holdings, $id, $patron, !empty($blocks) + ); + $holdings = $this->processEmailHolds( + $holdings, $id, $patron, !empty($blocks) ); - $holdings = $this->processILLRequests($holdings, $id, $patron); - $holdings = $this->processEmailHolds($holdings, $id, $patron); } - return $this->formatHoldings($holdings); + return [ + 'blocks' => $blocks, + 'holdings' => $this->formatHoldings($holdings) + ]; } /** @@ -174,13 +205,14 @@ class Holds extends \VuFind\ILS\Logic\Holds * * @return array Modified holdings */ - protected function processEmailHolds($holdings, $id, $patron) + protected function processEmailHolds( + $holdings, $id, $patron, $requestsBlocked + ) { if (!is_array($holdings)) { return $holdings; } - // Are email holds allowed? $requestConfig = $this->catalog->checkFunction( 'EmailHold', compact('id', 'patron') ); @@ -189,29 +221,17 @@ class Holds extends \VuFind\ILS\Logic\Holds return $holdings; } - // Generate Links - // Loop through each holding foreach ($holdings as &$location) { foreach ($location as &$copy) { - // Is this copy requestable - if (isset($copy['addEmailHoldLink']) + if (!$requestsBlocked && isset($copy['addEmailHoldLink']) && $copy['addEmailHoldLink'] ) { - // If the request is blocked, link to an error page - // instead of the form: - if ($copy['addEmailHoldLink'] === 'block') { - $copy['emailHoldLink'] - = $this->getBlockedEmailHoldDetails($copy); - } else { - $copy['emailHoldLink'] - = $this->getRequestDetails( - $copy, - $requestConfig['HMACKeys'], - 'EmailHold' - ); - } - // If we are unsure whether request options are - // available, set a flag so we can check later via AJAX: + $copy['emailHoldLink'] = $this->getRequestDetails( + $copy, + $requestConfig['HMACKeys'], + 'EmailHoldLink' + ); + $copy['checkEmailHold'] = $copy['addEmailHoldLink'] === 'check'; } @@ -219,20 +239,4 @@ class Holds extends \VuFind\ILS\Logic\Holds } return $holdings; } - - /** - * Returns a URL to display a "blocked email hold" message. - * - * @param array $details An array of item data - * - * @return array Details for generating URL - */ - protected function getBlockedEmailHoldDetails($details) - { - // Build Params - return [ - 'action' => 'BlockedEmailHold', - 'record' => $details['id'] - ]; - } } diff --git a/themes/finc/templates/RecordTab/holdingsils.phtml b/themes/finc/templates/RecordTab/holdingsils.phtml index 7313dd55aa529b03d1b0a2d2f8cf6d831dfe0432..cf3de883f55268619850a9911f0139b904522247 100644 --- a/themes/finc/templates/RecordTab/holdingsils.phtml +++ b/themes/finc/templates/RecordTab/holdingsils.phtml @@ -72,7 +72,7 @@ if (!empty($holdingTitleHold)): ?> <? endif; ?> <? /* finc-specific snippet - #9274 - END */ ?> <? endif; ?> -<? foreach ($holdings as $holding): ?> +<? foreach ($holdings['holdings'] as $holding): ?> <? /* nxt line = finc-specific - #7841@56988450 - CK */ ?> <? $holdingsEmpty = false; ?> <? /* this next line produces an empty h3 heading in some cases - should be solved more elegantly - Fixme - CK*/ ?> diff --git a/themes/finc/templates/search/searchTabs.phtml b/themes/finc/templates/search/searchTabs.phtml new file mode 100644 index 0000000000000000000000000000000000000000..4e17691c810cc5a754e75bba9ab0b38d96f295a0 --- /dev/null +++ b/themes/finc/templates/search/searchTabs.phtml @@ -0,0 +1,9 @@ +<? if (isset($searchTabs) && count($searchTabs) > 0): ?> + <ul class="nav nav-tabs"> + <? foreach ($searchTabs as $tab): ?> + <li<?=$tab['selected'] ? ' class="active"' : ''?>> + <a <?=$tab['selected'] ? '' : 'href="' . $this->escapeHtmlAttr($tab['url']) . '"' ?>><?=$this->transEsc($tab['label']); ?></a> + </li> + <? endforeach; ?> + </ul> +<? endif; ?>