Bug 37148

Summary: Move the filter bar in the 'holds to pull' report from the bottom to the top of the table
Product: Koha Reporter: Andrew Auld <andrew.auld>
Component: CirculationAssignee: Jake Deery <jake.deery>
Status: Signed Off --- QA Contact: Nick Clemens (kidclamp) <nick>
Severity: minor    
Priority: P5 - low CC: anneli.osterman, cubingguy714, gmcharlt, helm.consortium, jake.deery, jonathan.druart, kyle.m.hall, martin.renvoize, nick, samalau
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function: holds
Attachments: Bug 37148: Moved filter bar to the top of Holds to Pull report table.
Bug 37148 - Move hold to pull column filters to top
Bug 37148 - Move hold to pull column filters to top
Bug 37148: [WIP] use built in table filtering
Bug 37148 - Move hold to pull column filters to top
Bug 37148 - Move hold to pull column filters to top

Description Andrew Auld 2024-06-21 10:13:30 UTC
The Holds to Pull report table of results has a filter bar which only appears at the end of each page of results. In systems where there are a lot of libraries/branches, this can mean scrolling a long way to allow the user to filter to show results from their library/branch, or to filter in another way.

Possibly related to Bug #35139 https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35139
Comment 1 Eric Garcia 2024-06-26 18:26:07 UTC
Created attachment 168175 [details] [review]
Bug 37148: Moved filter bar to the top of Holds to Pull report table.
Comment 2 Eric Garcia 2024-06-26 18:30:00 UTC
To Test:

1. Go to Circulation -> Holds to pull
2. Notice filter bar is at the bottom of the table.
3. Apply patch, restart_all
4. See filter bar at the top of the table.
Comment 3 Sam Lau 2024-06-26 21:13:43 UTC
Instead of putting the filters into the same <thead>, I recommend just doing a new <thead></thead> underneath the existing one and then putting the filter code in there. 

This makes everything less crowded and with the current patch, it's hard to see what you type in for some of the filters, specifically "Pull this many items".
Comment 4 Anneli Österman 2024-08-01 13:15:19 UTC
Looks like the patch breaks the Columns drop down menu of the Hold to pull report. After applying the patch to a sandbox, Columns menu only has the little check marks without the column names. I tried with two PTFS Europe's sandboxes.
Comment 5 Martin Renvoize (ashimema) 2024-08-23 12:17:56 UTC
We're going to resurrect this one
Comment 6 Jake Deery 2024-08-27 10:58:02 UTC
Created attachment 170759 [details] [review]
Bug 37148 - Move hold to pull column filters to top

This bug moves the column filters on the holds to pull page (pendingreserves.pl)
to the table header, similar to how it is being done on shelves.pl. This
should make it much clearer to users that filtering is possible, and also
make the filters float on the page, so they are always visible.

To test:
a)  apply half a dozen holds, with varying item types, shelving locations,
    holding branches, titles, and collections
b)  go to pendingreserves.pl
c)  notice that the filters are in the table's footer, and that you have
    to scroll down to see them
d)  APPLY PATCH
e)  notice that on pendingreserves.pl, the filters present in tfoot are
    now in thead
f)  notice that the filters are unchanged, aside from location on page
g)  notice that the filters now stick to the top of the page, like the
    headings did
h)  notice that the headings still change the sort order when clicked
i)  notice that the filter inputs all still work as expected
j)  SIGN OFF! :-)
Comment 7 Katrin Fischer 2024-08-27 11:58:58 UTC
Could we consider doing this to all tables with the filter options? 
I think they never really make sense at the bottom: when I have so many results I want to filter, I don't want to have to scroll down first.
Comment 8 Jake Deery 2024-08-27 12:09:11 UTC
Agreed; it seems silly to have them at the bottom. Let's get this signed-off, and then I can work on a separate omnibus bug for the rest of them?

Jake.
Comment 9 Martin Renvoize (ashimema) 2024-09-03 06:49:53 UTC
Do we need to obsolete the first patch here now Jake?
Comment 10 Martin Renvoize (ashimema) 2024-09-03 06:51:59 UTC
(In reply to Martin Renvoize from comment #9)
> Do we need to obsolete the first patch here now Jake?

Answer: Yes.. the new patch is a fresh patch.
Comment 11 Martin Renvoize (ashimema) 2024-09-03 06:56:26 UTC
Created attachment 170955 [details] [review]
Bug 37148 - Move hold to pull column filters to top

This bug moves the column filters on the holds to pull page (pendingreserves.pl)
to the table header, similar to how it is being done on shelves.pl. This
should make it much clearer to users that filtering is possible, and also
make the filters float on the page, so they are always visible.

To test:
a)  apply half a dozen holds, with varying item types, shelving locations,
    holding branches, titles, and collections
b)  go to pendingreserves.pl
c)  notice that the filters are in the table's footer, and that you have
    to scroll down to see them
d)  APPLY PATCH
e)  notice that on pendingreserves.pl, the filters present in tfoot are
    now in thead
f)  notice that the filters are unchanged, aside from location on page
g)  notice that the filters now stick to the top of the page, like the
    headings did
h)  notice that the headings still change the sort order when clicked
i)  notice that the filter inputs all still work as expected
j)  SIGN OFF! :-)

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 12 Martin Renvoize (ashimema) 2024-09-03 06:57:48 UTC
All works as described.. so signing off.

However, the commit message format is wrong.. remember to run the QA script against your patches Jake.. it'll highlight that sort of minor error (: instead of - please ;P )

I wonder about generalising as Katrin has asked.. though I can't entirely remember how these bits fit together right now.
Comment 13 Martin Renvoize (ashimema) 2024-09-03 07:08:29 UTC
So.. we actually already have the 'add_filters' option available to us in the KohaTable component.. however for some reason it doesn't work as expected for this table.

I think this patch is OK as is.. but we could investigate why it doesn't work here if we wanted..  or just not worry and leave it to the ajax tables when that eventually rolls around to this particular case?
Comment 14 Jake Deery 2024-09-03 10:09:54 UTC
Ah, nicely spotted — you might need to show me where to find those QA scripts and the best options to use :-)
Comment 15 Nick Clemens (kidclamp) 2024-10-01 15:02:55 UTC
Created attachment 172279 [details] [review]
Bug 37148: [WIP] use built in table filtering
Comment 16 Nick Clemens (kidclamp) 2024-10-01 15:04:15 UTC
Created attachment 172280 [details] [review]
Bug 37148 - Move hold to pull column filters to top

This bug moves the column filters on the holds to pull page (pendingreserves.pl)
to the table header, similar to how it is being done on shelves.pl. This
should make it much clearer to users that filtering is possible, and also
make the filters float on the page, so they are always visible.

To test:
a)  apply half a dozen holds, with varying item types, shelving locations,
    holding branches, titles, and collections
b)  go to pendingreserves.pl
c)  notice that the filters are in the table's footer, and that you have
    to scroll down to see them
d)  APPLY PATCH
e)  notice that on pendingreserves.pl, the filters present in tfoot are
    now in thead
f)  notice that the filters are unchanged, aside from location on page
g)  notice that the filters now stick to the top of the page, like the
    headings did
h)  notice that the headings still change the sort order when clicked
i)  notice that the filter inputs all still work as expected
j)  SIGN OFF! :-)

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 17 Nick Clemens (kidclamp) 2024-10-01 15:05:10 UTC
I got the built in filters to show, but styling was wrong and no branch dropdown - PQA here - having good instructions on how to add filters would be nice
Comment 18 Martin Renvoize (ashimema) 2024-10-02 09:30:45 UTC
Yeah, it's an odd case.. I'm not at all sure why the built in filters aren't working nicely in this particular table.

I think this is an OK middle ground for now, but I'd love to understand what's going on later.
Comment 19 Jonathan Druart 2024-10-02 13:40:20 UTC
+    [% IF print %]
+        <script>
+            $( document ).ready(function() {
+                window.print();
+                window.onafterprint = function () {+                    window.close();
+                }
+                setTimeout('window.close()', 1000); // Hack for Chrome < 63
+            });
+        </script>
+    [% END #/print %]

Why do we have this?
Comment 20 Jonathan Druart 2024-10-02 13:44:09 UTC
(In reply to Nick Clemens (kidclamp) from comment #15)
> Created attachment 172279 [details] [review] [review]
> Bug 37148: [WIP] use built in table filtering

What's wrong exactly with this patch? Why is the styling wrong?

We cannot add the dropdown in the column filters with KohaTable (columns_settings.inc), only using kohaTable (datatables.js, ie. when using the REST API)
Comment 21 Katrin Fischer 2024-10-11 09:53:20 UTC
Can you please take a look at Jonathan's comments? Thanks!
Comment 22 Jake Deery 2024-10-24 14:21:43 UTC
Created attachment 173272 [details] [review]
Bug 37148 - Move hold to pull column filters to top

This bug moves the column filters on the holds to pull page (pendingreserves.pl)
to the table header, similar to how it is being done on shelves.pl. This
should make it much clearer to users that filtering is possible, and also
make the filters float on the page, so they are always visible.

To test:
a)  apply half a dozen holds, with varying item types, shelving locations,
    holding branches, titles, and collections
b)  go to pendingreserves.pl
c)  notice that the filters are in the table's footer, and that you have
    to scroll down to see them
d)  APPLY PATCH
e)  notice that on pendingreserves.pl, the filters present in tfoot are
    now in thead
f)  notice that the filters are unchanged, aside from location on page
g)  notice that the filters now stick to the top of the page, like the
    headings did
h)  notice that the headings still change the sort order when clicked
i)  notice that the filter inputs all still work as expected
j)  SIGN OFF! :-)

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 23 Jake Deery 2024-10-24 14:23:13 UTC
(In reply to Jonathan Druart from comment #19)
> +    [% IF print %]
> +        <script>
> +            $( document ).ready(function() {
> +                window.print();
> +                window.onafterprint = function () {+                   
> window.close();
> +                }
> +                setTimeout('window.close()', 1000); // Hack for Chrome < 63
> +            });
> +        </script>
> +    [% END #/print %]
> 
> Why do we have this?

I don't think we do anymore, actually. I think it is obsolete, so I have removed it. Thanks :-)

Jake.