Skip to content

Commit 69f3dea

Browse files
author
root
committed
LotsLerum-160: show Utlånad for on-loan+hold copies; show Reserverad for hold-shelf items (per customer)
1 parent 16fdba9 commit 69f3dea

3 files changed

Lines changed: 21 additions & 2 deletions

File tree

languages/en.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1716,4 +1716,4 @@ search_aria_description = "Search in the library catalog (title, author, subject
17161716

17171717
holds_descriptive_text = "Text description"
17181718
select_page = "Page"
1719-
On Holdshelf = "Not Available"
1719+
On Holdshelf = "Reserved"

languages/sv.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1654,7 +1654,7 @@ Zip = "Postnummer"
16541654
zoom = "Zooma"
16551655
Category = "Medietyp"
16561656
On Hold = "Reserverad"
1657-
On Holdshelf = "Inte tillgänglig"
1657+
On Holdshelf = "Reserverad"
16581658
On Shelf = "Tillgänglig"
16591659
Overdue = "Försenad"
16601660
Swedish = Svenska

module/LOTS/src/LOTS/ILS/Driver/KohaRest.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -724,6 +724,25 @@ protected function getItemStatusesForBiblio($id, $patron = null, array $options
724724
{
725725
$results = parent::getItemStatusesForBiblio($id, $patron, $options);
726726

727+
// LotsLerum-160: on loan + hold should show "Utlånad", not "Reserverad".
728+
// Parent collapses a copy that is both checked out and reserved into
729+
// status "On Hold" but keeps both in status_array (["Borrowed","On Hold"]).
730+
// When that combination is present, prefer the loan status.
731+
// NOTE: ported from lots-8.0 (verified there on live data); verify on a
732+
// running VuFind 11 instance during the upgrade, as the parent result
733+
// shape may differ.
734+
if (is_array($results)) {
735+
foreach ($results as &$lotsEntry) {
736+
if (is_array($lotsEntry)
737+
&& ($lotsEntry['status'] ?? null) === 'On Hold'
738+
&& in_array('Borrowed', $lotsEntry['status_array'] ?? [], true)
739+
) {
740+
$lotsEntry['status'] = 'Checked Out';
741+
}
742+
}
743+
unset($lotsEntry);
744+
}
745+
727746
if (empty($results['holdings'])) {
728747
return $results;
729748
}

0 commit comments

Comments
 (0)