Bug 36064 - Add information about holds with cancellation requests to staff start page
Summary: Add information about holds with cancellation requests to staff start page
Status: Needs documenting
Alias: None
Product: Koha
Classification: Unclassified
Component: Hold requests (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Lucas Gass (lukeg)
QA Contact: Tomás Cohen Arazi (tcohen)
URL:
Keywords:
Depends on: 22456
Blocks:
  Show dependency treegraph
 
Reported: 2024-02-09 23:55 UTC by Lucas Gass (lukeg)
Modified: 2024-11-18 23:08 UTC (History)
6 users (show)

See Also:
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:
24.11.00
Circulation function:


Attachments
Bug 36064: Add holds with cancellation request info to staff interface main page (5.32 KB, patch)
2024-02-10 00:03 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 36064: Add holds with cancellation request info to staff interface main page (5.37 KB, patch)
2024-02-10 02:13 UTC, David Nind
Details | Diff | Splinter Review
Bug 36064: Add holds with cancellation request info to staff interface main page (5.43 KB, patch)
2024-02-10 17:09 UTC, ByWater Sandboxes
Details | Diff | Splinter Review
Bug 36064: (follow-up) Activate correct tab (3.61 KB, patch)
2024-02-13 12:02 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 36064: Add holds with cancellation request info to staff interface main page (5.76 KB, patch)
2024-04-29 18:37 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 36064: (follow-up) Activate correct tab (3.57 KB, patch)
2024-04-29 18:37 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 36064: Add holds with cancellation request info to staff interface main page (5.76 KB, patch)
2024-04-29 18:38 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 36064: (follow-up) Activate correct tab (3.57 KB, patch)
2024-04-29 18:38 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 36064: Add holds with cancellation request info to staff interface main page (5.44 KB, patch)
2024-04-29 20:56 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 36064: (follow-up) Activate correct tab (3.81 KB, patch)
2024-04-29 20:56 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 36064: Add holds with cancellation request info to staff interface main page (5.33 KB, patch)
2024-04-30 02:47 UTC, David Nind
Details | Diff | Splinter Review
Bug 36064: (follow-up) Activate correct tab (3.62 KB, patch)
2024-04-30 02:47 UTC, David Nind
Details | Diff | Splinter Review
Bug 36064: Add holds with cancellation request info to staff interface main page (5.33 KB, patch)
2024-08-23 17:43 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 36064: (follow-up) Activate correct tab (3.71 KB, patch)
2024-08-23 17:43 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 36064: Add holds with cancellation request info to staff interface main page (5.39 KB, patch)
2024-10-22 14:19 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 36064: (follow-up) Activate correct tab (3.76 KB, patch)
2024-10-22 14:19 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 36064: (QA follow-up) Simplify and tidy (1.32 KB, patch)
2024-10-22 14:19 UTC, Tomás Cohen Arazi (tcohen)
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) 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 (lukeg) 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 Comment hidden (obsolete)
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 Comment hidden (obsolete)
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 Comment hidden (obsolete)
Comment 10 Owen Leonard 2024-04-29 18:38:18 UTC Comment hidden (obsolete)
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 (lukeg) 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 (lukeg) 2024-04-29 20:56:31 UTC Comment hidden (obsolete)
Comment 15 Lucas Gass (lukeg) 2024-04-29 20:56:33 UTC Comment hidden (obsolete)
Comment 16 Lucas Gass (lukeg) 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.
Comment 21 Kyle M Hall (khall) 2024-07-19 12:53:51 UTC
Could you update mainpage.pl to only execute the query if the results will be visible?
Comment 22 Owen Leonard 2024-08-23 17:43:53 UTC
Created attachment 170654 [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 23 Owen Leonard 2024-08-23 17:43:56 UTC
Created attachment 170655 [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 24 Tomás Cohen Arazi (tcohen) 2024-10-22 14:19:33 UTC
Created attachment 173159 [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: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 25 Tomás Cohen Arazi (tcohen) 2024-10-22 14:19:36 UTC
Created attachment 173160 [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>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 26 Tomás Cohen Arazi (tcohen) 2024-10-22 14:19:39 UTC
Created attachment 173161 [details] [review]
Bug 36064: (QA follow-up) Simplify and tidy

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 27 Tomás Cohen Arazi (tcohen) 2024-10-22 14:23:31 UTC
Nice improvement. Kyle's request was addressed and the QA scripts are happy with my follow-up.

Please note that Koha::Holds->waiting returns a(n instantiated) resultset and thus there's no need for the extra ->search() call.
Comment 28 Katrin Fischer 2024-10-25 09:12:35 UTC
Pushed for 24.11!

Well done everyone, thank you!
Comment 29 Lucas Gass (lukeg) 2024-11-18 23:08:09 UTC
Enhancement, no 24.05.x backport