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.
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.
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. :)
Created attachment 150041 [details] [review] Bug 33575: (follow-up) don't allow priority and pickup location to be hidden
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.
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>
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>
Brilliant, Lucas - works perfectly! This is a really useful patch :)
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>
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>
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>
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>
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>
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>
Rebased for current master and resetting to PQA.
Pushed to master for 23.11. Nice work everyone, thanks!
Enhancement not pushed to 23.05.x
Is there a reason why pagination is explicitly turned off ("bPaginate":false)?
Documented by Caroline Cyr La Rose (a few months ago)
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?