Bug 21308: Results from order search do not show the search parameters
authorOwen Leonard <oleonard@myacpl.org>
Fri, 22 Feb 2019 13:26:01 +0000 (13:26 +0000)
committerNick Clemens <nick@bywatersolutions.com>
Fri, 19 Apr 2019 14:13:53 +0000 (14:13 +0000)
This patch modifies the orders search results page so that the search
form appears in the sidebar. This allows the user to view and re-use
their search parameters.

This patch also moves the "no search results" message to the top of the
page in a message box.

To test, apply the patch and go to Acquisitions -> Orders search.

 - Perform a search which will return results. In the sidebar you should
   see the full orders search form with your search parameters in the
   form fields.

 - Perform a search which will return no results. You should see the
   "Your search returned no results." message in a standard message
   dialog.

Signed-off-by: Bin Wen <bin.wen@inlibro.com>

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

koha-tmpl/intranet-tmpl/prog/en/includes/filter-orders.inc
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/histsearch.tt

index 42a3060..8cc68b5 100644 (file)
@@ -10,7 +10,7 @@
     <li><label for="name">Vendor: </label> <input type="text" name="name" id="name" value="[% filters.name | html %]" /></li>
     <li><label for="basket">Basket: </label> <input type="text" name="basket" id="basket" value="[% filters.basket | html %]" /></li>
     <li><label for="basket_creators">Basket created by: </label>
-        <input autocomplete="off" id="find_patron" type="text" style="width:150px" class="noEnterSubmit" />
+        <input autocomplete="off" id="find_patron" type="text" class="noEnterSubmit" />
         <div>
             <div id="basket_creators" style="float:left;"></div>
         </div>
index c925d73..f825331 100644 (file)
     <div class="row">
         <div class="col-sm-10 col-sm-push-2">
             <main>
+                [% IF !order_loop && search_done %]
+                    <div class="dialog message">
+                        Your search returned no results.
+                    </div>
+                [% END %]
+
+                [% UNLESS ( order_loop ) %]
+                    [% PROCESS filter_form context => "main" %]
+                [% END %]
+
 
-[% UNLESS ( order_loop ) %]<form action="/cgi-bin/koha/acqui/histsearch.pl" method="post">
-<fieldset class="rows">
-    <legend>Search orders</legend>
-    [% INCLUDE 'filter-orders.inc' %]
-</fieldset>
-    <input type="hidden" name="do_search" value="1" />
-       <fieldset class="action"><input type="submit" value="Search" /></fieldset>
-       </form>[% END %]
     [% IF ( order_loop ) %]<h1>Search results</h1>
        <div id="acqui_histsearch">
         <table id="histsearcht">
             </tbody>
         </table>
     </div>
-    [% ELSIF search_done %]
-      There is no order for this search.
     [% END %]
 
 </main>
 
 <div class="col-sm-2 col-sm-pull-10">
     <aside>
+        [% IF ( order_loop ) %]
+            [% PROCESS filter_form context => "sidebar" %]
+        [% END %]
         [% INCLUDE 'acquisitions-menu.inc' %]
     </aside>
 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
                 "sPaginationType": "four_button"
             }, columns_settings );
 
-            [% UNLESS order_loop %]
-                patron_autocomplete({
-                    patron_container: $("#basket_creators"),
-                    input_autocomplete: $("#find_patron"),
-                    patron_input_name: 'created_by',
-                    field_to_retrieve: 'borrowernumber'
-                });
-            [% END %]
+            patron_autocomplete({
+                patron_container: $("#basket_creators"),
+                input_autocomplete: $("#find_patron"),
+                patron_input_name: 'created_by',
+                field_to_retrieve: 'borrowernumber'
+            });
         });
     </script>
 [% END %]
 
+[% BLOCK filter_form %]
+    <form action="/cgi-bin/koha/acqui/histsearch.pl" method="post">
+        [% IF ( context == "sidebar" ) %]
+            <fieldset class="brief">
+                <h4>Search orders</h4>
+        [% ELSE %]
+            <fieldset class="rows">
+                <legend>Search orders</legend>
+        [% END %]
+            [% INCLUDE 'filter-orders.inc' %]
+        </fieldset>
+        <input type="hidden" name="do_search" value="1" />
+        <fieldset class="action"><input type="submit" value="Search" /></fieldset>
+    </form>
+[% END %]
+
 [% INCLUDE 'intranet-bottom.inc' %]