Skip to content

Commit

Permalink
When using the "Pickup at" setting within the Format Map, properly lo…
Browse files Browse the repository at this point in the history
…ad available locations when the location code is not the entire location code of the item.
  • Loading branch information
mdnoble73 committed May 14, 2024
1 parent 3fa4014 commit 74629c5
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
34 changes: 33 additions & 1 deletion code/web/RecordDrivers/MarcRecordDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -2836,11 +2836,43 @@ public function getValidPickupLocations($pickupAtRule): array {
foreach ($library->getLocations() as $libraryBranch) {
$locations[strtolower($libraryBranch->code)] = strtolower($libraryBranch->code);
}
}else{
//This is probably a sierra library where the location code is just a portion of the item location. Trim off characters until we get a match.
$tmpCode = $item->locationCode;
while (strlen($tmpCode) >= 2) {
$tmpCode = substr($tmpCode, 0, strlen($tmpCode) -1);
$location = new Location();
$location->code = $tmpCode;
if ($location->find(true)) {
$library = $location->getParentLibrary();
foreach ($library->getLocations() as $libraryBranch) {
$locations[strtolower($libraryBranch->code)] = strtolower($libraryBranch->code);
}
}
}
}
}
} else {
//Add the owning location
$locations[strtolower($item->locationCode)] = strtolower($item->locationCode);
if (!isset($locations[$item->locationCode])) {
$location = new Location();
$location->code = $item->locationCode;
if ($location->find(true)) {
$locations[strtolower($item->locationCode)] = strtolower($location->code);
}else{
//This is probably a sierra library where the location code is just a portion of the item location. Trim off characters until we get a match.
$tmpCode = $item->locationCode;
while (strlen($tmpCode) >= 2) {
$tmpCode = substr($tmpCode, 0, strlen($tmpCode) -1);
$location = new Location();
$location->code = $tmpCode;
if ($location->find(true)) {
$locations[strtolower($item->locationCode)] = strtolower($location->code);
break;
}
}
}
}
}
}

Expand Down
1 change: 1 addition & 0 deletions code/web/release_notes/24.06.00.MD
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

### Sierra Updates
- When linking to ILS course reserves, use the Vendor Opac Url in the Account Profile rather than the URL in config.ini. (Ticket 131388) (*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*)

//kirstien

Expand Down

0 comments on commit 74629c5

Please sign in to comment.