Bugzilla – Attachment 169335 Details for
Bug 34805
Add order search form to acq start page
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34805: Add order search form to acq start page
Bug-34805-Add-order-search-form-to-acq-start-page.patch (text/plain), 8.76 KB, created by
Owen Leonard
on 2024-07-22 17:28:36 UTC
(
hide
)
Description:
Bug 34805: Add order search form to acq start page
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2024-07-22 17:28:36 UTC
Size:
8.76 KB
patch
obsolete
>From 60f2d8504e10243a24fdd8badb8448ca8e7a36b8 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Fri, 14 Jun 2024 12:36:12 +0000 >Subject: [PATCH] Bug 34805: Add order search form to acq start page > >This patch adds the order search form to the Acquisitions home page. >I've modified acqui-home.pl so that it will pass the same default date >limiters as histsearch.pl. > >To test, apply the patch and go to Acquisitions. > >Test the order search form to confirm that it works as expected. Any >search from this version of the form should return identical results to >seraches performed from the "Advanced search" link in the sidebar. > >Sponsored-by: Athens County Public Libraries >--- > acqui/acqui-home.pl | 29 ++++++++++++------- > .../prog/en/includes/filter-orders.inc | 20 ++++++++++++- > .../prog/en/includes/html_helpers.inc | 18 ++++++++++++ > .../prog/en/modules/acqui/acqui-home.tt | 5 +++- > .../prog/en/modules/acqui/histsearch.tt | 22 ++------------ > 5 files changed, 61 insertions(+), 33 deletions(-) > >diff --git a/acqui/acqui-home.pl b/acqui/acqui-home.pl >index 07b1cce899..143983ca56 100755 >--- a/acqui/acqui-home.pl >+++ b/acqui/acqui-home.pl >@@ -36,6 +36,7 @@ use C4::Members; > use Koha::Acquisition::Currencies; > use Koha::Patrons; > use Koha::Suggestions; >+use Koha::DateUtils qw( dt_from_string ); > > my $query = CGI->new; > my ( $template, $loggedinuser, $cookie, $userflags ) = get_template_and_user( >@@ -117,18 +118,24 @@ foreach my $budget ( @{$budget_arr} ) { > push @budget_loop, $budget; > } > >+my $filters; >+$filters->{from_placed_on} = my $from_placed_on = dt_from_string; >+$filters->{to_placed_on} = my $to_placed_on = dt_from_string; >+$filters->{from_placed_on}->set_time_zone('floating')->subtract( years => 1 ); >+ > $template->param( >- type => 'intranet', >- loop_budget => \@budget_loop, >- total => $total, >- totspent => $totspent, >- totordered => $totordered, >- totcomtd => $totcomtd, >- totavail => $totavail, >- total_active => $total_active, >- totspent_active => $totspent_active, >- totordered_active => $totordered_active, >- totavail_active => $totavail_active, >+ type => 'intranet', >+ loop_budget => \@budget_loop, >+ total => $total, >+ totspent => $totspent, >+ totordered => $totordered, >+ totcomtd => $totcomtd, >+ totavail => $totavail, >+ total_active => $total_active, >+ totspent_active => $totspent_active, >+ totordered_active => $totordered_active, >+ totavail_active => $totavail_active, >+ filters => $filters, > ); > > my $cur = Koha::Acquisition::Currencies->get_active; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/filter-orders.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/filter-orders.inc >index d939531a26..4e06f42713 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/filter-orders.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/filter-orders.inc >@@ -1,6 +1,10 @@ > [% USE Koha %] > [% USE Branches %] > [% PROCESS 'html_helpers.inc' %] >+[% IF context == "main" %] >+ <div class="row"> >+ <div class="col-sm-6"> >+[% END %] > <ol> > <li><label for="title">Title: </label> <input type="text" name="title" id="title" value="[% filters.title | html %]" /></li> > <li><label for="author">Author: </label> <input type="text" name="author" id="author" value="[% filters.author | html %]" /></li> >@@ -26,6 +30,12 @@ > [% PROCESS options_for_libraries libraries => Branches.all(selected => '') %] > </select> > </li> >+[% IF context == "main" %] >+ </ol> >+ </div> >+ <div class="col-sm-6"> >+ <ol> >+[% END %] > <li><label for="booksellerinvoicenumber ">Vendor invoice number: </label> <input type="text" name="booksellerinvoicenumber" id="booksellerinvoicenumber" value="[% filters.booksellerinvoicenumber | html %]" /></li> > <li> > <label for="basketgroupname">Basket group:</label> >@@ -35,7 +45,9 @@ > <li> > <label for="ordernumber">Order line:</label> > <input type="text" name="ordernumber" id="ordernumber" value="[% filters.ordernumber | html %]" /> >- <label class="yesno" for="search_children_too"> >+ </li> >+ <li class="radio"> >+ <label for="search_children_too"> > [% IF filters.search_children_too %] > <input type="checkbox" name="search_children_too" id="search_children_too" value="1" checked="checked" /> > [% ELSE %] >@@ -84,6 +96,8 @@ > <option value="cancelled">Cancelled</option> > [% END %] > </select> >+ </li> >+ <li class="radio"> > <label class="yesno" for="is_standing"> > [% IF filters.is_standing %] > <input type="checkbox" name="is_standing" id="is_standing" value="1" checked="checked" /> >@@ -122,3 +136,7 @@ > <div class="hint">[% INCLUDE 'date-format.inc' %]</div> > </li> > </ol> >+[% IF context == "main" %] >+ </div> >+ </div> >+[% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc >index 872388b317..16b72ce2ae 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc >@@ -518,3 +518,21 @@ > </div> <!-- /.panel-body --> > </div> <!-- /.panel-collapse --> > [% END %] >+ >+[% BLOCK acquisitions_filter_form %] >+ <form action="/cgi-bin/koha/acqui/histsearch.pl" method="get"> >+ [% IF ( context == "sidebar" ) %] >+ <fieldset class="brief"> >+ <h4>Search orders</h4> >+ [% ELSE %] >+ <fieldset class="rows"> >+ <legend>Search orders</legend> >+ [% END %] >+ [% INCLUDE 'filter-orders.inc' context == context %] >+ <input type="hidden" name="do_search" value="1" /> >+ </fieldset> >+ <fieldset class="action"> >+ <input type="submit" class="btn btn-primary" value="Search" /> >+ </fieldset> >+ </form> >+[% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/acqui-home.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/acqui-home.tt >index b2d862f073..5255cfbd37 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/acqui-home.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/acqui-home.tt >@@ -53,7 +53,7 @@ > [% END %] > <div id="acqui_acqui_home_order"> > <fieldset> >- <legend>Manage orders</legend> >+ <legend>Search vendors</legend> > <form name="findsupplier" action="/cgi-bin/koha/acqui/booksellers.pl" method="get"> > <p><label for="supplierpage">Vendor: </label><input type="text" size="25" name="supplier" id="supplierpage" class="focus" /> > <input type="submit" class="btn btn-primary" value="Search" /> >@@ -87,6 +87,8 @@ > > </div> > >+[% PROCESS acquisitions_filter_form context => "main" %] >+ > [% IF ( loop_budget ) %] > > <div class="page-section"> >@@ -222,6 +224,7 @@ > </div> <!-- /.row --> > > [% MACRO jsinclude BLOCK %] >+ [% INCLUDE 'calendar.inc' %] > [% INCLUDE 'datatables.inc' %] > [% Asset.js("lib/jquery/plugins/treetable/jquery.treetable.js") | $raw %] > [% Asset.js("js/acquisitions-menu.js") | $raw %] >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 4c2e5b17fc..b12d7adf81 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/histsearch.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/histsearch.tt >@@ -59,7 +59,7 @@ > [% END %] > > [% UNLESS ( order_loop ) %] >- [% PROCESS filter_form context => "main" %] >+ [% PROCESS acquisitions_filter_form context => "main" %] > [% END %] > > >@@ -149,7 +149,7 @@ > <div class="col-sm-2 col-sm-pull-10"> > <aside> > [% IF ( order_loop ) %] >- [% PROCESS filter_form context => "sidebar" %] >+ [% PROCESS acquisitions_filter_form context => "sidebar" %] > [% END %] > [% INCLUDE 'acquisitions-menu.inc' %] > </aside> >@@ -201,22 +201,4 @@ > </script> > [% END %] > >-[% BLOCK filter_form %] >- <form action="/cgi-bin/koha/acqui/histsearch.pl" method="get"> >- [% IF ( context == "sidebar" ) %] >- <fieldset class="brief"> >- <h4>Search orders</h4> >- [% ELSE %] >- <fieldset class="rows"> >- <legend>Search orders</legend> >- [% END %] >- [% INCLUDE 'filter-orders.inc' %] >- <input type="hidden" name="do_search" value="1" /> >- </fieldset> >- <fieldset class="action"> >- <input type="submit" class="btn btn-primary" value="Search" /> >- </fieldset> >- </form> >-[% END %] >- > [% INCLUDE 'intranet-bottom.inc' %] >-- >2.39.2
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 34805
:
155899
|
169335
|
169392
|
170542
|
170543
|
171072
|
171073