[Rt-commit] rtir branch, master, updated. 4.0.1rc1-116-g133febb9
? sunnavy
sunnavy at bestpractical.com
Fri Apr 10 17:32:13 EDT 2020
The branch, master has been updated
via 133febb901da02f013c3c3729c13f3eb5b761437 (commit)
via 7b96b55e6ee713bd4ddde005e1bc24b7c50e1a3a (commit)
from 4b61cf5f7d36eac57736d0a860b2eeea541e9e34 (commit)
Summary of changes:
html/RTIR/Create.html | 28 ++++++++++++++++++++++++----
html/RTIR/Elements/SelectRTIRQueue | 3 +++
html/RTIR/Incident/Create.html | 9 +++++----
3 files changed, 32 insertions(+), 8 deletions(-)
- Log -----------------------------------------------------------------
commit 7b96b55e6ee713bd4ddde005e1bc24b7c50e1a3a
Author: michel <michel at bestpractical.com>
Date: Thu Mar 26 00:02:20 2020 +0100
Choose queue on ticket create page.
The available queues are the RTIR queues.
diff --git a/html/RTIR/Create.html b/html/RTIR/Create.html
index 78a7f648..19e246d8 100644
--- a/html/RTIR/Create.html
+++ b/html/RTIR/Create.html
@@ -64,8 +64,8 @@
<form action="<%RT::IR->HREFTo("Split.html") %>" method="post" enctype="multipart/form-data" name="TicketCreate">
% }
<input type="hidden" name="id" value="new" />
-<input type="hidden" class="hidden" name="Queue" value="<% $QueueObj->Id %>" />
<input type="hidden" class="hidden" name="Token" value="<% $ARGS{'Token'} %>" />
+<input type="hidden" name="QueueChanged" value="0" />
% if ( $Split ) {
<input type="hidden" name="Split" value="<% $SplitObj->id %>" />
% }
@@ -104,10 +104,12 @@
QueueObj => $QueueObj,
fields => [
{ name => 'Queue',
- comp => '/Ticket/Elements/ShowQueue',
+ comp => '/RTIR/Elements/SelectRTIRQueue',
args => {
- QueueObj => $QueueObj,
- Wrap => 1,
+ Name => 'Queue',
+ Default => $Queue,
+ ShowNullOption => 0,
+ AutoSubmit => 1,
},
},
{
@@ -406,6 +408,24 @@ $m->callback(
ARGSRef => \%ARGS,
);
+# Use default queue from config site or user prefs if none provided
+unless ($Queue) {
+ $Queue = GetDefaultQueue();
+}
+
+# pick first in list in normal order unless queue provided from form/url/defaults
+unless ($Queue) {
+ my $cache_key = SetObjectSessionCache(
+ ObjectType => 'Queue',
+ CheckRight => 'CreateTicket',
+ CacheNeedsUpdate => RT->System->QueueCacheNeedsUpdate,
+ );
+
+ $Queue = $session{$cache_key}{objects}[0]->{Id};
+}
+
+$session{DefaultQueue} = $Queue;
+
my $QueueObj = RT::Queue->new( $session{'CurrentUser'} );
$QueueObj->Load( $Queue );
diff --git a/html/RTIR/Elements/SelectRTIRQueue b/html/RTIR/Elements/SelectRTIRQueue
index 44e37724..b569f8c8 100644
--- a/html/RTIR/Elements/SelectRTIRQueue
+++ b/html/RTIR/Elements/SelectRTIRQueue
@@ -71,6 +71,7 @@ $CacheNeedsUpdate => RT->System->QueueCacheNeedsUpdate
$Lifecycle => ''
$LimitToConstituency => 0
$Constituency => undef
+$AutoSubmit => 0
</%args>
<%init>
my $Class = "select-rtir-queue-".$Lifecycle;
@@ -148,4 +149,6 @@ if ( not defined $session{$cache_key} ) {
}
$session{$cache_key}{lastupdated} = time();
}
+$OnChange = "jQuery(this).closest('form').find('input[name=QueueChanged]').val(1);";
+$OnChange .= "jQuery(this).closest('form').submit();" if $AutoSubmit;
</%init>
diff --git a/html/RTIR/Incident/Create.html b/html/RTIR/Incident/Create.html
index 0a711e8c..186c9e08 100644
--- a/html/RTIR/Incident/Create.html
+++ b/html/RTIR/Incident/Create.html
@@ -71,8 +71,8 @@ if ( $ChildObj && $ChildObj->id && !$ChildObj->CurrentUserHasRight('ModifyTicket
% }
<input type="hidden" name="id" value="new" />
-<input type="hidden" class="hidden" name="Queue" value="<% $QueueObj->Id %>" />
<input type="hidden" class="hidden" name="Token" value="<% $ARGS{'Token'} %>" />
+<input type="hidden" name="QueueChanged" value="0" />
% if ( $ChildObj ) {
<input type="hidden" name="Child" value="<% $Child %>" />
% }
@@ -130,7 +130,7 @@ if ( $ChildObj && $ChildObj->id && !$ChildObj->CurrentUserHasRight('ModifyTicket
<&|/l&>Queue</&>:
</div>
<div class="value col-md-9">
- <span class="current-value form-control"><& /Ticket/Elements/ShowQueue, QueueObj => $QueueObj &></span>
+ <& /RTIR/Elements/SelectRTIRQueue, Name => "Queue", Default => $ARGS{Queue}, AutoSubmit => 1, ShowNullOption => 0 &>
</div>
</div>
<div class="form-row">
@@ -371,8 +371,9 @@ if (!$QueueObj->Name) {
Abort( loc("Queue '[_1]' could not be loaded.", $ARGS{Queue}) );
}
-
-
+if( !RT::IR->IsIncidentQueue($QueueObj) ) {
+ RT::Interface::Web::Redirect(RT::IR->HREFTo( '/Create.html?' . $m->comp('/Elements/QueryString', %ARGS )));
+}
my $ticket = RT::Ticket->new($session{'CurrentUser'}); # empty ticket object
commit 133febb901da02f013c3c3729c13f3eb5b761437
Merge: 4b61cf5f 7b96b55e
Author: sunnavy <sunnavy at bestpractical.com>
Date: Sat Apr 11 05:31:32 2020 +0800
Merge branch '5.0/select-queue'
-----------------------------------------------------------------------
More information about the rt-commit
mailing list