[Rt-commit] [rtir] 07/07: add support in the create RTIR queue modal for child linked tickets and enforce strict contituency linking throughout
Dustin Graves
dustin at bestpractical.com
Thu May 12 20:11:44 EDT 2016
This is an automated email from the git hooks/post-receive script.
dustin pushed a commit to branch 3.4/popup-ticket-create
in repository rtir.
commit 281bd939d5d90154a592c9ac47d49b3eee537116
Author: Dustin Graves <dustin at bestpractical.com>
Date: Fri May 13 00:10:20 2016 +0000
add support in the create RTIR queue modal for child linked tickets and enforce strict contituency linking throughout
---
html/RTIR/Elements/CreateInRTIRQueueModal | 33 ++++++++++++++++++++++++++++---
1 file changed, 30 insertions(+), 3 deletions(-)
diff --git a/html/RTIR/Elements/CreateInRTIRQueueModal b/html/RTIR/Elements/CreateInRTIRQueueModal
index cf98050..5c6b479 100644
--- a/html/RTIR/Elements/CreateInRTIRQueueModal
+++ b/html/RTIR/Elements/CreateInRTIRQueueModal
@@ -49,22 +49,49 @@
$Lifecycle
$LifecycleDesc => $Lifecycle
$Incident => undef
+$Child => undef
</%ARGS>
<%INIT>
$Lifecycle = $Lifecycle->[0] if (ref $Lifecycle eq 'ARRAY');
+
+my ($linked_ticket, $linked_constituency);
+
+if ($Incident) {
+ $linked_ticket = RT::Ticket->new( $session{CurrentUser} );
+ $linked_ticket->Load($Incident);
+}
+
+if ($Child) {
+ $linked_ticket = RT::Ticket->new( $session{CurrentUser} );
+ $linked_ticket->Load($Child);
+}
+
+if ($linked_ticket && $linked_ticket->id) {
+ $linked_constituency = RT::IR->ConstituencyFor($linked_ticket);
+}
+
+my $limit_to_constituency =
+ # Limit no matter what if we have a filter
+ $m->{'RTIR_ConstituencyFilter'} ||
+ # Also limit if we have a linked constituency and StrictConstituencyLinking is set
+ (RT::IR->StrictConstituencyLinking && $linked_constituency)
+ ? 1:0;
</%INIT>
<form action="<% RT::IR->HREFTo('Create.html') %>" id="CreateInQueue">
% if ($Incident) {
<input type="hidden" name="Incident" value="<%$Incident%>"/>
% }
+% if ($Child) {
+<input type="hidden" name="Child" value="<%$Child%>"/>
+% }
<&|/l_unsafe, $LifecycleDesc,
$m->scomp('/RTIR/Elements/SelectRTIRQueue',
Name => 'Queue',
Lifecycle => $Lifecycle,
- #%ARGS,
ShowNullOption => 0,
- LimitToConstituency => $m->{'RTIR_ConstituencyFilter'} ? 1:0,
- Constituency => $m->{'RTIR_ConstituencyFilter'})
+ LimitToConstituency => $limit_to_constituency,
+ Constituency => $m->{'RTIR_ConstituencyFilter'} || $linked_constituency)
+
&>Create a new [_1] in the queue [_2]</&>
<& /Elements/Submit, Label => loc("Go"), Caption => loc("This will take you to a partially prefilled [_1] creation form.", $LifecycleDesc) &>
</form>
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the rt-commit
mailing list