[Rt-commit] rt branch, 4.0/lifecyles-vs-approvals, created. rt-4.0.0rc6-140-g63dfbbb
Ruslan Zakirov
ruz at bestpractical.com
Thu Mar 17 10:02:47 EDT 2011
The branch, 4.0/lifecyles-vs-approvals has been created
at 63dfbbbffe0ff77bdd29e16acbb0c3f3a6bf482b (commit)
- Log -----------------------------------------------------------------
commit 177a51d2287314c1cbb8d72978698c6a67535a98
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date: Wed Mar 16 12:26:40 2011 +0300
clone default lifecycle for approvals
diff --git a/etc/RT_Config.pm.in b/etc/RT_Config.pm.in
index 0a9b6f1..b08b64a 100755
--- a/etc/RT_Config.pm.in
+++ b/etc/RT_Config.pm.in
@@ -2116,6 +2116,50 @@ Set(%Lifecycles,
'deleted -> open' => { label => 'Undelete' },
],
},
+# don't change lifecyle of the approvals, they are not capable to deal with
+# custom statuses
+ approvals => {
+ initial => [ 'new' ],
+ active => [ 'open', 'stalled' ],
+ inactive => [ 'resolved', 'rejected', 'deleted' ],
+
+ defaults => {
+ on_create => 'new',
+ on_merge => 'resolved',
+ },
+
+ transitions => {
+ '' => [qw(new open resolved)],
+
+ # from => [ to list ],
+ new => [qw(open stalled resolved rejected deleted)],
+ open => [qw(new stalled resolved rejected deleted)],
+ stalled => [qw(new open rejected resolved deleted)],
+ resolved => [qw(new open stalled rejected deleted)],
+ rejected => [qw(new open stalled resolved deleted)],
+ deleted => [qw(new open stalled rejected resolved)],
+ },
+ rights => {
+ '* -> deleted' => 'DeleteTicket',
+ '* -> rejected' => 'ModifyTicket',
+ '* -> *' => 'ModifyTicket',
+ },
+ actions => [
+ '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' },
+ ],
+ },
);
=head1 Ticket Relationships
commit 93506fd4f4049809b556b4ce0318aff2e91cd041
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date: Thu Mar 17 16:58:25 2011 +0300
introduce new properties in lifecycles for approvals
diff --git a/etc/RT_Config.pm.in b/etc/RT_Config.pm.in
index b08b64a..45014df 100755
--- a/etc/RT_Config.pm.in
+++ b/etc/RT_Config.pm.in
@@ -2081,7 +2081,9 @@ Set(%Lifecycles,
defaults => {
on_create => 'new',
- on_merge => 'resolved',
+ on_merge => 'resolved',
+ approved => 'open',
+ denied => 'rejeceted',
},
transitions => {
commit 63dfbbbffe0ff77bdd29e16acbb0c3f3a6bf482b
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date: Thu Mar 17 17:01:21 2011 +0300
on approve and deny use statuses from config
diff --git a/lib/RT/Approval/Rule/Passed.pm b/lib/RT/Approval/Rule/Passed.pm
index 1618e6e..e4f967b 100644
--- a/lib/RT/Approval/Rule/Passed.pm
+++ b/lib/RT/Approval/Rule/Passed.pm
@@ -86,7 +86,10 @@ sub Commit {
}
}
- $obj->SetStatus( Status => 'open', Force => 1 );
+ $obj->SetStatus(
+ Status => $obj->QueueObj->Lifecycle->DefaultStatus('approved') || 'open',
+ Force => 1,
+ );
}
my $passed = !$top->HasUnresolvedDependencies( Type => 'approval' );
diff --git a/lib/RT/Approval/Rule/Rejected.pm b/lib/RT/Approval/Rule/Rejected.pm
index b10f5f0..9a5a8d0 100644
--- a/lib/RT/Approval/Rule/Rejected.pm
+++ b/lib/RT/Approval/Rule/Rejected.pm
@@ -82,7 +82,7 @@ sub Commit { # XXX: from custom prepare code
$rejected->Correspond( MIMEObj => $template->MIMEObj );
$rejected->SetStatus(
- Status => 'rejected',
+ Status => $rejected->QueueObj->Lifecycle->DefaultStatus('denied') || 'rejected',
Force => 1,
);
}
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list