From b30f81b7cac991a1a9871aa3d673d3000195e9d2 Mon Sep 17 00:00:00 2001 From: Frank Morgner <morgnerf@ub.uni-leipzig.de> Date: Thu, 22 Feb 2018 09:41:49 +0100 Subject: [PATCH] refs #12533 * match vcard field X-LIBRARY-BORROWER_BRANCH to home_libary ** insufficent due to overwriting in profileAction() VuFind\..\MyResearchController --- module/finc/src/finc/ILS/Driver/FincILS.php | 15 ++++++++++----- module/finc/src/finc/ILS/Driver/PAIA.php | 19 ++++++++++--------- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/module/finc/src/finc/ILS/Driver/FincILS.php b/module/finc/src/finc/ILS/Driver/FincILS.php index 3ab786cc25c..4811e178b43 100644 --- a/module/finc/src/finc/ILS/Driver/FincILS.php +++ b/module/finc/src/finc/ILS/Driver/FincILS.php @@ -515,7 +515,6 @@ class FincILS extends PAIA implements LoggerAwareInterface if (isset($patron['address'])) { try { $vcard = VObject\Reader::read($patron['address']); - if (isset($vcard->ADR)) { foreach ($vcard->ADR as $adr) { $address[( @@ -540,6 +539,10 @@ class FincILS extends PAIA implements LoggerAwareInterface if (isset($vcard->ROLE)) { $group = (string)$vcard->ROLE; } + if (isset($vcard->{'X-LIBRARY-BORROWER-BRANCH'})) { + $home_library + = (string)$vcard->{'X-LIBRARY-BORROWER-BRANCH'}; + } if (isset($vcard->{'X-LIBRARY-ILS-PATRON-EDIT-ALLOW'})) { $editable = $this->getEditableProfileFields( (string)$vcard->{'X-LIBRARY-ILS-PATRON-EDIT-ALLOW'} @@ -594,12 +597,14 @@ class FincILS extends PAIA implements LoggerAwareInterface // PAIA specific custom values 'expires' => isset($patron['expires']) ? $this->convertDate($patron['expires']) : null, - 'statuscode' => isset($patron['status']) ? $patron['status'] : null, + 'statuscode' => isset($patron['status']) + ? $patron['status'] : null, 'canWrite' => in_array(self::SCOPE_WRITE_ITEMS, $this->getSession()->scope), // fincILS and PAIA specific custom values - 'email' => !empty($patron['email']) ? - $patron['email'] : (!empty($emails[0]) ? $emails[0] : null), - 'editableFields' => (!empty($editable)) ? $editable : null + 'email' => !empty($patron['email']) + ? $patron['email'] : (!empty($emails[0]) ? $emails[0] : null), + 'editableFields' => (!empty($editable)) ? $editable : null, + 'home_library' => (!empty($home_library)) ? $home_library : null ]; return (isset($profile)) ? array_merge($idm, $profile) : $idm; diff --git a/module/finc/src/finc/ILS/Driver/PAIA.php b/module/finc/src/finc/ILS/Driver/PAIA.php index 3da0a278cc0..0a206b2583c 100644 --- a/module/finc/src/finc/ILS/Driver/PAIA.php +++ b/module/finc/src/finc/ILS/Driver/PAIA.php @@ -320,15 +320,16 @@ class PAIA extends \VuFind\ILS\Driver\PAIA //todo: make fields more configurable if (is_array($patron)) { return [ - 'firstname' => $patron['firstname'], - 'lastname' => $patron['lastname'], - 'address1' => null, - 'address2' => null, - 'city' => null, - 'country' => null, - 'zip' => null, - 'phone' => null, - 'group' => null, + 'firstname' => $patron['firstname'], + 'lastname' => $patron['lastname'], + 'address1' => null, + 'address2' => null, + 'city' => null, + 'country' => null, + 'zip' => null, + 'phone' => null, + 'group' => null, + 'home_library' => null, // PAIA specific custom values 'expires' => isset($patron['expires']) ? $this->convertDate($patron['expires']) : null, -- GitLab