diff --git a/config/vufind/Voyager.ini b/config/vufind/Voyager.ini index fac3b6b4c0928a62ade9b3c967290d7d89209a4f..e855a5447f951a17c3e09c5e12835883b62585b9 100644 --- a/config/vufind/Voyager.ini +++ b/config/vufind/Voyager.ini @@ -99,3 +99,11 @@ login_field = LAST_NAME ; This regular expression controls which status messages are displayed on the ; Checked Out Items list. show_statuses = "/lost|missing|claim/i" + +[Profile] +; This setting can be used to define which Voyager phone type is used as the primary +; phone number. Default is "Primary". +;primary_phone = Primary +; This setting can be used to define which Voyager phone type is used as the mobile +; phone number. Default is "Mobile". +;mobile_phone = Mobile \ No newline at end of file diff --git a/config/vufind/VoyagerRestful.ini b/config/vufind/VoyagerRestful.ini index ea1727d1488f5fc451e5e12df18e5e0ca5c31e34..82e2f248410c45029fb8ea30ab146f734f4ff051 100644 --- a/config/vufind/VoyagerRestful.ini +++ b/config/vufind/VoyagerRestful.ini @@ -317,4 +317,12 @@ show_statuses = "/lost|missing|claim/i" ; of config.ini for notes on these settings. When set here, these will override the ; config.ini defaults when Voyager is used for authentication. ;pattern = "alphanumeric" -;hint = "Your optional custom hint can go here." \ No newline at end of file +;hint = "Your optional custom hint can go here." + +[Profile] +; This setting can be used to define which Voyager phone type is used as the primary +; phone number. Default is "Primary". +;primary_phone = Primary +; This setting can be used to define which Voyager phone type is used as the mobile +; phone number. Default is "Mobile". +;mobile_phone = Mobile \ No newline at end of file diff --git a/languages/en.ini b/languages/en.ini index 377ac6bb34c4dfbaaa32a1e21a318f0f23b9c5b6..fb5fadb133fdf3316e298bfcabebc2906cb75cbc 100644 --- a/languages/en.ini +++ b/languages/en.ini @@ -607,6 +607,7 @@ Message From Sender = "Message From Sender" Metadata Prefix = "Metadata Prefix" Microfilm = "Microfilm" MLA Citation = "MLA Citation" +Mobile Number = "Mobile Number" mobile_link = "You appear to be on a mobile device; switch to mobile view?" Monograph Title = "Monograph Title" more = "more" diff --git a/languages/fi.ini b/languages/fi.ini index a024e5bcfdbaf4d3838c524a1c6ee90e3df91a3f..f5855eeab32766ea87dfb5592200c80e6788a247 100644 --- a/languages/fi.ini +++ b/languages/fi.ini @@ -612,6 +612,7 @@ Message From Sender = "Viesti lähettäjältä" Metadata Prefix = "Metadatan etuliite" Microfilm = "Mikrofilmi" MLA Citation = "MLA-viite" +Mobile Number = "Matkapuhelin" mobile_link = "Vaikuttaa siltä, että käytät mobiililaitetta. Siirrytäänkö mobiiliversioon?" Monograph Title = "Kirjan nimi" more = "lisää" diff --git a/languages/sv.ini b/languages/sv.ini index 0d40848a35a92cfa8b2bba7618e37704460d49e8..ad1a1de0bc5ca7da6c8486f78917ebb65205da9d 100644 --- a/languages/sv.ini +++ b/languages/sv.ini @@ -607,6 +607,7 @@ Message From Sender = "Meddelande från" Metadata Prefix = "Metadata Prefix" Microfilm = "Mikrofilm" MLA Citation = "MLA-referens" +Mobile Number = "Mobiltelefon" mobile_link = "You appear to be on a mobile device; switch to mobile view?" Monograph Title = "Monografis titel" more = "mer" diff --git a/module/VuFind/src/VuFind/ILS/Driver/Demo.php b/module/VuFind/src/VuFind/ILS/Driver/Demo.php index 13ae7dbed147d9d659861656711244fe1528fd1c..64c15e8943d64bab4e14dc31d11bb3d2598cf63e 100644 --- a/module/VuFind/src/VuFind/ILS/Driver/Demo.php +++ b/module/VuFind/src/VuFind/ILS/Driver/Demo.php @@ -721,6 +721,7 @@ class Demo extends AbstractBase 'city' => 'City', 'country' => 'Country', 'phone' => '1900 CALL ME', + 'mobile_phone' => '1234567890', 'group' => 'Library Staff', 'expiration_date' => 'Someday' ]; diff --git a/module/VuFind/src/VuFind/ILS/Driver/Voyager.php b/module/VuFind/src/VuFind/ILS/Driver/Voyager.php index def6f4d681bd2a277765340b623bf12c1ec1d24e..0ad30c1379cf8a2f3ff7e23200c0de92e6f25ae2 100644 --- a/module/VuFind/src/VuFind/ILS/Driver/Voyager.php +++ b/module/VuFind/src/VuFind/ILS/Driver/Voyager.php @@ -1973,16 +1973,24 @@ EOT; "PATRON.HISTORICAL_CHARGES, PATRON_ADDRESS.ADDRESS_LINE1, " . "PATRON_ADDRESS.ADDRESS_LINE2, PATRON_ADDRESS.ZIP_POSTAL, " . "PATRON_ADDRESS.CITY, PATRON_ADDRESS.COUNTRY, " . - "PATRON_PHONE.PHONE_NUMBER, PATRON_GROUP.PATRON_GROUP_NAME " . + "PATRON_PHONE.PHONE_NUMBER, PHONE_TYPE.PHONE_DESC, " . + "PATRON_GROUP.PATRON_GROUP_NAME " . "FROM $this->dbName.PATRON, $this->dbName.PATRON_ADDRESS, " . - "$this->dbName.PATRON_PHONE, $this->dbName.PATRON_BARCODE, " . - "$this->dbName.PATRON_GROUP " . + "$this->dbName.PATRON_PHONE, $this->dbName.PHONE_TYPE, " . + "$this->dbName.PATRON_BARCODE, $this->dbName.PATRON_GROUP " . "WHERE PATRON.PATRON_ID = PATRON_ADDRESS.PATRON_ID (+) " . "AND PATRON_ADDRESS.ADDRESS_ID = PATRON_PHONE.ADDRESS_ID (+) " . "AND PATRON.PATRON_ID = PATRON_BARCODE.PATRON_ID (+) " . "AND PATRON_BARCODE.PATRON_GROUP_ID = " . "PATRON_GROUP.PATRON_GROUP_ID (+) " . + "AND PATRON_PHONE.PHONE_TYPE = PHONE_TYPE.PHONE_TYPE (+) " . "AND PATRON.PATRON_ID = :id"; + $primaryPhoneType = isset($this->config['Profile']['primary_phone']) + ? $this->config['Profile']['primary_phone'] + : 'Primary'; + $mobilePhoneType = isset($this->config['Profile']['mobile_phone']) + ? $this->config['Profile']['mobile_phone'] + : 'Mobile'; try { $sqlStmt = $this->executeSQL($sql, [':id' => $patron['id']]); $patron = []; @@ -1994,7 +2002,11 @@ EOT; $patron['lastname'] = utf8_encode($row['LAST_NAME']); } if (!empty($row['PHONE_NUMBER'])) { - $patron['phone'] = utf8_encode($row['PHONE_NUMBER']); + if ($primaryPhoneType === $row['PHONE_DESC']) { + $patron['phone'] = utf8_encode($row['PHONE_NUMBER']); + } elseif ($mobilePhoneType === $row['PHONE_DESC']) { + $patron['mobile_phone'] = utf8_encode($row['PHONE_NUMBER']); + } } if (!empty($row['PATRON_GROUP_NAME'])) { $patron['group'] = utf8_encode($row['PATRON_GROUP_NAME']); diff --git a/themes/bootstrap3/templates/myresearch/profile.phtml b/themes/bootstrap3/templates/myresearch/profile.phtml index ca1d2ef556f74bd7bf1717c4671956d0bd8d2db3..495f97ba352c21f69bc7a84ff6f7152ebd86a71e 100644 --- a/themes/bootstrap3/templates/myresearch/profile.phtml +++ b/themes/bootstrap3/templates/myresearch/profile.phtml @@ -54,6 +54,7 @@ $this->transEsc('City') => 'city', $this->transEsc('Country') => 'country', $this->transEsc('Phone Number') => 'phone', + $this->transEsc('Mobile Number') => 'mobile_phone', $this->transEsc('Group') => 'group', $this->transEsc('Expires') => 'expiration_date' ]