Mailing List Archive

rtir branch, 5.0/abort-ticket-create-page-if-no-queue, created. 5.0.0beta1-1-g776b3582
The branch, 5.0/abort-ticket-create-page-if-no-queue has been created
at 776b358231848579f70f7fa1af5a7d92a88c834c (commit)

- Log -----------------------------------------------------------------
commit 776b358231848579f70f7fa1af5a7d92a88c834c
Author: craig kaiser <craig@bestpractical.com>
Date: Mon Jun 22 09:21:00 2020 -0400

Abort ticket create if no queue can be loaded

diff --git a/html/RTIR/Create.html b/html/RTIR/Create.html
index 7d738d4b..5e197762 100644
--- a/html/RTIR/Create.html
+++ b/html/RTIR/Create.html
@@ -435,8 +435,9 @@ my $QueueObj = RT::Queue->new( $session{'CurrentUser'} );
$QueueObj->Load( $Queue );

if (!$QueueObj->Name) {
- Abort( loc("Queue '[_1]' could not be loaded.",$Queue) );
- }
+ Abort(loc("Queue [_1] could not be loaded.", $Queue||''), Code => HTTP::Status::HTTP_BAD_REQUEST );
+}
+$QueueObj->Disabled && Abort(loc("Cannot create tickets in a disabled queue."), Code => HTTP::Status::HTTP_NOT_FOUND);

$Lifecycle ||= $QueueObj->Lifecycle;

diff --git a/html/RTIR/Incident/Create.html b/html/RTIR/Incident/Create.html
index fd036c5f..29bda7b1 100644
--- a/html/RTIR/Incident/Create.html
+++ b/html/RTIR/Incident/Create.html
@@ -416,8 +416,9 @@ my $QueueObj = RT::Queue->new($session{'CurrentUser'});
$QueueObj->Load( $queue );

if (!$QueueObj->Name) {
-Abort( loc("Queue '[_1]' could not be loaded.", $queue) );
- }
+ Abort(loc("Queue [_1] could not be loaded.", $queue||''), Code => HTTP::Status::HTTP_BAD_REQUEST );
+}
+$QueueObj->Disabled && Abort(loc("Cannot create tickets in a disabled queue."), Code => HTTP::Status::HTTP_NOT_FOUND);

# Load appropriate Investigations queue
my $InvestigationsQueue = $ARGS{InvestigationQueue} || 'Investigations' . ( $constituency ? ' - ' . $constituency : '' );

-----------------------------------------------------------------------
_______________________________________________
rt-commit mailing list
rt-commit@lists.bestpractical.com
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-commit