Bug 22818 - ILL should be able to send notices
Summary: ILL should be able to send notices
Status: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: ILL (show other bugs)
Version: master
Hardware: All All
: P5 - low new feature with 1 vote (vote)
Assignee: Andrew Isherwood
QA Contact: Tomás Cohen Arazi
URL:
Keywords: Manual, release-notes-needed, rel_20_05_target
: 18588 20917 23614 23615 (view as bug list)
Depends on:
Blocks:
 
Reported: 2019-05-01 10:23 UTC by Andrew Isherwood
Modified: 2019-11-01 07:34 UTC (History)
8 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 22818: Add notices sysprefs and DB column (21.26 KB, patch)
2019-05-16 13:50 UTC, Andrew Isherwood
Details | Diff | Splinter Review
Bug 22818: Add support for ILL notices (4.44 KB, patch)
2019-05-16 13:50 UTC, Andrew Isherwood
Details | Diff | Splinter Review
Bug 22818: Add generation and sending of notices (23.40 KB, patch)
2019-05-16 13:50 UTC, Andrew Isherwood
Details | Diff | Splinter Review
Bug 22818: Add MessageAttribut{e,es}.pm (3.06 KB, patch)
2019-05-16 13:50 UTC, Andrew Isherwood
Details | Diff | Splinter Review
Bug 22818: Unit tests (9.74 KB, patch)
2019-05-16 13:50 UTC, Andrew Isherwood
Details | Diff | Splinter Review
Bug 22818: Add notices sysprefs and DB column (21.26 KB, patch)
2019-05-24 15:38 UTC, Andrew Isherwood
Details | Diff | Splinter Review
Bug 22818: Add support for ILL notices (4.43 KB, patch)
2019-05-24 15:38 UTC, Andrew Isherwood
Details | Diff | Splinter Review
Bug 22818: Add generation and sending of notices (23.40 KB, patch)
2019-05-24 15:38 UTC, Andrew Isherwood
Details | Diff | Splinter Review
Bug 22818: Add MessageAttribut{e,es}.pm (3.06 KB, patch)
2019-05-24 15:38 UTC, Andrew Isherwood
Details | Diff | Splinter Review
Bug 22818: Unit tests (9.74 KB, patch)
2019-05-24 15:38 UTC, Andrew Isherwood
Details | Diff | Splinter Review
Bug 22818: Add notices sysprefs and DB column (21.35 KB, patch)
2019-06-18 08:24 UTC, PTFS Europe Sandboxes
Details | Diff | Splinter Review
Bug 22818: Add support for ILL notices (4.53 KB, patch)
2019-06-18 08:24 UTC, PTFS Europe Sandboxes
Details | Diff | Splinter Review
Bug 22818: Add generation and sending of notices (23.50 KB, patch)
2019-06-18 08:24 UTC, PTFS Europe Sandboxes
Details | Diff | Splinter Review
Bug 22818: Add MessageAttribut{e,es}.pm (3.16 KB, patch)
2019-06-18 08:24 UTC, PTFS Europe Sandboxes
Details | Diff | Splinter Review
Bug 22818: Unit tests (9.83 KB, patch)
2019-06-18 08:24 UTC, PTFS Europe Sandboxes
Details | Diff | Splinter Review
Bug 22818: Add notices sysprefs and DB column (21.35 KB, patch)
2019-09-17 14:14 UTC, Andrew Isherwood
Details | Diff | Splinter Review
Bug 22818: Add support for ILL notices (4.77 KB, patch)
2019-09-17 14:14 UTC, Andrew Isherwood
Details | Diff | Splinter Review
Bug 22818: Add generation and sending of notices (23.50 KB, patch)
2019-09-17 14:14 UTC, Andrew Isherwood
Details | Diff | Splinter Review
Bug 22818: Add MessageAttribut{e,es}.pm (3.16 KB, patch)
2019-09-17 14:14 UTC, Andrew Isherwood
Details | Diff | Splinter Review
Bug 22818: Unit tests (9.83 KB, patch)
2019-09-17 14:14 UTC, Andrew Isherwood
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Isherwood 2019-05-01 10:23:18 UTC
Currently ILL has no ability to send notices. There are a number of events that would warrant a notice being send out, these include:

To patron:
- Request ready for pickup
- Item requested not available

To staff:
- Request cancelled by patron
- Request modified by patron

To supplier:
- "Request from partner"

The last one, "Request from partner", is currently send via an ad-hoc function, but would make sense to convert to a notice.
Comment 1 Andrew Isherwood 2019-05-16 13:50:45 UTC
Created attachment 89831 [details] [review]
Bug 22818: Add notices sysprefs and DB column

This patch adds two new sysprefs. 'ILLDefaultEmail', 'ILLSendStaffNotices' and a new column to the
branches table called 'branchillemail'. It also adds five ILL related
notices.

Here we are providing the ability for a branch to have a dedicated email
address for it's ILL staff, the idea being that any notices sent by ILL
to staff need to go to specific staff, rather than the general branch
email address. If no branch specific address is defined, the address
specified in the ILLDefaultEmail syspref is used.

We're also providing a syspref 'ILLSendStaffNotices' to allow the user to specify which
notices should be sent to staff upon certain events.

We are also providing patron messaging preferences for the two patron
bound notices

We are also providing five notices for various ILL related events.
Comment 2 Andrew Isherwood 2019-05-16 13:50:47 UTC
Created attachment 89832 [details] [review]
Bug 22818: Add support for ILL notices

Here we're just adding ILL notices to the existing "letters"
infrastructure so notices can be displayed and edited
Comment 3 Andrew Isherwood 2019-05-16 13:50:50 UTC
Created attachment 89833 [details] [review]
Bug 22818: Add generation and sending of notices

This patch adds the ability for ILL to send notices, both triggered by
staff and triggered by events.

Staff can trigger notices to patrons from the "Manage ILL request" screen:
- ILL request ready for pickup
- ILL request unavailable
- Place request with partners

The following notices to staff are triggered automatically:
- Request has been modified by patron
- Request has been cancelled by patron

Branches can now specify an "ILL email" address to which notices
intended to inform staff of changes to requests by patrons can be sent.

The sending of notices is controlled by a few new sysprefs:
- "ILLDefaultStaffEmail" - Fallback email address for staff ILL notices
to be sent to in the absence of a branch address
- "ILLSendStaffNotices" - To specify which staff notices should be sent
automatically when requests are manipulated by patrons

Patron notices are also controlled by the patron's messaging
preferences
Comment 4 Andrew Isherwood 2019-05-16 13:50:52 UTC
Created attachment 89834 [details] [review]
Bug 22818: Add MessageAttribut{e,es}.pm

We need to be able to access individual message attributes in tests, so
adding accessors for them
Comment 5 Andrew Isherwood 2019-05-16 13:50:55 UTC
Created attachment 89835 [details] [review]
Bug 22818: Unit tests

This patch adds unit tests for the new methods in Illrequest.pm
Comment 6 Andrew Isherwood 2019-05-16 13:51:23 UTC
- Apply patch
- Update database and schema

- Create a report using the following SQL in order to verify that notices are being generated:
SELECT borrowernumber, subject, content, message_transport_type, to_address, from_address FROM message_queue WHERE letter_code LIKE 'ILL%' ORDER BY message_id DESC

- Create one or more "partners". These are patrons that belong to a patron category that has a code that matches the <partner_code> value in your koha-conf.xml (default is ILLLIBS). Patrons in this category must have a primary email defined. Patrons defined in this way are offered as request partners within the ILL interface.

SYSTEM PREFERENCES AND BRANCH CONFIG
- In the staff interface, go to Tools > Notices & Slips
=> TEST: Observe that there are 5 new notices defined for the "Interlibrary loans" module
- Go to "Koha administration" > "Libraries"
- Choose a library and "Edit" it
=> TEST: Observe there is a new "ILL staff email" field
- Enter an email address in the "ILL staff email" field and save the branch
- Go to "Koha administration" > search for the "ILLDefaultStaffEmail" syspref
=> TEST: Observe the new syspref exists
- Enter an email address in this syspref and then save it
- Go to "Koha administration" > search for the "ILLSendStaffNotices" syspref
=> TEST: Observe the new syspref exists
- Enter the names of the two staff notices in this syspref as "ILL_REQUEST_CANCEL|ILL_REQUEST_MODIFIED" and save the syspref

PATRON MESSAGING PREFERENCES
- Go to a patron's messaging preferences
=> TEST: Observe that two new messaging preferences exist, "Interlibrary loan ready" & "Interlibrary loan unavailable"
- Select email and/or SMS for each of these notices

SENDING PATRON NOTICES FROM ILL REQUEST
- In the staff interface, go to "ILL requests"
- Create an ILL request using the FreeForm backend (for the user you just modified the messaging preferences for), select the branch that you previously added the "ILL staff email" address to
- Go to the "Manage ILL request" screen for the newly created request
=> TEST: Observe that there is a new "Send notice to patron" dropdown in the button bar which offers two notices to send
- Select a notice to be sent
=> TEST: Observe that a message reporting the successful queueing of the notice is displayed
- Click on the "ILL request log" for the request
=> TEST: Observe that a log entry "Patron notice sent:" was added to the log
- Run the report created earlier
=> TEST: Observe that a notice was created for all sending methods selected in the patron's messaging preferences
=> TEST: Observe that the borrowernumber column of the notice is populated

SENDING REQUEST TO PARTNERS
- Go to the "Manage ILL request" screen for a request
- Choose "Place request with partners"
=> TEST: Observe that the text defined in the ILL_PARTNER_REQ notice is displayed and can be modified
- Select one or more partners that were defined earlier, then click "Send email"
=> TEST: Observe that the request's status has changed to "Requested from partners"
- Run the report created earlier
=> TEST: Observe that a notice was created for each selected partner
=> TEST: Observe that the to_address column matches the primary email address for the partner
=> TEST: Observe that the from_address matches the previously defined "ILL staff email" for the request's branch

PATRON GENERATED NOTICES
- As a patron with ILL requests, go to the "your interlibrary loan requests" page in the OPAC
- View a request
- Add some text to the notes field and save
- Run the report created earlier
=> TEST: Observe that a notice was created for the modification
=> TEST: Observe that the to_address matches the previously defined "ILL staff email" for the request's branch
=> TEST: Observe that the from_address matches the previously defined "ILL staff email" for the request's branch
- As a patron with ILL requests, go to the "your interlibrary loan requests" page in the OPAC
- View a request
- Choose "Request cancellation"
- Run the report created earlier
=> TEST: Observe that a notice was created for the modification
=> TEST: Observe that the to_address matches the previously defined "ILL staff email" for the request's branch
=> TEST: Observe that the from_address matches the previously defined "ILL staff email" for the request's branch

There is a fallback hierarchy for the address to which staff notices are sent:

Branch ILL staff email > ILLDefaultStaffEmail > General branch email > Koha admin email

Please test that this hierarchy is adhered to by undefining one or more of these options.
Comment 7 Andrew Isherwood 2019-05-24 11:54:04 UTC
*** Bug 18588 has been marked as a duplicate of this bug. ***
Comment 8 Andrew Isherwood 2019-05-24 15:38:21 UTC
Created attachment 90063 [details] [review]
Bug 22818: Add notices sysprefs and DB column

This patch adds two new sysprefs. 'ILLDefaultEmail', 'ILLSendStaffNotices' and a new column to the
branches table called 'branchillemail'. It also adds five ILL related
notices.

Here we are providing the ability for a branch to have a dedicated email
address for it's ILL staff, the idea being that any notices sent by ILL
to staff need to go to specific staff, rather than the general branch
email address. If no branch specific address is defined, the address
specified in the ILLDefaultEmail syspref is used.

We're also providing a syspref 'ILLSendStaffNotices' to allow the user to specify which
notices should be sent to staff upon certain events.

We are also providing patron messaging preferences for the two patron
bound notices

We are also providing five notices for various ILL related events.
Comment 9 Andrew Isherwood 2019-05-24 15:38:24 UTC
Created attachment 90064 [details] [review]
Bug 22818: Add support for ILL notices

Here we're just adding ILL notices to the existing "letters"
infrastructure so notices can be displayed and edited
Comment 10 Andrew Isherwood 2019-05-24 15:38:27 UTC
Created attachment 90065 [details] [review]
Bug 22818: Add generation and sending of notices

This patch adds the ability for ILL to send notices, both triggered by
staff and triggered by events.

Staff can trigger notices to patrons from the "Manage ILL request" screen:
- ILL request ready for pickup
- ILL request unavailable
- Place request with partners

The following notices to staff are triggered automatically:
- Request has been modified by patron
- Request has been cancelled by patron

Branches can now specify an "ILL email" address to which notices
intended to inform staff of changes to requests by patrons can be sent.

The sending of notices is controlled by a few new sysprefs:
- "ILLDefaultStaffEmail" - Fallback email address for staff ILL notices
to be sent to in the absence of a branch address
- "ILLSendStaffNotices" - To specify which staff notices should be sent
automatically when requests are manipulated by patrons

Patron notices are also controlled by the patron's messaging
preferences
Comment 11 Andrew Isherwood 2019-05-24 15:38:30 UTC
Created attachment 90066 [details] [review]
Bug 22818: Add MessageAttribut{e,es}.pm

We need to be able to access individual message attributes in tests, so
adding accessors for them
Comment 12 Andrew Isherwood 2019-05-24 15:38:32 UTC
Created attachment 90067 [details] [review]
Bug 22818: Unit tests

This patch adds unit tests for the new methods in Illrequest.pm
Comment 13 Andrew Isherwood 2019-06-03 13:11:50 UTC
Slightly revised test plan:

- Apply patch
- Update database and schema

- Create a report using the following SQL in order to verify that notices are being generated:
SELECT borrowernumber, subject, content, message_transport_type, to_address, from_address FROM message_queue WHERE letter_code LIKE 'ILL%' ORDER BY message_id DESC

- Create one or more "partners". These are patrons that belong to a patron category that has a code that matches the <partner_code> value in your koha-conf.xml (default is ILLLIBS). Patrons in this category must have a primary email defined. Patrons defined in this way are offered as request partners within the ILL interface.

- Go to "Koha administration", search for "IllLog" syspref, ensure it is set to "Log"

SYSTEM PREFERENCES AND BRANCH CONFIG
- In the staff interface, go to Tools > Notices & Slips
=> TEST: Observe that there are 5 new notices defined for the "Interlibrary loans" module
- Go to "Koha administration" > "Libraries"
- Choose a library and "Edit" it
=> TEST: Observe there is a new "ILL staff email" field
- Enter an email address in the "ILL staff email" field and save the branch
- Go to "Koha administration" > search for the "ILLDefaultStaffEmail" syspref
=> TEST: Observe the new syspref exists
- Enter an email address in this syspref and then save it
- Go to "Koha administration" > search for the "ILLSendStaffNotices" syspref
=> TEST: Observe the new syspref exists
- Enter the names of the two staff notices in this syspref as "ILL_REQUEST_CANCEL|ILL_REQUEST_MODIFIED" and save the syspref

PATRON MESSAGING PREFERENCES
- Go to a patron's messaging preferences
=> TEST: Observe that two new messaging preferences exist, "Interlibrary loan ready" & "Interlibrary loan unavailable"
- Select email and/or SMS for each of these notices

SENDING PATRON NOTICES FROM ILL REQUEST
- In the staff interface, go to "ILL requests"
- Create an ILL request using the FreeForm backend (for the user you just modified the messaging preferences for), select the branch that you previously added the "ILL staff email" address to
- Go to the "Manage ILL request" screen for the newly created request
=> TEST: Observe that there is a new "Send notice to patron" dropdown in the button bar which offers two notices to send
- Select a notice to be sent
=> TEST: Observe that a message reporting the successful queueing of the notice is displayed
- Click on the "ILL request log" for the request
=> TEST: Observe that a log entry "Patron notice sent:" was added to the log
- Run the report created earlier
=> TEST: Observe that a notice was created for all sending methods selected in the patron's messaging preferences
=> TEST: Observe that the borrowernumber column of the notice is populated

SENDING REQUEST TO PARTNERS
- Go to the "Manage ILL request" screen for a request
- Choose "Place request with partners"
=> TEST: Observe that the text defined in the ILL_PARTNER_REQ notice is displayed and can be modified
- Select one or more partners that were defined earlier, then click "Send email"
=> TEST: Observe that the request's status has changed to "Requested from partners"
- Run the report created earlier
=> TEST: Observe that a notice was created for each selected partner
=> TEST: Observe that the to_address column matches the primary email address for the partner
=> TEST: Observe that the from_address matches the previously defined "ILL staff email" for the request's branch

PATRON GENERATED NOTICES
- As a patron with ILL requests, go to the "your interlibrary loan requests" page in the OPAC
- View a request
- Add some text to the notes field and save
- Run the report created earlier
=> TEST: Observe that a notice was created for the modification
=> TEST: Observe that the to_address matches the previously defined "ILL staff email" for the request's branch
=> TEST: Observe that the from_address matches the previously defined "ILL staff email" for the request's branch
- As a patron with ILL requests, go to the "your interlibrary loan requests" page in the OPAC
- View a request
- Choose "Request cancellation"
- Run the report created earlier
=> TEST: Observe that a notice was created for the modification
=> TEST: Observe that the to_address matches the previously defined "ILL staff email" for the request's branch
=> TEST: Observe that the from_address matches the previously defined "ILL staff email" for the request's branch

There is a fallback hierarchy for the address to which staff notices are sent:

Branch ILL staff email > ILLDefaultStaffEmail > General branch email > Koha admin email

Please test that this hierarchy is adhered to by undefining one or more of these options.
Comment 14 PTFS Europe Sandboxes 2019-06-18 08:24:09 UTC
Created attachment 90715 [details] [review]
Bug 22818: Add notices sysprefs and DB column

This patch adds two new sysprefs. 'ILLDefaultEmail', 'ILLSendStaffNotices' and a new column to the
branches table called 'branchillemail'. It also adds five ILL related
notices.

Here we are providing the ability for a branch to have a dedicated email
address for it's ILL staff, the idea being that any notices sent by ILL
to staff need to go to specific staff, rather than the general branch
email address. If no branch specific address is defined, the address
specified in the ILLDefaultEmail syspref is used.

We're also providing a syspref 'ILLSendStaffNotices' to allow the user to specify which
notices should be sent to staff upon certain events.

We are also providing patron messaging preferences for the two patron
bound notices

We are also providing five notices for various ILL related events.

Signed-off-by: Niamh Walker-Headon <Niamh.Walker-Headon@it-tallaght.ie>
Sponsored-by: PTFS Europe
Comment 15 PTFS Europe Sandboxes 2019-06-18 08:24:13 UTC
Created attachment 90716 [details] [review]
Bug 22818: Add support for ILL notices

Here we're just adding ILL notices to the existing "letters"
infrastructure so notices can be displayed and edited

Signed-off-by: Niamh Walker-Headon <Niamh.Walker-Headon@it-tallaght.ie>
Sponsored-by: PTFS Europe
Comment 16 PTFS Europe Sandboxes 2019-06-18 08:24:16 UTC
Created attachment 90717 [details] [review]
Bug 22818: Add generation and sending of notices

This patch adds the ability for ILL to send notices, both triggered by
staff and triggered by events.

Staff can trigger notices to patrons from the "Manage ILL request" screen:
- ILL request ready for pickup
- ILL request unavailable
- Place request with partners

The following notices to staff are triggered automatically:
- Request has been modified by patron
- Request has been cancelled by patron

Branches can now specify an "ILL email" address to which notices
intended to inform staff of changes to requests by patrons can be sent.

The sending of notices is controlled by a few new sysprefs:
- "ILLDefaultStaffEmail" - Fallback email address for staff ILL notices
to be sent to in the absence of a branch address
- "ILLSendStaffNotices" - To specify which staff notices should be sent
automatically when requests are manipulated by patrons

Patron notices are also controlled by the patron's messaging
preferences

Signed-off-by: Niamh Walker-Headon <Niamh.Walker-Headon@it-tallaght.ie>
Sponsored-by: PTFS Europe
Comment 17 PTFS Europe Sandboxes 2019-06-18 08:24:19 UTC
Created attachment 90718 [details] [review]
Bug 22818: Add MessageAttribut{e,es}.pm

We need to be able to access individual message attributes in tests, so
adding accessors for them

Signed-off-by: Niamh Walker-Headon <Niamh.Walker-Headon@it-tallaght.ie>
Sponsored-by: PTFS Europe
Comment 18 PTFS Europe Sandboxes 2019-06-18 08:24:22 UTC
Created attachment 90719 [details] [review]
Bug 22818: Unit tests

This patch adds unit tests for the new methods in Illrequest.pm

Signed-off-by: Niamh Walker-Headon <Niamh.Walker-Headon@it-tallaght.ie>
Sponsored-by: PTFS Europe
Comment 19 Andrew Isherwood 2019-08-02 13:00:29 UTC
*** Bug 20917 has been marked as a duplicate of this bug. ***
Comment 20 Andrew Isherwood 2019-09-17 14:14:41 UTC
Created attachment 92898 [details] [review]
Bug 22818: Add notices sysprefs and DB column

This patch adds two new sysprefs. 'ILLDefaultEmail', 'ILLSendStaffNotices' and a new column to the
branches table called 'branchillemail'. It also adds five ILL related
notices.

Here we are providing the ability for a branch to have a dedicated email
address for it's ILL staff, the idea being that any notices sent by ILL
to staff need to go to specific staff, rather than the general branch
email address. If no branch specific address is defined, the address
specified in the ILLDefaultEmail syspref is used.

We're also providing a syspref 'ILLSendStaffNotices' to allow the user to specify which
notices should be sent to staff upon certain events.

We are also providing patron messaging preferences for the two patron
bound notices

We are also providing five notices for various ILL related events.

Signed-off-by: Niamh Walker-Headon <Niamh.Walker-Headon@it-tallaght.ie>
Sponsored-by: PTFS Europe
Comment 21 Andrew Isherwood 2019-09-17 14:14:44 UTC
Created attachment 92899 [details] [review]
Bug 22818: Add support for ILL notices

Here we're just adding ILL notices to the existing "letters"
infrastructure so notices can be displayed and edited

Signed-off-by: Niamh Walker-Headon <Niamh.Walker-Headon@it-tallaght.ie>
Sponsored-by: PTFS Europe
Comment 22 Andrew Isherwood 2019-09-17 14:14:48 UTC
Created attachment 92900 [details] [review]
Bug 22818: Add generation and sending of notices

This patch adds the ability for ILL to send notices, both triggered by
staff and triggered by events.

Staff can trigger notices to patrons from the "Manage ILL request" screen:
- ILL request ready for pickup
- ILL request unavailable
- Place request with partners

The following notices to staff are triggered automatically:
- Request has been modified by patron
- Request has been cancelled by patron

Branches can now specify an "ILL email" address to which notices
intended to inform staff of changes to requests by patrons can be sent.

The sending of notices is controlled by a few new sysprefs:
- "ILLDefaultStaffEmail" - Fallback email address for staff ILL notices
to be sent to in the absence of a branch address
- "ILLSendStaffNotices" - To specify which staff notices should be sent
automatically when requests are manipulated by patrons

Patron notices are also controlled by the patron's messaging
preferences

Signed-off-by: Niamh Walker-Headon <Niamh.Walker-Headon@it-tallaght.ie>
Sponsored-by: PTFS Europe
Comment 23 Andrew Isherwood 2019-09-17 14:14:51 UTC
Created attachment 92901 [details] [review]
Bug 22818: Add MessageAttribut{e,es}.pm

We need to be able to access individual message attributes in tests, so
adding accessors for them

Signed-off-by: Niamh Walker-Headon <Niamh.Walker-Headon@it-tallaght.ie>
Sponsored-by: PTFS Europe
Comment 24 Andrew Isherwood 2019-09-17 14:14:55 UTC
Created attachment 92902 [details] [review]
Bug 22818: Unit tests

This patch adds unit tests for the new methods in Illrequest.pm

Signed-off-by: Niamh Walker-Headon <Niamh.Walker-Headon@it-tallaght.ie>
Sponsored-by: PTFS Europe
Comment 25 Andrew Isherwood 2019-09-17 15:10:31 UTC
*** Bug 23614 has been marked as a duplicate of this bug. ***
Comment 26 Andrew Isherwood 2019-09-17 15:10:54 UTC
*** Bug 23615 has been marked as a duplicate of this bug. ***
Comment 27 Tomás Cohen Arazi 2019-09-17 16:56:45 UTC
I'm starting to test this. I would like to say that I see more and more the need to have an ILL configuration section in the staff interface.