Koha/misc/cronjobs
Ian Walls d29efac4f3 Talking Tech Support - Phase I
Implements support for Talking Tech I-tiva phone notification for OVERDUE, PREDUE and HOLD notifications.
Overdues respect triggers as configured for the patron's branch.
Predue and Holds notifications respect patron's messaging preference choices.
A new column for phone notification is added if the TalkingTechItivaPhoneNotification system preference is turned on

Record of phone messages being sent to patrons is added to the patron's Notices
tab; notice of success or failure can be retrieved from I-tiva.

See the TalkingTech.README for installation and set-up instructions.

Aside from the control system preference, and the necessary changes to Messaging Preferences
forms to make use of phone notifications, the bulk of the code resides in external
cronjobs.

TalkingTech_itiva_outbound.pl generates the Spec C file to send to I-tiva.  Actual transmission
of the file must be handled by the system administrator.

TalkingTech_itiva_inbound.pl processes the received Results file from I-tiva.  Getting the
file from I-tiva to Koha is the job of the system administrator, as well.

Both scripts have a --help option with full documentation.

The only necessary change to core Koha behavior is in C4::Letters::EnqueueLetter.  The return
value was changed from 0 or 1 (successful addition of letter to message_queue or not), to the actual
insert ID of the letter.  This was required by the outbound script to present a unique Transaction ID
for the notice added to the patron's record (so a 'sent' or 'failed' status could be updated).  Since
the dbh and sth are not shared, and the last_insert_id() command is table-specific, this should be thread-safe.
No changes are necessary to any parts of Koha, as all usage of EnqueueLetter currently ignores the return value.

To Test:

1. Turn on TalkingTechItivaPhoneNotification system preference
2. Verify that 'phone' is now a valid notification option for patrons on both staff and OPAC side
3. Attempt to set a 'phone' preference for PREDUE or HOLD messaging; attempt should succeed
4. Set up the patron for notices to triggers:
   a. include checked out items due in a range of days, including the value set up in their messaging preferences.
   b. place several holds, some in position, others waiting for pickup, others in transit.
   c. set the patron up to have overdues, overdue by a range of days that includes the delay values for
the patrons branch and categorycode
5. Run TalkingTech_itiva_outbound.pl --type=RESERVE --type=PREOVERDUE --type=OVERDUE --outfile=/tmp/talkingtechtest.csv

The resulting talkingtechtest.csv file should include all the items due on X days (where X is the patrons' preference),
and none of the ones due in other increments.  Similarly, overdues messages should be added for each item due by a delay
value as configured; overdues of other numbers of days should be ignore.  Holds that are waiting pick up or in transit should
have messages, those still pending should not.

Messages should be added to the patron's notices tab for each issue sent.  Verify these messages exist, and all Notices
tokens are replaced with appropriate information.

Repeat, this time with 4c making use of the default branch overdue triggers, instead of branch-specific triggers.

To test the inbound script, create a CSV with rows in the format "<<Message_id>>","<<SUCCESS or FAIL>>"
Message ID should correspond to the final column of the talkingtechtest.csv file (the transaction id) for the message.

Primary Authorship: Ian Walls
Additional modifications: Kyle M Hall

http://bugs.koha-community.org/show_bug.cgi?id=4246
Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>

Tested and in use in production by two public libraries : Middletown
and Washoe. Both have given their sign off, but don't have git to
actually sign off.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-06-10 17:46:52 +02:00
..
holds bug 7641 follow-up: activate use strict (see coding guidelines) 2012-03-29 15:10:16 +02:00
rss Bug 5370: Fix all references to koha.org 2010-11-08 09:41:47 +13:00
social_data Bug 7470: Babeltheque integration 2012-03-26 14:24:04 +02:00
stats Bug 2505 - remove unnecessary -w and replace with use warnings; 2010-04-07 13:27:07 -04:00
thirdparty Talking Tech Support - Phase I 2012-06-10 17:46:52 +02:00
advance_notices.pl Bug 5549 : Fix calculation of duedates in fines.pl and advance_notices.pl 2012-03-20 13:20:01 +13:00
backup.sh add single-transaction flag to mysqldump in example backup script. 2008-06-03 06:00:49 -05:00
batch_anonymise.pl Bug 6572: Script batch anonymisation wrapper 2011-10-20 13:57:14 +13:00
build_browser_and_cloud.pl Bug 2505 - Add commented use warnings where missing in the misc/ directory 2010-04-21 20:26:44 +12:00
cart_to_shelf.pl 7368 Typo in cart_to_shelf 2012-03-16 11:50:29 +01:00
check-url.pl Bug 6267: [SIGNED-OFF]Fix a typo 2012-06-09 14:44:17 +02:00
cleanup_database.pl Bug 7240: Cleaning up import tables and action_logs 2012-01-13 12:20:51 +01:00
cloud-kw.pl Bug 5385: POD Cleanups (part 2) 2010-11-12 10:06:56 +13:00
cloud-sample.conf Fixes bugs #2875-2879 2008-12-29 19:59:44 -06:00
CONFIGURE.gmail Bug 5251 : Enhancement: [3.2] (Resubmission) Adding code to support using gmail as an SMTP server 2011-04-08 14:01:15 +12:00
create_koc_db.pl Bug 2505 - remove unnecessary -w and replace with use warnings; 2010-04-07 13:27:07 -04:00
crontab.example Bug 6478 -- add purge_suggestions.pl to the crontab.example 2011-07-16 20:23:20 +12:00
fines.pl Bug 5549 : Refactor fines.pl 2012-03-20 13:27:12 +13:00
gather_print_notices.pl bug_7001: Issue and Reserve slips are notices. 2012-03-09 10:11:20 +01:00
import_webservice_batch.pl bug_7613: OCLC Connexion gateway 2012-04-06 17:26:20 +02:00
j2a.pl Bug 7157 follow-up: j2a.pl executable again 2012-01-27 12:18:25 +01:00
longoverdue.pl Bug 7526 - longoverdue.pl leaves items marked as lost as still checked out to patron 2012-03-20 11:22:52 +01:00
MARC21_parse_test.pl Bug 6752: Be stricter with utf-8 encoding of output 2012-01-27 12:11:06 +01:00
overdue_notices.pl Bug 5549 : Overdues : Handle some date comparison and display issues 2012-03-20 13:21:19 +13:00
printoverdues.sh Bug 6048: printoverdues.sh bash odities 2011-10-07 14:14:53 +13:00
process_message_queue.pl Bug 5251 : Enhancement: [3.2] (Resubmission) Adding code to support using gmail as an SMTP server 2011-04-08 14:01:15 +12:00
purge_suggestions.pl Bug 5944 : (MT #3000) new cronjob script to delete old suggestions 2011-03-24 22:10:20 +13:00
runreport.pl Bug 5253: Add options to runreport.pl 2011-03-29 22:53:06 +13:00
serialsUpdate.pl Bug 2505 - remove unnecessary -w and replace with use warnings; 2010-04-07 13:27:07 -04:00
services_throttle.pl Minor updates to minor cronjob script. 2008-12-31 09:47:54 -06:00
smsoverdues.pl Bug 3810: Ensure all calls to Mail::Sendmail handled consistently 2011-03-16 20:57:12 +13:00
staticfines.pl Bug 6858: Adds staticfines.pl for static fines processing 2012-05-28 16:29:48 +02:00
zebraqueue_start.pl Bug 2505 - Add commented use warnings where missing in the misc/ directory 2010-04-21 20:26:44 +12:00