From 976561a384e42570c8960f566bc88606ab6f87b1 Mon Sep 17 00:00:00 2001 From: Marc Veron Date: Sun, 16 Jun 2013 22:02:45 +0200 Subject: [PATCH] Bug 5652: display subtitles on patron checkout and holds summary This patch adds subtitles (from Keyword to MARC mapping) to the following tables on the checkout page: - Checkouts - Previous checkouts - Relative's checkouts - Relative's previous checkouts - Holds Additionally it suppresses the appearence of the superfluous word "by" in cases where the biblio has no author. Test scenario: -------------- 1) Make sure that you have one or more fields mapped to subtitle in: Home . Administration . Keyword to MARC mapping (e.g. 245 b) 2) Test the checkout page with patrons having - current checkouts (today) - previous checkouts - relatives (e.g. kids) with current /previous checkouts - holds on items - holds on biblios ...with items having: - title, subtitle, author - title, no subtitle, author - title, subtitle, no author - title, no subtitle, no author 3) Do the same on patron's detail page Signed-off-by: Nicole C. Engard All tests pass Signed-off-by: Owen Leonard Signed-off-by: Chris Cormack Signed-off-by: Galen Charlton --- circ/circulation.pl | 4 +++- .../intranet-tmpl/prog/en/modules/circ/circulation.tt | 10 +++++----- .../prog/en/modules/members/moremember.tt | 6 +++--- members/moremember.pl | 6 ++++-- 4 files changed, 15 insertions(+), 11 deletions(-) diff --git a/circ/circulation.pl b/circ/circulation.pl index 825a1446c7..efd533e57c 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -392,6 +392,7 @@ if ($borrowernumber) { $getreserv{reservedate} = format_date( $num_res->{'reservedate'} ); $getreserv{reserve_id} = $num_res->{'reserve_id'}; $getreserv{title} = $getiteminfo->{'title'}; + $getreserv{subtitle} = GetRecordValue('subtitle', GetMarcBiblio($getiteminfo->{biblionumber}), GetFrameworkCode($getiteminfo->{biblionumber})); $getreserv{itemtype} = $itemtypeinfo->{'description'}; $getreserv{author} = $getiteminfo->{'author'}; $getreserv{barcodereserv} = $getiteminfo->{'barcode'}; @@ -431,6 +432,7 @@ if ($borrowernumber) { $getreserv{color} = 'inwait'; $getreserv{title} = $getbibinfo->{'title'}; + $getreserv{subtitle} = GetRecordValue('subtitle', GetMarcBiblio($num_res->{biblionumber}), GetFrameworkCode($num_res->{biblionumber})); $getreserv{nottransfered} = 0; $getreserv{itemtype} = $itemtypeinfo->{'description'}; $getreserv{author} = $getbibinfo->{'author'}; @@ -502,7 +504,7 @@ sub build_issue_data { $it->{'displaydate'} = output_pref($it->{'issuedate'}); #$it->{'od'} = ( $it->{'date_due'} lt $todaysdate ) ? 1 : 0 ; $it->{'od'} = $it->{'overdue'}; - $it->{'author'} ||= ' '; + $it->{'subtitle'} = GetRecordValue('subtitle', GetMarcBiblio($it->{biblionumber}), GetFrameworkCode($it->{biblionumber})); $it->{'renew_failed'} = $renew_failed{$it->{'itemnumber'}}; $it->{'return_failed'} = $return_failed{$it->{'barcode'}}; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt index dce5fcc159..852b98c01a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -852,7 +852,7 @@ No patron matched [% message %] [% KohaAuthorisedValues.GetByCode( 'DAMAGED', todayissue.damaged ) %] [% END %] - [% todayissue.title |html %][% IF ( todayissue.author ) %], by [% todayissue.author %][% END %][% IF ( todayissue.itemnotes ) %]- [% todayissue.itemnotes %][% END %] [% todayissue.barcode %] + [% todayissue.title |html %][% FOREACH subtitl IN todayissue.subtitle %] [% subtitl.subfield %][% END %][% IF ( todayissue.author ) %], by [% todayissue.author %][% END %][% IF ( todayissue.itemnotes ) %]- [% todayissue.itemnotes %][% END %] [% todayissue.barcode %] [% UNLESS ( noItemTypeImages ) %] [% IF ( todayissue.itemtype_image ) %][% END %][% END %][% todayissue.itemtype %] [% todayissue.checkoutdate %] [% IF ( todayissue.multiple_borrowers ) %][% todayissue.firstname %] [% todayissue.surname %][% END %] @@ -939,7 +939,7 @@ No patron matched [% message %] [% KohaAuthorisedValues.GetByCode( 'DAMAGED', previssue.damaged ) %] [% END %] - [% previssue.title |html %][% IF ( previssue.author ) %], by [% previssue.author %][% END %] [% IF ( previssue.itemnotes ) %]- [% previssue.itemnotes %][% END %] [% previssue.barcode %] + [% previssue.title |html %][% FOREACH subtitl IN previssue.subtitle %] [% subtitl.subfield %][% END %][% IF ( previssue.author ) %], by [% previssue.author %][% END %] [% IF ( previssue.itemnotes ) %]- [% previssue.itemnotes %][% END %] [% previssue.barcode %] [% previssue.itemtype %] @@ -1077,7 +1077,7 @@ No patron matched [% message %] [% KohaAuthorisedValues.GetByCode( 'DAMAGED', relissue.damaged ) %] [% END %] - [% relissue.title |html %][% IF ( relissue.author ) %], by [% relissue.author %][% END %][% IF ( relissue.itemnotes ) %]- [% relissue.itemnotes %][% END %] [% relissue.barcode %] + [% relissue.title |html %][% FOREACH subtitl IN relissue.subtitle %] [% subtitl.subfield %][% END %][% IF ( relissue.author ) %], by [% relissue.author %][% END %][% IF ( relissue.itemnotes ) %]- [% relissue.itemnotes %][% END %] [% relissue.barcode %] [% UNLESS ( noItemTypeImages ) %] [% IF ( relissue.itemtype_image ) %][% END %][% END %][% relissue.itemtype %] [% relissue.displaydate %] [% relissue.issuingbranchname %] @@ -1098,7 +1098,7 @@ No patron matched [% message %] [% IF ( relprevissue.overdue ) %][% ELSE %][% END %] [% relprevissue.dd %] - [% relprevissue.title |html %][% IF ( relprevissue.author ) %], by [% relprevissue.author %][% END %] [% IF ( relprevissue.itemnotes ) %]- [% relprevissue.itemnotes %][% END %] [% relprevissue.barcode %] + [% relprevissue.title |html %][% FOREACH subtitl IN relprevissue.subtitle %] [% subtitl.subfield %][% END %][% IF ( relprevissue.author ) %], by [% relprevissue.author %][% END %] [% IF ( relprevissue.itemnotes ) %]- [% relprevissue.itemnotes %][% END %] [% relprevissue.barcode %] [% UNLESS noItemTypeImages %][% IF relprevissue.itemtype_image %][% END %][% END %][% relprevissue.itemtype %] [% relprevissue.displaydate %] [% relprevissue.issuingbranchname %] @@ -1137,7 +1137,7 @@ No patron matched [% message %] [% FOREACH reservloo IN reservloop %] [% reservloo.reservedate %] - [% reservloo.title |html %][% IF ( reservloo.author ) %], by [% reservloo.author %][% END %] + [% reservloo.title |html %][% FOREACH subtitl IN reservloo.subtitle %] [% subtitl.subfield %][% END %][% IF ( reservloo.author ) %], by [% reservloo.author %][% END %] [% reservloo.itemcallnumber %] [% IF ( reservloo.barcodereserv ) %]Item [% reservloo.barcodereserv %] [% END %][% IF ( reservloo.waiting ) %] waiting at [% reservloo.waitingat %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt index a457228809..5bd8a14908 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt @@ -482,7 +482,7 @@ function validate1(date) { [% issueloo.itemdamaged %] [% END %] - [% issueloo.title |html %][% IF ( issueloo.author ) %], by [% issueloo.author %][% END %] [% IF ( issueloo.publishercode ) %]; [% issueloo.publishercode %] [% END %] [% IF ( issueloo.publicationyear ) %], [% issueloo.publicationyear %][% END %] [% issueloo.barcode %] + [% issueloo.title |html %][% FOREACH subtitl IN issueloo.subtitle %] [% subtitl.subfield %][% END %][% IF ( issueloo.author ) %], by [% issueloo.author %][% END %] [% IF ( issueloo.publishercode ) %]; [% issueloo.publishercode %] [% END %] [% IF ( issueloo.publicationyear ) %], [% issueloo.publicationyear %][% END %] [% issueloo.barcode %] [% UNLESS ( noItemTypeImages ) %] [% IF ( issueloo.itemtype_image ) %][% END %][% END %][% issueloo.itemtype_description %] [% issueloo.issuedate | $KohaDates%] [% issueloo.issuingbranchname %] @@ -590,7 +590,7 @@ function validate1(date) { [% relissueloo.itemdamaged %] [% END %] - [% relissueloo.title |html %][% IF relissueloo.author %], by [% relissueloo.author %][% END %] [% IF relissueloo.publishercode %]; [% relissueloo.publishercode %] [% END %] [% IF relissueloo.publicationyear %], [% relissueloo.publicationyear %][% END %] [% relissueloo.barcode %] + [% relissueloo.title |html %][% FOREACH subtitl IN relissueloo.subtitle %] [% subtitl.subfield %][% END %][% IF relissueloo.author %], by [% relissueloo.author %][% END %] [% IF relissueloo.publishercode %]; [% relissueloo.publishercode %] [% END %] [% IF relissueloo.publicationyear %], [% relissueloo.publicationyear %][% END %] [% relissueloo.barcode %] [% UNLESS ( noItemTypeImages ) %] [% IF ( relissueloo.itemtype_image ) %][% END %][% END %][% relissueloo.itemtype_description %] [% relissueloo.issuedate | $KohaDates %] [% relissueloo.issuingbranchname %] @@ -633,7 +633,7 @@ function validate1(date) { [% reservloo.reservedate | $KohaDates %] - [% reservloo.title |html %][% IF ( reservloo.author ) %], by [% reservloo.author %][% END %] + [% reservloo.title |html %][% FOREACH subtitl IN reservloo.subtitle %] [% subtitl.subfield %][% END %][% IF ( reservloo.author ) %], by [% reservloo.author %][% END %] [% reservloo.itemcallnumber %] [% IF ( reservloo.waiting ) %] diff --git a/members/moremember.pl b/members/moremember.pl index 7188e90a57..7ed96d3bb7 100755 --- a/members/moremember.pl +++ b/members/moremember.pl @@ -302,6 +302,8 @@ if ($borrowernumber) { $getreserv{nottransferedby} = GetBranchName( $getiteminfo->{'holdingbranch'} ); } + $getreserv{title} = $getiteminfo->{'title'}; + $getreserv{subtitle} = GetRecordValue('subtitle', GetMarcBiblio($getiteminfo->{biblionumber}), GetFrameworkCode($getiteminfo->{biblionumber})); # if we don't have a reserv on item, we put the biblio infos and the waiting position if ( $getiteminfo->{'title'} eq '' ) { @@ -309,6 +311,7 @@ if ($borrowernumber) { my $getbibtype = getitemtypeinfo( $getbibinfo->{'itemtype'} ); $getreserv{color} = 'inwait'; $getreserv{title} = $getbibinfo->{'title'}; + $getreserv{subtitle} = GetRecordValue('subtitle', GetMarcBiblio($num_res->{biblionumber}), GetFrameworkCode($num_res->{biblionumber})); $getreserv{nottransfered} = 0; $getreserv{itemtype} = $getbibtype->{'description'}; $getreserv{author} = $getbibinfo->{'author'}; @@ -448,8 +451,7 @@ sub build_issue_data { if ($issue->{issuedate} ) { $issuedate = $issue->{issuedate}->clone(); } - - my $biblionumber = $issue->{biblionumber}; + $issue->{subtitle} = GetRecordValue('subtitle', GetMarcBiblio($issue->{biblionumber}), GetFrameworkCode($issue->{biblionumber})); $issue->{issuingbranchname} = GetBranchName($issue->{branchcode}); my %row = %{$issue}; $totalprice += $issue->{replacementprice}; -- 2.39.5