From 37df4eec4b22080834bab73b1fb6381e5b8844c2 Mon Sep 17 00:00:00 2001 From: Mehdi Hamidi Date: Fri, 3 Mar 2017 14:33:29 -0500 Subject: [PATCH] Bug 7611 - Show the NOT_LOAN authorised values for item status in XSLT OPAC search results Added : Call number for all not for loan status XSLT Results template improvement : Use the NOT_LOAN authorised values Improvement : Use the NOT_LOAN authorised values when showing items status in the OPAC search results. Before this patch, these items were only considered as "unavailable". Note : This patch only affects the OPAC XSLT search results template for MARC21 records. This patch was not tested on UNIMARC or NORMARC records. I won't be able to support these formats, so I'm hoping someone could do the same for these other record formats. Patch sponsored by the CCSR ( http://www.ccsr.qc.ca ) --- C4/XSLT.pm | 10 +++++++++- .../bootstrap/en/xslt/MARC21slim2OPACResults.xsl | 22 ++++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/C4/XSLT.pm b/C4/XSLT.pm index b757f8f..2a8dd11 100644 --- a/C4/XSLT.pm +++ b/C4/XSLT.pm @@ -284,9 +284,11 @@ sub buildKohaItemsNamespace { my $location = ""; my $ccode = ""; my $xml = ''; + my %descs = map { $_->{authorised_value} => $_ } Koha::AuthorisedValues->get_descriptions_by_koha_field( { kohafield => 'items.notforloan' } ); + for my $item (@items) { my $status; - + my $substatus = ''; my ( $transfertwhen, $transfertfrom, $transfertto ) = C4::Circulation::GetTransfers($item->{itemnumber}); my $reservestatus = C4::Reserves::GetReserveStatus( $item->{itemnumber} ); @@ -299,6 +301,11 @@ sub buildKohaItemsNamespace { if ( $item->{itemnotforloan} > 0 || $item->{notforloan} > 0 || $itemtypes->{ $item->{itype} }->{notforloan} == 1 ) { $status = "reference"; } + if ($item->{itemnotforloan} > 0 || $item->{notforloan} > 0 ){ + $status = "reallynotforloan"; + $substatus = $descs{$item->{notforloan}} || ''; + $substatus = $substatus->{opac_description} if $substatus; + } if ($item->{onloan}) { $status = "Checked out"; } @@ -333,6 +340,7 @@ sub buildKohaItemsNamespace { . "$location" . "$ccode" . "$status" + . "$substatus" . "$itemcallnumber" . "$stocknumber" . ""; diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl index 7349b81..99b1457 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl +++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl @@ -12,6 +12,7 @@ + @@ -1249,6 +1250,27 @@ + + : + + + + + +
+ + + + [Call number: ] + ( + + ) + . , + +
+
+
+ Checked out ( -- 1.9.1