From b7d5d62b19bcc5136db4dc6702537840a8d2c981 Mon Sep 17 00:00:00 2001
From: Christopher Brannon <cbrannon@cdalibrary.org>
Date: Fri, 7 Apr 2017 20:25:52 +0000
Subject: [PATCH] Bug 18355: Modifies location on detail pages.
---
catalogue/detail.pl | 68 ++++++++++++++++++++++++++---------------------------
opac/opac-detail.pl | 7 ++++--
2 files changed, 39 insertions(+), 36 deletions(-)
diff --git a/catalogue/detail.pl b/catalogue/detail.pl
index 3043661..303f819 100755
--- a/catalogue/detail.pl
+++ b/catalogue/detail.pl
@@ -144,8 +144,8 @@ my $hostrecords;
# adding items linked via host biblios
my @hostitems = GetHostItemsInfo($record);
if (@hostitems){
- $hostrecords =1;
- push (@items,@hostitems);
+ $hostrecords =1;
+ push (@items,@hostitems);
}
my $dat = &GetBiblioData($biblionumber);
@@ -157,7 +157,7 @@ my @subs;
foreach my $subscription (@subscriptions) {
my %cell;
- my $serials_to_display;
+ my $serials_to_display;
$cell{subscriptionid} = $subscription->{subscriptionid};
$cell{subscriptionnotes} = $subscription->{internalnotes};
$cell{missinglist} = $subscription->{missinglist};
@@ -167,15 +167,13 @@ foreach my $subscription (@subscriptions) {
$cell{callnumber} = $subscription->{callnumber};
$cell{closed} = $subscription->{closed};
#get the three latest serials.
- $serials_to_display = $subscription->{staffdisplaycount};
- $serials_to_display = C4::Context->preference('StaffSerialIssueDisplayCount') unless $serials_to_display;
- $cell{staffdisplaycount} = $serials_to_display;
- $cell{latestserials} =
- GetLatestSerials( $subscription->{subscriptionid}, $serials_to_display );
+ $serials_to_display = $subscription->{staffdisplaycount};
+ $serials_to_display = C4::Context->preference('StaffSerialIssueDisplayCount') unless $serials_to_display;
+ $cell{staffdisplaycount} = $serials_to_display;
+ $cell{latestserials} = GetLatestSerials( $subscription->{subscriptionid}, $serials_to_display );
push @subs, \%cell;
}
-
# Get acquisition details
if ( C4::Context->preference('AcquisitionDetails') ) {
my $orders = C4::Acquisition::GetHistory( biblionumber => $biblionumber, get_canceled_order => 1 );
@@ -242,7 +240,9 @@ foreach my $item (@items) {
#get shelf location and collection code description if they are authorised value.
# same thing for copy number
my $shelfcode = $item->{'location'};
- $item->{'location'} = $shelflocations->{$shelfcode} if ( defined( $shelfcode ) && defined($shelflocations) && exists( $shelflocations->{$shelfcode} ) );
+ my $permshelfcode = $item->{'permanent_location'};
+ $item->{'location'} = ( defined( $permshelfcode ) && defined($shelflocations) && exists( $shelflocations->{$permshelfcode} ) ) ? $shelflocations->{$permshelfcode} : undef;
+ $item->{'location'} .= ' (' . $shelflocations->{$shelfcode} . ')' if ( defined( $shelfcode ) && defined($shelflocations) && exists($shelflocations->{$shelfcode} ) && ($shelfcode ne $permshelfcode) );
my $ccode = $item->{'ccode'};
$item->{'ccode'} = $collections->{$ccode} if ( defined( $ccode ) && defined($collections) && exists( $collections->{$ccode} ) );
my $copynumber = $item->{'copynumber'};
@@ -256,7 +256,7 @@ foreach my $item (@items) {
my $ItemBorrowerReserveInfo = C4::Members::GetMember( borrowernumber => $reservedfor);
if (C4::Context->preference('HidePatronName')){
- $item->{'hidepatronname'} = 1;
+ $item->{'hidepatronname'} = 1;
}
if ( defined $reservedate ) {
@@ -272,7 +272,7 @@ foreach my $item (@items) {
}
- # Check the transit status
+ # Check the transit status
my ( $transfertwhen, $transfertfrom, $transfertto ) = GetTransfers($item->{itemnumber});
if ( defined( $transfertwhen ) && ( $transfertwhen ne '' ) ) {
$item->{transfertwhen} = $transfertwhen;
@@ -292,9 +292,9 @@ foreach my $item (@items) {
if ($item->{biblionumber} ne $biblionumber){
$item->{hostbiblionumber} = $item->{biblionumber};
- $item->{hosttitle} = GetBiblioData($item->{biblionumber})->{title};
+ $item->{hosttitle} = GetBiblioData($item->{biblionumber})->{title};
}
-
+
#count if item is used in analytical bibliorecords
my $countanalytics= GetAnalyticsCount($item->{itemnumber});
if ($countanalytics > 0){
@@ -343,27 +343,27 @@ if (scalar(@itemloop) == 0 || scalar(@otheritemloop) == 0) {
$template->param( norequests => $norequests );
$template->param(
- MARCNOTES => $marcnotesarray,
- MARCSUBJCTS => $marcsubjctsarray,
- MARCAUTHORS => $marcauthorsarray,
- MARCSERIES => $marcseriesarray,
- MARCURLS => $marcurlsarray,
+ MARCNOTES => $marcnotesarray,
+ MARCSUBJCTS => $marcsubjctsarray,
+ MARCAUTHORS => $marcauthorsarray,
+ MARCSERIES => $marcseriesarray,
+ MARCURLS => $marcurlsarray,
MARCISBNS => $marcisbnsarray,
- MARCHOSTS => $marchostsarray,
- subtitle => $subtitle,
- itemdata_ccode => $itemfields{ccode},
- itemdata_enumchron => $itemfields{enumchron},
- itemdata_uri => $itemfields{uri},
- itemdata_copynumber => $itemfields{copynumber},
- itemdata_stocknumber => $itemfields{stocknumber},
- volinfo => $itemfields{enumchron},
- itemdata_itemnotes => $itemfields{itemnotes},
- itemdata_nonpublicnotes => $itemfields{itemnotes_nonpublic},
- z3950_search_params => C4::Search::z3950_search_args($dat),
- hostrecords => $hostrecords,
- analytics_flag => $analytics_flag,
- C4::Search::enabled_staff_search_views,
- materials => $materials_flag,
+ MARCHOSTS => $marchostsarray,
+ subtitle => $subtitle,
+ itemdata_ccode => $itemfields{ccode},
+ itemdata_enumchron => $itemfields{enumchron},
+ itemdata_uri => $itemfields{uri},
+ itemdata_copynumber => $itemfields{copynumber},
+ itemdata_stocknumber => $itemfields{stocknumber},
+ volinfo => $itemfields{enumchron},
+ itemdata_itemnotes => $itemfields{itemnotes},
+ itemdata_nonpublicnotes => $itemfields{itemnotes_nonpublic},
+ z3950_search_params => C4::Search::z3950_search_args($dat),
+ hostrecords => $hostrecords,
+ analytics_flag => $analytics_flag,
+ C4::Search::enabled_staff_search_views,
+ materials => $materials_flag,
);
if (C4::Context->preference("AlternateHoldingsField") && scalar @items == 0) {
diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl
index 1336ae1..212ecec 100755
--- a/opac/opac-detail.pl
+++ b/opac/opac-detail.pl
@@ -666,8 +666,11 @@ if ( not $viewallitems and @items > $max_items_to_display ) {
$itm->{'ccode'} = $collections->{$ccode} if defined($ccode) && $collections && exists( $collections->{$ccode} );
my $copynumber = $itm->{'copynumber'};
$itm->{'copynumber'} = $copynumbers->{$copynumber} if ( defined($copynumbers) && defined($copynumber) && exists( $copynumbers->{$copynumber} ) );
- if ( defined $itm->{'location'} ) {
- $itm->{'location_description'} = $shelflocations->{ $itm->{'location'} };
+ if ( defined $itm->{'permanent_location'} ) {
+ $itm->{'location_description'} = $shelflocations->{ $itm->{'permanent_location'} };
+ }
+ if ( ( defined $itm->{'location'} ) && ( $itm->{'location'} ne $itm->{'permanent_location'} ) ) {
+ $itm->{'location_description'} .= ' (' . $shelflocations->{ $itm->{'location'} } . ')';
}
if (exists $itm->{itype} && defined($itm->{itype}) && exists $itemtypes->{ $itm->{itype} }) {
$itm->{'imageurl'} = getitemtypeimagelocation( 'opac', $itemtypes->{ $itm->{itype} }->{'imageurl'} );
--
2.1.4