[Rt-commit] rt branch, create-action, updated. cb2ab22d7a09d75f9149d77c7ce8a0b7758abb57
sartak at bestpractical.com
sartak at bestpractical.com
Wed Sep 23 13:37:52 EDT 2009
The branch, create-action has been updated
via cb2ab22d7a09d75f9149d77c7ce8a0b7758abb57 (commit)
via b4686eb92b9556c2e04b414700442372d17f0b51 (commit)
from 1ab929fd8a8e44d070523e4d02d5a2df4b9854d1 (commit)
Summary of changes:
lib/RT/Action/CreateTicket.pm | 13 ++++++++++++-
lib/RT/View/Ticket/Create.pm | 4 ++++
2 files changed, 16 insertions(+), 1 deletions(-)
- Log -----------------------------------------------------------------
commit b4686eb92b9556c2e04b414700442372d17f0b51
Author: Shawn M Moore <sartak at bestpractical.com>
Date: Wed Sep 23 13:33:35 2009 -0400
defaults are optional
diff --git a/lib/RT/Action/CreateTicket.pm b/lib/RT/Action/CreateTicket.pm
index a40aff0..a847314 100644
--- a/lib/RT/Action/CreateTicket.pm
+++ b/lib/RT/Action/CreateTicket.pm
@@ -207,7 +207,7 @@ sub _add_parameter_type {
my $key = $args{key} || "_${name}_parameters";
my $add_method = $args{add_method} || "add_${name}_parameter";
my $get_method = $args{get_method} || "${name}_parameters";
- my %defaults = %{ $args{defaults} };
+ my %defaults = %{ $args{defaults} || {} };
no strict 'refs';
commit cb2ab22d7a09d75f9149d77c7ce8a0b7758abb57
Author: Shawn M Moore <sartak at bestpractical.com>
Date: Wed Sep 23 13:37:45 2009 -0400
Skeleton of custom field handling
diff --git a/lib/RT/Action/CreateTicket.pm b/lib/RT/Action/CreateTicket.pm
index a847314..eeda3ac 100644
--- a/lib/RT/Action/CreateTicket.pm
+++ b/lib/RT/Action/CreateTicket.pm
@@ -128,6 +128,8 @@ sub after_set_queue {
label => _('Referred to by'),
);
+ $self->add_ticket_custom_fields($queue);
+
$self->set_initial_priority($queue);
$self->set_final_priority($queue);
}
@@ -199,6 +201,11 @@ sub take_action {
HTML::Mason::Commands::create_ticket(%{ $self->argument_values });
}
+sub add_ticket_custom_fields {
+ my $self = shift;
+ my $queue = shift;
+}
+
sub _add_parameter_type {
my $class = shift;
my %args = @_;
@@ -265,5 +272,9 @@ __PACKAGE__->_add_parameter_type(
},
);
+__PACKAGE__->_add_parameter_type(
+ name => 'ticket_custom_field',
+);
+
1;
diff --git a/lib/RT/View/Ticket/Create.pm b/lib/RT/View/Ticket/Create.pm
index c7cdf60..79c4289 100644
--- a/lib/RT/View/Ticket/Create.pm
+++ b/lib/RT/View/Ticket/Create.pm
@@ -111,6 +111,10 @@ sub show_basics {
render_param($create, $role_group);
}
+ for my $custom_field ($create->ticket_custom_field_parameters) {
+ render_param($create, $custom_field);
+ }
+
render_param($create, 'subject');
render_param($create, 'attachments');
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list