diff options
author | Ivan Kohler <ivan@freeside.biz> | 2015-07-26 15:41:26 -0700 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2015-07-26 15:41:26 -0700 |
commit | 9aee669886202be7035e6c6049fc71bc99dd3013 (patch) | |
tree | 2fd5bf6de74f3d99270587ffb1833e4188a6373d /rt/etc/upgrade/4.2.4/content | |
parent | ac20214d38d9af00430423f147b5a0e50751b050 (diff) | |
parent | 1add633372bdca3cc7163c2ce48363fed3984437 (diff) |
Merge branch 'master' of git.freeside.biz:/home/git/freeside
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; + +}; |