Bugzilla – Attachment 31988 Details for
Bug 12944
Search for creator of an order
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[PASSED QA] Bug 12944: Search orders by basket creator
PASSED-QA-Bug-12944-Search-orders-by-basket-creato.patch (text/plain), 5.99 KB, created by
Kyle M Hall (khall)
on 2014-10-03 14:27:59 UTC
(
hide
)
Description:
[PASSED QA] Bug 12944: Search orders by basket creator
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2014-10-03 14:27:59 UTC
Size:
5.99 KB
patch
obsolete
>From fbae1b4d32e3c8d74dcdca22ca5ebb0ed15d6acf Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Wed, 17 Sep 2014 17:13:00 +0200 >Subject: [PATCH] [PASSED QA] Bug 12944: Search orders by basket creator > >This patch adds the ability to search orders using the basket creator. > >Test plan: >- go on the order advanced search form (acqui/histsearch.pl) >- use the autocomplete input to search patrons >- launch the search and verify the results are consistent with the > values you have filled. > >Signed-off-by: Paola Rossi <paola.rossi@cineca.it> > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > C4/Acquisition.pm | 13 ++++++++--- > acqui/histsearch.pl | 2 + > .../prog/en/modules/acqui/histsearch.tt | 21 +++++++++++++++++++- > 3 files changed, 31 insertions(+), 5 deletions(-) > >diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm >index e8c7790..7c4f58f 100644 >--- a/C4/Acquisition.pm >+++ b/C4/Acquisition.pm >@@ -2312,6 +2312,7 @@ sub GetHistory { > my $get_canceled_order = $params{get_canceled_order} || 0; > my $ordernumber = $params{ordernumber}; > my $search_children_too = $params{search_children_too} || 0; >+ my $created_by = $params{created_by} || []; > > my @order_loop; > my $total_qty = 0; >@@ -2328,6 +2329,8 @@ sub GetHistory { > aqorders.basketno, > aqbasket.basketname, > aqbasket.basketgroupid, >+ aqbasket.authorisedby, >+ concat( borrowers.firstname,' ',borrowers.surname) AS authorisedbyname, > aqbasketgroups.name as groupname, > aqbooksellers.name, > aqbasket.creationdate, >@@ -2356,12 +2359,9 @@ sub GetHistory { > LEFT JOIN aqinvoices ON aqorders.invoiceid = aqinvoices.invoiceid > LEFT JOIN deletedbiblio ON deletedbiblio.biblionumber=aqorders.biblionumber > LEFT JOIN deletedbiblioitems ON deletedbiblioitems.biblionumber=aqorders.biblionumber >+ LEFT JOIN borrowers ON aqbasket.authorisedby=borrowers.borrowernumber > "; > >- if ( C4::Context->preference("IndependentBranches") ) { >- $query .= " LEFT JOIN borrowers ON aqbasket.authorisedby=borrowers.borrowernumber"; >- } >- > $query .= " WHERE 1 "; > > unless ($get_canceled_order or (defined $orderstatus and $orderstatus eq 'cancelled')) { >@@ -2449,6 +2449,11 @@ sub GetHistory { > $query .= ") "; > } > >+ if ( @$created_by ) { >+ $query .= ' AND aqbasket.authorisedby IN ( ' . join( ',', ('?') x @$created_by ) . ')'; >+ push @query_params, @$created_by; >+ } >+ > > if ( C4::Context->preference("IndependentBranches") ) { > unless ( C4::Context->IsSuperLibrarian() ) { >diff --git a/acqui/histsearch.pl b/acqui/histsearch.pl >index b474ac1..d3efbf7 100755 >--- a/acqui/histsearch.pl >+++ b/acqui/histsearch.pl >@@ -76,6 +76,7 @@ my $budget = $input->param( 'budget' ); > my $orderstatus = $input->param( 'orderstatus' ); > my $ordernumber = $input->param( 'ordernumber' ); > my $search_children_too = $input->param( 'search_children_too' ); >+my @created_by = $input->param('created_by'); > > if ( not $input->param('from') ) { > # FIXME Dirty but we can't sent a Date::Calc to C4::Dates ? >@@ -121,6 +122,7 @@ if ($do_search) { > orderstatus => $orderstatus, > ordernumber => $ordernumber, > search_children_too => $search_children_too, >+ created_by => \@created_by, > ); > } > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/histsearch.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/histsearch.tt >index 3bb7fcb..75bc842 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/histsearch.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/histsearch.tt >@@ -5,6 +5,8 @@ > [% INCLUDE 'doc-head-close.inc' %] > [% INCLUDE 'calendar.inc' %] > [% INCLUDE 'datatables.inc' %] >+ >+<script type="text/javascript" src="[% interface %]/js/autocomplete/patrons.pl"></script> > <script type="text/javascript"> > //<![CDATA[ > $(document).ready(function() { >@@ -15,7 +17,16 @@ > ], > "sPaginationType": "four_button" > } ) ); >- }); >+ >+ >+ patron_autocomplete({ >+ patron_container: $("#basket_creators"), >+ input_autocomplete: $("#find_patron"), >+ patron_input_name: 'created_by', >+ field_to_retrieve: 'borrowernumber' >+ }); >+}); >+ > //]]> > </script> > </head> >@@ -43,6 +54,12 @@ > [% END %] > <li><label for="name">Vendor: </label> <input type="text" name="name" id="name" value="[% name %]" /></li> > <li><label for="basket">Basket: </label> <input type="text" name="basket" id="basket" value="[% basket %]" /></li> >+ <li><label for="basket_creators">Basket created by: </label> >+ <input autocomplete="off" id="find_patron" type="text" style="width:150px" class="noEnterSubmit" /> >+ <div> >+ <div id="basket_creators" style="float:left;"></div> >+ </div> >+ </li> > <li><label for="booksellerinvoicenumber ">Bookseller invoice no: </label> <input type="text" name="booksellerinvoicenumber" id="booksellerinvoicenumber" value="[% booksellerinvoicenumber %]" /></li> > <li> > <label for="basketgroupname">Basket group:</label> >@@ -135,6 +152,7 @@ > <th>Order line (parent)</th> > <th>Status</th> > <th>Basket</th> >+ <th>Basket creator</th> > <th>Basket group</th> > <th>Invoice number</th> > <th class="anti-the">Summary</th> >@@ -164,6 +182,7 @@ > [% END %] > </td> > <td>[% order.basketname %] (<a href="basket.pl?basketno=[% order.basketno %]">[% order.basketno %]</a>)</td> >+ <td>[% order.authorisedbyname %]</td> > <td> > [% IF ( order.basketgroupid ) %] > [% order.groupname %] (<a href="basketgroup.pl?booksellerid=[% order.id %]">[% order.basketgroupid %]</a>) >-- >1.7.2.5
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 12944
:
31682
|
31683
|
31824
|
31825
|
31987
|
31988
|
31989
|
32922
|
32931
|
33197
|
33198
|
33199
|
33200
|
34781
|
35589
|
35590
|
35591
|
35592
|
35593
|
35698