Bugzilla – Attachment 24108 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.36 KB, created by
Biblibre Sandboxes
on 2014-01-10 09:33:36 UTC
(
hide
)
Description:
Bug 11141: Filters are not kept on receiving.
Filename:
MIME Type:
Creator:
Biblibre Sandboxes
Created:
2014-01-10 09:33:36 UTC
Size:
5.36 KB
patch
obsolete
>From 63530097c28810e6501903950a40fec2a990c6c1 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. > >Signed-off-by: Nicolas Bravais <nicolas.bravais@gmail.com> >--- > 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 aeb4394..71bf90c 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 ad0e51d..94cf987 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 9d5fae9..40f4118 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' %] > <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.dataTables.columnFilter.js"></script> >+<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, { >@@ -81,6 +84,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.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 11141
:
22412
|
24051
|
24108
|
24381
|
24536
|
24537