From efb725429d1bfb9d8ee823c8bfb1c55d06492101 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Tue, 23 Mar 2010 15:08:56 -0400 Subject: [PATCH] Fix for Bug 4173, Statuses not appearing in the OPAC Adds output of "RESTRICTED" authorized value (an item's "Use Restriction" status) --- C4/Items.pm | 25 ++++++++++++++++++++ .../prog/en/modules/catalogue/detail.tmpl | 2 + .../opac-tmpl/prog/en/modules/opac-detail.tmpl | 2 +- 3 files changed, 28 insertions(+), 1 deletions(-) diff --git a/C4/Items.pm b/C4/Items.pm index cd6f7d0..03980e9 100644 --- a/C4/Items.pm +++ b/C4/Items.pm @@ -1355,6 +1355,31 @@ sub GetItemsInfo { } $data->{itypenotforloan} = $data->{notforloan} if (C4::Context->preference('item-level_itypes')); + # get restricted status and description if applicable + my $restrictedstatus = $dbh->prepare( + 'SELECT authorised_value + FROM marc_subfield_structure + WHERE kohafield="items.restricted" + ' + ); + + $restrictedstatus->execute; + my ($authorised_valuecode) = $restrictedstatus->fetchrow; + if ($authorised_valuecode) { + $restrictedstatus = $dbh->prepare( + "SELECT lib,lib_opac FROM authorised_values + WHERE category=? + AND authorised_value=?" + ); + $restrictedstatus->execute( $authorised_valuecode, + $data->{restricted} ); + + if ( my $rstdata = $restrictedstatus->fetchrow_hashref ) { + $data->{restricted} = $rstdata->{'lib'}; + $data->{restrictedopac} = $rstdata->{'lib_opac'}; + } + } + # my stack procedures my $stackstatus = $dbh->prepare( 'SELECT authorised_value diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tmpl index 3d8a9af..1ba5ee6 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tmpl @@ -297,6 +297,8 @@ function verify_images() { Available + + () 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 df0b1db..bc2b505 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tmpl +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tmpl @@ -411,7 +411,7 @@ YAHOO.util.Event.onContentReady("furtherm", function () { - + () -- 1.6.3.3