Bug 36064

Summary: Add Holds with cancellation requests info to intranet-main page
Product: Koha Reporter: Lucas Gass <lucas>
Component: Hold requestsAssignee: Lucas Gass <lucas>
Status: Signed Off --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: barbara.johnson, cbrannon, david, gmcharlt
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
This enhancement adds a "Holds with cancellation requests: X" link to the staff interface home page. This makes it more visible to librarians that patrons have made cancellation requests, and action them (where patrons have the ability to cancel holds).
Version(s) released in:
Bug Depends on: 22456    
Bug Blocks:    
Attachments: Bug 36064: Add holds with cancellation request info to staff interface main page
Bug 36064: Add holds with cancellation request info to staff interface main page
Bug 36064: Add holds with cancellation request info to staff interface main page
Bug 36064: (follow-up) Activate correct tab
Bug 36064: Add holds with cancellation request info to staff interface main page
Bug 36064: (follow-up) Activate correct tab
Bug 36064: Add holds with cancellation request info to staff interface main page
Bug 36064: (follow-up) Activate correct tab
Bug 36064: Add holds with cancellation request info to staff interface main page
Bug 36064: (follow-up) Activate correct tab
Bug 36064: Add holds with cancellation request info to staff interface main page
Bug 36064: (follow-up) Activate correct tab

Description Lucas Gass 2024-02-09 23:55:46 UTC
Some librarians would like to see notice/warning on the staff interface main page if there are holds with cancellation requests. 

Like Bug 36063 but for holds with cancellation requests.
Comment 1 Lucas Gass 2024-02-10 00:03:20 UTC Comment hidden (obsolete)
Comment 2 David Nind 2024-02-10 02:13:27 UTC Comment hidden (obsolete)
Comment 3 ByWater Sandboxes 2024-02-10 17:09:22 UTC
Created attachment 162002 [details] [review]
Bug 36064: Add holds with cancellation request info to staff interface main page

To Test:
1. APPLY PATCH, restart_all
2. Make some holds
3. Make sure there is a Default waiting hold cancellation policy.
4. Make the holds watiing by checking them in.
5. Go to the OPAC and request to cancel.
6. Go to the staff interface home page, you should see 'Holds with cancellation requests: X'.
7. Cancel the hold.
8. Back on the main page it should not be counted again the number for 'Holds with cancellation requests: X'
9. Log in as a staff member with Staff access but without circulate_remaining_permissions.
10. You should not see the 'Holds with cancellation requests: X' line.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>
Comment 4 Christopher Brannon 2024-02-10 17:10:40 UTC
Works as described.  However, the link to the cancelled holds page/tab isn't 100%.  It takes you to the page, but doesn't always bring up the tab.  I think it is an issue with the page/tab, not this patch.
Comment 5 Owen Leonard 2024-02-13 12:02:10 UTC
Created attachment 162105 [details] [review]
Bug 36064: (follow-up) Activate correct tab

This patch makes a change to the JavaScript on waitingreserves.pl so
that the correct tab is activated if you follow the "Holds with
cancellation requests" link on the home page.

The page has code to activate the last viewed tab, but I've modified it
so that if there is a location hash ('waitingreserves.pl#tab') the tab
specified in the hash is selected instead of the last used tab.

If there is no location hash the last active tab will be activated.

I've also corrected the location hash in the link on the home page.

To test, apply the patch and follow the "Holds with cancellation
requests" link. The "Holds with cancellation requests" tab should be
active.

Click a different tab, e.g. "Holds waiting." Go the the circulation home
page, then click the link for "Holds awaiting pickup." The tab you
selected should be active.
Comment 6 David Nind 2024-04-29 00:11:11 UTC
Just a note - this bug is dependent on bug 36063, which currently doesn't apply (and is also currently Failed QA).
Comment 7 Owen Leonard 2024-04-29 18:37:04 UTC Comment hidden (obsolete)
Comment 8 Owen Leonard 2024-04-29 18:37:06 UTC Comment hidden (obsolete)
Comment 9 Owen Leonard 2024-04-29 18:38:16 UTC
Created attachment 165798 [details] [review]
Bug 36064: Add holds with cancellation request info to staff interface main page

To Test:
1. APPLY PATCH, restart_all
2. Make some holds
3. Make sure there is a Default waiting hold cancellation policy.
4. Make the holds watiing by checking them in.
5. Go to the OPAC and request to cancel.
6. Go to the staff interface home page, you should see 'Holds with
   cancellation requests: X'.
7. Cancel the hold.
8. Back on the main page it should not be counted again the number for
   'Holds with cancellation requests: X'
9. Log in as a staff member with Staff access but without
   circulate_remaining_permissions.
10. You should not see the 'Holds with cancellation requests: X' line.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>
Comment 10 Owen Leonard 2024-04-29 18:38:18 UTC
Created attachment 165799 [details] [review]
Bug 36064: (follow-up) Activate correct tab

This patch makes a change to the JavaScript on waitingreserves.pl so
that the correct tab is activated if you follow the "Holds with
cancellation requests" link on the home page.

The page has code to activate the last viewed tab, but I've modified it
so that if there is a location hash ('waitingreserves.pl#tab') the tab
specified in the hash is selected instead of the last used tab.

If there is no location hash the last active tab will be activated.

I've also corrected the location hash in the link on the home page.

To test, apply the patch and follow the "Holds with cancellation
requests" link. The "Holds with cancellation requests" tab should be
active.

Click a different tab, e.g. "Holds waiting." Go the the circulation home
page, then click the link for "Holds awaiting pickup." The tab you
selected should be active.
Comment 11 Owen Leonard 2024-04-29 18:39:20 UTC
(In reply to David Nind from comment #6)
> Just a note - this bug is dependent on bug 36063, which currently doesn't
> apply (and is also currently Failed QA).

I hope no one minds, I rebased this one on main so that it could move forward without waiting for Bug 36063. The features don't really depend on each other.
Comment 12 Lucas Gass 2024-04-29 19:15:23 UTC
> I hope no one minds, I rebased this one on main so that it could move
> forward without waiting for Bug 36063. The features don't really depend on
> each other.

I appreciate it, Owen!
Comment 13 David Nind 2024-04-29 20:31:09 UTC
sha1/fake ancestor error when trying to apply the patches:

git bz apply 36064

Bug 36064 - Add Holds with cancellation requests info to intranet-main page

165798 - Bug 36064: Add holds with cancellation request info to staff interface main page
165799 - Bug 36064: (follow-up) Activate correct tab

Apply? [(y)es, (n)o, (i)nteractive] y
Applying: Bug 36064: Add holds with cancellation request info to staff interface main page
error: sha1 information is lacking or useless (mainpage.pl).
error: could not build fake ancestor
Patch failed at 0001 Bug 36064: Add holds with cancellation request info to staff interface main page
Comment 14 Lucas Gass 2024-04-29 20:56:31 UTC
Created attachment 165809 [details] [review]
Bug 36064: Add holds with cancellation request info to staff interface main page

To Test:
1. APPLY PATCH, restart_all
2. Make some holds
3. Make sure there is a Default waiting hold cancellation policy.
4. Make the holds watiing by checking them in.
5. Go to the OPAC and request to cancel.
6. Go to the staff interface home page, you should see 'Holds with
   cancellation requests: X'.
7. Cancel the hold.
8. Back on the main page it should not be counted again the number for
   'Holds with cancellation requests: X'
9. Log in as a staff member with Staff access but without
   circulate_remaining_permissions.
10. You should not see the 'Holds with cancellation requests: X' line.
Comment 15 Lucas Gass 2024-04-29 20:56:33 UTC
Created attachment 165810 [details] [review]
Bug 36064: (follow-up) Activate correct tab

This patch makes a change to the JavaScript on waitingreserves.pl so
that the correct tab is activated if you follow the "Holds with
cancellation requests" link on the home page.

The page has code to activate the last viewed tab, but I've modified it
so that if there is a location hash ('waitingreserves.pl#tab') the tab
specified in the hash is selected instead of the last used tab.

If there is no location hash the last active tab will be activated.

I've also corrected the location hash in the link on the home page.

To test, apply the patch and follow the "Holds with cancellation
requests" link. The "Holds with cancellation requests" tab should be
active.

Click a different tab, e.g. "Holds waiting." Go the the circulation home
page, then click the link for "Holds awaiting pickup." The tab you
selected should be active.
Comment 16 Lucas Gass 2024-04-29 20:57:15 UTC
Rebased my patch and attached it back with Owen's as well.
Comment 17 David Nind 2024-04-30 02:47:22 UTC
Created attachment 165823 [details] [review]
Bug 36064: Add holds with cancellation request info to staff interface main page

To Test:
1. APPLY PATCH, restart_all
2. Make some holds
3. Make sure there is a Default waiting hold cancellation policy.
4. Make the holds watiing by checking them in.
5. Go to the OPAC and request to cancel.
6. Go to the staff interface home page, you should see 'Holds with
   cancellation requests: X'.
7. Cancel the hold.
8. Back on the main page it should not be counted again the number for
   'Holds with cancellation requests: X'
9. Log in as a staff member with Staff access but without
   circulate_remaining_permissions.
10. You should not see the 'Holds with cancellation requests: X' line.

Signed-off-by: David Nind <david@davidnind.com>
Comment 18 David Nind 2024-04-30 02:47:25 UTC
Created attachment 165824 [details] [review]
Bug 36064: (follow-up) Activate correct tab

This patch makes a change to the JavaScript on waitingreserves.pl so
that the correct tab is activated if you follow the "Holds with
cancellation requests" link on the home page.

The page has code to activate the last viewed tab, but I've modified it
so that if there is a location hash ('waitingreserves.pl#tab') the tab
specified in the hash is selected instead of the last used tab.

If there is no location hash the last active tab will be activated.

I've also corrected the location hash in the link on the home page.

To test, apply the patch and follow the "Holds with cancellation
requests" link. The "Holds with cancellation requests" tab should be
active.

Click a different tab, e.g. "Holds waiting." Go the the circulation home
page, then click the link for "Holds awaiting pickup." The tab you
selected should be active.

Signed-off-by: David Nind <david@davidnind.com>
Comment 19 David Nind 2024-04-30 02:52:55 UTC
Testing notes (using KTD):

1. Enable patrons to cancel hold requests:
   1.1 Go to Administration > Circulation and fine rules > Default waiting hold cancellation policy
   1.2 For All and All set cancellation allowed to Yes and click +Add

2. Have some patron hold cancellation requests:
   2.1 Log in as the patron you created the holds for (change their username and password)
   2.2 In the OPAC under Summary > Holds, click 'Request to cancel' for one of the waiting holds
Comment 20 Katrin Fischer 2024-04-30 07:45:37 UTC
I believe this could make a great and save addition to 24.05 still.