Bugzilla – Attachment 22412 Details for
Bug 11141
Filters are not kept on receiving
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11141: Filters are not kept on receiving.
Bug-11141-Filters-are-not-kept-on-receiving.patch (text/plain), 5.37 KB, created by
Jonathan Druart
on 2013-10-25 14:48:11 UTC
(
hide
)
Description:
Bug 11141: Filters are not kept on receiving.
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2013-10-25 14:48:11 UTC
Size:
5.37 KB
patch
obsolete
>From c72088380fca7e6e44e7b457f5246757a592529f Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Fri, 25 Oct 2013 16:35:44 +0200 >Subject: [PATCH] Bug 11141: Filters are not kept on 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. >--- > acqui/finishreceive.pl | 2 +- > acqui/parcel.pl | 23 +++++++++++++++----- > .../intranet-tmpl/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 4196b52..71ff6b6 100755 >--- a/acqui/finishreceive.pl >+++ b/acqui/finishreceive.pl >@@ -141,7 +141,7 @@ if ($quantityrec > $origquantityrec ) { > > update_item( $_ ) foreach GetItemnumbersFromOrder( $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"); > > ################################ End of script ################################ > >diff --git a/acqui/parcel.pl b/acqui/parcel.pl >index 028e957..c88fe77 100755 >--- a/acqui/parcel.pl >+++ b/acqui/parcel.pl >@@ -70,6 +70,7 @@ use C4::Suggestions; > use JSON; > > my $input=new CGI; >+my $sticky_filters = $input->param('sticky_filters') || 0; > > sub get_value_with_gst_params { > my $value = shift; >@@ -203,12 +204,21 @@ push @book_foot_loop, map { $_ } values %foot; > my @loop_orders = (); > if(!defined $invoice->{closedate}) { > my $pendingorders; >- if($input->param('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, >@@ -313,5 +323,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 250cc96..dcb82ba 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt >@@ -4,12 +4,15 @@ > <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" /> > [% INCLUDE 'doc-head-close.inc' %] > [% INCLUDE 'datatables.inc' %] >+<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.cookie.min.js"></script> > [% INCLUDE 'greybox.inc' %] > <script type="text/javascript"> > //<![CDATA[ > > dt_overwrite_html_sorting_localeCompare(); > >+ var sticky_filters = [% sticky_filters %]; >+ > $(document).ready(function(){ > if ( $("#pendingt").length ) { > var pendingt = $("#pendingt").dataTable($.extend(true, {}, dataTablesDefaults, { >@@ -57,6 +60,21 @@ > } ) ); > } > >+ // Keep filters from finishreceive.pl to parcel.pl >+ $.cookie("filter_parcel_summary", $("#summaryfilter").val()); >+ $.cookie("filter_parcel_basketname", $("#basketfilter").val()); >+ $.cookie("filter_parcel_orderno", $("#orderfilter").val()); >+ $.cookie("filter_parcel_basketgroupname", $("#basketgroupnamefilter").val()); >+ $.cookie("filter_parcel_ean", $("#eanfilter").val()); >+ >+ $("#filterform").on('submit', function(){ >+ $.cookie("filter_parcel_summary", $("#summaryfilter").val()); >+ $.cookie("filter_parcel_basketname", $("#basketfilter").val()); >+ $.cookie("filter_parcel_orderno", $("#orderfilter").val()); >+ $.cookie("filter_parcel_basketgroupname", $("#basketgroupnamefilter").val()); >+ $.cookie("filter_parcel_ean", $("#eanfilter").val()); >+ }); >+ > }); > > // Case-insensitive version of jquery's contains function >-- >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 11141
:
22412
|
24051
|
24108
|
24381
|
24536
|
24537