[Rt-commit] rt branch, 4.0/lifecyles-vs-approvals, created. rt-4.0.0rc6-133-g5d13551
Kevin Falcone
falcone at bestpractical.com
Fri Mar 18 15:35:20 EDT 2011
The branch, 4.0/lifecyles-vs-approvals has been created
at 5d135515dd8a4cbe256a53d60aeb8d50824da679 (commit)
- Log -----------------------------------------------------------------
commit 43252dd8b7c7d6e81f12039d489e41ac141b6d68
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 b6514f4..c888a05 100755
--- a/etc/RT_Config.pm.in
+++ b/etc/RT_Config.pm.in
@@ -2243,6 +2243,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' },
+ ],
+ },
);
commit 97fb02ee787c6e4125b79a455a759248d1bc84b1
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 c888a05..6ee49f8 100755
--- a/etc/RT_Config.pm.in
+++ b/etc/RT_Config.pm.in
@@ -2208,7 +2208,9 @@ Set(%Lifecycles,
defaults => {
on_create => 'new',
- on_merge => 'resolved',
+ on_merge => 'resolved',
+ approved => 'open',
+ denied => 'rejeceted',
},
transitions => {
commit 7eb01200a4591ade6d19eda72a74d873a94e9881
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,
);
}
commit ca448ca6a5edd458566f6e12bc6be7650b1c873d
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date: Thu Mar 17 18:01:04 2011 +0300
document special statuses for approvals
diff --git a/etc/RT_Config.pm.in b/etc/RT_Config.pm.in
index 6ee49f8..907a3ea 100755
--- a/etc/RT_Config.pm.in
+++ b/etc/RT_Config.pm.in
@@ -2069,6 +2069,16 @@ When tickets are merged status of the ticket that merged is changed by
force to this. It should be one of inactive statuses; 'resolved' or
its equivalent is most probably the best candidate.
+=item approved
+
+When an approval accepted status of depending tickets changed
+to this value.
+
+=item denied
+
+When an approval denied status of depending tickets changed
+to this value.
+
=back
=head2 Transitions between statuses and UI actions
commit 44e120d8292bc20225be4690b385a4e8b65b7f89
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date: Thu Mar 17 18:23:22 2011 +0300
set lifecycle for approvals on DB init and upgrade
diff --git a/etc/initialdata b/etc/initialdata
index d677d06..747b77b 100755
--- a/etc/initialdata
+++ b/etc/initialdata
@@ -19,6 +19,7 @@
CorrespondAddress => "",
CommentAddress => "", },
{ Name => '___Approvals',
+ Lifecycle => 'approvals',
Description => 'A system-internal queue for the approvals system',
Disabled => 2, } );
diff --git a/etc/upgrade/4.0.0rc7/content b/etc/upgrade/4.0.0rc7/content
new file mode 100644
index 0000000..d0d210b
--- /dev/null
+++ b/etc/upgrade/4.0.0rc7/content
@@ -0,0 +1,21 @@
+ at Initial = (
+ sub {
+ $RT::Logger->debug("Going to set lifecycle for approvals");
+
+ my $queue = RT::Queue->new( RT->SystemUser );
+ $queue->Load('___Approvals');
+ unless ( $queue->id ) {
+ $RT::Logger->warning("There is no ___Approvals queue in the DB");
+ return 1;
+ }
+
+ return 1 if $queue->Lifecycle->Name eq 'approvals';
+
+ my ($status, $msg) = $queue->SetLifecycle('approvals');
+ unless ( $status ) {
+ $RT::Logger->error("Couldn't set lifecycle for '___Approvals' queue: $msg");
+ return 0;
+ }
+ return 1;
+ },
+);
commit 5d135515dd8a4cbe256a53d60aeb8d50824da679
Author: Kevin Falcone <falcone at bestpractical.com>
Date: Fri Mar 18 15:07:03 2011 -0400
typo
diff --git a/etc/RT_Config.pm.in b/etc/RT_Config.pm.in
index 907a3ea..cc8dff9 100755
--- a/etc/RT_Config.pm.in
+++ b/etc/RT_Config.pm.in
@@ -2220,7 +2220,7 @@ Set(%Lifecycles,
on_create => 'new',
on_merge => 'resolved',
approved => 'open',
- denied => 'rejeceted',
+ denied => 'rejected',
},
transitions => {
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list