Bug 20453

Summary: Send notification when hold is cancelled by librarian
Product: Koha Reporter: Josef Moravec <josef.moravec>
Component: Hold requestsAssignee: Aleisha Amohia <aleisha>
Status: RESOLVED DUPLICATE QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: aleisha, amitddng135, andrewfh, black23, david.roberts, gmcharlt, katrin.fischer, marjorie.barry-vila, rbit
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12656
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24718
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25534
Change sponsored?: Sponsored Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
This patch adds a new notice, HOLD_MANUAL_CANCEL, that can be sent to a borrower when a library cancels their hold request. The sending of this notice can be configured using messaging preferences.
Version(s) released in:
Attachments: Bug 20453: Adding notice to be sent when cancelling holds
Bug 20453: Send notice when cancelling a hold from intranet
Bug 20453: Adding notice to be sent when cancelling holds
Bug 20453: Send notice when cancelling a hold from intranet
Bug 20453: Adding notice to be sent when cancelling holds
Bug 20453: Send notice when cancelling a hold from intranet
Bug 20453: Manage sending of HOLD_MANUAL_CANCEL notice with patron messaging preferences
Bug 20453: Adding notice to be sent when cancelling holds
Bug 20453: Send notice when cancelling a hold from intranet
Bug 20453: Manage sending of HOLD_MANUAL_CANCEL notice with patron messaging preferences
Patch application errors
Bug 20453: Adding notice to be sent when cancelling holds
Bug 20453: Send notice when cancelling a hold from intranet
Bug 20453: Manage sending of HOLD_MANUAL_CANCEL notice with patron messaging preferences
Bug 20453: Adding notice to be sent when cancelling holds
Bug 20453: Send notice when cancelling a hold from intranet
Bug 20453: Manage sending of HOLD_MANUAL_CANCEL notice with patron messaging preferences

Description Josef Moravec 2018-03-20 13:47:44 UTC
When librarian cancel a patrons hold manually, it woul be nice to send a message to a patron.
Comment 1 Aleisha Amohia 2020-02-24 22:42:00 UTC
Created attachment 99546 [details] [review]
Bug 20453: Adding notice to be sent when cancelling holds

Sponsored-by: Waikato Institute of Technology
Comment 2 Aleisha Amohia 2020-02-24 22:42:06 UTC
Created attachment 99547 [details] [review]
Bug 20453: Send notice when cancelling a hold from intranet

To test:
1) Apply patch
2) Place a reserve for Borrower A
3) Cancel the reserve from reserve/request.pl
4) Go to Borrower A's account page and look at Notices tab
5) Confirm the HOLD_MANUAL_CANCEL notice is pending
6) Place a reserve for Borrower A again
7) Go to Circulation -> Holds to pull
8) Cancel the hold
9) Repeat steps 4 and 5
10) Place a reserve for Borrower A again
11) Go to Borrower A's account page and look at the Holds table (under
    Check out tab or Details tab)
12) Cancel hold using 'Cancel marked holds' button
13) Repeat steps 4 and 5

Sponsored-by: Waikato Institute of Technology
Comment 3 David Roberts 2020-03-26 01:44:05 UTC
The patch doesn't apply in my test environment :-(
Comment 4 Aleisha Amohia 2020-04-01 04:50:07 UTC
Created attachment 102170 [details] [review]
Bug 20453: Adding notice to be sent when cancelling holds

Sponsored-by: Waikato Institute of Technology
Comment 5 Aleisha Amohia 2020-04-01 04:50:12 UTC
Created attachment 102171 [details] [review]
Bug 20453: Send notice when cancelling a hold from intranet

To test:
1) Apply patch
2) Place a reserve for Borrower A
3) Cancel the reserve from reserve/request.pl
4) Go to Borrower A's account page and look at Notices tab
5) Confirm the HOLD_MANUAL_CANCEL notice is pending
6) Place a reserve for Borrower A again
7) Go to Circulation -> Holds to pull
8) Cancel the hold
9) Repeat steps 4 and 5
10) Place a reserve for Borrower A again
11) Go to Borrower A's account page and look at the Holds table (under
    Check out tab or Details tab)
12) Cancel hold using 'Cancel marked holds' button
13) Repeat steps 4 and 5

Sponsored-by: Waikato Institute of Technology
Comment 6 Andrew Fuerste-Henry 2020-04-01 13:16:08 UTC
This is a great idea, but I don't love that there's no way to turn it off for individual patrons or for groups of patrons. Ultimately, it should probably be a patron messaging preference like the hold available notice.
If nothing else, there should be something here that requires a library to specifically turn this notice on. As it is, the notice will just start sending to all patrons as son as the patch is applied.
Comment 7 Katrin Fischer 2020-04-01 19:54:25 UTC
(In reply to Andrew Fuerste-Henry from comment #6)
> This is a great idea, but I don't love that there's no way to turn it off
> for individual patrons or for groups of patrons. Ultimately, it should
> probably be a patron messaging preference like the hold available notice.
> If nothing else, there should be something here that requires a library to
> specifically turn this notice on. As it is, the notice will just start
> sending to all patrons as son as the patch is applied.

+1 :)
Comment 8 Michal Denar 2020-04-01 20:45:23 UTC
Hi Aleisha,
I get Error: "DataTables warning: table id=holds-table - Ajax error. For more information about this error, please see http://datatables.net/tn/7" at step 11.
Comment 9 Aleisha Amohia 2020-04-15 04:50:28 UTC
Created attachment 102956 [details] [review]
Bug 20453: Adding notice to be sent when cancelling holds

Sponsored-by: Waikato Institute of Technology
Comment 10 Aleisha Amohia 2020-04-15 04:50:33 UTC
Created attachment 102957 [details] [review]
Bug 20453: Send notice when cancelling a hold from intranet

To test:
1) Apply patch
2) Place a reserve for Borrower A
3) Cancel the reserve from reserve/request.pl
4) Go to Borrower A's account page and look at Notices tab
5) Confirm the HOLD_MANUAL_CANCEL notice is pending
6) Place a reserve for Borrower A again
7) Go to Circulation -> Holds to pull
8) Cancel the hold
9) Repeat steps 4 and 5
10) Place a reserve for Borrower A again
11) Go to Borrower A's account page and look at the Holds table (under
    Check out tab or Details tab)
12) Cancel hold using 'Cancel marked holds' button
13) Repeat steps 4 and 5

Sponsored-by: Waikato Institute of Technology
Comment 11 Aleisha Amohia 2020-04-15 04:50:37 UTC
Created attachment 102958 [details] [review]
Bug 20453: Manage sending of HOLD_MANUAL_CANCEL notice with patron messaging preferences

To test:
1) Apply this patch and run database updates
2) Confirm the 'Hold manually cancelled' option shows on the patron
messaging preferences table on both the staff client and the OPAC. It
should be unchecked (NOT enabled).
3) Follow the test plan from the second patch "Send notice when
cancelling a hold from intranet"
4) Confirm that after completing the test plan, Borrower A has not been
sent any notices (Check Notices tab)
5) Check the 'Hold manually cancelled' option in the patron messaging
preferences (enable).
6) Go through the previous test plan again.
7) Refresh the Notices tab each time you cancel a hold. Confirm a new
notice is pending with each refresh.

Sponsored-by: Waikato Institute of Technology
Comment 12 Andrew Fuerste-Henry 2020-04-29 18:27:46 UTC
This patch isn't applying for me. It's mad because installer/data/mysql/es-ES/mandatory/sample_notices.sql gone, due to bug 24897.
Comment 13 Aleisha Amohia 2020-04-29 21:24:57 UTC
Created attachment 103994 [details] [review]
Bug 20453: Adding notice to be sent when cancelling holds

Sponsored-by: Waikato Institute of Technology
Comment 14 Aleisha Amohia 2020-04-29 21:25:02 UTC
Created attachment 103995 [details] [review]
Bug 20453: Send notice when cancelling a hold from intranet

To test:
1) Apply patch
2) Place a reserve for Borrower A
3) Cancel the reserve from reserve/request.pl
4) Go to Borrower A's account page and look at Notices tab
5) Confirm the HOLD_MANUAL_CANCEL notice is pending
6) Place a reserve for Borrower A again
7) Go to Circulation -> Holds to pull
8) Cancel the hold
9) Repeat steps 4 and 5
10) Place a reserve for Borrower A again
11) Go to Borrower A's account page and look at the Holds table (under
    Check out tab or Details tab)
12) Cancel hold using 'Cancel marked holds' button
13) Repeat steps 4 and 5

Sponsored-by: Waikato Institute of Technology
Comment 15 Aleisha Amohia 2020-04-29 21:25:07 UTC
Created attachment 103996 [details] [review]
Bug 20453: Manage sending of HOLD_MANUAL_CANCEL notice with patron messaging preferences

To test:
1) Apply this patch and run database updates
2) Confirm the 'Hold manually cancelled' option shows on the patron
messaging preferences table on both the staff client and the OPAC. It
should be unchecked (NOT enabled).
3) Follow the test plan from the second patch "Send notice when
cancelling a hold from intranet"
4) Confirm that after completing the test plan, Borrower A has not been
sent any notices (Check Notices tab)
5) Check the 'Hold manually cancelled' option in the patron messaging
preferences (enable).
6) Go through the previous test plan again.
7) Refresh the Notices tab each time you cancel a hold. Confirm a new
notice is pending with each refresh.

Sponsored-by: Waikato Institute of Technology
Comment 16 Michael Adamyk 2020-07-27 21:36:25 UTC
Created attachment 107449 [details]
Patch application errors

I couldn't get this to work. I don't believe it is applying properly to my sandbox. I'm not seeing any new messaging preferences, and if I cancel a hold there are no notification messages.

I'm getting several conflicts and a failure message when I try to manually apply the patch (see attachment "bug20453.2")

Notably "Patch failed at 0001 Bug 20453: Adding notice to be sent when cancelling holds. The copy of the patch that failed is found in: .git/rebase-apply/patch"
Comment 18 Aleisha Amohia 2020-09-15 03:08:18 UTC
Created attachment 110092 [details] [review]
Bug 20453: Adding notice to be sent when cancelling holds

Sponsored-by: Waikato Institute of Technology
Comment 19 Aleisha Amohia 2020-09-15 03:08:24 UTC
Created attachment 110093 [details] [review]
Bug 20453: Send notice when cancelling a hold from intranet

To test:
1) Apply patch
2) Place a reserve for Borrower A
3) Cancel the reserve from reserve/request.pl
4) Go to Borrower A's account page and look at Notices tab
5) Confirm the HOLD_MANUAL_CANCEL notice is pending
6) Place a reserve for Borrower A again
7) Go to Circulation -> Holds to pull
8) Cancel the hold
9) Repeat steps 4 and 5
10) Place a reserve for Borrower A again
11) Go to Borrower A's account page and look at the Holds table (under
        Check out tab or Details tab)
12) Cancel hold using 'Cancel marked holds' button
13) Repeat steps 4 and 5

Sponsored-by: Waikato Institute of Technology
Comment 20 Aleisha Amohia 2020-09-15 03:08:30 UTC
Created attachment 110094 [details] [review]
Bug 20453: Manage sending of HOLD_MANUAL_CANCEL notice with patron messaging preferences

To test:
1) Apply this patch and run database updates
2) Confirm the 'Hold manually cancelled' option shows on the patron
messaging preferences table on both the staff client and the OPAC. It
should be unchecked (NOT enabled).
3) Follow the test plan from the second patch "Send notice when
cancelling a hold from intranet"
4) Confirm that after completing the test plan, Borrower A has not been
sent any notices (Check Notices tab)
5) Check the 'Hold manually cancelled' option in the patron messaging
preferences (enable).
6) Go through the previous test plan again.
7) Refresh the Notices tab each time you cancel a hold. Confirm a new
notice is pending with each refresh.

Sponsored-by: Waikato Institute of Technology
Comment 21 David Nind 2020-09-16 11:59:13 UTC
Created attachment 110178 [details] [review]
Bug 20453: Adding notice to be sent when cancelling holds

Sponsored-by: Waikato Institute of Technology

Signed-off-by: David Nind <david@davidnind.com>
Comment 22 David Nind 2020-09-16 11:59:20 UTC
Created attachment 110179 [details] [review]
Bug 20453: Send notice when cancelling a hold from intranet

To test:
1) Apply patch
2) Place a reserve for Borrower A
3) Cancel the reserve from reserve/request.pl
4) Go to Borrower A's account page and look at Notices tab
5) Confirm the HOLD_MANUAL_CANCEL notice is pending
6) Place a reserve for Borrower A again
7) Go to Circulation -> Holds to pull
8) Cancel the hold
9) Repeat steps 4 and 5
10) Place a reserve for Borrower A again
11) Go to Borrower A's account page and look at the Holds table (under
        Check out tab or Details tab)
12) Cancel hold using 'Cancel marked holds' button
13) Repeat steps 4 and 5

Sponsored-by: Waikato Institute of Technology

Signed-off-by: David Nind <david@davidnind.com>
Comment 23 David Nind 2020-09-16 11:59:28 UTC
Created attachment 110180 [details] [review]
Bug 20453: Manage sending of HOLD_MANUAL_CANCEL notice with patron messaging preferences

To test:
1) Apply this patch and run database updates
2) Confirm the 'Hold manually cancelled' option shows on the patron
messaging preferences table on both the staff client and the OPAC. It
should be unchecked (NOT enabled).
3) Follow the test plan from the second patch "Send notice when
cancelling a hold from intranet"
4) Confirm that after completing the test plan, Borrower A has not been
sent any notices (Check Notices tab)
5) Check the 'Hold manually cancelled' option in the patron messaging
preferences (enable).
6) Go through the previous test plan again.
7) Refresh the Notices tab each time you cancel a hold. Confirm a new
notice is pending with each refresh.

Sponsored-by: Waikato Institute of Technology

Signed-off-by: David Nind <david@davidnind.com>
Comment 24 Katrin Fischer 2020-09-17 21:18:11 UTC
Hi Aleisha,

I am trying to figure out how this is different from bug 25534 that has been pushed recently. It's also about notifying users when their hold is cancelled and uses the new notice template HOLD_CANCELLATION and allows to select a reason for cancellation that is stored in reserves.

They read like the same feature to me :(

Can you please check if this is a true duplicate?
Comment 25 Aleisha Amohia 2020-09-17 21:20:22 UTC
Ah. Bug 25534 does a bit more than this enhancement, but yes, it is the same feature. It's a shame that wasn't caught when Bug 25534 was reported. Oh well! Marking as duplicate.

*** This bug has been marked as a duplicate of bug 25534 ***
Comment 26 Katrin Fischer 2020-09-17 22:06:36 UTC
Yes, doubled up work is always sad - I am sorry that I didn't catch these earlier.