View | Details | Raw Unified | Return to bug 11867
Collapse All | Expand All

(-)a/installer/data/mysql/atomicupdate/Bug-4246-Talking-Tech-itiva-phone-notifications.pl (-7 / +7 lines)
Lines 7-24 my $dbh = C4::Context->dbh; Link Here
7
# add phone message transport type
7
# add phone message transport type
8
$dbh->do("INSERT INTO message_transport_types (message_transport_type) VALUES ('phone')");
8
$dbh->do("INSERT INTO message_transport_types (message_transport_type) VALUES ('phone')");
9
9
10
# adds HOLD_PHONE and PREDUE_PHONE letters (as placeholders)
10
# adds HOLD and PREDUE letters (as placeholders)
11
$dbh->do("INSERT INTO letter (module, code, name, title, content) VALUES
11
$dbh->do("INSERT INTO letter (module, code, name, title, content, message_transport_type) VALUES
12
          ('reserves', 'HOLD_PHONE', 'Item Available for Pick-up (phone notice)', 'Item Available for Pick-up (phone notice)', 'Your item is available for pickup'),
12
          ('reserves', 'HOLD', 'Item Available for Pick-up (phone notice)', 'Item Available for Pick-up (phone notice)', 'Your item is available for pickup', 'phone'),
13
          ('circulation', 'PREDUE_PHONE', 'Advance Notice of Item Due (phone notice)', 'Advance Notice of Item Due (phone notice)', 'Your item is due soon'),
13
          ('circulation', 'PREDUE', 'Advance Notice of Item Due (phone notice)', 'Advance Notice of Item Due (phone notice)', 'Your item is due soon', 'phone'),
14
          ('circulation', 'OVERDUE_PHONE', 'Overdue Notice (phone notice)', 'Overdue Notice (phone notice)', 'Your item is overdue')
14
          ('circulation', 'OVERDUE', 'Overdue Notice (phone notice)', 'Overdue Notice (phone notice)', 'Your item is overdue', 'phone')
15
          ");
15
          ");
16
16
17
# add phone notifications to patron message preferences options
17
# add phone notifications to patron message preferences options
18
$dbh->do("INSERT INTO message_transports
18
$dbh->do("INSERT INTO message_transports
19
         (message_attribute_id, message_transport_type, is_digest, letter_module, letter_code) VALUES
19
         (message_attribute_id, message_transport_type, is_digest, letter_module, letter_code) VALUES
20
         (4, 'phone', 0, 'reserves', 'HOLD_PHONE'),
20
         (4, 'phone', 0, 'reserves', 'HOLD'),
21
         (2, 'phone', 0, 'circulation', 'PREDUE_PHONE')
21
         (2, 'phone', 0, 'circulation', 'PREDUE')
22
         ");
22
         ");
23
23
24
# add TalkingTechItivaPhoneNotification syspref
24
# add TalkingTechItivaPhoneNotification syspref
(-)a/installer/data/mysql/updatedatabase.pl (+29 lines)
Lines 8299-8304 if ( CheckVersion($DBversion) ) { Link Here
8299
    SetVersion($DBversion);
8299
    SetVersion($DBversion);
8300
}
8300
}
8301
8301
8302
$DBversion = "3.15.00.XXX";
8303
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
8304
    $dbh->do(q|
8305
        UPDATE letter
8306
        SET code="HOLD",
8307
            message_transport_type="phone",
8308
            name=(SELECT name FROM ( SELECT name FROM letter WHERE code="HOLD" LIMIT 1 ) AS t)
8309
        WHERE code="HOLD_PHONE"
8310
    |);
8311
8312
    $dbh->do(q|
8313
        UPDATE letter
8314
        SET code="PREDUE",
8315
            message_transport_type="phone",
8316
            name=(SELECT name FROM ( SELECT name FROM letter WHERE code="HOLD" LIMIT 1 ) AS t)
8317
        WHERE code="PREDUE_PHONE"
8318
    |);
8319
8320
    $dbh->do(q|
8321
        UPDATE letter
8322
        SET code="OVERDUE",
8323
            message_transport_type="phone",
8324
            name=(SELECT name FROM ( SELECT name FROM letter WHERE code="HOLD" LIMIT 1 ) AS t)
8325
        WHERE code="OVERDUE_PHONE"
8326
    |);
8327
8328
    print "Upgrade to $DBversion done (Bug XXXXX: Update letters *_PHONE)\n";
8329
    SetVersion($DBversion);
8330
}
8302
8331
8303
8332
8304
8333
(-)a/misc/cronjobs/thirdparty/TalkingTech_itiva_outbound.pl (-3 / +3 lines)
Lines 68-75 my $type_module_map = { Link Here
68
};
68
};
69
69
70
my $type_notice_map = {
70
my $type_notice_map = {
71
    'PREOVERDUE' => 'PREDUE_PHONE',
71
    'PREOVERDUE' => 'PREDUE',
72
    'OVERDUE'    => 'OVERDUE_PHONE',
72
    'OVERDUE'    => 'OVERDUE',
73
    'RESERVE'    => 'HOLD',
73
    'RESERVE'    => 'HOLD',
74
};
74
};
75
75
Lines 136-141 foreach my $type (@types) { Link Here
136
                biblioitems => $issues->{'biblionumber'},
136
                biblioitems => $issues->{'biblionumber'},
137
                message_transport_type => 'phone',
137
                message_transport_type => 'phone',
138
            },
138
            },
139
            message_transport_type => 'phone',
139
        );
140
        );
140
141
141
        die "No letter found for type $type!... dying\n" unless $letter;
142
        die "No letter found for type $type!... dying\n" unless $letter;
142
- 

Return to bug 11867