[Rt-commit] rt branch, 3.9-trunk, updated. rt-3.8.8-415-g722fd18

Jesse Vincent jesse at bestpractical.com
Mon Aug 16 19:21:44 EDT 2010


The branch, 3.9-trunk has been updated
       via  722fd183682402dbc36d95937c23940706467e36 (commit)
      from  bc9a7548e95de25ed4b60d2ee97d06d763f25a73 (commit)

Summary of changes:
 etc/RT_Config.pm.in                                |   43 +++---
 lib/RT.pm.in                                       |    2 +-
 lib/RT/Action/AutoOpen.pm                          |   14 +-
 lib/RT/Action/SetStatus.pm                         |   18 +-
 lib/RT/Condition/StatusChange.pm                   |   16 +-
 lib/RT/{StatusSchema.pm => Lifecycle.pm}           |  155 ++++++++++----------
 lib/RT/Queue_Overlay.pm                            |   29 ++--
 lib/RT/StatusSchemas.pm                            |    9 -
 lib/RT/Ticket_Overlay.pm                           |   42 +++---
 ...mmaryByStatusSchema => QueueSummaryByLifecycle} |   24 ++--
 share/html/Elements/QueueSummaryByStatus           |   22 ++--
 share/html/Elements/Quicksearch                    |    4 +-
 share/html/Elements/SelectStatus                   |   10 +-
 share/html/Ticket/Elements/Tabs                    |   10 +-
 t/{status-schemas => lifecycles}/basics.t          |    8 +-
 t/{status-schemas => lifecycles}/dates.t           |   14 +-
 t/{status-schemas => lifecycles}/moving.t          |    6 +-
 t/{status-schemas => lifecycles}/utils.pl          |    4 +-
 18 files changed, 209 insertions(+), 221 deletions(-)
 rename lib/RT/{StatusSchema.pm => Lifecycle.pm} (73%)
 delete mode 100644 lib/RT/StatusSchemas.pm
 rename share/html/Elements/{QueueSummaryByStatusSchema => QueueSummaryByLifecycle} (86%)
 rename t/{status-schemas => lifecycles}/basics.t (97%)
 rename t/{status-schemas => lifecycles}/dates.t (97%)
 rename t/{status-schemas => lifecycles}/moving.t (95%)
 rename t/{status-schemas => lifecycles}/utils.pl (96%)

- Log -----------------------------------------------------------------
commit 722fd183682402dbc36d95937c23940706467e36
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Mon Aug 16 18:12:10 2010 -0400

    Status Schema has become Lifecycle

diff --git a/etc/RT_Config.pm.in b/etc/RT_Config.pm.in
index 8041ed1..f56d89f 100755
--- a/etc/RT_Config.pm.in
+++ b/etc/RT_Config.pm.in
@@ -1752,12 +1752,12 @@ Set($ApprovalRejectionNotes, 1);
 
 =head1 Miscellaneous Configuration
 
-=head1 Statuses
+=head1 Lifecycles
 
-=head2
+=head2 Lifecycle definitions
 
-Each schema is a list of possible statuses split into three logic sets:
-B<initial>, B<active> and B<inactive>. Each status in a schema must be
+Each lifecycle is a list of possible statuses split into three logic sets:
+B<initial>, B<active> and B<inactive>. Each status in a lifecycle must be
 unique. (Statuses may not be repeated across sets.)  Each set may have
 any number of statuses.
 
@@ -1790,7 +1790,7 @@ ticket, RT will use the L<"default_initial"> status.
 =item initial
 
 You can define multiple B<initial> statuses for tickets in a
-given status schema. Newly created tickets can only have
+given lifecycle. Newly created tickets can only have
 a status that's listed as initial.
 
 A ticket's B<Created> date is set immediately upon ticket creation.
@@ -1816,7 +1816,7 @@ changed from an B<Initial> or B<Active> status to an B<Inactive> status.
 
 B<deleted> is still a special status and protected by the B<DeleteTicket>
 right. If you don't want to allow ticket deletion at any time simply
-don't include it in your schema.
+don't include it in your lifecycle.
 
 =back
 
@@ -1829,7 +1829,7 @@ as described below.
 =head2 Transitions between statuses and UI actions
 
 A B<Transition> - is a change of status from A to B. You should define
-all possible transitions in each schema using the following format:
+all possible transitions in each lifecycle using the following format:
 
     default => {
         ...
@@ -1869,7 +1869,7 @@ On the left hand side you can have the following variants:
 
 Valid transitions are listed in order of priority. If a user attempts
 to to change status a ticket's status from B<new> to B<open> then the
-schema checked for presence of an exact match, then for 'any to B<open>',
+lifecycle is checked for presence of an exact match, then for 'any to B<open>',
 'B<new> to any' and finally 'any to any'.
 
 If you don't define any rights or there is no match for a
@@ -1912,14 +1912,14 @@ Use the following format to define labels and actions of transitions:
         ...
     },
 
-=head2 Moving tickets between queues with different schemas
+=head2 Moving tickets between queues with different lifecycles
 
-Unless there is a mapping between statuses in two schemas,
-you can not move tickets between queues with these schemas.
+Unless there is a mapping between statuses in two lifecycles,
+you can not move tickets between queues with these lifecycles.
 
     __maps__ => {
-        'from schema -> to schema' => {
-            'status in left schema' => 'status in right schema',
+        'from lifecycle -> to lifecycle' => {
+            'status in left lifecycle' => 'status in right lifecycle',
             ...
         },
         ...
@@ -1929,7 +1929,7 @@ you can not move tickets between queues with these schemas.
 
 =cut
 
-Set(%StatusSchemaMeta,
+Set(%Lifecycles,
     default => {
         default_initial => 'new',
         initial         => [ 'new', 'open' ],
@@ -1974,24 +1974,25 @@ Set(%StatusSchemaMeta,
 );
 
 
-=item %StatusSchemas
 
-StatusSchemas map schemas to individual queues.
+=item %LifecycleMap
+
+LifecycleMap maps lifecycles to individual queues.
 
 If there is no record for a given queue then RT uses the
-B<default> schema.
+B<default> lifecycle
 
 For example:
 
-    Set( %StatusSchemas,
-        General => 'some_schema',
-        'Another Queue' => 'another schema',
+    Set( %LifecycleMap,
+        General => 'some_lifecycle',
+        'Another Queue' => 'another_lifecycle',
     );
 
 =cut
 
 
-Set( %StatusSchemas,
+Set( %LifecycleMap,
      General => 'default',
 );
 
diff --git a/lib/RT.pm.in b/lib/RT.pm.in
index 1858af2..da4013b 100755
--- a/lib/RT.pm.in
+++ b/lib/RT.pm.in
@@ -454,7 +454,7 @@ sub InitClasses {
     require RT::Attributes;
     require RT::Dashboard;
     require RT::Approval;
-    require RT::StatusSchemas;
+    require RT::Lifecycle;
 
     # on a cold server (just after restart) people could have an object
     # in the session, as we deserialize it so we never call constructor
diff --git a/lib/RT/Action/AutoOpen.pm b/lib/RT/Action/AutoOpen.pm
index 440b6e2..db373d9 100755
--- a/lib/RT/Action/AutoOpen.pm
+++ b/lib/RT/Action/AutoOpen.pm
@@ -57,10 +57,10 @@ use base qw(RT::Action);
 
 This action automatically moves a ticket to an active status.
 
-Status is not changed if there is no active statuses in the schema.
+Status is not changed if there is no active statuses in the lifecycle.
 
 Status is not changed if the current status is first active for ticket's status
-schema. For example if ticket's status is 'processing' and active statuses are
+lifecycle. For example if ticket's status is 'processing' and active statuses are
 'processing', 'on hold' and 'waiting' then status is not changed, but for ticket
 with status 'on hold' other rules are checked.
 
@@ -82,11 +82,11 @@ sub Prepare {
     my $self = shift;
 
     my $ticket = $self->TicketObj;
-    my $schema = $ticket->QueueObj->status_schema;
+    my $lifecycle = $ticket->QueueObj->lifecycle;
     my $status = $ticket->Status;
 
-    my @active = $schema->active;
-    # no change if no active statuses in the schema
+    my @active = $lifecycle->active;
+    # no change if no active statuses in the lifecycle
     return 1 unless @active;
 
     # no change if the ticket is already has first status from the list of active
@@ -94,13 +94,13 @@ sub Prepare {
 
     # no change if the ticket is in initial status and the message is a mail
     # from a requestor
-    return 1 if $schema->is_initial($status) && $self->TransactionObj->IsInbound;
+    return 1 if $lifecycle->is_initial($status) && $self->TransactionObj->IsInbound;
 
     if ( my $msg = $self->TransactionObj->Message->First ) {
         return 1 if ($msg->GetHeader('RT-Control') || '') =~ /\bno-autoopen\b/i;
     }
 
-    my ($next) = grep $schema->is_active($_), $schema->transitions($status);
+    my ($next) = grep $lifecycle->is_active($_), $lifecycle->transitions($status);
 
     $self->{'set_status_to'} = $next;
 
diff --git a/lib/RT/Action/SetStatus.pm b/lib/RT/Action/SetStatus.pm
index 5db149f..3c2f404 100755
--- a/lib/RT/Action/SetStatus.pm
+++ b/lib/RT/Action/SetStatus.pm
@@ -57,9 +57,9 @@ RT::Action::SetStatus - RT's scrip action to set status of a ticket
 
 =head1 DESCRIPTION
 
-This action changes status to a new value according to L</ARGUMENT>.
-Status is not changed if transition is invalid or on other errors. All
-issues are logged with different level.
+This action changes status to a new value according to the rules in L</ARGUMENT>.
+Status is not changed if the transition is invalid or another error occurs. All
+issues are logged at apropriate levels.
 
 =head1 ARGUMENT
 
@@ -70,7 +70,7 @@ Argument can be one of the following:
 =item status literally
 
 Status is changed from the current value to a new defined by the argument,
-but only if it's valid status and allowed by transitions of the current schema,
+but only if it's valid status and allowed by transitions of the current lifecycle,
 for example:
 
     * The current status is 'stalled'
@@ -79,7 +79,7 @@ for example:
     * Status is changed
 
 However, in the example above Status is not changed if argument is anything
-else as it's just not allowed by the schema.
+else as it's just not allowed by the lifecycle.
 
 =item 'initial', 'active' or 'inactive'
 
@@ -100,7 +100,7 @@ sub Prepare {
     my $self = shift;
 
     my $ticket = $self->TicketObj;
-    my $schema = $ticket->QueueObj->status_schema;
+    my $lifecycle = $ticket->QueueObj->lifecycle;
     my $status = $ticket->Status;
 
     my $argument = $self->Argument;
@@ -112,14 +112,14 @@ sub Prepare {
     my $next = '';
     if ( $argument =~ /^(initial|active|inactive)$/i ) {
         my $method = 'is_'. lc $argument;
-        ($next) = grep $schema->$method($_), $schema->transitions($status);
+        ($next) = grep $lifecycle->$method($_), $lifecycle->transitions($status);
         unless ( $next ) {
             $RT::Logger->info("No transition from '$status' to $argument set");
             return 1;
         }
     }
-    elsif ( $schema->is_valid( $argument ) ) {
-        unless ( $schema->is_transition( $status => $argument ) ) {
+    elsif ( $lifecycle->is_valid( $argument ) ) {
+        unless ( $lifecycle->is_transition( $status => $argument ) ) {
             $RT::Logger->warning("Transition '$status -> $argument' is not valid");
             return 1;
         }
diff --git a/lib/RT/Condition/StatusChange.pm b/lib/RT/Condition/StatusChange.pm
index 0dc1d37..bb3b8eb 100755
--- a/lib/RT/Condition/StatusChange.pm
+++ b/lib/RT/Condition/StatusChange.pm
@@ -52,14 +52,14 @@ use strict;
 
 =head2 DESCRIPTION
 
-Condition check passes if the current transaction is a status change.
+This condition check passes if the current transaction is a status change.
 
-Argument can be used to apply additional conditions on old and new values.
+The argument can be used to apply additional conditions on old and new values.
 
-If argument is empty then check pass for any change of the status field.
+If argument is empty then the check passes for any change of the status field.
 
 If argument is equal to new value then check is passed. This is behavior
-is close to RT 3.8 and older. For example argumen equal 'resolved' means
+is close to RT 3.8 and older. For example, setting the argument to 'resolved' means
 'fire scrip when status changed from any to resolved'.
 
 The following extended format is supported:
@@ -113,14 +113,14 @@ sub IsApplicable {
     }
     else {
         $RT::Logger->error("Argument '$argument' is incorrect.")
-            unless RT::StatusSchema->load('')->is_valid( $argument );
+            unless RT::Lifecycle->load('')->is_valid( $argument );
         return 0;
     }
 
-    my $schema = $self->TicketObj->QueueObj->status_schema;
+    my $lifecycle = $self->TicketObj->QueueObj->lifecycle;
     if ( $new_must_be ) {
         return 0 unless grep lc($new) eq lc($_),
-            map {m/^(initial|active|inactive)$/i? $schema->valid(lc $_): $_ }
+            map {m/^(initial|active|inactive)$/i? $lifecycle->valid(lc $_): $_ }
             grep defined && length,
             map { s/^\s+//; s/\s+$//; $_ }
             split /,/, $new_must_be;
@@ -128,7 +128,7 @@ sub IsApplicable {
     if ( $old_must_be ) {
         my $old = lc($txn->OldValue || '');
         return 0 unless grep $old eq lc($_),
-            map {m/^(initial|active|inactive)$/i? $schema->valid(lc $_): $_ }
+            map {m/^(initial|active|inactive)$/i? $lifecycle->valid(lc $_): $_ }
             grep defined && length,
             map { s/^\s+//; s/\s+$//; $_ }
             split /,/, $old_must_be;
diff --git a/lib/RT/StatusSchema.pm b/lib/RT/Lifecycle.pm
similarity index 73%
rename from lib/RT/StatusSchema.pm
rename to lib/RT/Lifecycle.pm
index 986a341..9302e57 100644
--- a/lib/RT/StatusSchema.pm
+++ b/lib/RT/Lifecycle.pm
@@ -2,12 +2,13 @@
 use strict;
 use warnings;
 
-package RT::StatusSchema;
+package RT::Lifecycle;
 
 sub loc { return $RT::SystemUser->loc( @_ ) }
 
-our %STATUS_SCHEMAS;
-our %STATUS_SCHEMAS_CACHE;
+our %LIFECYCLES;
+our %LIFECYCLES_CACHE;
+__PACKAGE__->register_rights;
 
 # cache structure:
 #    {
@@ -17,8 +18,8 @@ our %STATUS_SCHEMAS_CACHE;
 #            active => [...],
 #            inactive => [...],
 #        },
-#        schema_x => {
-#            '' => [...], # all valid in schema
+#        lifecycle_x => {
+#            '' => [...], # all valid in lifecycle
 #            initial => [...],
 #            active => [...],
 #            inactive => [...],
@@ -38,13 +39,13 @@ our %STATUS_SCHEMAS_CACHE;
 
 =head1 NAME
 
-RT::StatusSchema - class to access and manipulate status schemas
+RT::Lifecycle - class to access and manipulate lifecycles
 
 =head1 DESCRIPTION
 
-A status schema is a list of statuses that a ticket can have. There are three
-groups of statuses: initial, active and inactive. A status schema also defines
-possible transitions between statuses. For example, in the 'default' schema,
+A lifecycle is a list of statuses that a ticket can have. There are three
+groups of statuses: initial, active and inactive. A lifecycle also defines
+possible transitions between statuses. For example, in the 'default' lifecycle,
 you may only change status from 'stalled' to 'open'.
 
 It is also possible to define user-interface labels and the action a user
@@ -67,19 +68,19 @@ sub new {
     my $proto = shift;
     my $self = bless {}, ref($proto) || $proto;
 
-    $self->fill_cache unless keys %STATUS_SCHEMAS_CACHE;
+    $self->fill_cache unless keys %LIFECYCLES_CACHE;
 
     return $self;
 }
 
 =head2 load
 
-Takes a name of the schema and loads it. If name is empty or undefined then
-loads the global schema with statuses from all named schemas.
+Takes a name of the lifecycle and loads it. If name is empty or undefined then
+loads the global lifecycle with statuses from all named lifecycles.
 
 Can be called as class method, returns a new object, for example:
 
-    my $schema = RT::StatusSchema->load('default');
+    my $lifecycle = RT::Lifecycle->load('default');
 
 =cut
 
@@ -89,31 +90,31 @@ sub load {
     return $self->new->load( $name, @_ )
         unless ref $self;
 
-    return unless exists $STATUS_SCHEMAS_CACHE{ $name };
+    return unless exists $LIFECYCLES_CACHE{ $name };
 
     $self->{'name'} = $name;
-    $self->{'data'} = $STATUS_SCHEMAS_CACHE{ $name };
+    $self->{'data'} = $LIFECYCLES_CACHE{ $name };
 
     return $self;
 }
 
 =head2 list
 
-Returns sorted list of the schemas' names.
+Returns sorted list of the lifecycles' names.
 
 =cut
 
 sub list {
     my $self = shift;
 
-    $self->fill_cache unless keys %STATUS_SCHEMAS_CACHE;
+    $self->fill_cache unless keys %LIFECYCLES_CACHE;
 
-    return sort grep length && $_ ne '__maps__', keys %STATUS_SCHEMAS_CACHE;
+    return sort grep length && $_ ne '__maps__', keys %LIFECYCLES_CACHE;
 }
 
 =head2 name
 
-Returns name of the laoded schema.
+Returns name of the laoded lifecycle.
 
 =cut
 
@@ -125,14 +126,14 @@ Methods to get statuses in different sets or validating them.
 
 =head3 valid
 
-Returns an array of all valid statuses for the current schema.
+Returns an array of all valid statuses for the current lifecycle.
 Statuses are not sorted alphabetically, instead initial goes first,
 then active and then inactive.
 
 Takes optional list of status types, from 'initial', 'active' or
 'inactive'. For example:
 
-    $schema->valid('initial', 'active');
+    $lifecycle->valid('initial', 'active');
 
 =cut
 
@@ -151,13 +152,13 @@ sub valid {
 =head3 is_valid
 
 Takes a status and returns true if value is a valid status for the current
-schema. Otherwise, returns false.
+lifecycle. Otherwise, returns false.
 
 Takes optional list of status types after the status, so it's possible check
 validity in particular sets, for example:
 
     # returns true if status is valid and from initial or active set
-    $schema->is_valid('some_status', 'initial', 'active');
+    $lifecycle->is_valid('some_status', 'initial', 'active');
 
 See also </valid>.
 
@@ -171,7 +172,7 @@ sub is_valid {
 
 =head3 initial
 
-Returns an array of all initial statuses for the current schema.
+Returns an array of all initial statuses for the current lifecycle.
 
 =cut
 
@@ -196,7 +197,7 @@ sub is_initial {
 
 =head3 default_initial
 
-Returns the "default" initial status for this schema
+Returns the "default" initial status for this lifecycle
 
 =cut
 
@@ -208,7 +209,7 @@ sub default_initial {
 
 =head3 active
 
-Returns an array of all active statuses for this schema.
+Returns an array of all active statuses for this lifecycle.
 
 =cut
 
@@ -232,7 +233,7 @@ sub is_active {
 
 =head3 inactive
 
-Returns an array of all inactive statuses for this schema.
+Returns an array of all inactive statuses for this lifecycle.
 
 =cut
 
@@ -317,12 +318,12 @@ sub check_right {
 sub register_rights {
     my $self = shift;
 
-    $self->fill_cache unless keys %STATUS_SCHEMAS_CACHE;
+    $self->fill_cache unless keys %LIFECYCLES_CACHE;
 
     my %tmp;
-    foreach my $schema ( values %STATUS_SCHEMAS_CACHE ) {
-        next unless exists $schema->{'rights'};
-        while ( my ($transition, $right) = each %{ $schema->{'rights'} } ) {
+    foreach my $lifecycle ( values %LIFECYCLES_CACHE ) {
+        next unless exists $lifecycle->{'rights'};
+        while ( my ($transition, $right) = each %{ $lifecycle->{'rights'} } ) {
             push @{ $tmp{ $right } ||=[] }, $transition;
         }
     }
@@ -391,7 +392,7 @@ sub transition_action {
 
 =head3 create
 
-Creates a new status schema in the DB. Takes a param hash with
+Creates a new lifecycle in the DB. Takes a param hash with
 'name', 'initial', 'active', 'inactive' and 'transitions' keys.
 
 All arguments except 'name' are optional and can be filled later
@@ -415,20 +416,20 @@ sub create {
     @{ $self }{qw(name data)} = (undef, undef);
 
     my $name = delete $args{'name'};
-    return (0, loc('Invalid schema name'))
+    return (0, loc('Invalid lifecycle name'))
         unless defined $name && length $name;
     return (0, loc('Already exist'))
-        if $STATUS_SCHEMAS_CACHE{ $name };
+        if $LIFECYCLES_CACHE{ $name };
 
     foreach my $method (qw(_set_defaults _set_statuses _set_transitions _set_actions)) {
         my ($status, $msg) = $self->$method( %args, name => $name );
         return ($status, $msg) unless $status;
     }
 
-    my ($status, $msg) = $self->_store_schemas( $name );
+    my ($status, $msg) = $self->_store_lifecycles( $name );
     return ($status, $msg) unless $status;
 
-    return (1, loc('Created a new status schema'));
+    return (1, loc('Created a new lifecycle'));
 }
 
 sub set_statuses {
@@ -440,15 +441,15 @@ sub set_statuses {
         @_
     );
 
-    my $name = $self->name or return (0, loc("Status schema is not loaded"));
+    my $name = $self->name or return (0, loc("Lifecycle is not loaded"));
 
     my ($status, $msg) = $self->_set_statuses( %args, name => $name );
     return ($status, $msg) unless $status;
 
-    ($status, $msg) = $self->_store_schemas( $name );
+    ($status, $msg) = $self->_store_lifecycles( $name );
     return ($status, $msg) unless $status;
 
-    return (1, loc('Updated schema'));
+    return (1, loc('Updated lifecycle'));
 }
 
 
@@ -458,101 +459,101 @@ sub set_transitions {
     my $self = shift;
     my %args = @_;
 
-    my $name = $self->name or return (0, loc("Status schema is not loaded"));
+    my $name = $self->name or return (0, loc("Lifecycle is not loaded"));
 
     my ($status, $msg) = $self->_set_transitions(
         transitions => \%args, name => $name
     );
     return ($status, $msg) unless $status;
 
-    ($status, $msg) = $self->_store_schemas( $name );
+    ($status, $msg) = $self->_store_lifecycles( $name );
     return ($status, $msg) unless $status;
 
-    return (1, loc('Updated schema with transitions data'));
+    return (1, loc('Updated lifecycle with transitions data'));
 }
 
 sub set_actions {
     my $self = shift;
     my %args = @_;
 
-    my $name = $self->name or return (0, loc("Status schema is not loaded"));
+    my $name = $self->name or return (0, loc("Lifecycle is not loaded"));
 
     my ($status, $msg) = $self->_set_actions(
         actions => \%args, name => $name
     );
     return ($status, $msg) unless $status;
 
-    ($status, $msg) = $self->_store_schemas( $name );
+    ($status, $msg) = $self->_store_lifecycles( $name );
     return ($status, $msg) unless $status;
 
-    return (1, loc('Updated schema with actions data'));
+    return (1, loc('Updated lifecycle with actions data'));
 }
 
 sub fill_cache {
     my $self = shift;
 
-    my $map = RT->Config->Get('StatusSchemaMeta') or return;
-#    my $map = $RT::System->first_attribute('StatusSchemas')
+    my $map = RT->Config->Get('Lifecycles') or return;
+#    my $map = $RT::System->first_attribute('Lifecycles')
 #        or return;
 #    $map = $map->content or return;
 
-    %STATUS_SCHEMAS_CACHE = %STATUS_SCHEMAS = %$map;
+    %LIFECYCLES_CACHE = %LIFECYCLES = %$map;
     my %all = (
         '' => [],
         initial => [],
         active => [],
         inactive => [],
     );
-    foreach my $schema ( values %STATUS_SCHEMAS_CACHE ) {
+    foreach my $lifecycle ( values %LIFECYCLES_CACHE ) {
         my @res;
         foreach my $type ( qw(initial active inactive) ) {
-            push @{ $all{ $type } }, @{ $schema->{ $type } || [] };
-            push @res,               @{ $schema->{ $type } || [] };
+            push @{ $all{ $type } }, @{ $lifecycle->{ $type } || [] };
+            push @res,               @{ $lifecycle->{ $type } || [] };
         }
 
         my %seen;
         @res = grep !$seen{ lc $_ }++, @res;
-        $schema->{''} = \@res;
+        $lifecycle->{''} = \@res;
     }
     foreach my $type ( qw(initial active inactive), '' ) {
         my %seen;
         @{ $all{ $type } } = grep !$seen{ lc $_ }++, @{ $all{ $type } };
         push @{ $all{''} }, @{ $all{ $type } } if $type;
     }
-    $STATUS_SCHEMAS_CACHE{''} = \%all;
+    $LIFECYCLES_CACHE{''} = \%all;
     return;
 }
 
 sub for_localization {
     my $self = shift;
-    $self->fill_cache unless keys %STATUS_SCHEMAS_CACHE;
+    $self->fill_cache unless keys %LIFECYCLES_CACHE;
 
     my @res = ();
 
-    push @res, @{ $STATUS_SCHEMAS_CACHE{''}{''} || [] };
-    foreach my $schema ( values %STATUS_SCHEMAS ) {
+    push @res, @{ $LIFECYCLES_CACHE{''}{''} || [] };
+    foreach my $lifecycle ( values %LIFECYCLES ) {
         push @res,
             grep defined && length,
             map $_->[0],
             grep ref($_),
-            values %{ $schema->{'actions'} || {} };
+            values %{ $lifecycle->{'actions'} || {} };
     }
 
     my %seen;
     return grep !$seen{lc $_}++, @res;
 }
 
-sub _store_schemas {
+sub _store_lifecycles {
     my $self = shift;
     my $name = shift;
     my ($status, $msg) = $RT::System->set_attribute(
-        name => 'StatusSchemas',
-        description => 'all system status schemas',
-        content => \%STATUS_SCHEMAS,
+        name => 'Lifecycles',
+        description => 'all system lifecycles',
+        content => \%LIFECYCLES,
     );
     $self->fill_cache;
     $self->load( $name );
-    return ($status, loc("Couldn't store schema")) unless $status;
+    return ($status, loc("Couldn't store lifecycle")) unless $status;
     return 1;
 }
 
@@ -570,14 +571,14 @@ sub _set_statuses {
         foreach my $status ( grep defined && length, @{ $args{ $type } || [] } ) {
             return (0, loc('Status should contain ASCII characters only. Translate via po files.'))
                 unless $status =~ /^[a-zA-Z0-9.,! ]+$/;
-            return (0, loc('Statuses must be unique in one schema'))
+            return (0, loc('Statuses must be unique within a lifecycle'))
                 if grep lc($_) eq lc($status), @all;
             push @all, $status;
             push @{ $tmp{ $type } }, $status;
         }
     }
 
-    $STATUS_SCHEMAS{ $args{'name'} }{ $_ } = $tmp{ $_ }
+    $LIFECYCLES{ $args{'name'} }{ $_ } = $tmp{ $_ }
         foreach qw(initial active inactive);
 
     return 1;
@@ -588,7 +589,7 @@ sub _set_defaults {
     my $self = shift;
     my %args = @_;
 
-    $STATUS_SCHEMAS{ $args{'name'} }{$_ } = $args{ $_ }
+    $LIFECYCLES{ $args{'name'} }{$_ } = $args{ $_ }
         foreach qw(default_initial);
 
     return 1;
@@ -603,7 +604,7 @@ sub _set_transitions {
     my %args = @_;
 
     # XXX, TODO: more tests on data
-    $STATUS_SCHEMAS{ $args{'name'} }{'transitions'} = $args{'transitions'};
+    $LIFECYCLES{ $args{'name'} }{'transitions'} = $args{'transitions'};
     return 1;
 }
 
@@ -612,7 +613,7 @@ sub _set_actions {
     my %args = @_;
 
     # XXX, TODO: more tests on data
-    $STATUS_SCHEMAS{ $args{'name'} }{'actions'} = $args{'actions'};
+    $LIFECYCLES{ $args{'name'} }{'actions'} = $args{'actions'};
     return 1;
 }
 
@@ -628,30 +629,30 @@ sub from_set {
 sub map {
     my $from = shift;
     my $to = shift;
-    $to = RT::StatusSchema->load( $to ) unless ref $to;
-    return $STATUS_SCHEMAS{'__maps__'}{ $from->name .' -> '. $to->name } || {};
+    $to = RT::Lifecycle->load( $to ) unless ref $to;
+    return $LIFECYCLES{'__maps__'}{ $from->name .' -> '. $to->name } || {};
 }
 
 sub set_map {
     my $self = shift;
     my $to = shift;
-    $to = RT::StatusSchema->load( $to ) unless ref $to;
+    $to = RT::Lifecycle->load( $to ) unless ref $to;
     my %map = @_;
     $map{ lc $_ } = delete $map{ $_ } foreach keys %map;
 
-    return (0, loc("Status schema is not loaded"))
+    return (0, loc("Lifecycle is not loaded"))
         unless $self->name;
 
-    return (0, loc("Status schema is not loaded"))
+    return (0, loc("Lifecycle is not loaded"))
         unless $to->name;
 
 
-    $STATUS_SCHEMAS{'__maps__'}{ $self->name .' -> '. $to->name } = \%map;
+    $LIFECYCLES{'__maps__'}{ $self->name .' -> '. $to->name } = \%map;
 
-    my ($status, $msg) = $self->_store_schemas( $self->name );
+    my ($status, $msg) = $self->_store_lifecycles( $self->name );
     return ($status, $msg) unless $status;
 
-    return (1, loc('Updated schema with actions data'));
+    return (1, loc('Updated lifecycle with actions data'));
 }
 
 sub has_map {
@@ -670,7 +671,7 @@ sub no_maps {
         foreach my $to ( @list ) {
             next if $from eq $to;
             push @res, $from, $to
-                unless RT::StatusSchema->load( $from )->has_map( $to );
+                unless RT::Lifecycle->load( $from )->has_map( $to );
         }
     }
     return @res;
@@ -680,7 +681,7 @@ sub queues {
     my $self = shift;
     require RT::Queues;
     my $queues = RT::Queues->new( $RT::SystemUser );
-    $queues->limit( column => 'status_schema', value => $self->name );
+    $queues->limit( column => 'lifecycle', value => $self->name );
     return $queues;
 }
 
diff --git a/lib/RT/Queue_Overlay.pm b/lib/RT/Queue_Overlay.pm
index 4d7712b..a99a601 100755
--- a/lib/RT/Queue_Overlay.pm
+++ b/lib/RT/Queue_Overlay.pm
@@ -71,7 +71,6 @@ no warnings qw(redefine);
 use RT::Groups;
 use RT::ACL;
 use RT::Interface::Email;
-use RT::StatusSchema;
 
 our @DEFAULT_ACTIVE_STATUS = qw(new open stalled);
 our @DEFAULT_INACTIVE_STATUS = qw(resolved rejected deleted);  
@@ -191,24 +190,24 @@ sub AvailableRights {
 
 # {{{ ActiveStatusArray
 
-sub status_schema {
+sub lifecycle {
     my $self = shift;
     unless (ref $self && $self->id) { 
-        return RT::StatusSchema->load('') 
+        return RT::Lifecycle->load('')
     }
 
     my $name = '';
 
-    # If you don't have StatusSchemas set, name is default
-    my $schemas = RT->Config->Get('StatusSchemas');
-    if ($schemas && $self->Name && defined $schemas->{$self->Name}) {
-        $name = $schemas->{$self->Name};
+    # If you don't have Lifecycles set, name is default
+    my $lifecycles = RT->Config->Get('LifecycleMap');
+    if ($lifecycles && $self->Name && defined $lifecycles->{$self->Name}) {
+        $name = $lifecycles->{$self->Name};
     } else {
         $name = 'default';
     }
 
-    my $res = RT::StatusSchema->load( $name );
-    $RT::Logger->error("Status schema '$name' for queue '".$self->Name."' doesn't exist") unless $res;
+    my $res = RT::Lifecycle->load( $name );
+    $RT::Logger->error("Lifecycle '$name' for queue '".$self->Name."' doesn't exist") unless $res;
     return $res;
 }
 
@@ -220,7 +219,7 @@ Returns an array of all ActiveStatuses for this queue
 
 sub ActiveStatusArray {
     my $self = shift;
-    return $self->status_schema->valid('initial', 'active');
+    return $self->lifecycle->valid('initial', 'active');
 }
 
 =head2 InactiveStatusArray
@@ -231,7 +230,7 @@ Returns an array of all InactiveStatuses for this queue
 
 sub InactiveStatusArray {
     my $self = shift;
-    return $self->status_schema->inactive;
+    return $self->lifecycle->inactive;
 }
 
 =head2 StatusArray
@@ -242,7 +241,7 @@ Returns an array of all statuses for this queue
 
 sub StatusArray {
     my $self = shift;
-    return $self->status_schema->valid( @_ );
+    return $self->lifecycle->valid( @_ );
 }
 
 =head2 IsValidStatus value
@@ -253,7 +252,7 @@ Returns true if value is a valid status.  Otherwise, returns 0.
 
 sub IsValidStatus {
     my $self  = shift;
-    return $self->status_schema->is_valid( shift );
+    return $self->lifecycle->is_valid( shift );
 }
 
 =head2 IsActiveStatus value
@@ -264,7 +263,7 @@ Returns true if value is a Active status.  Otherwise, returns 0
 
 sub IsActiveStatus {
     my $self  = shift;
-    return $self->status_schema->is_valid( shift, 'initial', 'active');
+    return $self->lifecycle->is_valid( shift, 'initial', 'active');
 }
 
 
@@ -278,7 +277,7 @@ Returns true if value is a Inactive status.  Otherwise, returns 0
 
 sub IsInactiveStatus {
     my $self  = shift;
-    return $self->status_schema->is_inactive( shift );
+    return $self->lifecycle->is_inactive( shift );
 }
 
 
diff --git a/lib/RT/StatusSchemas.pm b/lib/RT/StatusSchemas.pm
deleted file mode 100644
index 400d6d9..0000000
--- a/lib/RT/StatusSchemas.pm
+++ /dev/null
@@ -1,9 +0,0 @@
-use strict;
-use warnings;
-
-package RT::StatusSchemas;
-
-require RT::StatusSchema;
-RT::StatusSchema->register_rights;
-
-1;
diff --git a/lib/RT/Ticket_Overlay.pm b/lib/RT/Ticket_Overlay.pm
index 560d4ba..4b5d855 100755
--- a/lib/RT/Ticket_Overlay.pm
+++ b/lib/RT/Ticket_Overlay.pm
@@ -307,11 +307,11 @@ sub Create {
     }
 
     if ( ! defined $args{'Status'}) {
-        $args{'Status'} = $QueueObj->status_schema->default_initial();
+        $args{'Status'} = $QueueObj->lifecycle->default_initial();
     }
 
     unless ( $QueueObj->IsValidStatus( $args{'Status'} )
-            && $QueueObj->status_schema->is_initial( $args{'Status'} )) {
+            && $QueueObj->lifecycle->is_initial( $args{'Status'} )) {
         return ( 0, 0,
             $self->loc("Status '[_1]' isn't a valid status for tickets in this queue.",
                 $self->loc($args{'Status'})));
@@ -367,8 +367,8 @@ sub Create {
     #
     # Instead, we check to make sure that it's either an "active" or "inactive" status
     elsif (
-        $QueueObj->status_schema->is_active($args{'Status'}) ||
-        $QueueObj->status_schema->is_inactive($args{'Status'})
+        $QueueObj->lifecycle->is_active($args{'Status'}) ||
+        $QueueObj->lifecycle->is_inactive($args{'Status'})
 
     ){
         $Started->SetToNow;
@@ -380,7 +380,7 @@ sub Create {
     }
 
     #If the status is an inactive status, set the resolved date
-    elsif ( $QueueObj->status_schema->is_inactive( $args{'Status'} ) )
+    elsif ( $QueueObj->lifecycle->is_inactive( $args{'Status'} ) )
     {
         $RT::Logger->debug( "Got a ". $args{'Status'}
             ."(inactive) ticket with undefined resolved date. Setting to now."
@@ -614,7 +614,7 @@ sub Create {
     # TODO: Adding link may fire scrips on other end and those scrips
     # could create transactions on this ticket before 'Create' transaction.
     #
-    # We should implement different schema: record 'Create' transaction,
+    # We should implement different lifecycle: record 'Create' transaction,
     # create links and only then fire create transaction's scrips.
     #
     # Ideal variant: add all links without firing scrips, record create
@@ -1741,14 +1741,14 @@ sub SetQueue {
     }
 
     my $new_status;
-    my $old_schema = $self->QueueObj->status_schema;
-    my $new_schema = $NewQueueObj->status_schema;
-    if ( $old_schema->name ne $new_schema->name ) {
-        unless ( $old_schema->has_map( $new_schema ) ) {
+    my $old_lifecycle = $self->QueueObj->lifecycle;
+    my $new_lifecycle = $NewQueueObj->lifecycle;
+    if ( $old_lifecycle->name ne $new_lifecycle->name ) {
+        unless ( $old_lifecycle->has_map( $new_lifecycle ) ) {
             return ( 0, $self->loc("There is no mapping for statuses between these queues. Contact your system administrator.") );
         }
-        $new_status = $old_schema->map( $new_schema )->{ $self->Status };
-        return ( 0, $self->loc("Mapping between queues' status schemas is incomplete. Contact your system administrator.") )
+        $new_status = $old_lifecycle->map( $new_lifecycle )->{ $self->Status };
+        return ( 0, $self->loc("Mapping between queues' lifecycles is incomplete. Contact your system administrator.") )
             unless $new_status;
     }
 
@@ -1776,7 +1776,7 @@ sub SetQueue {
 
         #If we're changing the status from initial in old to not intial in new,
         # record that we've started
-        if ( $old_schema->is_initial($old_status) && !$new_schema->is_initial($new_status)  && $clone->StartedObj->Unix == 0 ) {
+        if ( $old_lifecycle->is_initial($old_status) && !$new_lifecycle->is_initial($new_status)  && $clone->StartedObj->Unix == 0 ) {
             #Set the Started time to "now"
             $clone->_Set(
                 Field             => 'Started',
@@ -1787,7 +1787,7 @@ sub SetQueue {
 
         #When we close a ticket, set the 'Resolved' attribute to now.
         # It's misnamed, but that's just historical.
-        if ( $new_schema->is_inactive($new_status) ) {
+        if ( $new_lifecycle->is_inactive($new_status) ) {
             $clone->_Set(
                 Field             => 'Resolved',
                 Value             => $now->ISO,
@@ -3060,24 +3060,24 @@ sub SetStatus {
         %args = (@_);
     }
 
-    my $schema = $self->QueueObj->status_schema;
+    my $lifecycle = $self->QueueObj->lifecycle;
 
     my $new = $args{'Status'};
-    unless ( $schema->is_valid( $new ) ) {
+    unless ( $lifecycle->is_valid( $new ) ) {
         return (0, $self->loc("Status '[_1]' isn't a valid status for tickets in this queue.", $self->loc($new)));
     }
 
     my $old = $self->__Value('Status');
-    unless ( $schema->is_transition( $old => $new ) ) {
+    unless ( $lifecycle->is_transition( $old => $new ) ) {
         return (0, $self->loc("You can't change status from '[_1]' to '[_2]'.", $self->loc($old), $self->loc($new)));
     }
 
-    my $check_right = $schema->check_right( $old => $new );
+    my $check_right = $lifecycle->check_right( $old => $new );
     unless ( $self->CurrentUserHasRight( $check_right ) ) {
         return ( 0, $self->loc('Permission Denied') );
     }
 
-    if ( !$args{Force} && $schema->is_inactive( $new ) && $self->HasUnresolvedDependencies) {
+    if ( !$args{Force} && $lifecycle->is_inactive( $new ) && $self->HasUnresolvedDependencies) {
         return (0, $self->loc('That ticket has unresolved dependencies'));
     }
 
@@ -3088,7 +3088,7 @@ sub SetStatus {
     $raw_started->Set(Format => 'ISO', Value => $self->__Value('Started'));
 
     #If we're changing the status from new, record that we've started
-    if ( $schema->is_initial($old) && !$schema->is_initial($new) && !$raw_started->Unix) {
+    if ( $lifecycle->is_initial($old) && !$lifecycle->is_initial($new) && !$raw_started->Unix) {
         #Set the Started time to "now"
         $self->_Set(
             Field             => 'Started',
@@ -3099,7 +3099,7 @@ sub SetStatus {
 
     #When we close a ticket, set the 'Resolved' attribute to now.
     # It's misnamed, but that's just historical.
-    if ( $schema->is_inactive($new) ) {
+    if ( $lifecycle->is_inactive($new) ) {
         $self->_Set(
             Field             => 'Resolved',
             Value             => $now->ISO,
diff --git a/share/html/Elements/QueueSummaryByStatusSchema b/share/html/Elements/QueueSummaryByLifecycle
similarity index 86%
rename from share/html/Elements/QueueSummaryByStatusSchema
rename to share/html/Elements/QueueSummaryByLifecycle
index e269b12..535ec36 100644
--- a/share/html/Elements/QueueSummaryByStatusSchema
+++ b/share/html/Elements/QueueSummaryByLifecycle
@@ -45,8 +45,8 @@
 %# those contributions and any derivatives thereof.
 %#
 %# END BPS TAGGED BLOCK }}}
-% foreach my $schema ( map $schema{$_}, sort keys %schema ) {
-% my @cur_statuses = grep $schema->is_valid($_), @statuses;
+% foreach my $lifecycle ( map $lifecycle{$_}, sort keys %lifecycle ) {
+% my @cur_statuses = grep $lifecycle->is_valid($_), @statuses;
 % next unless @cur_statuses;
 <table border="0" cellspacing="0" cellpadding="1" width="100%" class="queue-summary">
 
@@ -60,13 +60,13 @@
 <%PERL>
 my $i = 0;
 for my $queue (@queues) {
-    next if lc $queue->{Schema} ne lc $schema->name;
+    next if lc $queue->{Lifecycle} ne lc $lifecycle->name;
 
     $i++;
     my $name = $queue->{Name};
     $name =~ s/'/\\'/g;
     my $queue_cond = "Queue = '$name' AND ";
-    my $all_q = $queue_cond . '(' . join( " OR ", map "Status = '$_'", grep $schema->is_valid($_), @statuses ) . ')';
+    my $all_q = $queue_cond . '(' . join( " OR ", map "Status = '$_'", grep $lifecycle->is_valid($_), @statuses ) . ')';
 </%PERL>
 <tr class="<% $i%2 ? 'oddline' : 'evenline'%>" >
 
@@ -97,25 +97,23 @@ else {
         id          => $_->Id,
         Name        => $_->Name,
         Description => $_->Description,
-        Schema      => $_->status_schema->name,
+        Lifecycle      => $_->lifecycle->name,
     } } grep $_, @queues;
 
     $session{$cache} = \@queues if $cache;
 }
 
-use RT::StatusSchema;
-
-my %schema;
-$schema{ lc $_->name } = $_ foreach
-    grep $_, map RT::StatusSchema->load($_),
-    map $_->{'Schema'}, @queues;
+my %lifecycle;
+$lifecycle{ lc $_->name } = $_ foreach
+    grep $_, map RT::Lifecycle->load($_),
+    map $_->{'Lifecycle'}, @queues;
 
 
 unless ( @statuses ) {
     my %seen;
     foreach my $set('initial', 'active') {
-        foreach my $schema ( map $schema{$_}, sort keys %schema ) {
-            push @statuses, grep !$seen{lc $_}++, $schema->$set();
+        foreach my $lifecycle ( map $lifecycle{$_}, sort keys %lifecycle ) {
+            push @statuses, grep !$seen{lc $_}++, $lifecycle->$set();
         }
     }
 }
diff --git a/share/html/Elements/QueueSummaryByStatus b/share/html/Elements/QueueSummaryByStatus
index fc2db42..554d422 100644
--- a/share/html/Elements/QueueSummaryByStatus
+++ b/share/html/Elements/QueueSummaryByStatus
@@ -61,15 +61,15 @@ for my $queue (@queues) {
     my $name = $queue->{Name};
     $name =~ s/'/\\'/g;
     my $queue_cond = "Queue = '$name' AND ";
-    my $schema = $schema{ lc $queue->{'Schema'} };
-    my $all_q = $queue_cond . '(' . join( " OR ", map "Status = '$_'", grep $schema->is_valid($_), @statuses ) . ')';
+    my $lifecycle = $lifecycle{ lc $queue->{'Lifecycle'} };
+    my $all_q = $queue_cond . '(' . join( " OR ", map "Status = '$_'", grep $lifecycle->is_valid($_), @statuses ) . ')';
 </%PERL>
 <tr class="<% $i%2 ? 'oddline' : 'evenline'%>" >
 
 <td><a href="<% RT->Config->Get('WebPath') %>/Search/Results.html?Query=<% $all_q |u,n %>" title="<% $queue->{Description} %>"><% $queue->{Name} %></a></td>
 
 %   for my $status (@statuses) {
-%   if ( $schema->is_valid( $status ) ) {
+%   if ( $lifecycle->is_valid( $status ) ) {
 %       $Tickets->FromSQL( "Queue = $queue->{id} AND Status = '$status'" );
 <td align="right"><a href="<% RT->Config->Get('WebPath') %>/Search/Results.html?Query=<% $queue_cond ."Status = '$status'" |u,n %>"><% $Tickets->Count %></a></td>
 %   } else {
@@ -96,25 +96,23 @@ else {
         id          => $_->Id,
         Name        => $_->Name,
         Description => $_->Description,
-        Schema      => $_->status_schema->name,
+        Lifecycle      => $_->lifecycle->name,
     } } grep $_, @queues;
 
     $session{$cache} = \@queues if $cache;
 }
 
-use RT::StatusSchema;
-
-my %schema;
-$schema{ lc $_->name } = $_ foreach
-    grep $_, map RT::StatusSchema->load($_),
-    map $_->{'Schema'}, @queues;
+my %lifecycle;
+$lifecycle{ lc $_->name } = $_ foreach
+    grep $_, map RT::Lifecycle->load($_),
+    map $_->{'Lifecycle'}, @queues;
 
 
 unless ( @statuses ) {
     my %seen;
     foreach my $set('initial', 'active') {
-        foreach my $schema ( map $schema{$_}, sort keys %schema ) {
-            push @statuses, grep !$seen{lc $_}++, $schema->$set();
+        foreach my $lifecycle ( map $lifecycle{$_}, sort keys %lifecycle ) {
+            push @statuses, grep !$seen{lc $_}++, $lifecycle->$set();
         }
     }
 }
diff --git a/share/html/Elements/Quicksearch b/share/html/Elements/Quicksearch
index 559248f..29cbd66 100644
--- a/share/html/Elements/Quicksearch
+++ b/share/html/Elements/Quicksearch
@@ -13,8 +13,8 @@
 </div>
 <%INIT>
 my $unwanted = $session{'CurrentUser'}->UserObj->Preferences('QuickSearch', {});
-my $comp = $SplitBySchema? '/Elements/QueueSummaryByStatusSchema' : '/Elements/QueueSummaryByStatus';
+my $comp = $SplitByLifecycle? '/Elements/QueueSummaryByLifecycle' : '/Elements/QueueSummaryByStatus';
 </%INIT>
 <%ARGS>
-$SplitBySchema => 1
+$SplitByLifecycle => 1
 </%ARGS>
diff --git a/share/html/Elements/SelectStatus b/share/html/Elements/SelectStatus
index 097882d..5be8cc9 100644
--- a/share/html/Elements/SelectStatus
+++ b/share/html/Elements/SelectStatus
@@ -14,21 +14,21 @@
 my @status;
 if ( $TicketObj ) {
     my $current = $TicketObj->Status;
-    my $schema = $TicketObj->QueueObj->status_schema;
+    my $lifecycle = $TicketObj->QueueObj->lifecycle;
 
     my %has = ();
-    foreach my $next ( $schema->transitions( $current ) ) {
-        my $check = $schema->check_right( $current => $next );
+    foreach my $next ( $lifecycle->transitions( $current ) ) {
+        my $check = $lifecycle->check_right( $current => $next );
         $has{ $check } = $TicketObj->CurrentUserHasRight( $check )
             unless exists $has{ $check };
         push @status, $next if $has{ $check };
     }
 }
 elsif ( $QueueObj ) {
-    @status = $QueueObj->status_schema->valid;
+    @status = $QueueObj->lifecycle->valid;
 }
 else {
-    @status = RT::Queue->status_schema->valid;
+    @status = RT::Queue->lifecycle->valid;
 }
 </%INIT>
 <%ARGS>
diff --git a/share/html/Ticket/Elements/Tabs b/share/html/Ticket/Elements/Tabs
index 98f3788..7d58477 100755
--- a/share/html/Ticket/Elements/Tabs
+++ b/share/html/Ticket/Elements/Tabs
@@ -55,7 +55,7 @@ if ($Ticket) {
     my $id = $Ticket->id();
 
     my $current = $Ticket->Status;
-    my $schema  = $Ticket->QueueObj->status_schema;
+    my $lifecycle  = $Ticket->QueueObj->lifecycle;
     my %has;
     my $i = 1;
 
@@ -202,11 +202,11 @@ if ($Ticket) {
     }
 
     if ( $can{'ModifyTicket'} ) {
-        foreach my $next ( $schema->transitions($current) ) {
-            my $action = $schema->transition_action( $current => $next );
+        foreach my $next ( $lifecycle->transitions($current) ) {
+            my $action = $lifecycle->transition_action( $current => $next );
             next if $action eq 'hide';
 
-            my $check = $schema->check_right( $current => $next );
+            my $check = $lifecycle->check_right( $current => $next );
             $has{$check} = $Ticket->CurrentUserHasRight($check)
                 unless exists $has{$check};
             next unless $has{$check};
@@ -230,7 +230,7 @@ if ($Ticket) {
             }
             $actions->{ 'G' . $i++ } = {
                 path  => $path,
-                title => loc( $schema->transition_label( $current => $next ) ),
+                title => loc( $lifecycle->transition_label( $current => $next ) ),
             };
         }
     }
diff --git a/t/status-schemas/basics.t b/t/lifecycles/basics.t
similarity index 97%
rename from t/status-schemas/basics.t
rename to t/lifecycles/basics.t
index 62bd26a..fa958aa 100644
--- a/t/status-schemas/basics.t
+++ b/t/lifecycles/basics.t
@@ -4,7 +4,7 @@ use strict;
 use warnings;
 use Data::Dumper;
 
-BEGIN {require  't/status-schemas/utils.pl'};
+BEGIN {require  't/lifecycles/utils.pl'};
 
 my $general = RT::Test->load_or_create_queue(
     Name => 'General',
@@ -20,8 +20,8 @@ my $tstatus = sub {
 
 diag "check basic API";
 {
-    my $schema = $general->status_schema;
-    isa_ok($schema, 'RT::StatusSchema');
+    my $schema = $general->lifecycle;
+    isa_ok($schema, 'RT::Lifecycle');
     is $schema->name, 'default', "it's a default schema";
     is join(', ', sort $schema->valid),
         join(', ', sort qw(new open stalled resolved rejected deleted)),
@@ -44,7 +44,7 @@ diag "check status input on create";
 
     my $valid = 1;
     foreach ( @form_values ) {
-        next if $general->status_schema->is_valid($_);
+        next if $general->lifecycle->is_valid($_);
         $valid = 0;
         diag("$_ doesn't appear to be a valid status, but it was in the form");
     }
diff --git a/t/status-schemas/dates.t b/t/lifecycles/dates.t
similarity index 97%
rename from t/status-schemas/dates.t
rename to t/lifecycles/dates.t
index 54d9389..300aafe 100644
--- a/t/status-schemas/dates.t
+++ b/t/lifecycles/dates.t
@@ -4,7 +4,7 @@ use strict;
 use warnings;
 use Data::Dumper;
 
-BEGIN {require 't/status-schemas/utils.pl'};
+BEGIN {require 't/lifecycles/utils.pl'};
 
 my $general = RT::Test->load_or_create_queue(
     Name => 'General',
@@ -28,12 +28,12 @@ ok $m->login, 'logged in';
 
 diag "check basic API";
 {
-    my $schema = $general->status_schema;
-    isa_ok($schema, 'RT::StatusSchema');
+    my $schema = $general->lifecycle;
+    isa_ok($schema, 'RT::Lifecycle');
     is $schema->name, 'default', "it's a default schema";
 
-    $schema = $delivery->status_schema;
-    isa_ok($schema, 'RT::StatusSchema');
+    $schema = $delivery->lifecycle;
+    isa_ok($schema, 'RT::Lifecycle');
     is $schema->name, 'delivery', "it's a delivery schema";
 }
 
@@ -276,7 +276,7 @@ diag "dates on status change for delivery schema";
 
 diag "add partial map between general->delivery";
 {
-    my $schemas = RT->Config->Get('StatusSchemaMeta');
+    my $schemas = RT->Config->Get('Lifecycles');
     $schemas->{'__maps__'} = {
         'default -> delivery' => {
             new => 'on way',
@@ -285,7 +285,7 @@ diag "add partial map between general->delivery";
             'on way' => 'resolved',
         },
     };
-    RT::StatusSchema->fill_cache;
+    RT::Lifecycle->fill_cache;
 }
 
 diag "check date changes on moving a ticket";
diff --git a/t/status-schemas/moving.t b/t/lifecycles/moving.t
similarity index 95%
rename from t/status-schemas/moving.t
rename to t/lifecycles/moving.t
index 9c864df..59ce82e 100644
--- a/t/status-schemas/moving.t
+++ b/t/lifecycles/moving.t
@@ -4,7 +4,7 @@ use strict;
 use warnings;
 use Data::Dumper;
 
-BEGIN {require 't/status-schemas/utils.pl'};
+BEGIN {require 't/lifecycles/utils.pl'};
 
 my $general = RT::Test->load_or_create_queue(
     Name => 'General',
@@ -40,13 +40,13 @@ diag "check moving without a map";
 
 diag "add partial map";
 {
-    my $schemas = RT->Config->Get('StatusSchemaMeta');
+    my $schemas = RT->Config->Get('Lifecycles');
     $schemas->{'__maps__'} = {
         'default -> delivery' => {
             new => 'ordered',
         },
     };
-    RT::StatusSchema->fill_cache;
+    RT::Lifecycle->fill_cache;
 }
 
 diag "check moving with a partial map";
diff --git a/t/status-schemas/utils.pl b/t/lifecycles/utils.pl
similarity index 96%
rename from t/status-schemas/utils.pl
rename to t/lifecycles/utils.pl
index c6616b3..21abeb2 100644
--- a/t/status-schemas/utils.pl
+++ b/t/lifecycles/utils.pl
@@ -7,7 +7,7 @@ use warnings;
 my $config;
 BEGIN {
 $config = <<END;
-Set(\%StatusSchemaMeta,
+Set(\%Lifecycles,
     default => {
         default_initial => 'new',
         initial  => [qw(new open resolved )],
@@ -58,7 +58,7 @@ Set(\%StatusSchemaMeta,
         },
     },
 );
-Set(\%StatusSchemas, delivery => 'delivery');
+Set(\%LifecycleMap, delivery => 'delivery');
 END
 }
 

-----------------------------------------------------------------------


More information about the Rt-commit mailing list