From a37a5babe96a4c8bbadd05e38290868a162a995e Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Tue, 20 Jul 2010 10:07:22 -0400 Subject: [PATCH] Fix for Bug 4173 - Statuses not appearing in the OPAC This adds display of "Use restrictions" authorized values to the OPAC and the staff client for available and not-for-loan items. --- C4/Items.pm | 25 ++++++++++++++++++++ .../prog/en/modules/catalogue/detail.tmpl | 2 + .../opac-tmpl/prog/en/includes/item-status.inc | 8 +++--- 3 files changed, 31 insertions(+), 4 deletions(-) diff --git a/C4/Items.pm b/C4/Items.pm index 264fa5b..5eda6dd 100644 --- a/C4/Items.pm +++ b/C4/Items.pm @@ -1270,6 +1270,31 @@ sub GetItemsInfo { $data->{notforloanvalue} = $lib; } + # 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 e3391ac..8dde1b5 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tmpl @@ -326,6 +326,8 @@ function verify_images() { Available + + () diff --git a/koha-tmpl/opac-tmpl/prog/en/includes/item-status.inc b/koha-tmpl/opac-tmpl/prog/en/includes/item-status.inc index 5e881fe..6369bba 100644 --- a/koha-tmpl/opac-tmpl/prog/en/includes/item-status.inc +++ b/koha-tmpl/opac-tmpl/prog/en/includes/item-status.inc @@ -19,14 +19,14 @@ - + () - Not for loan + Not for loan () - Not for loan + Not for loan () Item damaged - Available + Available () -- 1.7.1