From 513d72135eb4b630a6148879dae43142bca20b53 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Thu, 5 Aug 2021 11:43:16 +0000 Subject: [PATCH] Bug 26302: Add resultbranch and other status in C4/XSLT Groundwork for changes in the OPAC results xslt. NOTE: Adds both new prefs too. Signed-off-by: Marcel de Rooy Signed-off-by: Owen Leonard Signed-off-by: David Nind Signed-off-by: Nick Clemens Signed-off-by: Jonathan Druart --- C4/XSLT.pm | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/C4/XSLT.pm b/C4/XSLT.pm index 2de14b89a5..dd8d26f250 100644 --- a/C4/XSLT.pm +++ b/C4/XSLT.pm @@ -172,6 +172,7 @@ sub get_xslt_sysprefs { TrackClicks opacthemes IdRef OpacSuppression OPACResultsLibrary OPACShowOpenURL OpenURLResolverURL OpenURLImageLocation + resultsMaxItems resultsMaxItemsUnavailable OpenURLText OPACShowMusicalInscripts OPACPlayMusicalInscripts / ) { my $sp = C4::Context->preference( $syspref ); @@ -351,25 +352,32 @@ sub buildKohaItemsNamespace { my $substatus = ''; if ($item->has_pending_hold) { - $status = 'Pending hold'; + $status = 'other'; + $substatus = 'Pending hold'; } elsif ( $item->holds->waiting->count ) { - $status = 'Waiting'; + $status = 'other'; + $substatus = 'Waiting'; } elsif ($item->get_transfer) { - $status = 'In transit'; + $status = 'other'; + $substatus = 'In transit'; } elsif ($item->damaged) { - $status = "Damaged"; + $status = 'other'; + $substatus = "Damaged"; } elsif ($item->itemlost) { - $status = "Lost"; + $status = 'other'; + $substatus = "Lost"; } elsif ( $item->withdrawn) { - $status = "Withdrawn"; + $status = 'other'; + $substatus = "Withdrawn"; } elsif ($item->onloan) { - $status = "Checked out"; + $status = 'other'; + $substatus = "Checked out"; } elsif ( $item->notforloan ) { $status = $item->notforloan =~ /^($ref_status)$/ @@ -391,6 +399,7 @@ sub buildKohaItemsNamespace { } my $homebranch = xml_escape($branches{$item->homebranch}); my $holdingbranch = xml_escape($branches{$item->holdingbranch}); + my $resultbranch = C4::Context->preference('OPACResultsLibrary') eq 'homebranch' ? $homebranch : $holdingbranch; my $location = xml_escape($item->location && exists $shelflocations->{$item->location} ? $shelflocations->{$item->location} : $item->location); my $ccode = xml_escape($item->ccode && exists $ccodes->{$item->ccode} ? $ccodes->{$item->ccode} : $item->ccode); my $itemcallnumber = xml_escape($item->itemcallnumber); @@ -399,6 +408,7 @@ sub buildKohaItemsNamespace { "" . "$homebranch" . "$holdingbranch" + . "$resultbranch" . "$location" . "$ccode" . "".( $status // q{} )."" -- 2.39.5