Bug 31391 - Staff-side recalls
Summary: Staff-side recalls
Status: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: master
Hardware: All All
: P3 enhancement (vote)
Assignee: Aleisha Amohia
QA Contact: Testopia
URL:
Keywords: rel_22_11_candidate
Depends on: 19532
Blocks: 31415
  Show dependency treegraph
 
Reported: 2022-08-18 05:38 UTC by Aleisha Amohia
Modified: 2022-11-21 22:25 UTC (History)
10 users (show)

See Also:
Change sponsored?: Sponsored
Patch complexity: Medium patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
This enhancement adds the ability to place recalls via the staff interface by introducing a system preference, RecallsInterface, to configure where recalls can be placed. Recalls can either be placed via the OPAC, or the staff interface, or both. This is set to OPAC by default to be consistent with current behaviour. This enhancement also adds the ability to convert existing holds to recalls easily via the staff interface. The hold will be cancelled and a recall placed using the hold's information.
Version(s) released in:


Attachments
Issue 1: RecallsInterface system preference (3.67 KB, patch)
2022-08-18 23:40 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Issue 1: Implement RecallsInterface on OPAC (2.67 KB, patch)
2022-08-18 23:41 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Issue 1: Convert reserves to recalls on staff client (28.49 KB, patch)
2022-08-18 23:41 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Issue 1: Convert reserves to recalls on staff client (28.42 KB, patch)
2022-08-19 03:22 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 31391: RecallsInterface system preference (3.65 KB, patch)
2022-08-23 01:38 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 31391: Recalled authorised value for hold cancellation (1.96 KB, patch)
2022-08-23 01:38 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 31391: Implement RecallsInterface on OPAC (2.55 KB, patch)
2022-08-23 01:38 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 31391: Request recalls and convert reserves on staff interface (36.17 KB, patch)
2022-08-23 01:38 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 31391: Request recalls and convert reserves on staff interface (36.17 KB, patch)
2022-10-07 00:55 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 31391: Request recalls and convert reserves on staff interface (36.97 KB, patch)
2022-10-25 01:51 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 31391: (follow-up) Fix cancel recalls using checkbox (730 bytes, patch)
2022-11-03 23:06 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 31391: Request recalls and convert reserves on staff interface (36.81 KB, patch)
2022-11-21 03:18 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 31391: (follow-up) Fix cancel recalls using checkbox (1.63 KB, patch)
2022-11-21 03:18 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 31391: RecallsInterface system preference (3.67 KB, patch)
2022-11-21 22:05 UTC, David Nind
Details | Diff | Splinter Review
Bug 31391: Recalled authorised value for hold cancellation (1.99 KB, patch)
2022-11-21 22:05 UTC, David Nind
Details | Diff | Splinter Review
Bug 31391: Implement RecallsInterface on OPAC (2.59 KB, patch)
2022-11-21 22:05 UTC, David Nind
Details | Diff | Splinter Review
Bug 31391: Request recalls and convert reserves on staff interface (36.83 KB, patch)
2022-11-21 22:05 UTC, David Nind
Details | Diff | Splinter Review
Bug 31391: (follow-up) Fix cancel recalls using checkbox (1.67 KB, patch)
2022-11-21 22:05 UTC, David Nind
Details | Diff | Splinter Review
Bug 31391: (follow-up) Fix number of tests and terminology (1.85 KB, patch)
2022-11-21 22:05 UTC, David Nind
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Aleisha Amohia 2022-08-18 05:38:54 UTC
Add functionality for recalls to be placed via the staff interface
Comment 1 Aleisha Amohia 2022-08-18 23:40:57 UTC
Created attachment 139442 [details] [review]
Issue 1: RecallsInterface system preference

(cherry picked from commit fed2dcd820335395f6478754e76c3e0d751bee57)
Comment 2 Aleisha Amohia 2022-08-18 23:41:02 UTC
Created attachment 139443 [details] [review]
Issue 1: Implement RecallsInterface on OPAC

(cherry picked from commit 75eb449b369255c3288bdc55ed274e38bf29c5c2)
Comment 3 Aleisha Amohia 2022-08-18 23:41:06 UTC
Created attachment 139444 [details] [review]
Issue 1: Convert reserves to recalls on staff client

(cherry picked from commit 1c6c784e4c392ca5d12bd003559146fce60dcaed)

Issue 1: Convert recalls and place staff-side recalls

(cherry picked from commit 3a02cb1c0769213d9a5988600fadf7e305cc3637)
Comment 4 Aleisha Amohia 2022-08-18 23:41:24 UTC
This is a work in progress and is not ready for testing
Comment 5 Aleisha Amohia 2022-08-19 03:22:09 UTC
Created attachment 139446 [details] [review]
Issue 1: Convert reserves to recalls on staff client

(cherry picked from commit 1c6c784e4c392ca5d12bd003559146fce60dcaed)

Issue 1: Convert recalls and place staff-side recalls

(cherry picked from commit 3a02cb1c0769213d9a5988600fadf7e305cc3637)
Comment 6 Aleisha Amohia 2022-08-23 01:38:24 UTC Comment hidden (obsolete)
Comment 7 Aleisha Amohia 2022-08-23 01:38:28 UTC Comment hidden (obsolete)
Comment 8 Aleisha Amohia 2022-08-23 01:38:33 UTC Comment hidden (obsolete)
Comment 9 Aleisha Amohia 2022-08-23 01:38:37 UTC Comment hidden (obsolete)
Comment 10 David Nind 2022-10-06 22:47:44 UTC Comment hidden (obsolete)
Comment 11 Aleisha Amohia 2022-10-07 00:55:45 UTC Comment hidden (obsolete)
Comment 12 David Nind 2022-10-08 20:49:31 UTC
Hi Aleisha.

Everything works as per the test plan EXCEPT for step 7.

I cannot cancel a recall and existing or new recall from the OPAC after changing the system preference from 'the OPAC only' to 'the staff interface only'.

For step 7 (have an existing recall, hcnage system preference): 
- Can no longer place recalls (as expected). 
- Cannot cancel a recall (in OPAC from either your summary > recalls tab or your recalls history). Message is: "Recalls have not been enabled. Please contact your library." 

David

---------------------
Testing notes (using koha-testing-docker):
---------------------

Patrons used:
- Patron A: Mary Burton (Midway) (changed password and set username to first name)
- Patron B: Henry Acevedo (Midway)

Step 2: Circulation rules for recalls
- Recalls allowed (total): 5
- Recalls per record (count): 1
- On shelf recalls allowed: If any unavailable
- Recall due date interval (day): 5
- Recall overdue fine amount:5
- Recall pickup period (day):2

Step 5:
- Placed and cancelled a recall from:
  . the patron's OPAC account (your summary > recalls > cancel)
  . in the staff interface:
    . recalls tab for the record
    . patron's account - details section > holds tab
    . patron's account - recalls history section
    . circulation > recalls > recalls queue
- Placed and fulfilled the recall
  . place recall
  . check item in (and transfer if required)
  . check item is listed under circulation > recalls > recalls awaiting pickup
  . check under patron's account that recall status is 'Ready for pickup'
  . checkout out item to recall requestor
  . check in item again so that it is available

Step 6: before changing the system preference to staff interface only, checkout an item to Patron B and place a recall again for Patron A so that you can view in their OPAC account and cancel
- should still be a recalls tab in the your summary section
- your recalls history should still be visible
- can cancel from both places

Step 8: check out Item to Patron B first
Comment 13 Aleisha Amohia 2022-10-25 01:51:20 UTC Comment hidden (obsolete)
Comment 14 David Nind 2022-10-26 00:08:21 UTC
Hi Aleisha.

Apologies for Failing QA on this again!

The previous issue reported is fixed (step 7 - can't cancel a recall from OPAC when RecallsInterface = staff interface only).

I've identified a new issue with step 5 - cancelling a recall from the recalls section for a record - record doesn't exist after cancelling a recall using the 'Cancel selected recalls' button and selecting the normal section. 

To replicate:
1. Place a recall
2. Go to the recalls section for the record on the staff interface
3. Using Actions > Cancel works as expected
4. Repeat steps 1 and 2.
5. Cancel the recall by ticking the box next to the item and then selecting 'Cancel selected recalls' button doesn't work as expected:
   . The recall is cancelled
   . URL = http://127.0.0.1:8081/cgi-bin/koha/recalls/request.pl
   . Breadcrumb = Home > Catalog > No title > Place a recall 
   . Click on the normal section:
      message = The record you requested does not exist ().
      URL = http://127.0.0.1:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=

I'm not sure if I tested this last time. I'm also sure I've seen this when testing something else a while ago, but can't remember or find what bug it was.

Also, for step 13 it is possible to have more than one recall for a record or item. Whose recall takes priority, and what is the workflow libraries would use to address this?
- If a recall is already on the record (from the previous step), there are now two recalls (a record level one, and an item level one)
- On the record page is shows "recalled by X on [date]" - for X it shows the person who made the latest recall, not the first person who place a recall.  
- Is this an edge case to be resolved in a separate bug, or a non-issue? 
- It seems logical that multiple patrons could make a recall request for the same record. What would the workflow be for libraries if they were in this situation, and how do they resolve this?


David
Comment 15 Aleisha Amohia 2022-11-03 23:06:11 UTC Comment hidden (obsolete)
Comment 16 Aleisha Amohia 2022-11-03 23:13:06 UTC
(In reply to David Nind from comment #14)
> Hi Aleisha.
> 
> Apologies for Failing QA on this again!
> 
> The previous issue reported is fixed (step 7 - can't cancel a recall from
> OPAC when RecallsInterface = staff interface only).
> 
> I've identified a new issue with step 5 - cancelling a recall from the
> recalls section for a record - record doesn't exist after cancelling a
> recall using the 'Cancel selected recalls' button and selecting the normal
> section. 
> 
> To replicate:
> 1. Place a recall
> 2. Go to the recalls section for the record on the staff interface
> 3. Using Actions > Cancel works as expected
> 4. Repeat steps 1 and 2.
> 5. Cancel the recall by ticking the box next to the item and then selecting
> 'Cancel selected recalls' button doesn't work as expected:
>    . The recall is cancelled
>    . URL = http://127.0.0.1:8081/cgi-bin/koha/recalls/request.pl
>    . Breadcrumb = Home > Catalog > No title > Place a recall 
>    . Click on the normal section:
>       message = The record you requested does not exist ().
>       URL =
> http://127.0.0.1:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=
> 
> I'm not sure if I tested this last time. I'm also sure I've seen this when
> testing something else a while ago, but can't remember or find what bug it
> was.

Fixed in latest follow-up

> 
> Also, for step 13 it is possible to have more than one recall for a record
> or item. Whose recall takes priority, and what is the workflow libraries
> would use to address this?
> - If a recall is already on the record (from the previous step), there are
> now two recalls (a record level one, and an item level one)
> - On the record page is shows "recalled by X on [date]" - for X it shows the
> person who made the latest recall, not the first person who place a recall.  
> - Is this an edge case to be resolved in a separate bug, or a non-issue? 
> - It seems logical that multiple patrons could make a recall request for the
> same record. What would the workflow be for libraries if they were in this
> situation, and how do they resolve this?
> 

I think that is outside of the scope of this particular ticket (because fulfilling recalls via the staff interface came from the original Bug 19532) but at the moment the oldest/earliest placed recall will be picked first, and priority is given to item-level recalls over biblio-level recalls. A follow-up to all of this would be to introduce a priority field like reserves has, but that can come after we bring in functionality to place recalls via the staff interface I think

> 
> David
Comment 17 David Nind 2022-11-04 06:38:48 UTC Comment hidden (obsolete)
Comment 18 Aleisha Amohia 2022-11-21 03:18:11 UTC Comment hidden (obsolete)
Comment 19 Aleisha Amohia 2022-11-21 03:18:16 UTC Comment hidden (obsolete)
Comment 20 Aleisha Amohia 2022-11-21 03:23:32 UTC
(In reply to David Nind from comment #17)
> This is still not working for me and doesn't appear to be fixed.
> 
> If it helps, there is an entry in
> /var/log/koha/kohadev/plack-intranet-error.log:
> [2022/11/04 06:36:44] [WARN] Use of uninitialized value $biblionumber in
> concatenation (.) or string at /kohadevbox/koha/recalls/request.pl     line
> 49.
> 
> Everything else continues to work as per the test plan.

Sorry you were right - amended in most recent patch
Comment 21 David Nind 2022-11-21 22:05:06 UTC
Created attachment 144131 [details] [review]
Bug 31391: RecallsInterface system preference

Signed-off-by: David <david@davidnind.com>
Comment 22 David Nind 2022-11-21 22:05:15 UTC
Created attachment 144132 [details] [review]
Bug 31391: Recalled authorised value for hold cancellation

Signed-off-by: David <david@davidnind.com>
Comment 23 David Nind 2022-11-21 22:05:22 UTC
Created attachment 144133 [details] [review]
Bug 31391: Implement RecallsInterface on OPAC

Signed-off-by: David <david@davidnind.com>
Comment 24 David Nind 2022-11-21 22:05:29 UTC
Created attachment 144134 [details] [review]
Bug 31391: Request recalls and convert reserves on staff interface

This enhancement adds the ability to place recalls via the staff
interface by introducing a system preference, RecallsInterface, to
configure where recalls can be placed. Recalls can either be placed via
the OPAC, or the staff interface, or both. This is set to OPAC by
default to be consistent with current behaviour.

This enhancement also adds the ability to convert existing reserves to
recalls easily via the staff interface. The reserve will be cancelled
and a recall placed using the reserve's information.

To test:
1) Update database and restart services
2) Enable UseRecalls and set the relevant recalls circulation rules
3) View the new RecallsInterface system preference. Confirm it is set to
OPAC only by default
4) Check out Item A to Patron B.
5) Log into the OPAC as Patron A. Confirm you can place, view and cancel
recalls as normal.
6) In the staff interface, set RecallsInterface to Staff interface only.
7) In the OPAC, confirm you can still view and cancel recalls, but can
no longer place recalls.
8) In the staff interface, search for Item A and go to the Reserves tab.
Place a reserve for Patron C.
9) Under the Priority column, select the dropdown and choose the recall
option next to your reserve.
10) Click Update holds. Confirm when the page refreshes that your
reserve has disappeared.
11) Go to the recalls tab. Confirm your reserve has been converted to a
recall, and details like the patron, expiration, and pickup location have
carried across to the recall.
12) On this recalls page, use the patron search to find Patron D. Test
placing a record-level recall by keeping the 'recall next available
item' checkbox.
13) When the page refreshes, confirm the recall was successfully placed
with the correct details stored.
14) Repeat steps 12 and 13 with Patron E, this time place an item-level
recall by choosing an item in the 'place a recall on a specific item'
table. When selecting one of these items, the 'recall next available
item' checkbox should de-select.
15) Set RecallsInterface back to OPAC only. Go back to the record and
view the Recalls tab.
16) Confirm you cannot search for a patron to place a recall, but can
still view and cancel recalls. Confirm you also cannot convert reserves
to recalls.
17) Set RecallsInterface to both staff interface and OPAC. Confirm you
can place recalls on both interfaces.
18) On the staff interface, test placing recalls that your circulation
rules do not allow. For example, if 'recalls per record' is 1, ensure
you're blocked from placing a second recall on a record for a patron.
19) Place a reserve for one of the patron's that already has a recall.
Once complete, try to convert this reserve into a recall. Confirm you
are blocked and shown a message that the hold cannot be converted to a
recall.
20) Ensure tests pass t/db_dependent/Holds.t

Sponsored-by: Auckland University of Technology

Signed-off-by: David <david@davidnind.com>
Comment 25 David Nind 2022-11-21 22:05:35 UTC
Created attachment 144135 [details] [review]
Bug 31391: (follow-up) Fix cancel recalls using checkbox

Signed-off-by: David <david@davidnind.com>
Comment 26 David Nind 2022-11-21 22:05:41 UTC
Created attachment 144136 [details] [review]
Bug 31391: (follow-up) Fix number of tests and terminology

Fixed two items:
- Number of tests: changed to 77 (from 76), tests now pass
- Terminology: changed message when attempting to place recalls
from the staff interface when RecallsInterface in set to the OPAC
only (staff client should be staff interface)

Signed-off-by: David <david@davidnind.com>
Comment 27 David Nind 2022-11-21 22:20:43 UTC
(In reply to Aleisha Amohia from comment #20)
> (In reply to David Nind from comment #17)
> > This is still not working for me and doesn't appear to be fixed.
> > 
> > If it helps, there is an entry in
> > /var/log/koha/kohadev/plack-intranet-error.log:
> > [2022/11/04 06:36:44] [WARN] Use of uninitialized value $biblionumber in
> > concatenation (.) or string at /kohadevbox/koha/recalls/request.pl     line
> > 49.
> > 
> > Everything else continues to work as per the test plan.
> 
> Sorry you were right - amended in most recent patch

Thanks Aleisha - now signed off!

I added a follow-up to change the number of tests so that tests pass, and change staff client to staff interface.

David
Comment 28 Aleisha Amohia 2022-11-21 22:25:26 UTC
(In reply to David Nind from comment #27)

> Thanks Aleisha - now signed off!
> 
> I added a follow-up to change the number of tests so that tests pass, and
> change staff client to staff interface.
> 
> David

Good catch! Thank you for your awesome testing.