Bug 10833

Summary: Multi transport types for advanced notices
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: ToolsAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Marcel de Rooy <m.de.rooy>
Severity: enhancement    
Priority: P5 - low CC: gitbot, gmcharlt, m.de.rooy, mtj, olli-antti.kivilahti
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on: 9016    
Bug Blocks: 12315, 12396    
Attachments: Bug 10833: Multi transport types for advanced notices
Bug 10833: Multi transport types for advanced notices
Bug 10833: Enhanced a warning message to include the message transport type in the message.
Bug 10833: Multi transport types for advanced notices
Bug 10833: Enhanced a warning message to include the message transport type in the message.
Bug 10833: Multi transport types for advanced notices
Bug 10833: Enhanced a warning message to include the message transport type in the message.

Description Jonathan Druart 2013-09-06 09:12:23 UTC
Bug 9016 adds a UI for creating a message for each transport types for a letter.

The cronjob script misc/cronjobs/advance_notices.pl should deal with this configuration.
Comment 1 Jonathan Druart 2013-09-06 09:46:51 UTC Comment hidden (obsolete)
Comment 2 I'm just a bot 2013-09-29 05:53:40 UTC
Applying: Bug 9016: DB changes: new table overduerules_transport_types
Using index info to reconstruct a base tree...
M	installer/data/mysql/updatedatabase.pl
Falling back to patching base and 3-way merge...
Auto-merging installer/data/mysql/updatedatabase.pl
CONFLICT (content): Merge conflict in installer/data/mysql/updatedatabase.pl
Patch failed at 0001 Bug 9016: DB changes: new table overduerules_transport_types
The copy of the patch that failed is found in:
   /home/christopher/git/koha/.git/rebase-apply/patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Comment 3 I'm just a bot 2013-09-29 05:53:54 UTC
This bug depends on bug9016 which is in status Needs Signoff but the patches for it do not apply cleanly
Comment 4 Jonathan Druart 2013-10-15 07:25:16 UTC
(In reply to I'm just a bot from comment #3)
> This bug depends on bug9016 which is in status Needs Signoff but the patches
> for it do not apply cleanly

It applies cleanly (but 9016 has a conflict on updatedatabase.pl).
Comment 5 Olli-Antti Kivilahti 2014-01-03 13:32:32 UTC Comment hidden (obsolete)
Comment 6 Olli-Antti Kivilahti 2014-01-03 13:33:24 UTC Comment hidden (obsolete)
Comment 7 Marcel de Rooy 2014-04-23 12:24:12 UTC
Does not apply on top of 9016. Please rebase.
Comment 8 Jonathan Druart 2014-04-23 13:10:09 UTC Comment hidden (obsolete)
Comment 9 Jonathan Druart 2014-04-23 13:10:15 UTC Comment hidden (obsolete)
Comment 10 Jonathan Druart 2014-04-23 13:10:45 UTC
Last patches fix conflict with bug 8258.
Comment 11 Marcel de Rooy 2014-04-24 11:45:59 UTC
Created attachment 27528 [details] [review]
Bug 10833: Multi transport types for advanced notices

Test plan:
- Choose 2 patrons P1 and P2
- Edit "Patron messaging preferences" and
check SMS + email with 2 days in advance for P1
check email with 5 days in advance for P2
- defined a message for the letter code PREDUE for sms and email
  (tools/letters.pl).
- select 2 barcodes (B1, B2).
    * checkout B1 to P1 with a due date = NOW - 2 days
    * checkout B2 to P2 with a due date = NOW - 5 days
- into the mysql cli, note the value of unsent message:
  select count(*) from message_queue where status != "send";
- launch the cronjob:
  perl misc/cronjobs/advance_notices.pl -c
- retry the previous sql query, you should have X + 3 unsent messages
  (depending of current checkouts in your DB!).
- view all unsent message:
  select borrowernumber, letter_code, message_transport_type, content
  from message_queue where status != "send";
  You should see:
    2 messages for P1, 1 for sms, 1 for email and the letter code PREDUE
    1 message for P2, email and the letter code PREDUE

Signed-off-by: Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 12 Marcel de Rooy 2014-04-24 11:46:04 UTC
Created attachment 27529 [details] [review]
Bug 10833: Enhanced a warning message to include the message transport type in the message.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 13 Marcel de Rooy 2014-04-24 11:48:05 UTC
Can generate this error with a missing notice for sms:
No circulation PREDUE letter transported by sms at /usr/share/koha/testclone/C4/Letters.pm line 455.
no letter of type 'PREDUE' found. Please see sample_notices.sql at misc/cronjobs/advance_notices.pl line 293.

Two warnings are better than zero. But it seems to be redundant :)
Comment 14 Marcel de Rooy 2014-04-24 11:50:07 UTC
Just a note: I tested this on top of 9016, 10845 and 10832.
Comment 15 Galen Charlton 2014-05-02 21:21:19 UTC
Pushed to master.  Thanks, Jonathan!
Comment 16 Jonathan Druart 2014-06-11 10:30:25 UTC
This development introduced critical bugs. See bug 12315 and bug 12396.
Comment 17 Mason James 2015-02-25 13:28:28 UTC
(In reply to Galen Charlton from comment #15)
> Pushed to master.  Thanks, Jonathan!

Patch already included in 3.16.x branch