[Rt-commit] rt branch, 3.9-lifecycles_improvments, updated. rt-3.9.4-230-g86ced9f
Ruslan Zakirov
ruz at bestpractical.com
Wed Nov 3 02:47:18 EDT 2010
The branch, 3.9-lifecycles_improvments has been updated
via 86ced9fbb65e7c2ae10c629a0801c691d04ece45 (commit)
from 3a09a003dc811e1bf66e2cd3839a62107bf52531 (commit)
Summary of changes:
etc/RT_Config.pm.in | 60 +++++++++++++++++++++++-------------------------
lib/RT/Lifecycle.pm | 2 +-
t/lifecycles/utils.pl | 30 ++++++++++++------------
3 files changed, 45 insertions(+), 47 deletions(-)
- Log -----------------------------------------------------------------
commit 86ced9fbb65e7c2ae10c629a0801c691d04ece45
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date: Tue Nov 2 07:23:04 2010 +0300
Name action properties, positionals are extandable
diff --git a/etc/RT_Config.pm.in b/etc/RT_Config.pm.in
index ffe3ef4..f3547e5 100755
--- a/etc/RT_Config.pm.in
+++ b/etc/RT_Config.pm.in
@@ -1983,19 +1983,19 @@ Use the following format to define labels and actions of transitions:
default => {
...
actions => [
- 'new -> open' => ['Open It', 'Respond'],
- 'new -> resolved' => ['Resolve', 'Comment'],
- 'new -> rejected' => ['Reject', 'Respond'],
- 'new -> deleted' => ['Delete', ''],
-
- 'open -> stalled' => ['Stall', 'Comment'],
- 'open -> resolved' => ['Resolve', 'Comment'],
- 'open -> rejected' => ['Reject', 'Respond'],
-
- 'stalled -> open' => ['Open It', ''],
- 'resolved -> open' => ['Re-open', 'Comment'],
- 'rejected -> open' => ['Re-open', 'Comment'],
- 'deleted -> open' => ['Undelete', ''],
+ 'new -> open' => { label => 'Open It', update => 'Respond' },
+ 'new -> resolved' => { label => 'Resolve', update => 'Comment' },
+ 'new -> rejected' => { label => 'Reject', update => 'Respond' },
+ 'new -> deleted' => { label => 'Delete' },
+
+ 'open -> stalled' => { label => 'Stall', update => 'Comment' },
+ 'open -> resolved' => { label => 'Resolve', update => 'Comment' },
+ 'open -> rejected' => { label => 'Reject', update => 'Respond' },
+
+ 'stalled -> open' => { label => 'Open It' },
+ 'resolved -> open' => { label => 'Re-open', update => 'Comment' },
+ 'rejected -> open' => { label => 'Re-open', update => 'Comment' },
+ 'deleted -> open' => { label => 'Undelete' },
],
...
},
@@ -2008,10 +2008,10 @@ For example:
...
actions => [
...
- 'new -> rejected' => ['Reject', 'Respond'],
- 'new -> rejected' => ['Quick Reject'],
+ 'new -> rejected' => { label => 'Reject', update => 'Respond' },
+ 'new -> rejected' => { label => 'Quick Reject' },
...
- '* -> deleted' => ['Delete'],
+ '* -> deleted' => { label => 'Delete' },
...
],
...
@@ -2060,21 +2060,19 @@ Set(%Lifecycles,
actions => [
# 'from -> to' => [action text, Respond/Comment/hide/''],
- 'new -> open' => [ 'Open It', 'Respond' ],
- 'new -> resolved' => [ 'Resolve', 'Comment' ],
- 'new -> rejected' => [ 'Reject', 'Respond' ],
- 'new -> deleted' => [ 'Delete', '' ],
-
- 'open -> stalled' => [ 'Stall', 'Comment' ],
- 'open -> resolved' => [ 'Resolve', 'Comment' ],
- 'open -> rejected' => [ 'Reject', 'Respond' ],
- 'open -> deleted' => [ 'Delete', 'hide' ],
-
- 'stalled -> open' => [ 'Open It', '' ],
- 'resolved -> open' => [ 'Re-open', 'Comment' ],
- 'rejected -> open' => [ 'Re-open', 'Comment' ],
- 'deleted -> open' => [ 'Undelete', '' ],
- 'open -> new' => [ 'New', 'hide' ],
+ 'new -> open' => { label => 'Open It', update => 'Respond' },
+ 'new -> resolved' => { label => 'Resolve', update => 'Comment' },
+ 'new -> rejected' => { label => 'Reject', update => 'Respond' },
+ 'new -> deleted' => { label => 'Delete' },
+
+ 'open -> stalled' => { label => 'Stall', update => 'Comment' },
+ 'open -> resolved' => { label => 'Resolve', update => 'Comment' },
+ 'open -> rejected' => { label => 'Reject', update => 'Respond' },
+
+ 'stalled -> open' => { label => 'Open It' },
+ 'resolved -> open' => { label => 'Re-open', update => 'Comment' },
+ 'rejected -> open' => { label => 'Re-open', update => 'Comment' },
+ 'deleted -> open' => { label => 'Undelete' },
],
},
);
diff --git a/lib/RT/Lifecycle.pm b/lib/RT/Lifecycle.pm
index ca026e3..d611ba9 100644
--- a/lib/RT/Lifecycle.pm
+++ b/lib/RT/Lifecycle.pm
@@ -596,7 +596,7 @@ sub fill_cache {
my @tmp = splice @res;
while ( my ($transition, $info) = splice @tmp, 0, 2 ) {
my ($from, $to) = split /\s*->\s*/, $transition, 2;
- push @res, { from => $from, to => $to, label => $info->[0], update => $info->[1] };
+ push @res, { %$info, from => $from, to => $to };
}
$lifecycle->{'actions'} = \@res;
}
diff --git a/t/lifecycles/utils.pl b/t/lifecycles/utils.pl
index 0ea6f77..33813e9 100644
--- a/t/lifecycles/utils.pl
+++ b/t/lifecycles/utils.pl
@@ -22,19 +22,19 @@ Set(\%Lifecycles,
deleted => [qw(open)],
},
actions => {
- 'new -> open' => ['Open It', 'Respond'],
- 'new -> resolved' => ['Resolve', 'Comment'],
- 'new -> rejected' => ['Reject', 'Respond'],
- 'new -> deleted' => ['Delete', ''],
+ 'new -> open' => {label => 'Open It', update => 'Respond'},
+ 'new -> resolved' => {label => 'Resolve', update => 'Comment'},
+ 'new -> rejected' => {label => 'Reject', update => 'Respond'},
+ 'new -> deleted' => {label => 'Delete', update => ''},
- 'open -> stalled' => ['Stall', 'Comment'],
- 'open -> resolved' => ['Resolve', 'Comment'],
- 'open -> rejected' => ['Reject', 'Respond'],
+ 'open -> stalled' => {label => 'Stall', update => 'Comment'},
+ 'open -> resolved' => {label => 'Resolve', update => 'Comment'},
+ 'open -> rejected' => {label => 'Reject', update => 'Respond'},
- 'stalled -> open' => ['Open It', ''],
- 'resolved -> open' => ['Re-open', 'Comment'],
- 'rejected -> open' => ['Re-open', 'Comment'],
- 'deleted -> open' => ['Undelete', ''],
+ 'stalled -> open' => {label => 'Open It', update => ''},
+ 'resolved -> open' => {label => 'Re-open', update => 'Comment'},
+ 'rejected -> open' => {label => 'Re-open', update => 'Comment'},
+ 'deleted -> open' => {label => 'Undelete', update => ''},
},
},
delivery => {
@@ -49,11 +49,11 @@ Set(\%Lifecycles,
delivered => [],
},
actions => {
- 'ordered -> on way' => ['Put On Way', 'Respond'],
- 'ordered -> delayed' => ['Delay', 'Respond'],
+ 'ordered -> on way' => {label => 'Put On Way', update => 'Respond'},
+ 'ordered -> delayed' => {label => 'Delay', update => 'Respond'},
- 'on way -> delivered' => ['Done', 'Respond'],
- 'delayed -> on way' => ['Put On Way', 'Respond'],
+ 'on way -> delivered' => {label => 'Done', update => 'Respond'},
+ 'delayed -> on way' => {label => 'Put On Way', update => 'Respond'},
},
},
);
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list