Bug 33575 - Add table settings to the holds table for a specific record in the staff interface
Summary: Add table settings to the holds table for a specific record in the staff inte...
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Lucas Gass (lukeg)
QA Contact: Katrin Fischer
URL:
Keywords:
Depends on:
Blocks: 35483 35306 36439
  Show dependency treegraph
 
Reported: 2023-04-20 15:45 UTC by Lucas Gass (lukeg)
Modified: 2024-10-04 15:45 UTC (History)
10 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
23.11.00
Circulation function:


Attachments
Bug 33575: Add dataTable to hold table on /reserve/request.tt (35.81 KB, patch)
2023-04-20 15:56 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 33575: (follow-up) don't allow priority and pickup location to be hidden (2.19 KB, patch)
2023-04-21 14:20 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 33575: Add dataTable to hold table on /reserve/request.tt (35.88 KB, patch)
2023-04-25 11:27 UTC, PTFS Europe Sandboxes
Details | Diff | Splinter Review
Bug 33575: (follow-up) don't allow priority and pickup location to be hidden (2.26 KB, patch)
2023-04-25 11:27 UTC, PTFS Europe Sandboxes
Details | Diff | Splinter Review
Bug 33575: Add dataTable to hold table on /reserve/request.tt (35.93 KB, patch)
2023-05-09 22:20 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 33575: (follow-up) don't allow priority and pickup location to be hidden (2.31 KB, patch)
2023-05-09 22:20 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 33575: (QA follow-up) Fix date sorting on Date column (1.40 KB, patch)
2023-05-09 22:20 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 33575: Add dataTable to hold table on /reserve/request.tt (37.25 KB, patch)
2023-10-31 20:37 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 33575: (follow-up) don't allow priority and pickup location to be hidden (2.32 KB, patch)
2023-10-31 20:37 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 33575: (QA follow-up) Fix date sorting on Date column (1.41 KB, patch)
2023-10-31 20:37 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Lucas Gass (lukeg) 2023-04-20 15:45:32 UTC
Some libraries who have lots of holds on a single bib would like to be able to sort/search/filter that table. We should make it a dataTable with table settings.
Comment 1 Lucas Gass (lukeg) 2023-04-20 15:56:03 UTC
Created attachment 149970 [details] [review]
Bug 33575: Add dataTable to hold table on /reserve/request.tt

To test:
1. Have a record with several holds on it.
2. Go to the holds page for that record ( /cgi-bin/koha/reserve/request.pl?biblionumber=144 )
3. Cannot sort by columns
4. Apply patch, restart_all
5. Now the table should be a dataTable that will allow you sort.
6. Try hiding columns by clicking on the 'Columns' icon above the table, make sure columns are correctly being hidden.
7. Try to hide columns by going to Adminstration > Table settings ( Circulation > Holds > patron_holds_table ), make sure columns are correctly being hidden.
8. Now login with a user who has the 'place_holds' permission but does NOT have the 'modify_holds_priority' permssion.
9. The table will not have the change priority columns. Make sure all columns can still be hidden/shown correctly for that use.
Comment 2 Sally 2023-04-21 08:53:05 UTC
This is a brilliant idea, Lucas - adding configuration to the request.pl table is super helpful, and I'd love to see this patch in Koha.

It works well on testing:

- The dataTable works as expected; I am able to hide columns using the controls on the page

- The dataTable configuration works as expected; I am able to change settings (hidden by default, cannot be toggled) in the administration screen and they're correctly reflected on the dataTable - and these changes are remembered when the page reloads after submitting a change

- Logging in as a staff member without the modify_holds_priority permission works as described

The only issue is that there's a couple of columns which I think need to be set as default as visible / cannot be toggled, the same as the checkbox.  

They are: Priority and Pickup Library

Priority

When you hide Priority and submit any changes, the page redirects to: /cgi-bin/koha/reserve/request.pl / Place a hold on No title - instead of reloading the page you were on

Pickup library

When you hide Pickup library and submit any changes, Koha throws an error:  [You must supply a pickup location when placing a hold] at /usr/share/perl5/Exception/Class/Base.pm line 88 

If those two changes can be made, I can sign off. :)
Comment 3 Lucas Gass (lukeg) 2023-04-21 14:20:07 UTC
Created attachment 150041 [details] [review]
Bug 33575: (follow-up) don't allow priority and pickup location to be hidden
Comment 4 Lucas Gass (lukeg) 2023-04-21 14:23:05 UTC
Sally, thanks for your testing! I have provided a follow-up so you cannot hide the priority or pickup location columns. 

I also added a hidden span to the set lowest priority <th> so that when you try to hide/show the columns using the button above the table you will see the name of the column.
Comment 5 PTFS Europe Sandboxes 2023-04-25 11:27:29 UTC
Created attachment 150187 [details] [review]
Bug 33575: Add dataTable to hold table on /reserve/request.tt

To test:
1. Have a record with several holds on it.
2. Go to the holds page for that record ( /cgi-bin/koha/reserve/request.pl?biblionumber=144 )
3. Cannot sort by columns
4. Apply patch, restart_all
5. Now the table should be a dataTable that will allow you sort.
6. Try hiding columns by clicking on the 'Columns' icon above the table, make sure columns are correctly being hidden.
7. Try to hide columns by going to Adminstration > Table settings ( Circulation > Holds > patron_holds_table ), make sure columns are correctly being hidden.
8. Now login with a user who has the 'place_holds' permission but does NOT have the 'modify_holds_priority' permssion.
9. The table will not have the change priority columns. Make sure all columns can still be hidden/shown correctly for that use.

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Comment 6 PTFS Europe Sandboxes 2023-04-25 11:27:31 UTC
Created attachment 150188 [details] [review]
Bug 33575: (follow-up) don't allow priority and pickup location to be hidden

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Comment 7 Sally 2023-04-25 11:29:49 UTC
Brilliant, Lucas - works perfectly!  This is a really useful patch :)
Comment 8 Katrin Fischer 2023-05-09 22:20:26 UTC
Created attachment 150915 [details] [review]
Bug 33575: Add dataTable to hold table on /reserve/request.tt

To test:
1. Have a record with several holds on it.
2. Go to the holds page for that record ( /cgi-bin/koha/reserve/request.pl?biblionumber=144 )
3. Cannot sort by columns
4. Apply patch, restart_all
5. Now the table should be a dataTable that will allow you sort.
6. Try hiding columns by clicking on the 'Columns' icon above the table, make sure columns are correctly being hidden.
7. Try to hide columns by going to Adminstration > Table settings ( Circulation > Holds > patron_holds_table ), make sure columns are correctly being hidden.
8. Now login with a user who has the 'place_holds' permission but does NOT have the 'modify_holds_priority' permssion.
9. The table will not have the change priority columns. Make sure all columns can still be hidden/shown correctly for that use.

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 9 Katrin Fischer 2023-05-09 22:20:28 UTC
Created attachment 150916 [details] [review]
Bug 33575: (follow-up) don't allow priority and pickup location to be hidden

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 10 Katrin Fischer 2023-05-09 22:20:31 UTC
Created attachment 150917 [details] [review]
Bug 33575: (QA follow-up) Fix date sorting on Date column

Implements correct date sorting for different date formats on the Date column.

See:
https://wiki.koha-community.org/wiki/DataTables_HowTo#Sorting_dates_regardless_of_date_format_preference
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 11 Lucas Gass (lukeg) 2023-10-31 20:37:20 UTC
Created attachment 158161 [details] [review]
Bug 33575: Add dataTable to hold table on /reserve/request.tt

To test:
1. Have a record with several holds on it.
2. Go to the holds page for that record ( /cgi-bin/koha/reserve/request.pl?biblionumber=144 )
3. Cannot sort by columns
4. Apply patch, restart_all
5. Now the table should be a dataTable that will allow you sort.
6. Try hiding columns by clicking on the 'Columns' icon above the table, make sure columns are correctly being hidden.
7. Try to hide columns by going to Adminstration > Table settings ( Circulation > Holds > patron_holds_table ), make sure columns are correctly being hidden.
8. Now login with a user who has the 'place_holds' permission but does NOT have the 'modify_holds_priority' permssion.
9. The table will not have the change priority columns. Make sure all columns can still be hidden/shown correctly for that use.

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 12 Lucas Gass (lukeg) 2023-10-31 20:37:23 UTC
Created attachment 158162 [details] [review]
Bug 33575: (follow-up) don't allow priority and pickup location to be hidden

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 13 Lucas Gass (lukeg) 2023-10-31 20:37:25 UTC
Created attachment 158163 [details] [review]
Bug 33575: (QA follow-up) Fix date sorting on Date column

Implements correct date sorting for different date formats on the Date column.

See:
https://wiki.koha-community.org/wiki/DataTables_HowTo#Sorting_dates_regardless_of_date_format_preference
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 14 Lucas Gass (lukeg) 2023-10-31 20:38:07 UTC
Rebased for current master and resetting to PQA.
Comment 15 Tomás Cohen Arazi (tcohen) 2023-11-01 20:26:32 UTC
Pushed to master for 23.11.

Nice work everyone, thanks!
Comment 16 Fridolin Somers 2023-11-08 08:47:31 UTC
Enhancement not pushed to 23.05.x
Comment 17 lasse.pouru 2024-03-08 10:13:48 UTC
Is there a reason why pagination is explicitly turned off ("bPaginate":false)?
Comment 18 Aude Charillon 2024-04-19 11:40:59 UTC
Documented by Caroline Cyr La Rose (a few months ago)
Comment 19 Michael Adamyk 2024-10-04 15:45:53 UTC
Once a holds table has been sorted by another column (Patron, Date, etc) it won't allow you to re-sort the table by the original "Priority" column. The column header arrow turns blue like it has sorted, but the sort doesn't actually change. 

The only way to "reset" the view to seeing the list by priority is to refresh the page. Is that a bug, or intended?