[Rt-commit] rt branch, 3.9-trunk, updated. rt-3.9.4-129-gd85c55d

? sunnavy sunnavy at bestpractical.com
Thu Oct 7 22:46:36 EDT 2010


The branch, 3.9-trunk has been updated
       via  d85c55dac1cfac304b16a7f3694bddb8896e9de3 (commit)
      from  bd8fd37912c29e80890cdc1da0d0e852a577313e (commit)

Summary of changes:
 etc/RT_Config.pm.in      |   10 ++++++++++
 lib/RT/Lifecycle.pm      |   13 ++++++++++++-
 lib/RT/Ticket_Overlay.pm |    9 +++------
 3 files changed, 25 insertions(+), 7 deletions(-)

- Log -----------------------------------------------------------------
commit d85c55dac1cfac304b16a7f3694bddb8896e9de3
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Fri Oct 8 10:49:14 2010 +0800

    add default_inactive status to merge tickets

diff --git a/etc/RT_Config.pm.in b/etc/RT_Config.pm.in
index 9cc8aad..23f2924 100755
--- a/etc/RT_Config.pm.in
+++ b/etc/RT_Config.pm.in
@@ -1829,6 +1829,7 @@ For example:
         initial  => ['new'],
         active   => ['open', 'stalled'],
         inactive => ['resolved', 'rejected', 'deleted'],
+        default_inactive => 'resolved',
         ...
     },
 
@@ -1879,6 +1880,14 @@ 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 lifecycle.
 
+=item default_inactive
+
+you can specify a set of statuses which
+RT will treat as valid "inactive" statuses for tickets.
+
+If you (or your code) doesn't specify a status when resolving a
+ticket, RT will use the L<"default_inactive"> status.
+
 =back
 
 Statuses in each set are ordered and listed in the UI in the defined
@@ -1997,6 +2006,7 @@ Set(%Lifecycles,
         initial         => [ 'new', 'open' ],
         active          => [ 'open', 'stalled' ],
         inactive        => [ 'resolved', 'rejected', 'deleted' ],
+        default_inactive => 'resolved',
 
         transitions => {
 
diff --git a/lib/RT/Lifecycle.pm b/lib/RT/Lifecycle.pm
index 68f4386..b2620e4 100644
--- a/lib/RT/Lifecycle.pm
+++ b/lib/RT/Lifecycle.pm
@@ -306,6 +306,17 @@ sub is_inactive {
     return 0;
 }
 
+=head3 default_inactive
+
+Returns the "default" inactive status for this lifecycle
+
+=cut
+
+sub default_inactive {
+    my $self = shift;
+    return $self->{data}->{default_inactive};
+}
+
 =head2 Transitions, rights, labels and actions.
 
 =head3 transitions
@@ -643,7 +654,7 @@ sub _set_defaults {
     my %args = @_;
 
     $LIFECYCLES{ $args{'name'} }{$_ } = $args{ $_ }
-        foreach qw(default_initial);
+        foreach qw(default_initial default_inactive);
 
     return 1;
 }
diff --git a/lib/RT/Ticket_Overlay.pm b/lib/RT/Ticket_Overlay.pm
index 3f97c8e..7adca6c 100755
--- a/lib/RT/Ticket_Overlay.pm
+++ b/lib/RT/Ticket_Overlay.pm
@@ -2637,13 +2637,10 @@ sub _MergeInto {
     }
 
 
-    if ( !$self->QueueObj->IsInactiveStatus($self->__Value('Status')) ) {
-        my $inactive =
-          $self->QueueObj->IsInactiveStatus('resolved')
-          ? 'resolved'
-          : ( $self->QueueObj->InactiveStatusArray )[0];
+    my $default_inactive = $self->QueueObj->lifecycle->default_inactive;
+    if ( $default_inactive ne $self->__Value('Status') ) {
         my ( $status_val, $status_msg )
-            = $self->__Set( Field => 'Status', Value => $inactive );
+            = $self->__Set( Field => 'Status', Value => $default_inactive );
 
         unless ($status_val) {
             $RT::Handle->Rollback();

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


More information about the Rt-commit mailing list