[Rt-commit] rt branch, 4.4/sla, updated. rt-4.2.11-133-gacbe9d8
? sunnavy
sunnavy at bestpractical.com
Thu Jul 9 10:08:36 EDT 2015
The branch, 4.4/sla has been updated
via acbe9d8cd3be526fd644a6e5e40979bb91e5ee74 (commit)
via bd668adc2c9c2f3920a653f0045d3390b6afa097 (commit)
from 93d4f6f99a7742d1ec23dffc4fab5850fe3f16ff (commit)
Summary of changes:
docs/UPGRADING-4.4 | 6 ++
etc/upgrade/4.3.7/content | 147 ++++++++++++++++++++++++++++++++--------------
2 files changed, 108 insertions(+), 45 deletions(-)
- Log -----------------------------------------------------------------
commit bd668adc2c9c2f3920a653f0045d3390b6afa097
Author: sunnavy <sunnavy at bestpractical.com>
Date: Thu Jul 9 22:02:10 2015 +0800
in case users are upgrading with SLA extension installed already
diff --git a/etc/upgrade/4.3.7/content b/etc/upgrade/4.3.7/content
index 492cabb..a2a4160 100644
--- a/etc/upgrade/4.3.7/content
+++ b/etc/upgrade/4.3.7/content
@@ -1,51 +1,108 @@
use strict;
use warnings;
-our @ScripConditions = (
- { Name => '[SLA] Require default', # loc
- Description => 'Detect a situation when we should set default service level' , # loc
- ApplicableTransTypes => 'Create',
- ExecModule => 'SLA_RequireDefault',
- },
- { Name => '[SLA] Require Starts set', # loc
- Description => 'Detect a situation when we should set Starts date' , # loc
- ApplicableTransTypes => 'Create,CustomField',
- ExecModule => 'SLA_RequireStartsSet',
- },
- { Name => '[SLA] Require Due set', # loc
- Description => 'Detect a situation when we should set Due date' , # loc
- ApplicableTransTypes => 'Create,CustomField,Correspond,Set,Status',
- ExecModule => 'SLA_RequireDueSet',
- },
-);
+our @Initial = (
+ sub {
+ my @ScripConditions = (
+ {
+ Name => '[SLA] Require default', # loc
+ Description => 'Detect a situation when we should set default service level', # loc
+ ApplicableTransTypes => 'Create',
+ ExecModule => 'SLA_RequireDefault',
+ },
+ {
+ Name => '[SLA] Require Starts set', # loc
+ Description => 'Detect a situation when we should set Starts date', # loc
+ ApplicableTransTypes => 'Create,CustomField',
+ ExecModule => 'SLA_RequireStartsSet',
+ },
+ {
+ Name => '[SLA] Require Due set', # loc
+ Description => 'Detect a situation when we should set Due date', # loc
+ ApplicableTransTypes => 'Create,CustomField,Correspond,Set,Status',
+ ExecModule => 'SLA_RequireDueSet',
+ },
+ );
-our @ScripActions = (
- { Name => '[SLA] Set default service level', # loc
- Description => 'Set service level according to the config' , # loc
- ExecModule => 'SLA_SetDefault',
- },
- { Name => '[SLA] Set starts date', # loc
- Description => 'Set the starts date according to an agreement' , # loc
- ExecModule => 'SLA_SetStarts',
- },
- { Name => '[SLA] Set due date', # loc
- Description => 'Set the due date according to an agreement' , # loc
- ExecModule => 'SLA_SetDue',
- },
-);
+ my @ScripActions = (
+ {
+ Name => '[SLA] Set default service level', # loc
+ Description => 'Set service level according to the config', # loc
+ ExecModule => 'SLA_SetDefault',
+ },
+ {
+ Name => '[SLA] Set starts date', # loc
+ Description => 'Set the starts date according to an agreement', # loc
+ ExecModule => 'SLA_SetStarts',
+ },
+ {
+ Name => '[SLA] Set due date', # loc
+ Description => 'Set the due date according to an agreement', # loc
+ ExecModule => 'SLA_SetDue',
+ },
+ );
-our @Scrips = (
- { Description => "[SLA] Set default service level if needed",
- ScripCondition => '[SLA] Require Default',
- ScripAction => '[SLA] Set default service level',
- Template => 'Blank' },
- { Description => "[SLA] Set starts date if needed",
- ScripCondition => '[SLA] Require starts set',
- ScripAction => '[SLA] Set starts date',
- Template => 'Blank' },
- { Description => "[SLA] Set due date if needed",
- ScripCondition => '[SLA] Require due set',
- ScripAction => '[SLA] Set due date',
- Template => 'Blank' },
-);
+ my @Scrips = (
+ {
+ Description => "[SLA] Set default service level if needed",
+ ScripCondition => '[SLA] Require Default',
+ ScripAction => '[SLA] Set default service level',
+ Template => 'Blank'
+ },
+ {
+ Description => "[SLA] Set starts date if needed",
+ ScripCondition => '[SLA] Require starts set',
+ ScripAction => '[SLA] Set starts date',
+ Template => 'Blank'
+ },
+ {
+ Description => "[SLA] Set due date if needed",
+ ScripCondition => '[SLA] Require due set',
+ ScripAction => '[SLA] Set due date',
+ Template => 'Blank'
+ },
+ );
+ for my $item ( @ScripActions ) {
+ my $entry = RT::ScripAction->new( RT->SystemUser );
+ $entry->Load( $item->{Name} );
+ next if $entry->id;
+ my $new_entry = RT::ScripAction->new( RT->SystemUser );
+ my ( $return, $msg ) = $new_entry->Create( %$item );
+ unless ( $return ) {
+ $RT::Logger->error( $msg );
+ }
+ else {
+ $RT::Logger->debug( $return . "." );
+ }
+ }
+ for my $item ( @ScripConditions ) {
+ my $entry = RT::ScripCondition->new( RT->SystemUser );
+ $entry->Load( $item->{Name} );
+ next if $entry->id;
+ my $new_entry = RT::ScripCondition->new( RT->SystemUser );
+ my ( $return, $msg ) = $new_entry->Create( %$item );
+ unless ( $return ) {
+ $RT::Logger->error( $msg );
+ }
+ else {
+ $RT::Logger->debug( $return . "." );
+ }
+ }
+ for my $item ( @Scrips ) {
+ my $entry = RT::Scrip->new( RT->SystemUser );
+ $entry->LoadByCols( Description => $item->{Description} );
+ next if $entry->id;
+ my $new_entry = RT::Scrip->new( RT->SystemUser );
+ my ( $return, $msg ) = $new_entry->Create( %$item, Queue => 0 );
+ unless ( $return ) {
+ $RT::Logger->error( $msg );
+ next;
+ }
+ else {
+ $RT::Logger->debug( $return . "." );
+ }
+ }
+
+ },
+);
commit acbe9d8cd3be526fd644a6e5e40979bb91e5ee74
Author: sunnavy <sunnavy at bestpractical.com>
Date: Thu Jul 9 22:07:47 2015 +0800
upgrading note for core sla
diff --git a/docs/UPGRADING-4.4 b/docs/UPGRADING-4.4
index bf96bec..8c275c0 100644
--- a/docs/UPGRADING-4.4
+++ b/docs/UPGRADING-4.4
@@ -31,6 +31,12 @@ reporting.
Custom fields with categories will be split out into hierarchical custom
fields.
+=item *
+
+SLA is in core now, if you installed RT::Extension::SLA before, you need to
+remove it from your plugins and adjust configs accordingly, see also the SLA
+section in F<RT_Config.pm>
+
=back
=cut
-----------------------------------------------------------------------
More information about the rt-commit
mailing list