diff --git a/module/finc/src/finc/Controller/CartController.php b/module/finc/src/finc/Controller/CartController.php index 6f21439655578ce521de5a5d1cb080007ff8fcec..4097f0e5f31deeb6d312a42667e51d01b1a7d6e4 100644 --- a/module/finc/src/finc/Controller/CartController.php +++ b/module/finc/src/finc/Controller/CartController.php @@ -117,7 +117,7 @@ class CartController extends \VuFind\Controller\CartController } // finc specific: dont redirect in layout context for performance reasons - page reloads after closing of lighbox anyway - if ($this->params()->fromPost('layout', $this->params()->fromQuery('layout')) === 'lightbox') { + if ($flashNamespace !== 'error' && $this->params()->fromPost('layout', $this->params()->fromQuery('layout')) === 'lightbox') { $view = $this->createViewModel($this->params()->fromPost()); $view->setTemplate('default/flash-message'); return $view; diff --git a/module/finc/src/finc/ILS/Driver/FincILS.php b/module/finc/src/finc/ILS/Driver/FincILS.php index 0ab8821c741002ad32a3749c30fa73dc4d57609d..ae3a88631ddbbd52d5c15bc999f64f0ca9370cba 100644 --- a/module/finc/src/finc/ILS/Driver/FincILS.php +++ b/module/finc/src/finc/ILS/Driver/FincILS.php @@ -580,6 +580,14 @@ class FincILS extends PAIA implements LoggerAwareInterface (string)$vcard->{'X-LIBRARY-ILS-PATRON-EDIT-ALLOW'} ); } + if (isset($vcard->{'X-LIBRARY-BORROWER-BLACK-LIST-INDICATOR'})) { + $statuscodeInd + = (string)$vcard->{'X-LIBRARY-BORROWER-BLACK-LIST-INDICATOR'}; + } + if (isset($vcard->{'X-LIBRARY-BORROWER-BLACK-LIST-DESCRIPTION'})) { + $statuscodeDesc + = (string)$vcard->{'X-LIBRARY-BORROWER-BLACK-LIST-DESCRIPTION'}; + } } catch (Exception $e) { throw $e; } @@ -632,6 +640,10 @@ class FincILS extends PAIA implements LoggerAwareInterface ? $this->convertDate($patron['expires']) : null, 'statuscode' => isset($patron['status']) ? $patron['status'] : null, + 'statuscodeInd' => isset($statuscodeInd) + ? $statuscodeInd : null, + 'statuscodeDesc' => isset($statuscodeDesc) + ? $statuscodeDesc : null, 'note' => isset($patron['note']) ? $patron['note'] : null, 'canWrite' => in_array(self::SCOPE_WRITE_ITEMS, $this->getSession()->scope), diff --git a/module/finc/src/finc/ILS/Driver/LiberoDingTrait.php b/module/finc/src/finc/ILS/Driver/LiberoDingTrait.php index 2abc6a74c621c2eae16a1f72a609628c5c829a1d..3940de37c6ff605239895f050f3ee746be7f826f 100644 --- a/module/finc/src/finc/ILS/Driver/LiberoDingTrait.php +++ b/module/finc/src/finc/ILS/Driver/LiberoDingTrait.php @@ -355,7 +355,7 @@ trait LiberoDingTrait */ public function setMyProfile($inval, $patron) { - $map = self::_profileDataMapper(true); + $map = self::profileDataMapper(true); $params = $this->getLiberoDingRequestParams(); $params['memberCode'] = $patron['cat_username']; @@ -440,7 +440,7 @@ trait LiberoDingTrait * (default true) * * @return array An associative array - * @see For content variables see method _profileDataMapper + * @see For content variables see method profileDataMapper * @throws \Exception Throws ILSException */ protected function getLiberoDingProfile($patron, $mapped = true) diff --git a/module/finc/src/finc/RecordDriver/SolrMarcFincTrait.php b/module/finc/src/finc/RecordDriver/SolrMarcFincTrait.php index 0f843e4ab98178b6f87511bdfd2c6dd2ddcb5971..645eaaedcb50e92b973429bd0e91371f2cdffe89 100644 --- a/module/finc/src/finc/RecordDriver/SolrMarcFincTrait.php +++ b/module/finc/src/finc/RecordDriver/SolrMarcFincTrait.php @@ -2428,6 +2428,17 @@ trait SolrMarcFincTrait return $retval; } + /** + * Check if punctuation has already been added in marc field + * see also https://www.loc.gov/marc/bibliographic/bdleader.html + * + * @return boolean + */ + public function hasPunctuation() + { + return in_array($this->getMarcRecord()->getLeader()[18], ['a', 'i']); + } + /** * Get the delivery status of the record. * diff --git a/module/finc/src/finc/View/Helper/Root/EnhancedRenderArray.php b/module/finc/src/finc/View/Helper/Root/EnhancedRenderArray.php new file mode 100644 index 0000000000000000000000000000000000000000..f2cd204de7f9d8c76795c8741306d01eb3e49836 --- /dev/null +++ b/module/finc/src/finc/View/Helper/Root/EnhancedRenderArray.php @@ -0,0 +1,67 @@ +<?php +/** + * View helper to render a portion of an array. + * + * PHP version 5 + * + * Copyright (C) Villanova University 2010. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * @category VuFind + * @package View_Helpers + * @author Demian Katz <demian.katz@villanova.edu> + * @author Gregor Gawol <gawol@ub.uni-leipzig.de> + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org/wiki/development Wiki + */ +namespace finc\View\Helper\Root; +use Zend\View\Helper\AbstractHelper; + +/** + * View helper to render a portion of an array. + * + * @category VuFind + * @package View_Helpers + * @author Demian Katz <demian.katz@villanova.edu> + * @author Gregor Gawol <gawol@ub.uni-leipzig.de> + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org/wiki/development Wiki + */ +class EnhancedRenderArray extends AbstractHelper +{ + /** + * Render a portion of an array. + * + * @param string $tpl A template for displaying each row. This should + * include %%KEY&&, %%LABEL%%, %%VALUE%% and %%DISABLED%% placeholders + * @param array $arr An associative array of possible values to display + * @param array $rows A label => profile key associative array specifying + * which rows of $arr to display + * + * @return string + */ + public function __invoke($tpl1, $tpl2, $arr, $rows) + { + $html = ''; + foreach ($rows as $label => $key) { + $html .= str_replace( + ['%%KEY%%', '%%LABEL%%', '%%VALUE%%'], + [$key, $label, $this->view->escapeHtml((isset($arr[$key]) ? $arr[$key] : ''))], + (isset($arr['disabled'][$key]) && ($arr['disabled'][$key] === true) ? $tpl1 : $tpl2) + ); + } + return $html; + } +} diff --git a/module/finc/src/finc/View/Helper/Root/MultiDataFieldsTrait.php b/module/finc/src/finc/View/Helper/Root/MultiDataFieldsTrait.php index c60b928230643400c2e3e64ba4f65af36d41a09f..2bae40e34a3202fd35a841750d7d7ea586405ae7 100644 --- a/module/finc/src/finc/View/Helper/Root/MultiDataFieldsTrait.php +++ b/module/finc/src/finc/View/Helper/Root/MultiDataFieldsTrait.php @@ -210,6 +210,22 @@ trait MultiDataFieldsTrait if (empty($data)) { return []; } + if ($driver->tryMethod('hasPunctuation', [], true) === false) { + /** @var \VuFind\RecordDriver\Response\PublicationDetails $pubDetail */ + foreach ($data as &$pubDetail) { + $place = $pubDetail->getPlace(); + $name = $pubDetail->getName(); + $date = $pubDetail->getDate(); + + if (!empty($place) && (!empty($name) || !empty($date))) { + $place = $place . ': '; + } + if (!empty($name) && !empty($date)) { + $name = $name . ', '; + } + $pubDetail = new \VuFind\RecordDriver\Response\PublicationDetails($place, $name, $date); + } + } return [[ 'label' => 'Published', 'values' => $data, diff --git a/module/finc/src/finc/View/Helper/Root/RecordDataFormatterFactory.php b/module/finc/src/finc/View/Helper/Root/RecordDataFormatterFactory.php index a09201ce1fe5020425bd0a90230d4cf6d1b80f4e..372032924f2c49ace68fa61226e0660a22dbcf41 100644 --- a/module/finc/src/finc/View/Helper/Root/RecordDataFormatterFactory.php +++ b/module/finc/src/finc/View/Helper/Root/RecordDataFormatterFactory.php @@ -393,10 +393,10 @@ class RecordDataFormatterFactory 'getLanguages', 'data-transEscCommaSepLang.phtml' ); - $spec->setTemplateLine( + $spec->setMultiLine( 'Published', - 'getImprint', - 'data-imprint.phtml' + true, + [$this,'publicationDetailsImprint'] ); $spec->setTemplateLine( 'Set Multipart', diff --git a/themes/finc/js/advanced_search.js b/themes/finc/js/advanced_search.js index dde587e5f5a727b796cbeae9590cec96e99720f0..6ea46964445197518ba9c68d8e9fc2e2fa8661ed 100644 --- a/themes/finc/js/advanced_search.js +++ b/themes/finc/js/advanced_search.js @@ -91,7 +91,9 @@ function addGroup(_firstTerm, _firstField, _join) { $newGroup.find('.adv-group-label') // update label .attr('for', 'search_lookfor' + nextGroup + '_0'); $newGroup.attr('id', 'group' + nextGroup); - $newGroup.attr('aria-label', $newGroup.attr('aria-label').replace('0', nextGroup + 1)); + if ($newGroup.attr('aria-label')) { + $newGroup.attr('aria-label', $newGroup.attr('aria-label').replace('0', nextGroup + 1)); + } $newGroup.find('.search_place_holder') .attr('id', 'group' + nextGroup + 'Holder') .removeClass('hidden');