[Rt-commit] rt branch, create-action, updated. 052505249e11b5ff8fe51945836233c9076dd3d7
sartak at bestpractical.com
sartak at bestpractical.com
Mon Sep 28 12:32:45 EDT 2009
The branch, create-action has been updated
via 052505249e11b5ff8fe51945836233c9076dd3d7 (commit)
from c990d4dafaa1b0a8594992e762c0f10818cce958 (commit)
Summary of changes:
lib/RT/Action/CreateTicket.pm | 16 +++++++++++++---
1 files changed, 13 insertions(+), 3 deletions(-)
- Log -----------------------------------------------------------------
commit 052505249e11b5ff8fe51945836233c9076dd3d7
Author: Shawn M Moore <sartak at bestpractical.com>
Date: Mon Sep 28 12:32:08 2009 -0400
Refactor _add_custom_field to make it more finegrained
diff --git a/lib/RT/Action/CreateTicket.pm b/lib/RT/Action/CreateTicket.pm
index 96d7c33..e677de2 100644
--- a/lib/RT/Action/CreateTicket.pm
+++ b/lib/RT/Action/CreateTicket.pm
@@ -210,12 +210,22 @@ sub _add_custom_fields {
my $method = $args{method};
while (my $cf = $cfs->next) {
- $self->$method(
- name => $cf->name,
+ my $render_as = $cf->type_for_rendering;
+ my %args = (
+ name => $cf->name,
defaults => {
- render_as => $cf->type_for_rendering,
+ render_as => $render_as,
},
);
+
+ if ($render_as =~ /Select/i) {
+ my @valid_values = 'XXX';
+ $args{defaults}{valid_values} = \@valid_values;
+ }
+
+ $self->$method(
+ %args,
+ );
}
}
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list