Skip to content

Commit

Permalink
Merge branch '25.01.02' into 25.02.00
Browse files Browse the repository at this point in the history
  • Loading branch information
mdnoble73 committed Feb 7, 2025
2 parents 86aa789 + a9a6557 commit e447b1a
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 14 deletions.
10 changes: 10 additions & 0 deletions code/web/release_notes/25.01.02.MD
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
## Aspen Discovery Updates
### Account Updates
- Correct remember this pickup location functionality when sublocations are not defined for a location. (DIS-296) (*MDN*)

## This release includes code contributions from
### Grove For Libraries
- Mark Noble (MDN)

## Special Testing thanks to
- Joe Salamon (Cuyahoga Public Library)
39 changes: 25 additions & 14 deletions code/web/services/Record/AJAX.php
Original file line number Diff line number Diff line change
Expand Up @@ -1820,35 +1820,46 @@ function setupHoldForm(string $recordSource, ?bool &$rememberHoldPickupLocation,
if (!$multipleAccountPickupLocations && !$promptForHoldNotifications && $library->allowRememberPickupLocation) {
//If the patron's preferred pickup location is not valid, then force them to pick a new location
$preferredPickupLocationIsValid = false;
$preferredPickupLocation = null;
$preferredPickupSublocationIsValid = false;
foreach ($locations as $location) {
if (is_object($location) && ($location->locationId == $user->pickupLocationId)) {
$preferredPickupLocationIsValid = true;
$preferredPickupLocation = $location;
break;
}
}

require_once ROOT_DIR . '/sys/LibraryLocation/Sublocation.php';
require_once ROOT_DIR . '/sys/LibraryLocation/SublocationPatronType.php';
$patronType = $user->getPTypeObj();
$sublocationLookup = new Sublocation();
$sublocationLookup->id = $user->pickupSublocationId;
$sublocationLookup->isValidHoldPickupAreaILS = 1;
$sublocationLookup->isValidHoldPickupAreaAspen = 1;
if ($sublocationLookup->find(true)) {
$sublocationPType = new SublocationPatronType();
$sublocationPType->patronTypeId = $patronType->id;
$sublocationPType->sublocationId = $sublocationLookup->id;
if ($sublocationPType->find(true)) {
$preferredPickupSublocationIsValid = true;
$preferredPickupSublocationIsValid = true;
if ($preferredPickupLocationIsValid) {
//The preferred location is valid, check to see if sublocations are in use and if so if the preferred pickup area is valid
$preferredSublocationsAtPreferredLocation = $preferredPickupLocation->getPickupSublocations($user);
if (count($preferredSublocationsAtPreferredLocation) > 1) {
$preferredPickupSublocationIsValid = false;
require_once ROOT_DIR . '/sys/LibraryLocation/Sublocation.php';
require_once ROOT_DIR . '/sys/LibraryLocation/SublocationPatronType.php';
$patronType = $user->getPTypeObj();
$sublocationLookup = new Sublocation();
$sublocationLookup->id = $user->pickupSublocationId;
$sublocationLookup->isValidHoldPickupAreaILS = 1;
$sublocationLookup->isValidHoldPickupAreaAspen = 1;
if ($sublocationLookup->find(true)) {
$sublocationPType = new SublocationPatronType();
$sublocationPType->patronTypeId = $patronType->id;
$sublocationPType->sublocationId = $sublocationLookup->id;
if ($sublocationPType->find(true)) {
$preferredPickupSublocationIsValid = true;
}
}
}
}

if ($preferredPickupLocationIsValid && $preferredPickupSublocationIsValid) {
$rememberHoldPickupLocation = $user->rememberHoldPickupLocation;
} else {
$rememberHoldPickupLocation = false;
} } else {
}
} else {
$rememberHoldPickupLocation = false;
}
$interface->assign('rememberHoldPickupLocation', $rememberHoldPickupLocation);
Expand Down
39 changes: 39 additions & 0 deletions code/web/sys/DBMaintenance/version_updates/25.01.02.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?php

function getUpdates25_01_02(): array {
$curTime = time();
return [
/*'name' => [
'title' => '',
'description' => '',
'continueOnError' => false,
'sql' => [
''
]
], //name*/

//mark - Grove

//katherine

//kirstien - Grove

//sublocation_ptype_uniqueness

//kodi

//alexander - PTFS-Europe

//chloe - PTFS-Europe

//James Staub - Nashville Public Library

//Lucas Montoya - Theke Solutions

//other

//yanjun - ByWater


];
}

0 comments on commit e447b1a

Please sign in to comment.