From 795421a643fb3247500e773af60988d051ee8917 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 25 Oct 2013 16:35:44 +0200 Subject: [PATCH] Bug 11141: retain pending order filters during receiving. On receiving orders, the librarian has to filter again the pending orders list. This patch stores the filters in a cookie in order to apply them when the librarian finish a receive and come back on the pending orders list. Test plan: 1/ choose a vendor with several baskets and orders. 2/ start to receive an item. 3/ on the pending orders page, add some relevant filters. 4/ receive an item. 5/ you are back on the pending orders page and filters are directly applied. Signed-off-by: Nicolas Bravais Signed-off-by: Katrin Fischer Passes all tests and QA script. Tested with receiving and cancelling the receive process the filters are kept. Signed-off-by: Galen Charlton --- acqui/finishreceive.pl | 2 +- acqui/parcel.pl | 23 ++++++++++++++----- .../prog/en/modules/acqui/parcel.tt | 18 +++++++++++++++ 3 files changed, 36 insertions(+), 7 deletions(-) diff --git a/acqui/finishreceive.pl b/acqui/finishreceive.pl index aeb4394453..71bf90c43a 100755 --- a/acqui/finishreceive.pl +++ b/acqui/finishreceive.pl @@ -165,4 +165,4 @@ ModItem( $_ ) foreach GetItemnumbersFromOrder($new_ordernumber); -print $input->redirect("/cgi-bin/koha/acqui/parcel.pl?invoiceid=$invoiceid"); +print $input->redirect("/cgi-bin/koha/acqui/parcel.pl?invoiceid=$invoiceid&sticky_filters=1"); diff --git a/acqui/parcel.pl b/acqui/parcel.pl index ad0e51db09..94cf987646 100755 --- a/acqui/parcel.pl +++ b/acqui/parcel.pl @@ -71,6 +71,7 @@ use C4::Reserves qw/GetReservesFromBiblionumber/; use JSON; my $input=new CGI; +my $sticky_filters = $input->param('sticky_filters') || 0; sub get_value_with_gst_params { my $value = shift; @@ -214,12 +215,21 @@ push @book_foot_loop, map { $_ } values %foot; my @loop_orders = (); unless( defined $invoice->{closedate} ) { my $pendingorders; - if($op eq "search"){ - my $search = $input->param('summaryfilter') || ''; - my $ean = $input->param('eanfilter') || ''; - my $basketname = $input->param('basketfilter') || ''; - my $orderno = $input->param('orderfilter') || ''; - my $basketgroupname = $input->param('basketgroupnamefilter') || ''; + if ( $op eq "search" or $sticky_filters ) { + my ( $search, $ean, $basketname, $orderno, $basketgroupname ); + if ( $sticky_filters ) { + $search = $input->cookie("filter_parcel_summary"); + $ean = $input->cookie("filter_parcel_ean"); + $basketname = $input->cookie("filter_parcel_basketname"); + $orderno = $input->cookie("filter_parcel_orderno"); + $basketgroupname = $input->cookie("filter_parcel_basketgroupname"); + } else { + $search = $input->param('summaryfilter') || ''; + $ean = $input->param('eanfilter') || ''; + $basketname = $input->param('basketfilter') || ''; + $orderno = $input->param('orderfilter') || ''; + $basketgroupname = $input->param('basketgroupnamefilter') || ''; + } $pendingorders = SearchOrders({ booksellerid => $booksellerid, basketname => $basketname, @@ -324,5 +334,6 @@ $template->param( total_quantity => $total_quantity, total_gste => sprintf( "%.2f", $total_gste ), total_gsti => sprintf( "%.2f", $total_gsti ), + sticky_filters => $sticky_filters, ); output_html_with_http_headers $input, $cookie, $template->output; 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 9d5fae98a9..40f4118c0a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt @@ -6,12 +6,15 @@ [% INCLUDE 'doc-head-close.inc' %] [% INCLUDE 'datatables.inc' %] + [% INCLUDE 'greybox.inc' %]