[Rt-commit] rtir branch, 5.0/restore-incidents-and-investigations-on-create, repushed
Aaron Trevena
ast at bestpractical.com
Fri Jun 12 10:30:40 EDT 2020
The branch 5.0/restore-incidents-and-investigations-on-create was deleted and repushed:
was 81ddc5076047340ce3cf2ffc68a807d0bec874f7
now 2f95e6da341f94eb57712070eb67eb1106a324db
1: fb4aafbe = 1: fb4aafbe Core RT::Extension::CreateIncidentAndInvestigation
2: 6b6ff8c1 = 2: 6b6ff8c1 Migrate Investigation/Elements/Create to elevator themes
3: 7ac8ea18 = 3: 7ac8ea18 Replace Cc and AdminCc helper text with tooltips
4: 3b7f1ed8 < -: ------- Add DefaultInvestigationsQueue RTIR config option
5: a314f50a ! 4: cf010fd3 Allow investigation queue to be selected
@@ -8,6 +8,9 @@
Both selected incident and selected investigation now persist
through the reload by reading the InvestigationQueue arg on post.
+
+ If the user can't load the Queue then load one they can
+ SeeQueue and CreateTicket for.
diff --git a/html/RTIR/Incident/Create.html b/html/RTIR/Incident/Create.html
--- a/html/RTIR/Incident/Create.html
@@ -19,8 +22,34 @@
-my $InvestigationsQueue = 'Investigations' . ( $constituency ? ' - ' . $constituency : '' );
+my $InvestigationsQueue = $ARGS{InvestigationQueue} || 'Investigations' . ( $constituency ? ' - ' . $constituency : '' );
my $InvestigationsQueueObj = RT::Queue->new( $session{'CurrentUser'} );
- my ($ret, $msg) = $InvestigationsQueueObj->Load( $InvestigationsQueue );
- RT->Logger->error("Unable to load $InvestigationsQueue : $msg") unless $ret;
+-my ($ret, $msg) = $InvestigationsQueueObj->Load( $InvestigationsQueue );
+-RT->Logger->error("Unable to load $InvestigationsQueue : $msg") unless $ret;
++$InvestigationsQueueObj->Load( $InvestigationsQueue );
++
++# Users limited by constituency may not be able to use the queue provided or selected
++# Look up what queue the user has SeeQueue and CreateTicket for and use that instead.
++unless ( $InvestigationsQueueObj->Name ) {
++ RT->Logger->debug( "Investigation Queue '$InvestigationsQueue' could not be loaded for user " . $session{'CurrentUser'}->Id . "." );
++
++ my $investigation_queues = RT::Queues->new($session{'CurrentUser'});
++
++ $investigation_queues->Limit(
++ FIELD => 'Lifecycle',
++ OPERATOR => '=',
++ VALUE => RT::IR->lifecycle_investigation,
++ );
++
++ while (my $object = $investigation_queues->Next) {
++ # Ensure the user can CreateTicket in the queue
++ next unless $session{CurrentUser}->HasRight( Object => $object, Right => 'CreateTicket' );
++
++ $InvestigationsQueueObj = $object;
++ last;
++ }
++}
+
+ if( !RT::IR->IsIncidentQueue($QueueObj) ) {
+ RT::Interface::Web::Redirect(RT::IR->HREFTo( '/Create.html?' . $m->comp('/Elements/QueryString', %ARGS )));
diff --git a/html/RTIR/Investigation/Elements/Create b/html/RTIR/Investigation/Elements/Create
--- a/html/RTIR/Investigation/Elements/Create
6: b80d086c < -: ------- Use DefaultInvestigationsQueue on incident create
7: 81ddc507 ! 5: 2f95e6da Reinstate "Incident"/"Launch Investigation" page menu
@@ -4,26 +4,6 @@
Reinstated tabbed switching view between incident and investigation
Fixed passing results to FilterRTAddresses as array when should be arrayref
-
-diff --git a/etc/RTIR_Config.pm b/etc/RTIR_Config.pm
---- a/etc/RTIR_Config.pm
-+++ b/etc/RTIR_Config.pm
-@@
- RT->Config->Set('DefaultQueue','Incident Reports');
- }
-
--=item C<$DefaultInvestigationsQueue>
--
--By default, investigation tickets will be created in the Investigations queue.
--You can set a different default investigations queue using this configuration
--option in RTIR_SiteConfig.pm.
--
-- Set( $DefaultInvestigationsQueue, 'Special Investigations' );
--
--=cut
-
- =back
-
diff --git a/html/RTIR/Incident/Create.html b/html/RTIR/Incident/Create.html
--- a/html/RTIR/Incident/Create.html
@@ -37,15 +17,10 @@
<& /Elements/Tabs &>
@@
- }
-
- # Load appropriate Investigations queue
--my $InvestigationsQueue = $ARGS{InvestigationQueue} || RT->Config->Get('DefaultInvestigationsQueue') || 'Investigations' . ( $constituency ? ' - ' . $constituency : '' );
-+my $InvestigationsQueue = $ARGS{InvestigationQueue} || 'Investigations' . ( $constituency ? ' - ' . $constituency : '' );
my $InvestigationsQueueObj = RT::Queue->new( $session{'CurrentUser'} );
$InvestigationsQueueObj->Load( $InvestigationsQueue );
--# Users limited by constituency may not be able to use the queue defined in DefaultInvestigationsQueue.
+-# Users limited by constituency may not be able to use the queue provided or selected
+# Users limited by constituency may not be able to use the default or specified investigations queue
# Look up what queue the user has SeeQueue and CreateTicket for and use that instead.
unless ( $InvestigationsQueueObj->Name ) {
More information about the rt-commit
mailing list