Summary: | We should notify an assignee when they are assigned a ticket | ||
---|---|---|---|
Product: | Koha | Reporter: | Martin Renvoize (ashimema) <martin.renvoize> |
Component: | Notices | Assignee: | Martin Renvoize (ashimema) <martin.renvoize> |
Status: | RESOLVED FIXED | QA Contact: | Kyle M Hall (khall) <kyle> |
Severity: | enhancement | ||
Priority: | P5 - low | CC: | caroline.cyr-la-rose, david, lucas |
Version: | unspecified | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Caroline Cyr La Rose | Documentation submission: | https://gitlab.com/koha-community/koha-manual/-/merge_requests/957 |
Text to go in the release notes: |
This enhancement to catalog concerns notifies staff when a new concern is assigned to them for action (when CatalogConcerns and OpacCatalogConcerns are enabled). It uses a new TICKET_ASSIGNED notice. No notice is sent when it is self-assigned.
**Sponsored by** *PTFS Europe*
|
Version(s) released in: |
24.11.00
|
Circulation function: | |||
Bug Depends on: | 35657 | ||
Bug Blocks: | 15278, 34255 | ||
Attachments: |
Bug 36758: Add TICKET_ASSIGNED notice
Bug 36758: Add librarian object Bug 36758: Unit tests for assignee notification trigger Bug 36758: Add trigger for assignee notification trigger Bug 36758: Add TICKET_ASSIGNED notice Bug 36758: Add librarian object Bug 36758: Unit tests for assignee notification trigger Bug 36758: Add trigger for assignee notification trigger Bug 36758: Add TICKET_ASSIGNED notice Bug 36758: Add librarian object Bug 36758: Unit tests for assignee notification trigger Bug 36758: Add trigger for assignee notification trigger Bug 36758: (follow-up) Fix unit tests |
Description
Martin Renvoize (ashimema)
2024-05-02 14:20:58 UTC
Created attachment 166316 [details] [review] Bug 36758: Add TICKET_ASSIGNED notice This patch adds a new default TICKET_ASSIGNED notice to be used with catalog concerns to notice the assigned staff user when a ticket has been assigned to them. Test plan 1) Run the database update and confirm that the new notice has been added to the database (If on the sandboxes, skip to the next patch) Created attachment 166317 [details] [review] Bug 36758: Add librarian object This patch adds a 'librarian' object fetch to C4::Letters::GetPreparedLetter when a called passes the 'want_librarian' flag. This allows for the notice to take full advantage of the patron object for that librarian rather than requireing old non-TT syntax for this feature. Test plan 1) We use the 'librarian' object in the new TICKET_ASSIGNED default notice, use the next patch to test that the librarian title is correctly substituted into the notice. Created attachment 166318 [details] [review] Bug 36758: Unit tests for assignee notification trigger This patch adds unit tests for the TICKET_ASSIGNED trigger being introduced with this patchset. Test plan 1) Run the unit tests prior to the next patch and confirm they fail 2) Apply the next patch and confirm the unit tests now pass Created attachment 166319 [details] [review] Bug 36758: Add trigger for assignee notification trigger This patch adds a new notice trigger to allow notifying assigned staff that they have been assigned a new catalog concern to action. Test plan 1) Enable catalog concerns (either via staff or opac interfaces) 2) Report a new concern (either via staff or opac interfaces) 3) As a staff user, assign the concern to another staff user 4) Check that the new 'TICKET_ASSIGNED' notice has be queued for that staff user. 5) Re-assign the catalog concern to yourself 6) Note that you do not see a 'TICKET_ASSIGNED@ notice queued as you self-assigned. Note to RM.. I introduce a new feature to C4::Letters::GetPreparedLetter in here (see 'Add librarian object'). It's perhaps wise to split this into it's own bug, but it's simplest to test inline here. Let me know if you'd like it split out as it will inevitably be very helpful in the transition to TT notices everywhere. Created attachment 166390 [details] [review] Bug 36758: Add TICKET_ASSIGNED notice This patch adds a new default TICKET_ASSIGNED notice to be used with catalog concerns to notice the assigned staff user when a ticket has been assigned to them. Test plan 1) Run the database update and confirm that the new notice has been added to the database (If on the sandboxes, skip to the next patch) Signed-off-by: David Nind <david@davidnind.com> Created attachment 166391 [details] [review] Bug 36758: Add librarian object This patch adds a 'librarian' object fetch to C4::Letters::GetPreparedLetter when a called passes the 'want_librarian' flag. This allows for the notice to take full advantage of the patron object for that librarian rather than requireing old non-TT syntax for this feature. Test plan 1) We use the 'librarian' object in the new TICKET_ASSIGNED default notice, use the next patch to test that the librarian title is correctly substituted into the notice. Signed-off-by: David Nind <david@davidnind.com> Created attachment 166392 [details] [review] Bug 36758: Unit tests for assignee notification trigger This patch adds unit tests for the TICKET_ASSIGNED trigger being introduced with this patchset. Test plan 1) Run the unit tests prior to the next patch and confirm they fail 2) Apply the next patch and confirm the unit tests now pass Signed-off-by: David Nind <david@davidnind.com> Created attachment 166393 [details] [review] Bug 36758: Add trigger for assignee notification trigger This patch adds a new notice trigger to allow notifying assigned staff that they have been assigned a new catalog concern to action. Test plan 1) Enable catalog concerns (either via staff or opac interfaces) 2) Report a new concern (either via staff or opac interfaces) 3) As a staff user, assign the concern to another staff user 4) Check that the new 'TICKET_ASSIGNED' notice has be queued for that staff user. 5) Re-assign the catalog concern to yourself 6) Note that you do not see a 'TICKET_ASSIGNED@ notice queued as you self-assigned. Signed-off-by: David Nind <david@davidnind.com> Created attachment 169238 [details] [review] Bug 36758: Add TICKET_ASSIGNED notice This patch adds a new default TICKET_ASSIGNED notice to be used with catalog concerns to notice the assigned staff user when a ticket has been assigned to them. Test plan 1) Run the database update and confirm that the new notice has been added to the database (If on the sandboxes, skip to the next patch) Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 169239 [details] [review] Bug 36758: Add librarian object This patch adds a 'librarian' object fetch to C4::Letters::GetPreparedLetter when a called passes the 'want_librarian' flag. This allows for the notice to take full advantage of the patron object for that librarian rather than requireing old non-TT syntax for this feature. Test plan 1) We use the 'librarian' object in the new TICKET_ASSIGNED default notice, use the next patch to test that the librarian title is correctly substituted into the notice. Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 169240 [details] [review] Bug 36758: Unit tests for assignee notification trigger This patch adds unit tests for the TICKET_ASSIGNED trigger being introduced with this patchset. Test plan 1) Run the unit tests prior to the next patch and confirm they fail 2) Apply the next patch and confirm the unit tests now pass Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 169241 [details] [review] Bug 36758: Add trigger for assignee notification trigger This patch adds a new notice trigger to allow notifying assigned staff that they have been assigned a new catalog concern to action. Test plan 1) Enable catalog concerns (either via staff or opac interfaces) 2) Report a new concern (either via staff or opac interfaces) 3) As a staff user, assign the concern to another staff user 4) Check that the new 'TICKET_ASSIGNED' notice has be queued for that staff user. 5) Re-assign the catalog concern to yourself 6) Note that you do not see a 'TICKET_ASSIGNED@ notice queued as you self-assigned. Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> I have fixed this typo: [%- INCLUDE 'patron-title.inc' patron => libraian -%] (In reply to Martin Renvoize from comment #5) > Note to RM.. I introduce a new feature to C4::Letters::GetPreparedLetter in > here (see 'Add librarian object'). It's perhaps wise to split this into > it's own bug, but it's simplest to test inline here. Let me know if you'd > like it split out as it will inevitably be very helpful in the transition to > TT notices everywhere. I think if this is needed for backport, maybe we could do the separate bug then. Keeping it in this patch set for now. Pushed for 24.11! Well done everyone, thank you! I am sorry, but this is breaking the tests. I did 3 follow-up patches, please look at them as well. They should only be the normal DBRev, Tidy and a few typo fixes in docs and letter. Created attachment 170226 [details] [review] Bug 36758: (follow-up) Fix unit tests We do two things here.. * We're making the improvement to C4::Letters that sets librarian to a patron object more resilient by testing for the userenv first. * We correct the logic in Koha::Ticket such that we always store changes when there's a ticket update Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Follow-up pushed to main, confirmed it fixes the tests locally. Fingers crossed! Enhancement will not be backported to 24.05.x |