Bug 13972

Summary: Include fields from subscription and serial table in serial notification email
Product: Koha Reporter: Katrin Fischer <katrin.fischer>
Component: NoticesAssignee: Katrin Fischer <katrin.fischer>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: binu, colin.campbell, marjorie.barry-vila, tomascohen, veron
Version: Main   
Hardware: All   
OS: All   
See Also: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12437
GIT URL: Change sponsored?: ---
Patch complexity: Small patch Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Bug 13972: Include fields from subscription and serial table in serial notification email
Bug 13972: Follow-up - Add unit tests for changed parts of SendAlerts
Bug 13972: Follow-up - Add unit tests for changed parts of SendAlerts
[Signed-off] Bug 13972: Include fields from subscription and serial table in serial notification email
[Signed-off] Bug 13972: Follow-up - Add unit tests for changed parts of SendAlerts
Bug 13972: Include fields from subscription and serial table in serial notification email
Bug 13972: Follow-up - Add unit tests for changed parts of SendAlerts

Description Katrin Fischer 2015-04-08 15:13:43 UTC
The sample notice RLIST is used for a notification of the patron when a new issue of a serial arrives (independent from the routing list feature). You can subscribe to the notice from the OPAC - subscription tab - more details.

The notice currently allows to include fields from branches, biblio, biblioitems and borrowers. It would be very good to also include subscriptions, serials and items so you can print information about which field has arrived into the notice.

Related code is here:
http://git.koha-community.org/gitweb/?p=koha.git;a=blob;f=C4/Letters.pm;hb=c16e19b3fdff71e20db1df036931d96dfabcce4d#l411
Comment 1 Katrin Fischer 2015-05-25 13:38:33 UTC Comment hidden (obsolete)
Comment 2 Katrin Fischer 2015-05-25 13:39:56 UTC
I know I am missing tests for the changed routine SendAlerts. 
I will probably need some help there.
Comment 3 Katrin Fischer 2015-05-25 15:02:40 UTC Comment hidden (obsolete)
Comment 4 Katrin Fischer 2015-05-25 15:03:29 UTC
I found some existing tests for serial claims - tried to adapt them for the other use case 'issue'. Ready for testing now :)
Comment 5 Katrin Fischer 2015-05-25 15:06:33 UTC Comment hidden (obsolete)
Comment 6 Marc Véron 2015-06-09 16:02:05 UTC Comment hidden (obsolete)
Comment 7 Marc Véron 2015-06-09 16:03:40 UTC Comment hidden (obsolete)
Comment 8 Jonathan Druart 2015-06-18 10:43:18 UTC
Created attachment 40273 [details] [review]
Bug 13972: Include fields from subscription and serial table in serial notification email

Currently it's not possible to include information about which
issue has arrived in the serial notification notice the patron
can subscribe to from the OPAC.

The patch makes the fields from the subscription and serial
table available to the notice template.

In order to be able to print information about the correct
issue, the GetAlert has been modified to expext the serialid
as externalid when the module is issue.

git grep SendAlerts (only call with 'issue' is in Serial.pm)

To test:
- Add a subscription, select a patron notification template
- Search for the record in the OPAC
- Go to the subscription tab - More details
- Subscribe to the notification
- Edit the notice template you selected for the subscription
  - add fields from subscription
  - add fields from serial (serial.serialseq has the issue
    information)
- Receive an issue for the subscription
- Check that you have received the notification and that
  all information has been printed correctly
  NOTE: notice is sent directly, not through the message_queue

Followed test plan, works as expected.
Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Comment 9 Jonathan Druart 2015-06-18 10:43:29 UTC
Created attachment 40274 [details] [review]
Bug 13972: Follow-up - Add unit tests for changed parts of SendAlerts

To test:
- prove t/db_dependent/Letters.t

Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Comment 10 Tomás Cohen Arazi (tcohen) 2015-09-02 17:49:06 UTC
Patches pushed to master.

Thanks Katrina!
Comment 11 Katrin Fischer 2017-01-27 13:26:18 UTC
*** Bug 12437 has been marked as a duplicate of this bug. ***