diff options
Diffstat (limited to 'rt/etc/upgrade/4.2.4/content')
-rw-r--r-- | rt/etc/upgrade/4.2.4/content | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/rt/etc/upgrade/4.2.4/content b/rt/etc/upgrade/4.2.4/content new file mode 100644 index 000000000..c56e36911 --- /dev/null +++ b/rt/etc/upgrade/4.2.4/content @@ -0,0 +1,47 @@ +use strict; +use warnings; + +our @ScripActions = ( + { Name => 'Open Inactive Tickets', # loc + Description => 'Open inactive tickets', # loc + ExecModule => 'AutoOpenInactive' }, +); + +# Ignore the above if there is already an AutoOpenInactive in the +# database -- i.e. originally a 4.2 install, or someone added one +# themselves. +our @Initial; +push @Initial, sub { + my $exist = RT::ScripAction->new( RT->SystemUser ); + $exist->LoadByCols( ExecModule => 'AutoOpenInactive' ); + @ScripActions = () if $exist->Id; +}; + +push @Initial, sub { + my $queue = RT::Queue->new( RT->SystemUser ); + my ($ok, $msg) = $queue->Load('___Approvals'); + unless ($ok) { + RT->Logger->warning("Unable to load ___Approvals: $msg"); + return; + } + unless ($queue->Disabled == 2) { + RT->Logger->warning("Going to force ___Approvals queue to be Disabled = 2"); + ($ok, $msg) = $queue->SetDisabled( 2 ); + unless ($ok) { + RT->Logger->error("Unable to set ___Approvals.Disabled = 2: $msg"); + return; + } + } + + unless ($queue->Lifecycle eq "approvals") { + RT->Logger->warning("Going to force ___Approvals queue to the approvals lifecycle"); + ($ok, $msg) = $queue->SetLifecycle( "approvals" ); + unless ($ok) { + RT->Logger->error("Unable to set ___Approvals lifecycle: $msg"); + return; + } + } + + return 1; + +}; |