Bugzilla – Attachment 22306 Details for
Bug 11122
Fix display of publication year/copyrightdate and publishercode on various pages in acquisitions
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11122 - publisher code and publication year not fetched in acq orders
0001-Bug-11122-publisher-code-and-publication-year-not-fe.patch (text/plain), 14.07 KB, created by
Fridolin Somers
on 2013-10-23 10:20:13 UTC
(
hide
)
Description:
Bug 11122 - publisher code and publication year not fetched in acq orders
Filename:
MIME Type:
Creator:
Fridolin Somers
Created:
2013-10-23 10:20:13 UTC
Size:
14.07 KB
patch
obsolete
>From 8fc5d2a6875a67011bf2194d3f7e47ba59368c38 Mon Sep 17 00:00:00 2001 >From: Fridolyn SOMERS <fridolyn.somers@biblibre.com> >Date: Wed, 23 Oct 2013 12:05:23 +0200 >Subject: [PATCH] Bug 11122 - publisher code and publication year not fetched > in acq orders > >In acquisition, several templates try to display publisher code and publication year : invoice.tt, parcel.tt, transferorder.tt. >Thoses pages use C4::Acquisition methods GetPendingOrders or GetInvoiceDetails. >The bug is that in the SQL query of those methods, biblioitems.publishercode and biblioitems.publicationyear. >In uncertainprice.pl those datas are fetch using GetBiblioData. >It whould be better to fetch them in GetPendingOrders and GetInvoiceDetails. > >This patch changes SQL queries to fetch wanted datas : aqorders.*,biblio.title,biblio.author,biblioitems.isbn,biblioitems.publishercode,biblioitems.publicationyear. GetInvoiceDetails also needs : biblio.seriestitle,biblioitems.volume. >This patch also unifies the way biblio datas are displayed : > <a href="link to catalog using biblionumber">[title]</a> <em>by</em> [author] – [isbn] > <em>Publisher:</em> [publishercode], [publicationyear] > >Test plan : >- Choose a biblio record containing a data in : > biblio.title, > biblio.author, > biblioitems.isbn, > biblioitems.publishercode, > biblioitems.publicationyear, > biblio.seriestitle, > biblioitems.volume. >- Create an order using this biblio. >- Look at this order in pages : parcel.pl, transferorder.pl, uncertainprice.pl >=> You see publisher code and publication year >- Look at this order in page : invoice.pl >=> You see publisher code, publication year, series title and volume >--- > C4/Acquisition.pm | 47 ++++++++++++++++------ > acqui/uncertainprice.pl | 20 +-------- > .../intranet-tmpl/prog/en/modules/acqui/invoice.tt | 18 ++++----- > .../intranet-tmpl/prog/en/modules/acqui/parcel.tt | 16 +++++--- > .../prog/en/modules/acqui/transferorder.tt | 7 +++- > .../prog/en/modules/acqui/uncertainprice.tt | 17 +++++--- > 6 files changed, 72 insertions(+), 53 deletions(-) > >diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm >index ed9c215..670b76f 100644 >--- a/C4/Acquisition.pm >+++ b/C4/Acquisition.pm >@@ -861,18 +861,30 @@ Results are ordered from most to least recent. > sub GetPendingOrders { > my ($supplierid,$grouped,$owner,$basketno,$ordernumber,$search,$ean) = @_; > my $dbh = C4::Context->dbh; >- my $strsth = " >- SELECT ".($grouped?"count(*),":"")."aqbasket.basketno, >- surname,firstname,biblio.*,biblioitems.isbn, >- aqbasket.closedate, aqbasket.creationdate, aqbasket.basketname, >- aqorders.* >+ my $strsth = q{SELECT }; >+ $strsth .= q{COUNT(*),} if $grouped; >+ $strsth .= q{ >+ aqbasket.basketno, >+ borrowers.surname, >+ borrowers.firstname, >+ biblio.title, >+ biblio.author, >+ biblioitems.isbn, >+ biblioitems.publishercode, >+ biblioitems.publicationyear, >+ aqbasket.closedate, >+ aqbasket.creationdate, >+ aqbasket.basketname, >+ aqorders.* > FROM aqorders >- LEFT JOIN aqbasket ON aqbasket.basketno=aqorders.basketno >- LEFT JOIN borrowers ON aqbasket.authorisedby=borrowers.borrowernumber >- LEFT JOIN biblio ON biblio.biblionumber=aqorders.biblionumber >- LEFT JOIN biblioitems ON biblioitems.biblionumber=biblio.biblionumber >- WHERE (quantity > quantityreceived OR quantityreceived is NULL) >- AND datecancellationprinted IS NULL"; >+ LEFT JOIN aqbasket ON aqbasket.basketno=aqorders.basketno >+ LEFT JOIN borrowers ON aqbasket.authorisedby=borrowers.borrowernumber >+ LEFT JOIN biblio ON biblio.biblionumber=aqorders.biblionumber >+ LEFT JOIN biblioitems ON biblioitems.biblionumber=biblio.biblionumber >+ WHERE >+ (quantity > quantityreceived OR quantityreceived IS NULL) >+ AND datecancellationprinted IS NULL >+ }; > my @query_params; > my $userenv = C4::Context->userenv; > if ( C4::Context->preference("IndependentBranches") ) { >@@ -2433,10 +2445,19 @@ sub GetInvoiceDetails { > > my $invoice = $sth->fetchrow_hashref; > >- $query = qq{ >- SELECT aqorders.*, biblio.* >+ $query = q{ >+ SELECT >+ aqorders.*, >+ biblio.title, >+ biblio.author, >+ biblio.seriestitle, >+ biblioitems.isbn, >+ biblioitems.publishercode, >+ biblioitems.publicationyear, >+ biblioitems.volume > FROM aqorders > LEFT JOIN biblio ON aqorders.biblionumber = biblio.biblionumber >+ LEFT JOIN biblioitems ON biblioitems.biblionumber=biblio.biblionumber > WHERE invoiceid = ? > }; > $sth = $dbh->prepare($query); >diff --git a/acqui/uncertainprice.pl b/acqui/uncertainprice.pl >index 924f9bd..905865e 100755 >--- a/acqui/uncertainprice.pl >+++ b/acqui/uncertainprice.pl >@@ -74,24 +74,8 @@ my $bookseller = &GetBookSellerFromId($booksellerid); > > #show all orders that have uncertain price for the bookseller > my $pendingorders = &GetPendingOrders($booksellerid,0,$owner,$basketno); >-my @orders; >- >-foreach my $order (@{$pendingorders}) { >- if ( $order->{'uncertainprice'} ) { >- my $bibdata = &GetBiblioData($order->{'biblionumber'}); >- $order->{'bibisbn'} = $bibdata->{'isbn'}; >- $order->{'bibpublishercode'} = $bibdata->{'publishercode'}; >- $order->{'bibpublicationyear'} = $bibdata->{'publicationyear'}; >- $order->{'bibtitle'} = $bibdata->{'title'}; >- $order->{'bibauthor'} = $bibdata->{'author'}; >- $order->{'surname'} = $order->{'surname'}; >- $order->{'firstname'} = $order->{'firstname'}; >- my $order_as_from_db=GetOrder($order->{ordernumber}); >- $order->{'quantity'} = $order_as_from_db->{'quantity'}; >- $order->{'listprice'} = $order_as_from_db->{'listprice'}; >- push(@orders, $order); >- } >-} >+my @orders = grep { $_->{'uncertainprice'} } @$pendingorders; >+ > if ( $op eq 'validate' ) { > $template->param( validate => 1); > my $count = scalar(@orders); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoice.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoice.tt >index 266aa65..e728d8f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoice.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoice.tt >@@ -108,18 +108,16 @@ > <tbody> > [% FOREACH order IN orders_loop %] > <tr> >- <td><p><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% order.biblionumber %]">[% order.title %]</a> >- [% IF ( order.author ) %] >- <br /><em>by</em> [% order.author %] >- [% END %] >- </p></td> >+ <td> >+ <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% order.biblionumber %]">[% order.title |html %]</a> >+ <br /> >+ [% IF ( order.author ) %] <em>by</em> [% order.author %][% END %] >+ [% IF ( order.isbn ) %] – [% order.isbn %][% END %] >+ </td> > <td> > [% IF ( order.publishercode ) %] >- <p>[% order.publishercode %] >- [% IF ( order.publicationyear ) %] >- - [% order.publicationyear %] >- [% END %] >- </p> >+ [% order.publishercode %] >+ [%- IF ( order.publicationyear ) %], [% order.publicationyear %][% END %] > [% END %] > </td> > <td><p>[% order.branchcode %]</p></td> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt >index 174a6bf..3f7cb31 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt >@@ -200,9 +200,12 @@ > <td class="orderfilterclass"><a href="neworderempty.pl?ordernumber=[% loop_order.ordernumber %]&booksellerid=[% loop_order.booksellerid %]">[% loop_order.ordernumber %]</a></td> > <td class="summaryfilterclass"> > <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% loop_order.biblionumber %]">[% loop_order.title |html %]</a> >- [% IF ( loop_order.author ) %] by [% loop_order.author %][% END %] >+ [% IF ( loop_order.author ) %] <em>by</em> [% loop_order.author %][% END %] > [% IF ( loop_order.isbn ) %] – [% loop_order.isbn %][% END %] >- [% IF ( loop_order.publishercode ) %]<br />Publisher :[% loop_order.publishercode %][% END %] >+ [% IF ( loop_order.publishercode ) %] >+ <br /><em>Publisher:</em> [% loop_order.publishercode %] >+ [%- IF ( loop_order.publicationyear ) %], [% loop_order.publicationyear %][% END %] >+ [% END %] > [% IF ( loop_order.suggestionid ) %] > <br/> > Suggested by: [% loop_order.surnamesuggestedby %][% IF ( loop_order.firstnamesuggestedby ) %], [% loop_order.firstnamesuggestedby %] [% END %] >@@ -307,9 +310,12 @@ > <td><a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% loop_receive.basketno %]">[% loop_receive.basketno %]</a></td> > <td><a href="neworderempty.pl?ordernumber=[% loop_receive.ordernumber %]&booksellerid=[% booksellerid %]">[% loop_receive.ordernumber %]</a></td> > <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% loop_receive.biblionumber %]">[% loop_receive.title |html %]</a> >- [% IF ( loop_receive.author ) %] / [% loop_receive.author %][% END %] >- [% IF ( loop_receive.isbn ) %] - [% loop_receive.isbn %][% END %] >- [% IF ( loop_receive.publishercode ) %]<br />Publisher :[% loop_receive.publishercode %][% END %] >+ [% IF ( loop_receive.author ) %] <em>by</em> [% loop_receive.author %][% END %] >+ [% IF ( loop_receive.isbn ) %] – [% loop_receive.isbn %][% END %] >+ [% IF ( loop_receive.publishercode ) %] >+ <br /><em>Publisher:</em> [% loop_receive.publishercode %] >+ [%- IF ( loop_receive.publicationyear ) %], [% loop_receive.publicationyear %][% END %] >+ [% END %] > [% IF ( loop_receive.suggestionid ) %] > <br/> > Suggested by: [% loop_receive.surnamesuggestedby %][% IF ( loop_receive.firstnamesuggestedby ) %], [% loop_receive.firstnamesuggestedby %] [% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/transferorder.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/transferorder.tt >index 3671632..5604166 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/transferorder.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/transferorder.tt >@@ -76,9 +76,12 @@ > <td><a href="neworderempty.pl?ordernumber=[% ordersloo.ordernumber %]">[% ordersloo.ordernumber %]</a></td> > <td> > <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% ordersloo.biblionumber %]">[% ordersloo.title |html %]</a> >- [% IF ( ordersloo.author ) %] by [% ordersloo.author %][% END %] >+ [% IF ( ordersloo.author ) %] <em>by</em> [% ordersloo.author %][% END %] > [% IF ( ordersloo.isbn ) %] – [% ordersloo.isbn %][% END %] >- [% IF ( ordersloo.publishercode ) %]<br />Publisher :[% ordersloo.publishercode %][% END %] >+ [% IF ( ordersloo.publishercode ) %] >+ <br /><em>Publisher:</em> [% ordersloo.publishercode %] >+ [%- IF ( ordersloo.publicationyear ) %], [% ordersloo.publicationyear %][% END %] >+ [% END %] > </td> > <td><a href="transferorder.pl?bookselleridfrom=[% ordersloo.bookselleridfrom %]&ordernumber=[% ordersloo.ordernumber %]">Transfer</a></td> > </tr> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/uncertainprice.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/uncertainprice.tt >index 41aad00..50a6d9a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/uncertainprice.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/uncertainprice.tt >@@ -107,11 +107,18 @@ function check(form) { > [% uncertainpriceorder.basketname %] > </td> > <td> >- [% uncertainpriceorder.bibtitle %] / [% uncertainpriceorder.bibauthor %] <br /> [% uncertainpriceorder.bibpublishercode %], [% uncertainpriceorder.bibpublicationyear %]<br />[% uncertainpriceorder.bibisbn %]<br /> >- <a href="neworderempty.pl?ordernumber=[% uncertainpriceorder.ordernumber %]&booksellerid=[% booksellerid %]&basketno=[% uncertainpriceorder.basketno %]"> >- edit >- </a> >- </td> >+ <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% uncertainpriceorder.biblionumber %]">[% uncertainpriceorder.title |html %]</a> >+ [% IF ( uncertainpriceorder.author ) %] <em>by</em> [% uncertainpriceorder.author %][% END %] >+ [% IF ( uncertainpriceorder.isbn ) %] – [% uncertainpriceorder.isbn %][% END %] >+ [% IF ( uncertainpriceorder.publishercode ) %] >+ <br /><em>Publisher:</em> [% uncertainpriceorder.publishercode %] >+ [%- IF ( uncertainpriceorder.publicationyear ) %], [% uncertainpriceorder.publicationyear %][% END %] >+ [% END %] >+ <br /> >+ <a href="neworderempty.pl?ordernumber=[% uncertainpriceorder.ordernumber %]&booksellerid=[% booksellerid %]&basketno=[% uncertainpriceorder.basketno %]"> >+ Edit >+ </a> >+ </td> > <td> > [% uncertainpriceorder.firstname %] [% uncertainpriceorder.surname %] > </td> >-- >1.8.3.2 >
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 11122
:
22306
|
23227
|
38130
|
38146
|
38667
|
44710
|
44711
|
44712
|
62935
|
62936
|
62937
|
63405
|
63406
|
63407
|
63538
|
63539
|
63540