Bug 29058: Add 'Always show holds' checkbox to request.pl
authorNick Clemens <nick@bywatersolutions.com>
Mon, 20 Sep 2021 11:17:50 +0000 (11:17 +0000)
committerFridolin Somers <fridolin.somers@biblibre.com>
Tue, 1 Feb 2022 07:55:39 +0000 (21:55 -1000)
commit0d103c2342756a0020b95d7f7cafb9a5d2ce4b1c
tree5941f5b272d23e53341865a7aac35ee474296626
parentbb3573d58f89fb484c903a710573862e429ad4e7
Bug 29058: Add 'Always show holds' checkbox to request.pl

This patch adds a new cookie 'awalys_show_holds' and utlises it on request.pl
to determine if the existing holds table should be loaded.

If the cookie does not exist, the table is loaded to preserve exiting behaviour.
If the cookie exists and is set to 'DONT' a new button 'Show holds' is added to
the page to allow force loading the table

To test:
1 - Place some holds on a record
2 - Click 'Holds' tab or 'Place a hold' from details page
3 - Note search box to place hold and table of existing holds
4 - Apply patch
5 - Reload the holds page and note new checkbox 'Always show holds'
6 - Confirm the box is checked
7 - Uncheck it
8 - Reload the page and confirm holds do not automatically load
9 - Click the new 'Show holds' button
10 - Confirm the existing holds load, and that 'Always show holds' is unchecked
11 - Check 'Always show holds'
12 - Reload page and confirm holds don't show
13 - Uncheck the box, load holds for another record, confirm it remains unchecked
14 - Bring up browser console (F12)
15 - In 'Storage' tab, under 'Cookies', delete the cookie for 'always_show_holds'
16 - Reload holds page, confirm holds load and check box is checked

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Bug 29058: (follow-up) Add hold count and don't display show options if no holds

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt
reserve/request.pl