Bugzilla – Attachment 27723 Details for
Bug 11859
Add edition and publication year to PDF templates in acquisitions
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[PASSED QA] Bug 11859: Add publication year and edition to English acq PDF templates
PASSED-QA-Bug-11859-Add-publication-year-and-editi.patch (text/plain), 7.25 KB, created by
Martin Renvoize (ashimema)
on 2014-04-28 16:42:24 UTC
(
hide
)
Description:
[PASSED QA] Bug 11859: Add publication year and edition to English acq PDF templates
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2014-04-28 16:42:24 UTC
Size:
7.25 KB
patch
obsolete
>From 4ca69f5b6517986af7d4639296af85cab15917e8 Mon Sep 17 00:00:00 2001 >From: Katrin Fischer <katrin.fischer@bsz-bw.de> >Date: Thu, 27 Feb 2014 11:12:11 +0100 >Subject: [PATCH] [PASSED QA] Bug 11859: Add publication year and edition to > English acq PDF templates > >To test: >- Switch OrderPdfFormat to pdfformat::layout3pages >- Create one or more baskets with a few orders, make sure you > are adding some records that contain a publication year and/or > edition statement >- Close the basket >- Create a basket group >- Print the PDF and check that edition and publication year > show up and bibliographic information is printed correctly >- Switch OrderPdfFormat to pdfformat::layout2pages >- Repeat PDF print > >This patch also changes the formatting a bit and differentiates between >UNIMARC and MARC21. For MARC21 no additional punctuation is needed as >those are cataloged with the information. Only spaces are added for MARC21, >while UNIMARC is kept they way it was before. > >http://bugs.koha-community.org/show_bug.cgi?id=11859 >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > acqui/basketgroup.pl | 6 +++++- > acqui/pdfformat/layout2pages.pm | 22 +++++++++++++++++++++- > acqui/pdfformat/layout3pages.pm | 23 ++++++++++++++++++++++- > 3 files changed, 48 insertions(+), 3 deletions(-) > >diff --git a/acqui/basketgroup.pl b/acqui/basketgroup.pl >index b2d8b94..8d84270 100755 >--- a/acqui/basketgroup.pl >+++ b/acqui/basketgroup.pl >@@ -200,12 +200,15 @@ sub printbasketgrouppdf{ > > # Editor Number > my $en; >+ my $edition; > my $marcrecord=eval{MARC::Record::new_from_xml( $ord->{marcxml},'UTF-8' )}; > if ($marcrecord){ > if ( C4::Context->preference("marcflavour") eq 'UNIMARC' ) { > $en = $marcrecord->subfield( '345', "b" ); >+ $edition = $marcrecord->subfield( '205', 'a' ); > } elsif ( C4::Context->preference("marcflavour") eq 'MARC21' ) { > $en = $marcrecord->subfield( '037', "a" ); >+ $edition = $marcrecord->subfield( '250', 'a' ); > } > } > >@@ -213,8 +216,9 @@ sub printbasketgrouppdf{ > isbn => ($ord->{isbn} ? $ord->{isbn} : undef), > itemtype => ( $ord->{itemtype} and $bib->{itemtype} ? $itemtypes->{$bib->{itemtype}}->{description} : undef ), > en => ( $en ? $en : undef ), >+ edition => ( $edition ? $edition : undef ), > }; >- for my $key ( qw/ gstrate author title itemtype publishercode discount quantity rrpgsti rrpgste gstgsti gstgste ecostgsti ecostgste gstvalue totalgste totalgsti / ) { >+ for my $key ( qw/ gstrate author title itemtype publishercode copyrightdate publicationyear discount quantity rrpgsti rrpgste gstgsti gstgste ecostgsti ecostgste gstvalue totalgste totalgsti / ) { > $ba_order->{$key} = $ord->{$key}; > } > >diff --git a/acqui/pdfformat/layout2pages.pm b/acqui/pdfformat/layout2pages.pm >index 335dc0a..df84c7d 100644 >--- a/acqui/pdfformat/layout2pages.pm >+++ b/acqui/pdfformat/layout2pages.pm >@@ -88,12 +88,32 @@ sub printorders { > } > push(@$abaskets, $arrbasket); > >+ my $titleinfo; > for my $basket (@$baskets){ > for my $line (@{$orders->{$basket->{basketno}}}) { > $arrbasket = undef; >+ $titleinfo = ""; >+ if ( C4::Context->preference("marcflavour") eq 'UNIMARC' ) { >+ $titleinfo = $line->{title} . " / " . $line->{author} . >+ ( $line->{isbn} ? " ISBN: " . $line->{isbn} : '' ) . >+ ( $line->{en} ? " EN: " . $line->{en} : '' ) . >+ ( $line->{itemtype} ? ", " . $line->{itemtype} : '' ) . >+ ( $line->{edition} ? ", " . $line->{edition} : '' ) . >+ ( $line->{publishercode} ? ' published by '. $line->{publishercode} : '') . >+ ( $line->{publicationyear} ? ', '. $line->{publicationyear} : ''); >+ } >+ else { # MARC21, NORMARC >+ $titleinfo = $line->{title} . " " . $line->{author} . >+ ( $line->{isbn} ? " ISBN: " . $line->{isbn} : '' ) . >+ ( $line->{en} ? " EN: " . $line->{en} : '' ) . >+ ( $line->{itemtype} ? " " . $line->{itemtype} : '' ) . >+ ( $line->{edition} ? ", " . $line->{edition} : '' ) . >+ ( $line->{publishercode} ? ' published by '. $line->{publishercode} : '') . >+ ( $line->{copyrightdate} ? ' '. $line->{copyrightdate} : ''); >+ } > push( @$arrbasket, > $basket->{basketno}, >- $line->{title} . " / " . $line->{author} . ( $line->{isbn} ? " ISBN : " . $line->{isbn} : '' ) . ( $line->{en} ? " EN : " . $line->{en} : '' ) . ", " . $line->{itemtype} . ( $line->{publishercode} ? ' published by '. $line->{publishercode} : ""), >+ $titleinfo, > $line->{quantity}, > $num->format_price($line->{rrpgsti}), > $num->format_price($line->{discount}).'%', >diff --git a/acqui/pdfformat/layout3pages.pm b/acqui/pdfformat/layout3pages.pm >index b9d10aa..d09be33 100644 >--- a/acqui/pdfformat/layout3pages.pm >+++ b/acqui/pdfformat/layout3pages.pm >@@ -108,10 +108,31 @@ sub printorders { > push(@$arrbasket, $bkey); > } > push(@$abaskets, $arrbasket); >+ >+ my $titleinfo; > foreach my $line (@{$orders->{$basket->{basketno}}}) { > $arrbasket = undef; >+ $titleinfo = ""; >+ if ( C4::Context->preference("marcflavour") eq 'UNIMARC' ) { >+ $titleinfo = $line->{title} . " / " . $line->{author} . >+ ( $line->{isbn} ? " ISBN: " . $line->{isbn} : '' ) . >+ ( $line->{en} ? " EN: " . $line->{en} : '' ) . >+ ( $line->{itemtype} ? ", " . $line->{itemtype} : '' ) . >+ ( $line->{edition} ? ", " . $line->{edition} : '' ) . >+ ( $line->{publishercode} ? ' published by '. $line->{publishercode} : '') . >+ ( $line->{publicationyear} ? ', '. $line->{publicationyear} : ''); >+ } >+ else { # MARC21, NORMARC >+ $titleinfo = $line->{title} . " " . $line->{author} . >+ ( $line->{isbn} ? " ISBN: " . $line->{isbn} : '' ) . >+ ( $line->{en} ? " EN: " . $line->{en} : '' ) . >+ ( $line->{itemtype} ? " " . $line->{itemtype} : '' ) . >+ ( $line->{edition} ? ", " . $line->{edition} : '' ) . >+ ( $line->{publishercode} ? ' published by '. $line->{publishercode} : '') . >+ ( $line->{copyrightdate} ? ' '. $line->{copyrightdate} : ''); >+ } > push( @$arrbasket, >- $line->{title} . " / " . $line->{author} . ( $line->{isbn} ? " ISBN : " . $line->{isbn} : '' ) . ( $line->{en} ? " EN : " . $line->{en} : '' ) . ", " . $line->{itemtype} . ( $line->{publishercode} ? ' published by '. $line->{publishercode} : ""), >+ $titleinfo, > $line->{quantity}, > $num->format_price($line->{rrpgste}), > $num->format_price($line->{rrpgsti}), >-- >1.7.10.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 11859
:
25703
|
25704
|
25705
|
27470
|
27471
|
27474
|
27723
|
27724
|
27725
|
27726
|
27727
|
27728
|
27730
|
27731
|
27732