Master to 4.2.8
[usit-rt.git] / etc / upgrade / 4.1.20 / content
CommitLineData
af59614d
MKG
1use strict;
2use warnings;
3
4our @ScripActions = (
5 { Name => 'Send Forward',
6 Description => 'Send forwarded message',
7 ExecModule => 'SendForward', },
8);
9
10our @Scrips = (
11 { Description => 'On Forward Transaction Send forwarded message',
12 ScripCondition => 'On Forward Transaction',
13 ScripAction => 'Send Forward',
14 Template => 'Forward' },
15 { Description => 'On Forward Ticket Send forwarded message',
16 ScripCondition => 'On Forward Ticket',
17 ScripAction => 'Send Forward',
18 Template => 'Forward Ticket' },
19);
20
21our @Initial = (
22 sub {
23 my $forward_template = RT::Template->new(RT->SystemUser);
24 $forward_template->Load('Forward');
25 $forward_template->SetDescription('Forwarded message');
26
27 if ( $forward_template->Content =~
28 m/^\n*This is (a )?forward of transaction #\{\s*\$Transaction->id\s*\} of (a )?ticket #\{\s*\$Ticket->id\s*\}\n*$/
29 ) {
30 $forward_template->SetContent(q{
31
32{ $ForwardTransaction->Content =~ /\S/ ? $ForwardTransaction->Content : "This is a forward of transaction #".$Transaction->id." of ticket #". $Ticket->id }
33});
34 }
35 else {
c33a4027 36 RT->Logger->error('Current "Forward" template is not the default version, please check docs/UPGRADING-4.2');
af59614d
MKG
37 }
38
39 my $forward_ticket_template = RT::Template->new(RT->SystemUser);
40 $forward_ticket_template->Load('Forward Ticket');
41 $forward_ticket_template->SetDescription('Forwarded ticket message');
42 if ( $forward_ticket_template->Content eq q{
43
44This is a forward of ticket #{ $Ticket->id }
45} ) {
46 $forward_ticket_template->SetContent(q{
47
48{ $ForwardTransaction->Content =~ /\S/ ? $ForwardTransaction->Content : "This is a forward of ticket #". $Ticket->id }
49});
50
51 }
52 else {
c33a4027 53 RT->Logger->error('Current "Forward Ticket" template is not the default version, please check docs/UPGRADING-4.2');
af59614d
MKG
54 }
55 },
56);