Bugzilla – Attachment 77513 Details for
Bug 15184
Ability to duplicate existing order lines to a given basket
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15184: Prepare the ground - Move order search filters
Bug-15184-Prepare-the-ground---Move-order-search-f.patch (text/plain), 16.74 KB, created by
Jonathan Druart
on 2018-08-06 21:17:34 UTC
(
hide
)
Description:
Bug 15184: Prepare the ground - Move order search filters
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2018-08-06 21:17:34 UTC
Size:
16.74 KB
patch
obsolete
>From 85ff1e642da15df6b6b0348e73f6b916436f4db3 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 27 Jul 2018 15:46:32 -0300 >Subject: [PATCH] Bug 15184: Prepare the ground - Move order search filters > >We are going to reuse these filters so we move it to a separate include >file. > >Sponsored-by: BULAC - http://www.bulac.fr/ >--- > acqui/histsearch.pl | 87 +++++++------------ > .../prog/en/includes/filter-orders.inc | 96 +++++++++++++++++++++ > .../prog/en/modules/acqui/histsearch.tt | 98 +--------------------- > 3 files changed, 128 insertions(+), 153 deletions(-) > create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/filter-orders.inc > >diff --git a/acqui/histsearch.pl b/acqui/histsearch.pl >index b30eda31dd..663ab604ae 100755 >--- a/acqui/histsearch.pl >+++ b/acqui/histsearch.pl >@@ -59,27 +59,7 @@ use C4::Koha; > use Koha::DateUtils; > > my $input = new CGI; >-my $title = $input->param( 'title'); >-my $author = $input->param('author'); >-my $isbn = $input->param('isbn'); >-my $name = $input->param( 'name' ); >-my $ean = $input->param('ean'); >-my $basket = $input->param( 'basket' ); >-my $basketgroupname = $input->param('basketgroupname'); >-my $booksellerinvoicenumber = $input->param( 'booksellerinvoicenumber' ); > my $do_search = $input->param('do_search') || 0; >-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->multi_param('created_by'); >- >-my $from_placed_on = eval { dt_from_string( scalar $input->param('from') ) } || dt_from_string; >-my $to_placed_on = eval { dt_from_string( scalar $input->param('to') ) } || dt_from_string; >-unless ( $input->param('from') ) { >- # Fill the form with year-1 >- $from_placed_on->subtract( years => 1 ); >-} > > my $dbh = C4::Context->dbh; > my ( $template, $loggedinuser, $cookie ) = get_template_and_user( >@@ -93,26 +73,35 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( > } > ); > >+my $filters = { >+ basket => scalar $input->param('basket'), >+ title => scalar $input->param('title'), >+ author => scalar $input->param('author'), >+ isbn => scalar $input->param('isbn'), >+ name => scalar $input->param('name'), >+ ean => scalar $input->param('ean'), >+ basketgroupname => scalar $input->param('basketgroupname'), >+ budget => scalar $input->param('budget'), >+ booksellerinvoicenumber => scalar $input->param('booksellerinvoicenumber'), >+ budget => scalar $input->param('budget'), >+ orderstatus => scalar $input->param('orderstatus'), >+ ordernumber => scalar $input->param('ordernumber'), >+ search_children_too => scalar $input->param('search_children_too'), >+ created_by => scalar $input->multi_param('created_by'), >+}; >+my $from_placed_on = eval { dt_from_string( scalar $input->param('from') ) } || dt_from_string; >+my $to_placed_on = eval { dt_from_string( scalar $input->param('to') ) } || dt_from_string; >+unless ( $input->param('from') ) { >+ # Fill the form with year-1 >+ $from_placed_on->subtract( years => 1 ); >+} >+$filters->{from_placed_on} = output_pref( { dt => $from_placed_on, dateformat => 'iso', dateonly => 1 } ), >+$filters->{to_placed_on} = output_pref( { dt => $to_placed_on, dateformat => 'iso', dateonly => 1 } ), >+ > my $order_loop; > # If we're supplied any value then we do a search. Otherwise we don't. > if ($do_search) { >- $order_loop = GetHistory( >- title => $title, >- author => $author, >- isbn => $isbn, >- ean => $ean, >- name => $name, >- from_placed_on => output_pref( { dt => $from_placed_on, dateformat => 'iso', dateonly => 1 } ), >- to_placed_on => output_pref( { dt => $to_placed_on, dateformat => 'iso', dateonly => 1 } ), >- basket => $basket, >- booksellerinvoicenumber => $booksellerinvoicenumber, >- basketgroupname => $basketgroupname, >- budget => $budget, >- orderstatus => $orderstatus, >- ordernumber => $ordernumber, >- search_children_too => $search_children_too, >- created_by => \@created_by, >- ); >+ $order_loop = GetHistory(%$filters); > } > > my $budgetperiods = C4::Budgets::GetBudgetPeriods; >@@ -126,26 +115,10 @@ for my $bp ( @{$budgetperiods} ) { > } > > $template->param( >- order_loop => $order_loop, >- numresults => $order_loop ? scalar(@$order_loop) : undef, >- title => $title, >- author => $author, >- isbn => $isbn, >- ean => $ean, >- name => $name, >- basket => $basket, >- booksellerinvoicenumber => $booksellerinvoicenumber, >- basketgroupname => $basketgroupname, >- ordernumber => $ordernumber, >- search_children_too => $search_children_too, >- from_placed_on => $from_placed_on, >- to_placed_on => $to_placed_on, >- orderstatus => $orderstatus, >- budget_id => $budget, >- bp_loop => $bp_loop, >- search_done => $do_search, >- debug => $debug || $input->param('debug') || 0, >- uc(C4::Context->preference("marcflavour")) => 1 >+ order_loop => $order_loop, >+ filters => $filters, >+ bp_loop => $bp_loop, >+ search_done => $do_search, > ); > > output_html_with_http_headers $input, $cookie, $template->output; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/filter-orders.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/filter-orders.inc >new file mode 100644 >index 0000000000..cb4840bf9f >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/filter-orders.inc >@@ -0,0 +1,96 @@ >+[% USE Koha %] >+<ol> >+ <li><label for="title">Title: </label> <input type="text" name="title" id="title" value="[% filters.title %]" /></li> >+ <li><label for="author">Author: </label> <input type="text" name="author" id="author" value="[% filters.author %]" /></li> >+ <li><label for="isbn">ISBN: </label> <input type="text" name="isbn" id="isbn" value="[% filters.isbn %]" /></li> >+ [% IF Koha.Preference('marcflavour') == 'UNIMARC' %] >+ <li><label for="ean">EAN: </label> <input type="text" name="ean" id="ean" value="[% filters.ean %]" /></li> >+ [% END %] >+ <li><label for="name">Vendor: </label> <input type="text" name="name" id="name" value="[% filters.name %]" /></li> >+ <li><label for="basket">Basket: </label> <input type="text" name="basket" id="basket" value="[% filters.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="[% filters.booksellerinvoicenumber %]" /></li> >+ <li> >+ <label for="basketgroupname">Basket group:</label> >+ <input type="text" name="basketgroupname" id="basketgroupname" value="[% filters.basketgroupname %]" /> >+ </li> >+ <li> >+ <label for="ordernumber">Order line:</label> >+ <input type="text" name="ordernumber" id="ordernumber" value="[% filters.ordernumber %]" /> >+ [% IF filters.search_children_too %] >+ <input type="checkbox" name="search_children_too" id="search_children_too" value="1" checked="checked" /> >+ [% ELSE %] >+ <input type="checkbox" name="search_children_too" id="search_children_too" value="1" /> >+ [% END %] >+ <label class="yesno" for="search_children_too">Display children too.</label> >+ </li> >+ >+ <li> >+ <label for="orderstatus">Order status: </label> >+ <select name="orderstatus" id="orderstatus"> >+ [% IF filters.orderstatus == "" %] >+ <option value="">Any status except cancelled</option> >+ [% ELSE %] >+ <option value="" selected="selected"></option> >+ [% END %] >+ [% IF filters.orderstatus == "new" %] >+ <option value="new" selected="selected">New</option> >+ [% ELSE %] >+ <option value="new">New</option> >+ [% END %] >+ [% IF filters.orderstatus == "ordered" %] >+ <option value="ordered" selected="selected">Ordered</option> >+ [% ELSE %] >+ <option value="ordered">Ordered</option> >+ [% END %] >+ [% IF filters.orderstatus == "partial" %] >+ <option value="partial" selected="selected">Partially received</option> >+ [% ELSE %] >+ <option value="partial">Partially received</option> >+ [% END %] >+ [% IF filters.orderstatus == "complete" %] >+ <option value="complete" selected="selected">Received</option> >+ [% ELSE %] >+ <option value="complete">Received</option> >+ [% END %] >+ [% IF filters.orderstatus == "cancelled" %] >+ <option value="cancelled" selected="selected">Cancelled</option> >+ [% ELSE %] >+ <option value="cancelled">Cancelled</option> >+ [% END %] >+ </select> >+ </li> >+ <li> >+ <label for="fund">Fund: </label> >+ <select name="budget" id="fund"> >+ <option value="">All funds</option> >+ [% FOREACH bp_loo IN bp_loop %] >+ <optgroup label="[% bp_loo.budget_period_description %]"> >+ [% FOREACH h_loo IN bp_loo.hierarchy %] >+ [% IF h_loo.budget_id == filters.budget %] >+ <option type="text" value="[% h_loo.budget_id %]" branchcode="[% h_loo.budget_branchcode %]" selected="selected"> >+ [% ELSE %] >+ <option type="text" value="[% h_loo.budget_id %]" branchcode="[% h_loo.budget_branchcode %]"> >+ [% END %] >+ [% h_loo.budget_display_name %] >+ </option> >+ [% END %] >+ </optgroup> >+ [% END %] >+ </select> >+ </li> >+ >+ <li><label for="from">From: </label> >+ <input type="text" size="10" id="from" name="from" value="[% filters.from_placed_on | $KohaDates %]" class="datepickerfrom" /> >+ <div class="hint">[% INCLUDE 'date-format.inc' %]</div> >+ </li> >+ <li><label for="to">To: </label> >+ <input type="text" size="10" id="to" name="to" value="[% filters.to_placed_on | $KohaDates %]" class="datepickerto" /> >+ <div class="hint">[% INCLUDE 'date-format.inc' %]</div> >+ </li> >+</ol> >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 8499d907ca..321c6a5633 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/histsearch.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/histsearch.tt >@@ -22,102 +22,8 @@ > [% UNLESS ( order_loop ) %]<form action="/cgi-bin/koha/acqui/histsearch.pl" method="post"> > <fieldset class="rows"> > <legend>Search orders</legend> >- <ol> >- <li><label for="title">Title: </label> <input type="text" name="title" id="title" value="[% title %]" /></li> >- <li><label for="author">Author: </label> <input type="text" name="author" id="author" value="[% author %]" /></li> >- <li><label for="isbn">ISBN: </label> <input type="text" name="isbn" id="isbn" value="[% isbn %]" /></li> >- [% IF (UNIMARC) %] >- <li><label for="ean">EAN: </label> <input type="text" name="ean" id="ean" value="[% ean %]" /></li> >- [% 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> >- <input type="text" name="basketgroupname" id="basketgroupname" value="[% basketgroupname %]" /> >- </li> >- <li> >- <label for="ordernumber">Order line:</label> >- <input type="text" name="ordernumber" id="ordernumber" value="[% ordernumber %]" /> >- [% IF search_children_too %] >- <input type="checkbox" name="search_children_too" id="search_children_too" value="1" checked="checked" /> >- [% ELSE %] >- <input type="checkbox" name="search_children_too" id="search_children_too" value="1" /> >- [% END %] >- <label class="yesno" for="search_children_too">Display children too.</label> >- </li> >- >- <li> >- <label for="orderstatus">Order status: </label> >- <select name="orderstatus" id="orderstatus"> >- [% IF orderstatus == "" %] >- <option value="">Any status except cancelled</option> >- [% ELSE %] >- <option value="" selected="selected"></option> >- [% END %] >- [% IF orderstatus == "new" %] >- <option value="new" selected="selected">New</option> >- [% ELSE %] >- <option value="new">New</option> >- [% END %] >- [% IF orderstatus == "ordered" %] >- <option value="ordered" selected="selected">Ordered</option> >- [% ELSE %] >- <option value="ordered">Ordered</option> >- [% END %] >- [% IF orderstatus == "partial" %] >- <option value="partial" selected="selected">Partially received</option> >- [% ELSE %] >- <option value="partial">Partially received</option> >- [% END %] >- [% IF orderstatus == "complete" %] >- <option value="complete" selected="selected">Received</option> >- [% ELSE %] >- <option value="complete">Received</option> >- [% END %] >- [% IF orderstatus == "cancelled" %] >- <option value="cancelled" selected="selected">Cancelled</option> >- [% ELSE %] >- <option value="cancelled">Cancelled</option> >- [% END %] >- </select> >- </li> >- <li> >- <label for="fund">Fund: </label> >- <select name="budget" id="fund"> >- <option value="">All funds</option> >- [% FOREACH bp_loo IN bp_loop %] >- <optgroup label="[% bp_loo.budget_period_description %]"> >- [% FOREACH h_loo IN bp_loo.hierarchy %] >- [% IF h_loo.budget_id == budget_id %] >- <option type="text" value="[% h_loo.budget_id %]" branchcode="[% h_loo.budget_branchcode %]" selected="selected"> >- [% ELSE %] >- <option type="text" value="[% h_loo.budget_id %]" branchcode="[% h_loo.budget_branchcode %]"> >- [% END %] >- [% h_loo.budget_display_name %] >- </option> >- [% END %] >- </optgroup> >- [% END %] >- </select> >- </li> >- >- <li><label for="from">From: </label> >- <input type="text" size="10" id="from" name="from" value="[% from_placed_on | $KohaDates %]" class="datepickerfrom" /> >- <div class="hint">[% INCLUDE 'date-format.inc' %]</div> >- </li> >- <li><label for="to">To: </label> >- <input type="text" size="10" id="to" name="to" value="[% to_placed_on | $KohaDates %]" class="datepickerto" /> >- <div class="hint">[% INCLUDE 'date-format.inc' %]</div> >- </li> >- </ol> >- </fieldset> >+ [% INCLUDE 'filter-orders.inc' %] >+</fieldset> > <input type="hidden" name="do_search" value="1" /> > <fieldset class="action"><input type="submit" value="Search" /></fieldset> > </form>[% END %] >-- >2.11.0
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 15184
:
77314
|
77315
|
77316
|
77317
|
77318
|
77513
|
77514
|
77515
|
77516
|
77517
|
77966
|
77967
|
77968
|
77969
|
77970
|
78074
|
78075
|
78076
|
78077
|
78078
|
78277
|
78278
|
78279
|
78280
|
78281
|
78282
|
78283
|
78284
|
78285
|
78340
|
78535
|
78536
|
78537
|
78538
|
78539
|
78697
|
78698
|
78699
|
78700
|
78701
|
78702
|
78703
|
78704
|
78705
|
78706
|
78898
|
78911
|
78927
|
78958
|
78959
|
78960
|
78961
|
78962
|
78963
|
78964
|
78965
|
78966
|
78967
|
78968
|
78969
|
78970
|
80485
|
80486
|
80487
|
80488
|
80489
|
80490
|
80491
|
80492
|
80493
|
80494
|
80495
|
80638
|
81435
|
81436
|
81437
|
81438
|
81439
|
81440
|
81441
|
81442
|
81443
|
81444
|
81445
|
81446
|
81447
|
81448
|
82079