Skip to content

Commit

Permalink
Merge branch '24.05.10' into 24.06.00
Browse files Browse the repository at this point in the history
  • Loading branch information
mdnoble73 committed Jun 6, 2024
2 parents 86c1d32 + 8139d9b commit 161e2c6
Show file tree
Hide file tree
Showing 6 changed files with 78 additions and 8 deletions.
21 changes: 18 additions & 3 deletions code/web/Drivers/Sierra.php
Original file line number Diff line number Diff line change
Expand Up @@ -1467,6 +1467,18 @@ public function updatePatronInfo($patron, $canUpdateContactInfo, $fromMasquerade
$params['phones'][] = $tmpPhone;
}
}
if ($library->allowPatronWorkPhoneNumberUpdates) {
if (!array_key_exists('phones', $params)) {
$params['phones'] = [];
}
if (isset($_REQUEST['workPhone'])) {
$patron->_workPhone = $_REQUEST['workPhone'];
$tmpPhone = new stdClass();
$tmpPhone->type = 't';
$tmpPhone->number = $_REQUEST['workPhone'];
$params['phones'][] = $tmpPhone;
}
}
if ($library->allowPatronAddressUpdates) {
$params['addresses'] = [];
$address = new stdClass();
Expand Down Expand Up @@ -1676,9 +1688,12 @@ private function loadContactInformationFromApiResult(User $user, stdClass $patro
}
}
if (!empty($patronInfo->phones)) {
$primaryPhone = reset($patronInfo->phones);
if (!empty($primaryPhone)) {
$user->phone = $primaryPhone->number;
foreach ($patronInfo->phones as $phoneInfo) {
if ($phoneInfo->type == 'p') {
$user->phone = $phoneInfo->number;
}elseif ($phoneInfo->type == 't') {
$user->_workPhone = $phoneInfo->number;
}
}
}
if (!empty($patronInfo->emails)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
{if !empty($showWorkPhoneInProfile)}
<div class="form-group">
<div class="col-xs-4"><label for="workPhone">{translate text='Work Phone Number' isPublicFacing=true}</label></div>
<div class="col-xs-8">{if !empty($edit) && $canUpdateContactInfo && $canUpdatePhoneNumber && !$isHorizon}<input name="workPhone" id="workPhone" value="{$profile->workPhone|escape}" size="50" maxlength="75" class="form-control">{else}{$profile->workPhone|escape}{/if}</div>
<div class="col-xs-8">{if !empty($edit) && $canUpdateContactInfo && $canUpdateWorkPhoneNumber && !$isHorizon}<input name="workPhone" id="workPhone" value="{$profile->_workPhone|escape}" size="50" maxlength="75" class="form-control">{else}{$profile->_workPhone|escape}{/if}</div>
</div>
{/if}
{/if}
Expand Down
15 changes: 15 additions & 0 deletions code/web/release_notes/24.05.10.MD
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,21 @@
- Update extracting records from Evolve to extract individual MARC records rather than updating individual items. (Ticket 125328) (*MDN*)
- When processing records to reload, force the record to be updated from Evolve during the indexing process. (Ticket 125328) (*MDN*)

### Sierra Updates
- When loading phone numbers, load the primary phone number from the phone number with a type of p. (Ticket 126596) (*MDN*)
- When loading phone numbers, load the "work" phone number from the phone number with a type of t. (Ticket 126596) (*MDN*)
- Update phone numbers appropriately based on primary and work phone numbers in Contact Information. (Ticket 126596) (*MDN*)
- When using the "Pickup at" setting within the Format Map, properly load available locations when the location code is not the entire location code of the item. (Tickets 128864, 130706) (*MDN*)

### User Account Updates
- Allow work phone to be updated independently of the main phone number.

<div markdown="1" class="settings">

#### New Settings
- Library Systems > ILS/Account Integration > User Profile > Allow Patrons to Update Their Work Phone Number
</div>

## This release includes code contributions from
- ByWater Solutions
- Mark Noble (MDN)
3 changes: 3 additions & 0 deletions code/web/services/MyAccount/ContactInformation.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ function launch() {
$canUpdateAddress = false;
$canUpdatePhoneNumber = false;
$showWorkPhoneInProfile = false;
$canUpdateWorkPhoneNumber = false;
$showNoticeTypeInProfile = false;
$allowPinReset = false;
$showAlternateLibraryOptionsInProfile = false;
Expand All @@ -35,6 +36,7 @@ function launch() {
$canUpdateAddress = ($patronHomeLibrary->allowPatronAddressUpdates == 1);
$canUpdatePhoneNumber = ($patronHomeLibrary->allowPatronPhoneNumberUpdates == 1);
$showWorkPhoneInProfile = ($patronHomeLibrary->showWorkPhoneInProfile == 1);
$canUpdateWorkPhoneNumber = ($patronHomeLibrary->allowPatronWorkPhoneNumberUpdates == 1);
$showNoticeTypeInProfile = ($patronHomeLibrary->showNoticeTypeInProfile == 1);
$allowPinReset = ($patronHomeLibrary->allowPinReset == 1);
$showAlternateLibraryOptionsInProfile = ($patronHomeLibrary->showAlternateLibraryOptionsInProfile == 1);
Expand All @@ -49,6 +51,7 @@ function launch() {
$interface->assign('canUpdateContactInfo', $canUpdateContactInfo);
$interface->assign('canUpdateAddress', $canUpdateAddress);
$interface->assign('canUpdatePhoneNumber', $canUpdatePhoneNumber);
$interface->assign('canUpdateWorkPhoneNumber', $canUpdateWorkPhoneNumber);
$interface->assign('showWorkPhoneInProfile', $showWorkPhoneInProfile);
$interface->assign('showNoticeTypeInProfile', $showNoticeTypeInProfile);
$interface->assign('allowPinReset', $allowPinReset);
Expand Down
24 changes: 24 additions & 0 deletions code/web/sys/DBMaintenance/version_updates/24.05.10.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

function getUpdates24_05_10(): array {
return [
/*'name' => [
'title' => '',
'description' => '',
'continueOnError' => false,
'sql' => [
''
]
], //name*/

'library_add_can_update_work_phone_number' => [
'title' => 'Library Add Can Update Work Phone Number',
'description' => 'Allow control over if a library can update their work phone number',
'continueOnError' => true,
'sql' => [
"ALTER TABLE library ADD allowPatronWorkPhoneNumberUpdates TINYINT(1) DEFAULT 1",
"UPDATE library set allowPatronWorkPhoneNumberUpdates = showWorkPhoneInProfile",
],
],
];
}
21 changes: 17 additions & 4 deletions code/web/sys/LibraryLocation/Library.php
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ class Library extends DataObject {
public $useAllCapsWhenUpdatingProfile;
public $requireNumericPhoneNumbersWhenUpdatingProfile;
public $bypassReviewQueueWhenUpdatingProfile;
public $allowPatronWorkPhoneNumberUpdates;
public $showWorkPhoneInProfile;
public $showNoticeTypeInProfile;
public $allowPickupLocationUpdates;
Expand Down Expand Up @@ -1838,11 +1839,23 @@ static function getObjectStructure($context = ''): array {
'property' => 'showWorkPhoneInProfile',
'type' => 'checkbox',
'label' => 'Show Work Phone in Profile',
'note' => 'Applies to CARL.X, Sierra, and Symphony Only',
'description' => 'Whether or not patrons should be able to change a secondary or work phone number in their profile.',
'hideInLists' => true,
'default' => 0,
'permissions' => ['Library ILS Connection'],
],
'allowPatronWorkPhoneNumberUpdates' => [
'property' => 'allowPatronWorkPhoneNumberUpdates',
'type' => 'checkbox',
'label' => 'Allow Patrons to Update Their Work Phone Number',
'note' => 'Applies to CARL.X, Sierra, and Symphony Only',
'description' => 'Whether or not patrons should be able to update their own work phone number in their profile.',
'hideInLists' => true,
'default' => 1,
'readOnly' => false,
'permissions' => ['Library ILS Connection'],
],
'showNoticeTypeInProfile' => [
'property' => 'showNoticeTypeInProfile',
'type' => 'checkbox',
Expand Down Expand Up @@ -3724,11 +3737,11 @@ static function getObjectStructure($context = ''): array {
],
],
],









'casSection' => [
'property' => 'casSection',
'type' => 'section',
Expand Down

0 comments on commit 161e2c6

Please sign in to comment.