@@ -, +, @@ --- ...-4246-Talking-Tech-itiva-phone-notifications.pl | 14 +++++----- installer/data/mysql/updatedatabase.pl | 29 ++++++++++++++++++++ .../thirdparty/TalkingTech_itiva_outbound.pl | 7 +++-- 3 files changed, 40 insertions(+), 10 deletions(-) --- a/installer/data/mysql/atomicupdate/Bug-4246-Talking-Tech-itiva-phone-notifications.pl +++ a/installer/data/mysql/atomicupdate/Bug-4246-Talking-Tech-itiva-phone-notifications.pl @@ -7,18 +7,18 @@ my $dbh = C4::Context->dbh; # add phone message transport type $dbh->do("INSERT INTO message_transport_types (message_transport_type) VALUES ('phone')"); -# adds HOLD_PHONE and PREDUE_PHONE letters (as placeholders) -$dbh->do("INSERT INTO letter (module, code, name, title, content) VALUES - ('reserves', 'HOLD_PHONE', 'Item Available for Pick-up (phone notice)', 'Item Available for Pick-up (phone notice)', 'Your item is available for pickup'), - ('circulation', 'PREDUE_PHONE', 'Advance Notice of Item Due (phone notice)', 'Advance Notice of Item Due (phone notice)', 'Your item is due soon'), - ('circulation', 'OVERDUE_PHONE', 'Overdue Notice (phone notice)', 'Overdue Notice (phone notice)', 'Your item is overdue') +# adds HOLD and PREDUE letters (as placeholders) +$dbh->do("INSERT INTO letter (module, code, name, title, content, message_transport_type) VALUES + ('reserves', 'HOLD', 'Item Available for Pick-up (phone notice)', 'Item Available for Pick-up (phone notice)', 'Your item is available for pickup', 'phone'), + ('circulation', 'PREDUE', 'Advance Notice of Item Due (phone notice)', 'Advance Notice of Item Due (phone notice)', 'Your item is due soon', 'phone'), + ('circulation', 'OVERDUE', 'Overdue Notice (phone notice)', 'Overdue Notice (phone notice)', 'Your item is overdue', 'phone') "); # add phone notifications to patron message preferences options $dbh->do("INSERT INTO message_transports (message_attribute_id, message_transport_type, is_digest, letter_module, letter_code) VALUES - (4, 'phone', 0, 'reserves', 'HOLD_PHONE'), - (2, 'phone', 0, 'circulation', 'PREDUE_PHONE') + (4, 'phone', 0, 'reserves', 'HOLD'), + (2, 'phone', 0, 'circulation', 'PREDUE') "); # add TalkingTechItivaPhoneNotification syspref --- a/installer/data/mysql/updatedatabase.pl +++ a/installer/data/mysql/updatedatabase.pl @@ -8069,6 +8069,35 @@ if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { SetVersion($DBversion); } +$DBversion = "3.15.00.XXX"; +if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { + $dbh->do(q| + UPDATE letter + SET code="HOLD", + message_transport_type="phone", + name=(SELECT name FROM ( SELECT name FROM letter WHERE code="HOLD" LIMIT 1 ) AS t) + WHERE code="HOLD_PHONE" + |); + + $dbh->do(q| + UPDATE letter + SET code="PREDUE", + message_transport_type="phone", + name=(SELECT name FROM ( SELECT name FROM letter WHERE code="HOLD" LIMIT 1 ) AS t) + WHERE code="PREDUE_PHONE" + |); + + $dbh->do(q| + UPDATE letter + SET code="OVERDUE", + message_transport_type="phone", + name=(SELECT name FROM ( SELECT name FROM letter WHERE code="HOLD" LIMIT 1 ) AS t) + WHERE code="OVERDUE_PHONE" + |); + + print "Upgrade to $DBversion done (Bug XXXXX: Update letters *_PHONE)\n"; + SetVersion($DBversion); +} =head1 FUNCTIONS --- a/misc/cronjobs/thirdparty/TalkingTech_itiva_outbound.pl +++ a/misc/cronjobs/thirdparty/TalkingTech_itiva_outbound.pl @@ -68,9 +68,9 @@ my $type_module_map = { }; my $type_notice_map = { - 'PREOVERDUE' => 'PREDUE_PHONE', - 'OVERDUE' => 'OVERDUE_PHONE', - 'RESERVE' => 'HOLD_PHONE', + 'PREOVERDUE' => 'PREDUE', + 'OVERDUE' => 'OVERDUE', + 'RESERVE' => 'HOLD', }; GetOptions( @@ -135,6 +135,7 @@ foreach my $type (@types) { biblio => $issues->{'biblionumber'}, biblioitems => $issues->{'biblionumber'} }, + message_transport_type => 'phone', ); die "No letter found for type $type!... dying\n" unless $letter; --