From 7ca35189f67d98c686ee8a4c06f257cb5ec7d497 Mon Sep 17 00:00:00 2001 From: Jared CAMINS-ESAKOV Date: Fri, 9 Apr 2010 13:53:22 -0400 Subject: [PATCH] Show location from 852 when no items Content-Type: text/plain; charset="utf-8" Instead of saying "No physical items for this record," display the location out of the 852 field. --- .../opac-tmpl/prog/en/modules/opac-detail.tmpl | 8 ++++++- opac/opac-detail.pl | 23 ++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletions(-) mode change 100644 => 100755 koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tmpl diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tmpl old mode 100644 new mode 100755 index 1b9085b..1319784 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tmpl +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tmpl @@ -422,7 +422,13 @@ YAHOO.util.Event.onContentReady("furtherm", function () { -

No physical items for this record

+

+ +

Location:

+ + +

No physical items for this record

+ diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl index c6d14ba..9cb2037 100755 --- a/opac/opac-detail.pl +++ b/opac/opac-detail.pl @@ -206,6 +206,27 @@ my $marcseriesarray = GetMarcSeries ($record,$marcflavour); my $marcurlsarray = GetMarcUrls ($record,$marcflavour); my $subtitle = GetRecordValue('subtitle', $record, GetFrameworkCode($biblionumber)); +my @noitemlocations = (); +my $location_noitems = 0; +my $noitemlocation; +my @field852s = $record->field('852'); + +for my $field852 (@field852s) { + $location_noitems = 1; + my %noitemloc; + $noitemloc{'noitemloc'} = $field852->subfield('a'); + + if ($field852->subfield('b')) { + my @subfieldb = $field852->subfield('b'); + $noitemloc{'noitemloc'} .= '--' . join('--', @subfieldb); + } + if ($field852->subfield('c')) { + my @subfieldc = $field852->subfield('c'); + $noitemloc{'noitemloc'} .= ' (' . join('/', @subfieldc) . ')'; + } + push(@noitemlocations, \%noitemloc); +} + $template->param( MARCNOTES => $marcnotesarray, MARCSUBJCTS => $marcsubjctsarray, @@ -219,6 +240,8 @@ my $subtitle = GetRecordValue('subtitle', $record, GetFrameworkCode($bib itemdata_uri => $itemfields{uri}, itemdata_copynumber => $itemfields{copynumber}, itemdata_itemnotes => $itemfields{itemnotes}, + location_noitems => $location_noitems, + NOITEMLOCATIONS => \@noitemlocations, authorised_value_images => $biblio_authorised_value_images, subtitle => $subtitle, ); -- 1.7.0.4