[Rt-commit] rt branch, update-action, updated. d06d867ceaa64ef735acdc08207e2468aa420c09
sartak at bestpractical.com
sartak at bestpractical.com
Tue Dec 8 06:34:50 EST 2009
The branch, update-action has been updated
via d06d867ceaa64ef735acdc08207e2468aa420c09 (commit)
from a641a3bf471ae3f178ba2acb7cdd3562d6831266 (commit)
Summary of changes:
lib/RT/Action/CreateTicket.pm | 7 ++-----
lib/RT/Action/TicketAction.pm | 9 +++++++++
2 files changed, 11 insertions(+), 5 deletions(-)
- Log -----------------------------------------------------------------
commit d06d867ceaa64ef735acdc08207e2468aa420c09
Author: Shawn M Moore <sartak at bestpractical.com>
Date: Tue Dec 8 06:34:36 2009 -0500
Refactor set_valid_statuses into TicketAction
diff --git a/lib/RT/Action/CreateTicket.pm b/lib/RT/Action/CreateTicket.pm
index 1ed63e5..57e68a0 100644
--- a/lib/RT/Action/CreateTicket.pm
+++ b/lib/RT/Action/CreateTicket.pm
@@ -49,7 +49,6 @@ sub after_set_queue {
my $queue = shift;
$self->SUPER::after_set_queue($queue, @_);
- $self->set_valid_statuses($queue);
$self->setup_gnupg($queue);
$self->add_role_group_parameter(
@@ -132,12 +131,10 @@ sub after_set_queue {
$self->set_final_priority($queue);
}
-sub set_valid_statuses {
+sub _valid_statuses {
my $self = shift;
my $queue = shift;
-
- my @valid_statuses = $queue->status_schema->initial;
- $self->fill_parameter(status => valid_values => \@valid_statuses);
+ return $queue->status_schema->initial;
}
sub setup_gnupg {
diff --git a/lib/RT/Action/TicketAction.pm b/lib/RT/Action/TicketAction.pm
index 7648156..2a0129d 100644
--- a/lib/RT/Action/TicketAction.pm
+++ b/lib/RT/Action/TicketAction.pm
@@ -11,9 +11,18 @@ sub after_set_queue {
my $queue = shift;
$self->SUPER::after_set_queue($queue, @_);
+ $self->set_valid_statuses($queue);
$self->set_valid_owners($queue);
}
+sub set_valid_statuses {
+ my $self = shift;
+ my $queue = shift;
+
+ my @valid_statuses = $self->_valid_statuses($queue);
+ $self->fill_parameter(status => valid_values => \@valid_statuses);
+}
+
sub set_valid_owners {
my $self = shift;
my $queue = shift;
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list