Bug 31391

Summary: Staff-side recalls
Product: Koha Reporter: Aleisha Amohia <aleisha>
Component: CirculationAssignee: Aleisha Amohia <aleisha>
Status: Signed Off --- QA Contact: Martin Renvoize (ashimema) <martin.renvoize>
Severity: enhancement    
Priority: P3 CC: david, dcook, fridolin.somers, gmcharlt, jonathan.druart, kyle.m.hall, m.de.rooy, magnus, pedro.amorim, tomascohen, victor
Version: MainKeywords: rel_25_05_candidate, RM_priority, roadmap_24_05, roadmap_24_11, roadmap_25_05
Hardware: All   
OS: All   
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:
Circulation function: recalls
Bug Depends on: 19532    
Bug Blocks: 31415, 38320    
Attachments: Issue 1: RecallsInterface system preference
Issue 1: Implement RecallsInterface on OPAC
Issue 1: Convert reserves to recalls on staff client
Issue 1: Convert reserves to recalls on staff client
Bug 31391: RecallsInterface system preference
Bug 31391: Recalled authorised value for hold cancellation
Bug 31391: Implement RecallsInterface on OPAC
Bug 31391: Request recalls and convert reserves on staff interface
Bug 31391: Request recalls and convert reserves on staff interface
Bug 31391: Request recalls and convert reserves on staff interface
Bug 31391: (follow-up) Fix cancel recalls using checkbox
Bug 31391: Request recalls and convert reserves on staff interface
Bug 31391: (follow-up) Fix cancel recalls using checkbox
Bug 31391: RecallsInterface system preference
Bug 31391: Recalled authorised value for hold cancellation
Bug 31391: Implement RecallsInterface on OPAC
Bug 31391: Request recalls and convert reserves on staff interface
Bug 31391: (follow-up) Fix cancel recalls using checkbox
Bug 31391: (follow-up) Fix number of tests and terminology
Bug 31391: Interface and wording fixes
Bug 31391: Interface and wording fixes
Bug 31391: RecallsInterface system preference
Bug 31391: Recalled authorised value for hold cancellation
Bug 31391: Implement RecallsInterface on OPAC
Bug 31391: Request recalls and convert reserves on staff interface
Bug 31391: (follow-up) Fix cancel recalls using checkbox
Bug 31391: (follow-up) Fix number of tests and terminology
Bug 31391: Interface and wording fixes
Bug 31391: RecallsInterface system preference
Bug 31391: Recalled authorised value for hold cancellation
Bug 31391: Implement RecallsInterface on OPAC
Bug 31391: Request recalls and convert reserves on staff interface
Bug 31391: (follow-up) Fix cancel recalls using checkbox
Bug 31391: (follow-up) Fix number of tests and terminology
Bug 31391: Interface and wording fixes
Bug 31391: Request recalls and convert reserves on staff interface
Bug 31391: (follow-up) Fix cancel recalls using checkbox
Bug 31391: (follow-up) Fix number of tests and terminology
Bug 31391: Interface and wording fixes
Bug 31391: Test fixes
Bug 31391: RecallsInterface system preference
Bug 31391: Recalled authorised value for hold cancellation
Bug 31391: Implement RecallsInterface on OPAC
Bug 31391: Request recalls and convert reserves on staff interface
Bug 31391: (follow-up) Fix cancel recalls using checkbox
Bug 31391: (follow-up) Fix number of tests and terminology
Bug 31391: Interface and wording fixes
Bug 31391: Test fixes
Bug 31391: RecallsInterface system preference
Bug 31391: Recalled authorised value for hold cancellation
Bug 31391: Implement RecallsInterface on OPAC
Bug 31391: Request recalls and convert reserves on staff interface
Bug 31391: (follow-up) Fix cancel recalls using checkbox
Bug 31391: (follow-up) Fix number of tests and terminology
Bug 31391: Interface and wording fixes
Bug 31391: Test fixes
Bug 31391: Update the UseRecalls system preference to have choices
Bug 31391: [WIP] Better recalls error messages
Bug 31391: RecallsInterface system preference
Bug 31391: Recalled authorised value for hold cancellation
Bug 31391: Implement RecallsInterface on OPAC
Bug 31391: Request recalls and convert reserves on staff interface
Bug 31391: (follow-up) Fix cancel recalls using checkbox
Bug 31391: (follow-up) Fix number of tests and terminology
Bug 31391: Interface and wording fixes
Bug 31391: Test fixes
Bug 31391: Update the UseRecalls system preference to have choices
Bug 31391: (follow-up) Include changed requirements of patron autocomplete, datatable
Bug 31391: RecallsInterface system preference
Bug 31391: Recalled authorised value for hold cancellation
Bug 31391: Implement RecallsInterface on OPAC
Bug 31391: Request recalls and convert reserves on staff interface
Bug 31391: (follow-up) Fix cancel recalls using checkbox
Bug 31391: (follow-up) Fix number of tests and terminology
Bug 31391: Interface and wording fixes
Bug 31391: Test fixes
Bug 31391: Update the UseRecalls system preference to have choices
Bug 31391: (follow-up) Include changed requirements of patron autocomplete, datatable

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.
Comment 29 Katrin Fischer 2023-02-24 22:52:06 UTC
Doing a first round of testing here:

1) QA test tools

 FAIL	installer/data/mysql/atomicupdate/bug_31391_-_add_HOLD_CANCELLATION-RECALLED_authorised_value.pl
   FAIL	  file permissions
		File must have the exec flag

 FAIL	installer/data/mysql/atomicupdate/bug_31391_-_add_RecallsInterface_syspref.pl
   FAIL	  file permissions
		File must have the exec flag


2) Unit tests

There is a new warn that is not there when running the test on master, that should be fixed to give a clean result:

t/db_dependent/Holds.t .. 76/77 An appropriate email address for borrower myfirstname.whateversurname1 could not be found. at /kohadevbox/koha/C4/Message.pm line 192.
No reserves HOLD_CANCELLATION letter transported by email at /kohadevbox/koha/C4/Letters.pm line 584.
t/db_dependent/Holds.t .. ok     
All tests successful.

3) Database update

* is idempotent
* installer/data/mysql/atomicupdate/bug_31391_-_add_HOLD_CANCELLATION-RECALLED_authorised_value. could be updated to also use the new style

3) Code review


+                            <th>Last location</th>
a) This might be a little confusing with the 'location' in item. Could we use 'Last library' or even 'holding library' here?

+                            [% IF ( item.itemlost || item.withdrawn ) %]
+                                <span class="lost">Unavailable (lost or missing)</span>
+                            [% END %]

b) This looks like it should read "(lost or withdrawn)"

+                                    Patron has already placed a <a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% patron.borrowernumber | uri %]#reserves">reserve</a> on this item.

c) Terminology: 'reserve' should be 'hold'.


4) GUI testing

a) The system preference RecallsInterface appears in the Curbside pickup section instead of in recalls. Maybe a rebase issue.

b) Could be a separate bug: when placing a recall from the detail page, the list of existing recalls needs the 'page-section' class to appear correctly in the new staff interface design with white background.

c) Could be a separate bug: Cancel recalls on the same page should be a yellow primary button.

d) Should I be able to to place a record level hold and a recall level hold for the same patron at the same time? It seems like maybe we should have a warning or a message there, maybe recommending to convert the existing hold.

e) When converting the hold, the recall action is 'Hiding' in the priorities. I feel like a link or icon might be a little nicer as I almost missed it there. Not blocker.


Stopping here for now, but I feel this will make the feature much more flexible!
Comment 30 Aleisha Amohia 2023-03-02 01:04:05 UTC
Created attachment 147581 [details] [review]
Bug 31391: Interface and wording fixes

This patch includes the following fixes:
- Making the atomic updates executable
- Preventing warns when running tests
- Updating db updates
- Fixing terminology
- Make 'cancel selected recalls' button yellow
- Fix HTML makeup of recalls request page
- Show a warning when placing a recall if there is already a
record-level hold by this patron
- Show a link to mark a hold for conversion which selects the recall
option on holds page
Comment 31 Aleisha Amohia 2023-03-02 01:23:08 UTC
Created attachment 147582 [details] [review]
Bug 31391: Interface and wording fixes

This patch includes the following fixes:
- Making the atomic updates executable
- Preventing warns when running tests
- Updating db updates
- Fixing terminology
- Make 'cancel selected recalls' button yellow
- Fix HTML makeup of recalls request page
- Show a warning when placing a recall if there is already a
record-level hold by this patron
- Show a link to mark a hold for conversion which selects the recall
option on holds page
Comment 32 David Nind 2023-05-02 01:38:39 UTC
Created attachment 150485 [details] [review]
Bug 31391: RecallsInterface system preference

Signed-off-by: David Nind <david@davidnind.com>
Comment 33 David Nind 2023-05-02 01:38:43 UTC
Created attachment 150486 [details] [review]
Bug 31391: Recalled authorised value for hold cancellation

Signed-off-by: David <david@davidnind.com>
Signed-off-by: David Nind <david@davidnind.com>
Comment 34 David Nind 2023-05-02 01:38:46 UTC
Created attachment 150487 [details] [review]
Bug 31391: Implement RecallsInterface on OPAC

Signed-off-by: David <david@davidnind.com>
Signed-off-by: David Nind <david@davidnind.com>
Comment 35 David Nind 2023-05-02 01:38:49 UTC
Created attachment 150488 [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>
Signed-off-by: David Nind <david@davidnind.com>
Comment 36 David Nind 2023-05-02 01:38:52 UTC
Created attachment 150489 [details] [review]
Bug 31391: (follow-up) Fix cancel recalls using checkbox

Signed-off-by: David <david@davidnind.com>
Signed-off-by: David Nind <david@davidnind.com>
Comment 37 David Nind 2023-05-02 01:38:55 UTC
Created attachment 150490 [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>
Signed-off-by: David Nind <david@davidnind.com>
Comment 38 David Nind 2023-05-02 01:38:59 UTC
Created attachment 150491 [details] [review]
Bug 31391: Interface and wording fixes

This patch includes the following fixes:
- Making the atomic updates executable
- Preventing warns when running tests
- Updating db updates
- Fixing terminology
- Make 'cancel selected recalls' button yellow
- Fix HTML makeup of recalls request page
- Show a warning when placing a recall if there is already a
record-level hold by this patron
- Show a link to mark a hold for conversion which selects the recall
option on holds page

Signed-off-by: David Nind <david@davidnind.com>
Comment 39 Jonathan Druart 2023-05-16 09:45:23 UTC
IMO we are too far in the release cycle to push this one for 23.05.

Additionally there are several bugs opened for the OPAC part that are still waiting to be fixed.
Comment 40 David Nind 2023-08-27 17:45:18 UTC
Bug 31415 Depends on bug 31391 (Signed Off)
Follow? [(y)es, (n)o] y

The patch no longer applies (discovered when testing bug 31415):


Bug 31391 - Staff-side recalls

150485 - Bug 31391: RecallsInterface system preference
150486 - Bug 31391: Recalled authorised value for hold cancellation
150487 - Bug 31391: Implement RecallsInterface on OPAC
150488 - Bug 31391: Request recalls and convert reserves on staff interface
150489 - Bug 31391: (follow-up) Fix cancel recalls using checkbox
150490 - Bug 31391: (follow-up) Fix number of tests and terminology
150491 - Bug 31391: Interface and wording fixes

Apply? [(y)es, (n)o, (i)nteractive] y
Applying: Bug 31391: RecallsInterface system preference
Applying: Bug 31391: Recalled authorised value for hold cancellation
Applying: Bug 31391: Implement RecallsInterface on OPAC
Using index info to reconstruct a base tree...
M	koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-detail-sidebar.inc
M	koha-tmpl/opac-tmpl/bootstrap/en/includes/title-actions-menu.inc
Falling back to patching base and 3-way merge...
Auto-merging koha-tmpl/opac-tmpl/bootstrap/en/includes/title-actions-menu.inc
CONFLICT (content): Merge conflict in koha-tmpl/opac-tmpl/bootstrap/en/includes/title-actions-menu.inc
Auto-merging koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-detail-sidebar.inc
CONFLICT (content): Merge conflict in koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-detail-sidebar.inc
error: Failed to merge in the changes.
Patch failed at 0001 Bug 31391: Implement RecallsInterface on OPAC
Comment 41 Aleisha Amohia 2023-10-12 21:01:44 UTC
Created attachment 156995 [details] [review]
Bug 31391: RecallsInterface system preference

Signed-off-by: David <david@davidnind.com>
Signed-off-by: David Nind <david@davidnind.com>
Comment 42 Aleisha Amohia 2023-10-12 21:01:47 UTC
Created attachment 156996 [details] [review]
Bug 31391: Recalled authorised value for hold cancellation

Signed-off-by: David <david@davidnind.com>
Signed-off-by: David Nind <david@davidnind.com>
Comment 43 Aleisha Amohia 2023-10-12 21:01:51 UTC
Created attachment 156997 [details] [review]
Bug 31391: Implement RecallsInterface on OPAC

Signed-off-by: David <david@davidnind.com>
Signed-off-by: David Nind <david@davidnind.com>
Comment 44 Aleisha Amohia 2023-10-12 21:01:55 UTC
Created attachment 156998 [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>
Signed-off-by: David Nind <david@davidnind.com>
Comment 45 Aleisha Amohia 2023-10-12 21:01:58 UTC
Created attachment 156999 [details] [review]
Bug 31391: (follow-up) Fix cancel recalls using checkbox

Signed-off-by: David <david@davidnind.com>
Signed-off-by: David Nind <david@davidnind.com>
Comment 46 Aleisha Amohia 2023-10-12 21:02:02 UTC
Created attachment 157000 [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>
Signed-off-by: David Nind <david@davidnind.com>
Comment 47 Aleisha Amohia 2023-10-12 21:02:05 UTC
Created attachment 157001 [details] [review]
Bug 31391: Interface and wording fixes

This patch includes the following fixes:
- Making the atomic updates executable
- Preventing warns when running tests
- Updating db updates
- Fixing terminology
- Make 'cancel selected recalls' button yellow
- Fix HTML makeup of recalls request page
- Show a warning when placing a recall if there is already a
record-level hold by this patron
- Show a link to mark a hold for conversion which selects the recall
option on holds page
- Include changes to patron search dropdown

Signed-off-by: David Nind <david@davidnind.com>
Comment 48 David Nind 2023-10-17 22:40:42 UTC
Everything still works, however the tests are failing for me:

prove t/db_dependent/Holds.t
t/db_dependent/Holds.t .. 68/74 Use of uninitialized value in numeric le (<=) at /kohadevbox/koha/C4/Circulation.pm line 3002.
Use of uninitialized value in numeric le (<=) at /kohadevbox/koha/C4/Circulation.pm line 3002.
Use of uninitialized value in numeric le (<=) at /kohadevbox/koha/C4/Circulation.pm line 3002.
t/db_dependent/Holds.t .. 73/74     # No tests run!

#   Failed test 'No tests run for subtest "ModReserve to convert a hold to a recall"'
#   at t/db_dependent/Holds.t line 1902.
Can't call method "categorycode" on unblessed reference at /kohadevbox/koha/C4/Circulation.pm line 3830.
# Looks like your test exited with 11 just after 74.
t/db_dependent/Holds.t .. Dubious, test returned 11 (wstat 2816, 0xb00)
Failed 1/74 subtests 

Test Summary Report
-------------------
t/db_dependent/Holds.t (Wstat: 2816 Tests: 74 Failed: 1)
  Failed test:  74
  Non-zero exit status: 11
Files=1, Tests=74,  7 wallclock secs ( 0.04 usr  0.01 sys +  3.62 cusr  1.28 csys =  4.95 CPU)
Result: FAIL
Comment 49 Aleisha Amohia 2023-11-09 02:46:59 UTC
Created attachment 158691 [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>
Signed-off-by: David Nind <david@davidnind.com>
Comment 50 Aleisha Amohia 2023-11-09 02:47:03 UTC
Created attachment 158692 [details] [review]
Bug 31391: (follow-up) Fix cancel recalls using checkbox

Signed-off-by: David <david@davidnind.com>
Signed-off-by: David Nind <david@davidnind.com>
Comment 51 Aleisha Amohia 2023-11-09 02:47:06 UTC
Created attachment 158693 [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>
Signed-off-by: David Nind <david@davidnind.com>
Comment 52 Aleisha Amohia 2023-11-09 02:47:10 UTC
Created attachment 158694 [details] [review]
Bug 31391: Interface and wording fixes

This patch includes the following fixes:
- Making the atomic updates executable
- Preventing warns when running tests
- Updating db updates
- Fixing terminology
- Make 'cancel selected recalls' button yellow
- Fix HTML makeup of recalls request page
- Show a warning when placing a recall if there is already a
record-level hold by this patron
- Show a link to mark a hold for conversion which selects the recall
option on holds page
- Include changes to patron search dropdown
- add 'mark hold for conversion to recall' column to columns settings

Signed-off-by: David Nind <david@davidnind.com>
Comment 53 Aleisha Amohia 2023-11-09 02:47:14 UTC
Created attachment 158695 [details] [review]
Bug 31391: Test fixes
Comment 54 David Nind 2023-11-11 01:48:49 UTC
Created attachment 158825 [details] [review]
Bug 31391: RecallsInterface system preference

Signed-off-by: David <david@davidnind.com>
Signed-off-by: David Nind <david@davidnind.com>
Comment 55 David Nind 2023-11-11 01:48:53 UTC
Created attachment 158826 [details] [review]
Bug 31391: Recalled authorised value for hold cancellation

Signed-off-by: David <david@davidnind.com>
Signed-off-by: David Nind <david@davidnind.com>
Comment 56 David Nind 2023-11-11 01:48:56 UTC
Created attachment 158827 [details] [review]
Bug 31391: Implement RecallsInterface on OPAC

Signed-off-by: David <david@davidnind.com>
Signed-off-by: David Nind <david@davidnind.com>
Comment 57 David Nind 2023-11-11 01:49:00 UTC
Created attachment 158828 [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>
Signed-off-by: David Nind <david@davidnind.com>
Comment 58 David Nind 2023-11-11 01:49:03 UTC
Created attachment 158829 [details] [review]
Bug 31391: (follow-up) Fix cancel recalls using checkbox

Signed-off-by: David <david@davidnind.com>
Signed-off-by: David Nind <david@davidnind.com>
Comment 59 David Nind 2023-11-11 01:49:07 UTC
Created attachment 158830 [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>
Signed-off-by: David Nind <david@davidnind.com>
Comment 60 David Nind 2023-11-11 01:49:11 UTC
Created attachment 158831 [details] [review]
Bug 31391: Interface and wording fixes

This patch includes the following fixes:
- Making the atomic updates executable
- Preventing warns when running tests
- Updating db updates
- Fixing terminology
- Make 'cancel selected recalls' button yellow
- Fix HTML makeup of recalls request page
- Show a warning when placing a recall if there is already a
record-level hold by this patron
- Show a link to mark a hold for conversion which selects the recall
option on holds page
- Include changes to patron search dropdown
- add 'mark hold for conversion to recall' column to columns settings

Signed-off-by: David Nind <david@davidnind.com>
Comment 61 David Nind 2023-11-11 01:49:15 UTC
Created attachment 158832 [details] [review]
Bug 31391: Test fixes

Signed-off-by: David Nind <david@davidnind.com>
Comment 62 David Nind 2023-11-11 01:50:05 UTC
Thanks Aleisha!

The tests now pass, and everything seems to be working as expected.

David
Comment 63 Pedro Amorim 2024-02-21 12:22:49 UTC
Test plan works as described and qa script seems happy, but I don't feel comfortable passing or failing QA here, so I'll leave that to someone else and provide some observations instead:

Instead of adding RecallsInterface, should we consider updating UseRecalls sys pref to:
0 - Don't use
1 - Use on OPAC only
2 - Use on staff interface only
3 - Use on both OPAC and staff interface

This would address the use-cases being covered here and not be YASP.
I understand it's more work but it seems partially redundant to have both UseRecalls and RecallsInterface. I believe using the values I suggest above would ease the work, since the current UseRecalls = 1 is equivalent to the would be RecallsInterface = 'opac', although some current checks for truthy UseRecalls would also now encompass '2' and '3', maybe not critical but just something to consider.

--------------

Some improvements to error messaging could be considered:

Attempt to place a recall on an item not checked out, you get:
"Unable to place a recall. Check your circulation rules."
When you should get something like:
"Unable to place a recall on an item not checked out."

Attempt to place a recall on the same patron that the item is checked out to, you get:
"Unable to place a recall. Check your circulation rules."
When you should get something like
"Unable to place recall. Item is already checked out to user X"
Comment 64 Martin Renvoize (ashimema) 2024-02-23 13:37:50 UTC
I agree with the preference suggestion here.

We also need the error messages improveing as highlighting, 

Failing QA
Comment 65 Aleisha Amohia 2024-03-04 20:51:51 UTC
Thanks all I agree with your suggestions and am working on implementing these.
Comment 66 Aleisha Amohia 2024-09-27 20:09:51 UTC
Created attachment 172166 [details] [review]
Bug 31391: RecallsInterface system preference

Signed-off-by: David <david@davidnind.com>
Signed-off-by: David Nind <david@davidnind.com>
Comment 67 Aleisha Amohia 2024-09-27 20:09:54 UTC
Created attachment 172167 [details] [review]
Bug 31391: Recalled authorised value for hold cancellation

Signed-off-by: David <david@davidnind.com>
Signed-off-by: David Nind <david@davidnind.com>
Comment 68 Aleisha Amohia 2024-09-27 20:09:57 UTC
Created attachment 172168 [details] [review]
Bug 31391: Implement RecallsInterface on OPAC

Signed-off-by: David <david@davidnind.com>
Signed-off-by: David Nind <david@davidnind.com>
Comment 69 Aleisha Amohia 2024-09-27 20:10:00 UTC
Created attachment 172169 [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>
Signed-off-by: David Nind <david@davidnind.com>
Comment 70 Aleisha Amohia 2024-09-27 20:10:03 UTC
Created attachment 172170 [details] [review]
Bug 31391: (follow-up) Fix cancel recalls using checkbox

Signed-off-by: David <david@davidnind.com>
Signed-off-by: David Nind <david@davidnind.com>
Comment 71 Aleisha Amohia 2024-09-27 20:10:06 UTC
Created attachment 172171 [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>
Signed-off-by: David Nind <david@davidnind.com>
Comment 72 Aleisha Amohia 2024-09-27 20:10:09 UTC
Created attachment 172172 [details] [review]
Bug 31391: Interface and wording fixes

This patch includes the following fixes:
- Making the atomic updates executable
- Preventing warns when running tests
- Updating db updates
- Fixing terminology
- Make 'cancel selected recalls' button yellow
- Fix HTML makeup of recalls request page
- Show a warning when placing a recall if there is already a
record-level hold by this patron
- Show a link to mark a hold for conversion which selects the recall
option on holds page
- Include changes to patron search dropdown
- add 'mark hold for conversion to recall' column to columns settings

Signed-off-by: David Nind <david@davidnind.com>
Comment 73 Aleisha Amohia 2024-09-27 20:10:13 UTC
Created attachment 172173 [details] [review]
Bug 31391: Test fixes

Signed-off-by: David Nind <david@davidnind.com>
Comment 74 Aleisha Amohia 2024-09-27 20:10:16 UTC
Created attachment 172174 [details] [review]
Bug 31391: Update the UseRecalls system preference to have choices

Options are:
* off
* opac
* staff
* opac_and_staff

This patch implements this all over the place.

All recalls things should still work including the above test plan.

Tests should pass:

* t/db_dependent/Circulation.t
* t/db_dependent/Circulation/transferbook.t
* t/db_dependent/Holds.t
* t/db_dependent/Koha/Biblio.t
* t/db_dependent/Koha/Item.t
* t/db_dependent/SIP/Transaction.t
* t/db_dependent/Search.t
* t/db_dependent/XSLT.t

Sponsored-by: Auckland University of Technology
Sponsored-by: Catalyst IT
Comment 75 Aleisha Amohia 2024-09-27 20:10:18 UTC
Created attachment 172175 [details] [review]
Bug 31391: [WIP] Better recalls error messages
Comment 76 Aleisha Amohia 2024-09-27 20:12:27 UTC
Hi Matrin, Pedro and David

I have:
- rebased the patches
- implemented UseRecalls to have choices so that RecallsInterface isn't needed
- begun working on the recalls error messages

This ends up causing significant changes to the existing recalls logic so I wanted to check my approach before I get too deep.

Could you please look at the latest WIP patch and let me know if this is what you had in mind for implementing those error messages?

Something I'm concerned about in particular is that included more detailed error messages means you can no longer do `if ( $biblio->can_be_recalled )` as it returns a string which Perl interprets at `true`.

Would appreciate any thoughts or ideas.
Comment 77 Katrin Fischer 2024-10-18 14:24:42 UTC
I am not sure I can help much with the questions on development side, but please let me know once this is ready for testing again and happy to help with that.
Comment 78 Pedro Amorim 2024-10-29 17:00:07 UTC
Hi Aleisha, providing my input here.
Patch doesn't apply (sorry!). I'll try to come back faster next you're available to rebase.

I've taken a look at the WIP patch. At first glance, it looks good, but it also looks like it may be a bit out of scope of the original intent here, which is to provide staff-side recalls, so I don't think it should be reason enough to block the whole thing because of it. Your call if you think we should tackle it here or perhaps better on a follow-up bug.
Having said that, I'll look again once it applies again.
Comment 79 Aleisha Amohia 2024-10-31 22:42:08 UTC
(In reply to Pedro Amorim from comment #78)
> Hi Aleisha, providing my input here.
> Patch doesn't apply (sorry!). I'll try to come back faster next you're
> available to rebase.
> 
> I've taken a look at the WIP patch. At first glance, it looks good, but it
> also looks like it may be a bit out of scope of the original intent here,
> which is to provide staff-side recalls, so I don't think it should be reason
> enough to block the whole thing because of it. Your call if you think we
> should tackle it here or perhaps better on a follow-up bug.
> Having said that, I'll look again once it applies again.

Thanks Pedro. It does feel wider than the original scope of the bug.

I'll see what I can do to address the earlier comments whilst keeping this within the scope.
Comment 80 Aleisha Amohia 2024-10-31 23:30:32 UTC
Created attachment 173839 [details] [review]
Bug 31391: RecallsInterface system preference

Signed-off-by: David <david@davidnind.com>
Signed-off-by: David Nind <david@davidnind.com>
Comment 81 Aleisha Amohia 2024-10-31 23:30:36 UTC
Created attachment 173840 [details] [review]
Bug 31391: Recalled authorised value for hold cancellation

Signed-off-by: David <david@davidnind.com>
Signed-off-by: David Nind <david@davidnind.com>
Comment 82 Aleisha Amohia 2024-10-31 23:30:39 UTC
Created attachment 173841 [details] [review]
Bug 31391: Implement RecallsInterface on OPAC

Signed-off-by: David <david@davidnind.com>
Signed-off-by: David Nind <david@davidnind.com>
Comment 83 Aleisha Amohia 2024-10-31 23:30:42 UTC
Created attachment 173842 [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>
Signed-off-by: David Nind <david@davidnind.com>
Comment 84 Aleisha Amohia 2024-10-31 23:30:46 UTC
Created attachment 173843 [details] [review]
Bug 31391: (follow-up) Fix cancel recalls using checkbox

Signed-off-by: David <david@davidnind.com>
Signed-off-by: David Nind <david@davidnind.com>
Comment 85 Aleisha Amohia 2024-10-31 23:30:49 UTC
Created attachment 173844 [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>
Signed-off-by: David Nind <david@davidnind.com>
Comment 86 Aleisha Amohia 2024-10-31 23:30:53 UTC
Created attachment 173845 [details] [review]
Bug 31391: Interface and wording fixes

This patch includes the following fixes:
- Making the atomic updates executable
- Preventing warns when running tests
- Updating db updates
- Fixing terminology
- Make 'cancel selected recalls' button yellow
- Fix HTML makeup of recalls request page
- Show a warning when placing a recall if there is already a
record-level hold by this patron
- Show a link to mark a hold for conversion which selects the recall
option on holds page
- Include changes to patron search dropdown
- add 'mark hold for conversion to recall' column to columns settings

Signed-off-by: David Nind <david@davidnind.com>
Comment 87 Aleisha Amohia 2024-10-31 23:30:56 UTC
Created attachment 173846 [details] [review]
Bug 31391: Test fixes

Signed-off-by: David Nind <david@davidnind.com>
Comment 88 Aleisha Amohia 2024-10-31 23:31:00 UTC
Created attachment 173847 [details] [review]
Bug 31391: Update the UseRecalls system preference to have choices

Options are:
* off
* opac
* staff
* opac_and_staff

This patch implements this all over the place.

All recalls things should still work including the above test plan.

Tests should pass:

* t/db_dependent/Circulation.t
* t/db_dependent/Circulation/transferbook.t
* t/db_dependent/Holds.t
* t/db_dependent/Koha/Biblio.t
* t/db_dependent/Koha/Item.t
* t/db_dependent/SIP/Transaction.t
* t/db_dependent/Search.t
* t/db_dependent/XSLT.t

Sponsored-by: Auckland University of Technology
Sponsored-by: Catalyst IT
Comment 89 Aleisha Amohia 2024-10-31 23:31:51 UTC
I've rebased patches and hopefully improved the styling of the error message, but I would like to work on improving the content of the error message in a follow-up bug.
Comment 90 David Nind 2024-11-01 19:48:49 UTC
(In reply to Aleisha Amohia from comment #89)
> I've rebased patches and hopefully improved the styling of the error
> message, but I would like to work on improving the content of the error
> message in a follow-up bug.

Hi Aleisha.

Thanks for rebasing!

I've changed the status to Failed QA as:

1. I can't place a recall using the staff interface (with staff interface or both selected for placing recalls):
   1.1 Patron search box doesn't work as expected, so can't select a patron to place a recall for: autocomplete doesn't work, search brings you to an empty record, browse by last name does nothing (the autocomplete still works on the holds section).
   1.2 Couldn't test steps 12-14, 17-19.


Testing notes (using KTD):
1. Test plan: with follow-up patches, there is now only one system preference UseRecalls, you can select which interfaces to allow recalls to be placed from

Other notes:
1. With recalls allowed from the staff interface only and an existing recall:
   1.1 In the OPAC, the status for the record as a "Recall" in a button, under "Checked out".
   1.2 If you click "Recall" you get "Recalls have not been enabled. Please contact your library." on the account's "Recalls history" section.
   1.3 Not sure if that is what is expected or not.
Comment 91 Aleisha Amohia 2024-11-12 01:09:49 UTC
Created attachment 174396 [details] [review]
Bug 31391: (follow-up) Include changed requirements of patron autocomplete, datatable
Comment 92 Pedro Amorim 2024-11-19 15:40:48 UTC
Hey looking here, some minor observations (these may not be issues and are possibly caused by my lack of understanding - follow-up as you see fit):

In koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt

We have
IF Koha.Preference('UseRecalls') != "off"

Should it not be
IF Koha.Preference('UseRecalls').match('opac)

i.e. do we want to show this on this template if UseRecalls = 'staff'? 

In opac-recall.pl:
Shouldn't the check for if($op eq 'cud-cancel) be inside the if ( C4::Context->preference('UseRecalls') =~ m/opac/ ) check?

---------


Code looks good and QA script is happy. I'll follow the test plan soon and provide a SO if all is well.
Comment 93 Pedro Amorim 2024-11-20 09:51:17 UTC
Created attachment 174822 [details] [review]
Bug 31391: RecallsInterface system preference

Signed-off-by: David <david@davidnind.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Comment 94 Pedro Amorim 2024-11-20 09:51:20 UTC
Created attachment 174823 [details] [review]
Bug 31391: Recalled authorised value for hold cancellation

Signed-off-by: David <david@davidnind.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Comment 95 Pedro Amorim 2024-11-20 09:51:24 UTC
Created attachment 174824 [details] [review]
Bug 31391: Implement RecallsInterface on OPAC

Signed-off-by: David <david@davidnind.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Comment 96 Pedro Amorim 2024-11-20 09:51:28 UTC
Created attachment 174825 [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>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Comment 97 Pedro Amorim 2024-11-20 09:51:31 UTC
Created attachment 174826 [details] [review]
Bug 31391: (follow-up) Fix cancel recalls using checkbox

Signed-off-by: David <david@davidnind.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Comment 98 Pedro Amorim 2024-11-20 09:51:35 UTC
Created attachment 174827 [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>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Comment 99 Pedro Amorim 2024-11-20 09:51:38 UTC
Created attachment 174828 [details] [review]
Bug 31391: Interface and wording fixes

This patch includes the following fixes:
- Making the atomic updates executable
- Preventing warns when running tests
- Updating db updates
- Fixing terminology
- Make 'cancel selected recalls' button yellow
- Fix HTML makeup of recalls request page
- Show a warning when placing a recall if there is already a
record-level hold by this patron
- Show a link to mark a hold for conversion which selects the recall
option on holds page
- Include changes to patron search dropdown
- add 'mark hold for conversion to recall' column to columns settings

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Comment 100 Pedro Amorim 2024-11-20 09:51:42 UTC
Created attachment 174829 [details] [review]
Bug 31391: Test fixes

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Comment 101 Pedro Amorim 2024-11-20 09:51:46 UTC
Created attachment 174830 [details] [review]
Bug 31391: Update the UseRecalls system preference to have choices

Options are:
* off
* opac
* staff
* opac_and_staff

This patch implements this all over the place.

All recalls things should still work including the above test plan.

Tests should pass:

* t/db_dependent/Circulation.t
* t/db_dependent/Circulation/transferbook.t
* t/db_dependent/Holds.t
* t/db_dependent/Koha/Biblio.t
* t/db_dependent/Koha/Item.t
* t/db_dependent/SIP/Transaction.t
* t/db_dependent/Search.t
* t/db_dependent/XSLT.t

Sponsored-by: Auckland University of Technology
Sponsored-by: Catalyst IT
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Comment 102 Pedro Amorim 2024-11-20 09:51:50 UTC
Created attachment 174831 [details] [review]
Bug 31391: (follow-up) Include changed requirements of patron autocomplete, datatable

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Comment 103 Pedro Amorim 2024-11-20 09:53:39 UTC
Have signed-off as the observations I'm listing below are minor and quickly fixable (adding the ones from comment #92 here to have them all in a single comment):

1) 
In koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt

We have
  IF Koha.Preference('UseRecalls') != "off"

Should it not be
  IF Koha.Preference('UseRecalls').match('opac)

i.e. do we want to show this on this template if UseRecalls = 'staff'? 

2)
In opac-recall.pl:
Shouldn't the check for if($op eq 'cud-cancel) be inside the if ( C4::Context->preference('UseRecalls') =~ m/opac/ ) check?

3)
Occurrences of:
  <input type="submit" class="btn btn-default" value="Place recall">
Should be using .btn-primary

4)
I believe occurrences of:
  div class="dialog alert"
Should be
  div class="alert alert-warning"

5)
At first it seems recalls_per_record was buggy as I had it configured as 5 but was placing 10 recalls on a biblio record. I then realized 'record' in recalls_per_record refers to the patron record (?) and is consistent with the other circulation rules.

6)
Bug 23269 should be rebased on this or vice-versa.
I believe recalls API endpoints will be needed for bug 23269.