Skip to content

Commit

Permalink
Update logic for determining the display name for an owning library f…
Browse files Browse the repository at this point in the history
…or a marc holding
  • Loading branch information
mdnoble73 committed Mar 28, 2024
1 parent a82772d commit 80ccbb6
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
1 change: 1 addition & 0 deletions code/web/Drivers/Millennium.php
Original file line number Diff line number Diff line change
Expand Up @@ -837,6 +837,7 @@ public function getIssueSummaries($id) {
//Get each line within the summary
$issueSummary = [];
$issueSummary['type'] = 'issueSummary';
$issueSummary['location'] = '';
$summaryLines = [];
preg_match_all('/<tr\\s*>(.*?)<\/tr>/s', $summaryData, $summaryLines, PREG_SET_ORDER);
for ($matchi = 0; $matchi < count($summaryLines); $matchi++) {
Expand Down
18 changes: 13 additions & 5 deletions code/web/RecordDrivers/MarcRecordDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -2724,7 +2724,8 @@ private function getMarcHoldings() {
if ($marcSubfieldB != false) {
//handle sierra quirks of location codes where the library can be indicated with the first part of a location code
$owningLibraryCode = trim(strtolower($marcSubfieldB->getData()));
for ($i = strlen($owningLibraryCode); $i >= 2; $i--) {
$owningLibrary = $owningLibraryCode;
for ($i = strlen($owningLibraryCode); $i >= 1; $i--) {
$tmpOwningLibraryCode = substr($owningLibraryCode, 0, $i);
if (array_key_exists($tmpOwningLibraryCode, $libraryCodeToDisplayName)) {
$owningLibrary = $libraryCodeToDisplayName[$tmpOwningLibraryCode];
Expand All @@ -2733,8 +2734,6 @@ private function getMarcHoldings() {
} elseif (array_key_exists($tmpOwningLibraryCode . 'z', $libraryCodeToDisplayName)) {
$owningLibrary = $libraryCodeToDisplayName[$tmpOwningLibraryCode . 'z'];
break;
} else if ($i == strlen($owningLibraryCode)){
$owningLibrary = $tmpOwningLibraryCode;
}
}
$marcHolding['library'] = $owningLibrary;
Expand All @@ -2744,8 +2743,17 @@ private function getMarcHoldings() {
$marcSubfieldC = $marc852Field->getSubfield('c');
if ($marcSubfieldC != false) {
$shelfLocation = trim(strtolower($marcSubfieldC->getData()));
if (array_key_exists($shelfLocation, $shelfLocationTranslationMapValues)) {
$shelfLocation = $shelfLocationTranslationMapValues[$shelfLocation];
if ($shelfLocationTranslationMap->usesRegularExpressions) {
foreach ($shelfLocationTranslationMapValues as $value => $translation) {
if (preg_match($value, $shelfLocation)) {
$shelfLocation = $translation;
break;
}
}
}else {
if (array_key_exists($shelfLocation, $shelfLocationTranslationMapValues)) {
$shelfLocation = $shelfLocationTranslationMapValues[$shelfLocation];
}
}
$marcHolding['shelfLocation'] = $shelfLocation;
} else {
Expand Down
3 changes: 3 additions & 0 deletions code/web/release_notes/24.04.00.MD
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
### Koha Updates
- When displaying libraries for self registration, sort by main library first and then alphabetically by name. (*MDN*)

### Marc holdings updates
- Update logic for determining the display name for an owning library for a marc holding. (Ticket 124256) (*MDN*)

### Theme Updates
- Replace Arial font with Arimo font. (Ticket 129721) (*MDN*)

Expand Down

0 comments on commit 80ccbb6

Please sign in to comment.