[Rt-commit] rt branch, create-action, updated. 84f8579dff7ff4be51a0222672fdc29e388fab57
sartak at bestpractical.com
sartak at bestpractical.com
Wed Sep 23 10:15:38 EDT 2009
The branch, create-action has been updated
via 84f8579dff7ff4be51a0222672fdc29e388fab57 (commit)
from 17932accb35f571035d1a9ed1cb1be44f01c68a1 (commit)
Summary of changes:
lib/RT/Action/CreateTicket.pm | 50 +++++++++++++++++++++++++++++++++++++++++
lib/RT/View/Ticket/Create.pm | 6 +++++
2 files changed, 56 insertions(+), 0 deletions(-)
- Log -----------------------------------------------------------------
commit 84f8579dff7ff4be51a0222672fdc29e388fab57
Author: Shawn M Moore <sartak at bestpractical.com>
Date: Wed Sep 23 10:15:33 2009 -0400
Add link parameters
diff --git a/lib/RT/Action/CreateTicket.pm b/lib/RT/Action/CreateTicket.pm
index 7fe8202..f13370b 100644
--- a/lib/RT/Action/CreateTicket.pm
+++ b/lib/RT/Action/CreateTicket.pm
@@ -96,6 +96,36 @@ sub after_set_queue {
hints => _('(Sends a carbon-copy of this update to a comma-delimited list of administrative email addresses. These people <strong>will</strong> receive future updates.)'),
);
+ $self->add_link_parameter(
+ name => 'depends_on',
+ label => _('Depends on'),
+ );
+
+ $self->add_link_parameter(
+ name => 'depended_on_by',
+ label => _('Depended on by'),
+ );
+
+ $self->add_link_parameter(
+ name => 'parents',
+ label => _('Parents'),
+ );
+
+ $self->add_link_parameter(
+ name => 'children',
+ label => _('Children'),
+ );
+
+ $self->add_link_parameter(
+ name => 'refers_to',
+ label => _('Refers to'),
+ );
+
+ $self->add_link_parameter(
+ name => 'referred_to_by',
+ label => _('Referred to by'),
+ );
+
$self->set_initial_priority($queue);
$self->set_final_priority($queue);
}
@@ -105,6 +135,11 @@ sub role_group_parameters {
return @{ $self->{_role_group_parameters} || [] };
}
+sub link_parameters {
+ my $self = shift;
+ return @{ $self->{_link_parameters} || [] };
+}
+
sub set_valid_statuses {
my $self = shift;
my $queue = shift;
@@ -165,6 +200,21 @@ sub add_role_group_parameter {
));
}
+sub add_link_parameter {
+ my $self = shift;
+ my %args = @_;
+
+ my $name = delete $args{name};
+
+ push @{ $self->{_link_parameters} }, $name;
+
+ $self->fill_parameter($name => (
+ render_as => 'text',
+ display_length => 10,
+ %args,
+ ));
+}
+
sub set_initial_priority {
my $self = shift;
my $queue = shift;
diff --git a/lib/RT/View/Ticket/Create.pm b/lib/RT/View/Ticket/Create.pm
index bb6b814..7ef7e2d 100644
--- a/lib/RT/View/Ticket/Create.pm
+++ b/lib/RT/View/Ticket/Create.pm
@@ -141,6 +141,12 @@ sub show_details {
render_param($create, 'starts');
render_param($create, 'due');
+ hr {};
+
+ for my $link_type ($create->link_parameters) {
+ render_param($create, $link_type);
+ }
+
$create->button(label => _('Create'));
};
}
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list