From 6a8ca7fbd18ebc1ef37bd6b253b2c65e168c1c4a Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Fri, 20 Jun 2008 17:37:04 -0500 Subject: [PATCH] bug 2248 [1/2]: improve item status display in OPAC detail The following statuses are now displayed correctly in the bib details page in the OPAC: * In transit * Damaged * Not for loan Prior to this patch, items of these statuses displayed as available. Signed-off-by: Joshua Ferraro --- koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tmpl | 9 +++++++-- opac/opac-detail.pl | 10 +++++++++- 2 files changed, 16 insertions(+), 3 deletions(-) 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 7774aec74f..58fa3dc1e2 100755 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tmpl +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tmpl @@ -268,14 +268,19 @@ Checked out - - + + " alt="" title="">Item lost Item withdrawn + + Item damaged + + In transit from + to since Available diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl index 7c98fea432..e3e537ee56 100755 --- a/opac/opac-detail.pl +++ b/opac/opac-detail.pl @@ -28,6 +28,7 @@ use C4::Serials; #uses getsubscriptionfrom biblionumber use C4::Output; use C4::Biblio; use C4::Items; +use C4::Circulation; use C4::Tags qw(get_tags); use C4::Dates qw/format_date/; use C4::XISBN qw(get_xisbns get_biblionumber_from_isbn get_biblio_from_xisbn); @@ -120,6 +121,7 @@ if (C4::Context->preference("RequestOnOpac")) { my $biblio_authorised_value_images = C4::Items::get_authorised_value_images( C4::Biblio::get_biblio_authorised_values( $biblionumber ) ); my $norequests = 1; +my $branches = GetBranches(); my %itemfields; for my $itm (@items) { $norequests = 0 && $norequests @@ -151,6 +153,13 @@ for my $itm (@items) { $itm->{'lostimagelabel'} = $lostimageinfo->{ 'label' }; } + + my ( $transfertwhen, $transfertfrom, $transfertto ) = GetTransfers($itm->{itemnumber}); + if ( $transfertwhen ne '' ) { + $itm->{transfertwhen} = format_date($transfertwhen); + $itm->{transfertfrom} = $branches->{$transfertfrom}{branchname}; + $itm->{transfertto} = $branches->{$transfertto}{branchname}; + } } ## get notes and subjects from MARC record @@ -289,7 +298,6 @@ $template->param( OpenOPACShelfBrowser => 1) if $starting_itemnumber; my ($starting_cn_sort, $starting_homebranch, $starting_location); my $sth_get_cn_sort = $dbh->prepare("SELECT cn_sort,homebranch,location from items where itemnumber=?"); $sth_get_cn_sort->execute($starting_itemnumber); -my $branches = GetBranches(); while (my $result = $sth_get_cn_sort->fetchrow_hashref()) { $starting_cn_sort = $result->{'cn_sort'}; $starting_homebranch->{code} = $result->{'homebranch'}; -- 2.39.5