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/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; + } +}