From 04270d01b2b74feda6d42124276fdcf7e5f4f4bd Mon Sep 17 00:00:00 2001 From: Joshua Ferraro Date: Wed, 4 Feb 2009 10:46:23 -0600 Subject: [PATCH] Distinguish between items marked 'not for loan' and 'Available' This patch works with XSL* sysprefs == ON, a future patch will address XSL sysprefs==OFF Items with notforloan set to a negative number still designate an 'ordered' status Some items are marked 'not for loan' by setting that value at the item level, others by assigning that value to that item's itemtype. This patch works for both scenarios. Specific changes this patch introduces to the OPAC: * Adds a new OPAC results page key 'Copies available for reference:' * Changes 'Copies available at:' to 'Copies available for loan:' * Changes the availability limit label in opac-advsearch from: 'Only items currently available' to 'Only items currently available for loan or reference * Displays the authorised value for the specific notforloan value in the OPAC detail page in parentheses next to 'Not for Loan' Signed-off-by: Galen Charlton --- C4/XSLT.pm | 9 +++++--- .../prog/en/modules/opac-advsearch.tmpl | 2 +- .../prog/en/modules/opac-detail.tmpl | 4 ++-- .../prog/en/xslt/MARC21slim2OPACResults.xsl | 23 +++++++++++++++++-- 4 files changed, 30 insertions(+), 8 deletions(-) diff --git a/C4/XSLT.pm b/C4/XSLT.pm index 1bea9f1aaf..8e77ea9c3b 100644 --- a/C4/XSLT.pm +++ b/C4/XSLT.pm @@ -134,17 +134,20 @@ sub buildKohaItemsNamespace { my @items = C4::Items::GetItemsInfo($biblionumber); my $branches = GetBranches(); my $itemtypes = GetItemTypes(); + my $xml; for my $item (@items) { my $status; + my ( $transfertwhen, $transfertfrom, $transfertto ) = C4::Circulation::GetTransfers($item->{itemnumber}); - if ( $item->{notforloan} == -1 || $item->{onloan} || $item->{wthdrawn} || $item->{itemlost} || $item->{damaged} || + + if ( $itemtypes->{ $item->{itype} }->{notforloan} == 1 || $item->{notforloan} || $item->{onloan} || $item->{wthdrawn} || $item->{itemlost} || $item->{damaged} || ($transfertwhen ne '') || $item->{itemnotforloan} ) { if ( $item->{notforloan} == -1) { $status = "On order"; } - if ( $item->{itemnotforloan} ) { - $status = "Not for loan"; + if ( $item->{itemnotforloan} > 0 || $item->{notforloan} > 0 || $itemtypes->{ $item->{itype} }->{notforloan} == 1 ) { + $status = "reference"; } if ($item->{onloan}) { $status = "Checked out"; diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-advsearch.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/opac-advsearch.tmpl index cade5d2e5f..9fd857f980 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-advsearch.tmpl +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-advsearch.tmpl @@ -325,7 +325,7 @@ -
+
diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tmpl index 45a9780fd9..1446b643fd 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tmpl +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tmpl @@ -266,9 +266,9 @@ - Not for loan + Not for loan () - Not for loan + Not for loan () 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 4cb2421d97..feeff9932b 100644 --- a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACResults.xsl +++ b/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACResults.xsl @@ -833,11 +833,11 @@ - No copies available + No copies available - Copies available at: + Copies available for loan: @@ -850,6 +850,25 @@ + + + + + Copies available for reference: + + + + [] + ( + + ) + . , + + + + + Checked out ( -- 2.39.5