From d35c96c07d9daf7afd0659bc26ee2b1b544d1e3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9rick=20Capovilla?= Date: Fri, 24 Feb 2012 16:17:03 -0500 Subject: [PATCH] XSLT Results template improvement : Use the NOT_LOAN authorised values Improved the MARC21slim2OPACResults.xsl file to use the authorised values instead of just showing these items as "unavailable" --- C4/XSLT.pm | 7 ++ .../prog/en/xslt/MARC21slim2OPACResults.xsl | 82 ++++++++++---------- 2 files changed, 47 insertions(+), 42 deletions(-) diff --git a/C4/XSLT.pm b/C4/XSLT.pm index 8bc4000..103bc37 100755 --- a/C4/XSLT.pm +++ b/C4/XSLT.pm @@ -184,6 +184,7 @@ sub buildKohaItemsNamespace { my @items = C4::Items::GetItemsInfo($biblionumber); my $branches = GetBranches(); my $itemtypes = GetItemTypes(); + my $not_loan_values = GetKohaAuthorisedValues('items.notforloan', '', 1); my $xml = ''; for my $item (@items) { my $status; @@ -200,6 +201,12 @@ sub buildKohaItemsNamespace { if ( $item->{itemnotforloan} > 0 || $item->{notforloan} > 0 || $itemtypes->{ $item->{itype} }->{notforloan} == 1 ) { $status = "reference"; } + if($item->{itemnotforloan} and defined $not_loan_values->{$item->{itemnotforloan}}){ + $status = $not_loan_values->{$item->{itemnotforloan}}; + } + if($item->{notforloan} and defined $not_loan_values->{$item->{notforloan}}) { + $status = $not_loan_values->{$item->{notforloan}}; + } if ($item->{onloan}) { $status = "Checked out"; } diff --git a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACResults.xsl b/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACResults.xsl index 9c6c307..0eaf262 100644 --- a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACResults.xsl +++ b/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACResults.xsl @@ -1023,49 +1023,47 @@ - - - Checked out ( - - ). - - - - - Withdrawn ( - - ). - - - - Lost ( - - ). - - - - Damaged ( - - ). - - - - On order ( - - ). - - - - In transit ( - - ). - - - - On hold ( - - ). + + + + + + Checked out ( + + + Withdrawn ( + + + Damaged ( + + + On order ( + + + In transit ( + + + On hold ( + + + + ( + + + + ). + + + + + + + Lost ( + + ). + + -- 1.7.2.5