[Patches] [PATCH] Fix for Bug 7121 - remove comma on items info
koha-patchbot at kohaaloha.com
koha-patchbot at kohaaloha.com
Sat Nov 12 06:05:03 NZDT 2011
From: Owen Leonard <oleonard at myacpl.org>
Date: Fri, 11 Nov 2011 11:43:27 -0500
Subject: [PATCH] Fix for Bug 7121 - remove comma on items info
Content-Type: text/plain; charset="utf-8"
Because I can't just take out one comma, I reworked
the way moredetail.pl fetches and outputs biblio
data based on the way it does in detail.pl. This
allows for simpler output in the template. In the
process I've added subtitle information to the
template.
---
catalogue/moredetail.pl | 30 +++++++++++-------
.../prog/en/modules/catalogue/moredetail.tt | 32 ++++++++++----------
2 files changed, 34 insertions(+), 28 deletions(-)
diff --git a/catalogue/moredetail.pl b/catalogue/moredetail.pl
index 6f6d10d..d4b9590 100755
--- a/catalogue/moredetail.pl
+++ b/catalogue/moredetail.pl
@@ -68,7 +68,7 @@ my $title=$query->param('title');
my $bi=$query->param('bi');
$bi = $biblionumber unless $bi;
my $itemnumber = $query->param('itemnumber');
-my $data=GetBiblioData($biblionumber);
+my $data = &GetBiblioData($biblionumber);
my $dewey = $data->{'dewey'};
my $showallitems = $query->param('showallitems');
@@ -86,7 +86,6 @@ my $subscriptionsnumber = CountSubscriptionFromBiblionumber($biblionumber);
# $dewey=~ s/\.$//;
# $data->{'dewey'}=$dewey;
-my @results;
my $fw = GetFrameworkCode($biblionumber);
my @all_items= GetItemsInfo($biblionumber);
my @items;
@@ -107,7 +106,7 @@ if (@hostitems){
push (@items, at hostitems);
}
-
+my $subtitle = GetRecordValue('subtitle', $record, $fw);
my $totalcount=@all_items;
my $showncount=@items;
@@ -120,7 +119,11 @@ my $ccodes= GetKohaAuthorisedValues('items.ccode',$fw);
my $itemtypes = GetItemTypes;
$data->{'itemtypename'} = $itemtypes->{$data->{'itemtype'}}->{'description'};
-$results[0]=$data;
+
+foreach ( keys %{$data} ) {
+ $template->param( "$_" => defined $data->{$_} ? $data->{$_} : '' );
+}
+
($itemnumber) and @items = (grep {$_->{'itemnumber'} == $itemnumber} @items);
foreach my $item (@items){
$item->{itemlostloop}= GetAuthorisedValues(GetAuthValCode('items.itemlost',$fw),$item->{itemlost}) if GetAuthValCode('items.itemlost',$fw);
@@ -169,15 +172,18 @@ $template->param(count => $data->{'count'},
subscriptiontitle => $data->{title},
C4::Search::enabled_staff_search_views,
);
-$template->param(BIBITEM_DATA => \@results);
-$template->param(ITEM_DATA => \@items);
-$template->param(moredetailview => 1);
-$template->param(loggedinuser => $loggedinuser);
-$template->param(biblionumber => $biblionumber);
-$template->param(biblioitemnumber => $bi);
-$template->param(itemnumber => $itemnumber);
+
+$template->param(
+ ITEM_DATA => \@items,
+ moredetailview => 1,
+ loggedinuser => $loggedinuser,
+ biblionumber => $biblionumber,
+ biblioitemnumber => $bi,
+ itemnumber => $itemnumber,
+ z3950_search_params => C4::Search::z3950_search_args(GetBiblioData($biblionumber)),
+ subtitle => $subtitle,
+);
$template->param(ONLY_ONE => 1) if ( $itemnumber && $showncount != @items );
-$template->param(z3950_search_params => C4::Search::z3950_search_args(GetBiblioData($biblionumber)));
output_html_with_http_headers $query, $cookie, $template->output;
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt
index 86c8a3f..edfc68a 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt
@@ -1,5 +1,5 @@
[% INCLUDE 'doc-head-open.inc' %]
-<title>Koha › Catalog › Item details for [% FOREACH BIBITEM_DAT IN BIBITEM_DATA %][% BIBITEM_DAT.title %][% END %]</title>
+<title>Koha › Catalog › Item details for [% title %] [% FOREACH subtitl IN subtitle %] [% subtitl.subfield %][% END %]</title>
[% INCLUDE 'doc-head-close.inc' %]
<style type="text/css">h3{padding-top: 1em; border-top: 2px solid #CCCCCC;}</style>
</head>
@@ -8,7 +8,7 @@
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
-<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/catalogue/search.pl">Catalog</a> › Item Details for <i>[% FOREACH BIBITEM_DAT IN BIBITEM_DATA %][% BIBITEM_DAT.title |html %][% END %]</i></div>
+<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/catalogue/search.pl">Catalog</a> › Item Details for <i>[% title |html %] [% FOREACH subtitl IN subtitle %] [% subtitl.subfield|html %][% END %]</i></div>
<div id="doc3" class="yui-t2">
@@ -18,24 +18,24 @@
[% INCLUDE 'cat-toolbar.inc' %]
<div id="catalogue_detail_biblio">
- [% FOREACH BIBITEM_DAT IN BIBITEM_DATA %]
- <h2>[% BIBITEM_DAT.title |html %] [% IF ( BIBITEM_DAT.author ) %], by [% BIBITEM_DAT.author %][% END %]</h2>
+
+ <h2>[% title |html %][% FOREACH subtitl IN subtitle %] [% subtitl.subfield|html %][% END %]</h2>
+ [% IF ( author ) %]<h4>by [% author %]</h4>[% END %]
<ol class="bibliodetails">
- <li><span class="label">Biblionumber:</span> [% BIBITEM_DAT.biblionumber %] </li>
+ <li><span class="label">Biblionumber:</span> [% biblionumber %] </li>
[% UNLESS ( item_level_itypes ) %]
- <li><span class="label">Item type:</span> [% BIBITEM_DAT.itemtypename %] </li>
+ <li><span class="label">Item type:</span> [% itemtypename %] </li>
[% END %]
- <!-- deprecated? <li><span class="label">Loan length:</span> [% BIBITEM_DAT.loanlength %] </li> -->
- <li><span class="label">Rental charge:</span>[% BIBITEM_DAT.rentalcharge %] </li>
- <li><span class="label">ISBN:</span> [% BIBITEM_DAT.isbn %] </li>
- <li><span class="label">Publisher:</span>[% BIBITEM_DAT.place %] [% BIBITEM_DAT.publishercode |html %] [% BIBITEM_DAT.publicationyear %] </li>
- [% IF ( BIBITEM_DAT.volumeddesc ) %]<li><span class="label">Volume:</span> [% BIBITEM_DAT.volumeddesc %]</li>[% END %]
- <li><span class="label">Physical Details:</span> [% BIBITEM_DAT.pages %] [% BIBITEM_DAT.illus %] [% BIBITEM_DAT.size %] </li>
- [% IF ( BIBITEM_DAT.bnotes ) %]<li><span class="label">Notes:</span> [% BIBITEM_DAT.bnotes %]</li>[% END %]
- <li><span class="label">No. of Items:</span> [% BIBITEM_DAT.count %] [% IF ( BIBITEM_DAT.hiddencount ) %]total ([% BIBITEM_DAT.showncount %] shown / [% BIBITEM_DAT.hiddencount %] hidden)
-<a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% BIBITEM_DAT.biblionumber %]&showallitems=1">Show all items</a>[% END %]</li>
+ [% IF ( rentalcharge ) %]<li><span class="label">Rental charge:</span>[% rentalcharge %] </li>[% END %]
+ <li><span class="label">ISBN:</span> [% isbn %] </li>
+ <li><span class="label">Publisher:</span>[% place %] [% publishercode |html %] [% publicationyear %] </li>
+ [% IF ( volumeddesc ) %]<li><span class="label">Volume:</span> [% volumeddesc %]</li>[% END %]
+ <li><span class="label">Physical Details:</span> [% pages %] [% illus %] [% size %] </li>
+ [% IF ( bnotes ) %]<li><span class="label">Notes:</span> [% bnotes %]</li>[% END %]
+ <li><span class="label">No. of Items:</span> [% count %] [% IF ( hiddencount ) %]total ([% showncount %] shown / [% hiddencount %] hidden)
+<a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% biblionumber %]&showallitems=1">Show all items</a>[% END %]</li>
</ol>
- [% END %]
+
<br clear="all" />
[% IF ( ONLY_ONE ) %]
<div class="dialog message">You are only viewing one item. <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% biblionumber %]&bi=[% biblioitemnumber %]#item[% itemnumber %]">View All</a></div>
--
1.7.3
More information about the Patches
mailing list