[Rt-commit] rtir branch, master, updated. 4.0.1rc1-222-g5d1fe1dd

? sunnavy sunnavy at bestpractical.com
Fri Jun 12 17:54:54 EDT 2020


The branch, master has been updated
       via  5d1fe1dd1d182b13e676cab7962d87af587ef64c (commit)
       via  383e0c4e3509ed3b8425b30a0311b39e4b5482dd (commit)
       via  4b128e385711a3965f96f25d9772c97223300373 (commit)
       via  cec52495269605d27a35582b2bd17e933a215c60 (commit)
       via  e42f27e22dbf70858b6d8a6b0ed5f2a5bb32c557 (commit)
       via  8f304a34a10fc0fe79e10d724db4ea2f55a3d044 (commit)
      from  8445f60fdefe3293db679644a9d409751680309a (commit)

Summary of changes:
 html/Callbacks/RTIR/Elements/Tabs/Privileged |  15 ++
 html/RTIR/Incident/Create.html               |  82 +++++++-
 html/RTIR/Investigation/Elements/Create      | 273 ++++++++++++++++++---------
 3 files changed, 277 insertions(+), 93 deletions(-)

- Log -----------------------------------------------------------------
commit 8f304a34a10fc0fe79e10d724db4ea2f55a3d044
Author: Blaine Motsinger <blaine at bestpractical.com>
Date:   Mon May 18 14:26:14 2020 -0500

    Core RT::Extension::CreateIncidentAndInvestigation
    
    This commit moves the RT::Extension::CreateIncidentAndInvestigation
    extension back to core RTIR.
    
    The code was removed in commit 5f72e57 due to complexity which has
    since been solved by moving the dropdown to the create pages.

diff --git a/html/RTIR/Incident/Create.html b/html/RTIR/Incident/Create.html
index a511d97b..22316991 100644
--- a/html/RTIR/Incident/Create.html
+++ b/html/RTIR/Incident/Create.html
@@ -318,6 +318,19 @@ if ( $ChildObj && $ChildObj->id && !$ChildObj->CurrentUserHasRight('ModifyTicket
 
 </div>  <!-- end ticket-create-incident -->
 
+<div id="ticket-create-investigation">
+<a name="investigation"></a>
+<& /RTIR/Investigation/Elements/Create,
+    %ARGS,
+    NamePrefix => 'Investigation',
+    QueueObj => $InvestigationsQueueObj,
+    Lifecycle => RT::IR->lifecycle_investigation,
+    Constituency => $constituency,
+    SkipField => { Owner => 1, Attachments => 1, DateFields => 1 },
+    IncludeSignature => (exists $ARGS{'InvestigationContent'} ? 0 : 1),
+&>
+</div>
+
 % $m->callback( CallbackName => 'FormEnd', QueueObj => $QueueObj, Constituency => $constituency,
 %    ChildObj => $ChildObj, SplitObj => $SplitObj, ARGSRef => \%ARGS );
 
@@ -405,6 +418,12 @@ if (!$QueueObj->Name) {
 Abort( loc("Queue '[_1]' could not be loaded.", $queue) );
  }
 
+# Load appropriate Investigations queue
+my $InvestigationsQueue = '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;
+
 if( !RT::IR->IsIncidentQueue($QueueObj) ) {
     RT::Interface::Web::Redirect(RT::IR->HREFTo( '/Create.html?' . $m->comp('/Elements/QueryString', %ARGS )));
 }
@@ -455,6 +474,23 @@ if ( $CreateIncident ) {
     );
 }
 
+if ( $CreateWithInvestigation ) {
+        $checks_failure += RT::IR->FilterRTAddresses(
+            ARGSRef => \%ARGS,
+            Fields => {
+                InvestigationRequestors => 'Requestor',
+                InvestigationCc => 'Cc',
+                InvestigationAdminCc => 'AdminCc',
+            },
+            results => \@results,
+        );
+}
+
+if ( $CreateWithInvestigation && !$InvestigationRequestors ) {
+    push @results, loc( "You must enter a correspondent for the investigation" );
+    $checks_failure = 1;
+}
+
 $m->callback( CallbackName => 'BeforeCreateRedirect', ARGSRef => \%ARGS,
     Child => $ChildObj, results => \@results, checks_failure => \$checks_failure );
 
@@ -470,6 +506,26 @@ if ( !$checks_failure && $CreateIncident ) {
     push @results, @tmp;
 
     if( $inc_obj ) {
+        my $inv_obj;
+        if ( $CreateWithInvestigation ) {
+            my (@tmp);
+            ($inv_obj, @tmp) = $m->comp(
+                '/RTIR/Investigation/Elements/Create:Process',
+                %ARGS,
+                NamePrefix => 'Investigation',
+                DefaultsNamePrefix => '',
+            );
+            push @results, @tmp;
+            if ( $inv_obj ) {
+                my($id, $msg) = $inv_obj->AddLink(
+                    Type => 'MemberOf',
+                    Target => $inc_obj->id
+                );
+                #XXX: correct message on success
+                push @results, $msg if !$id || $msg;
+            }
+        }
+
         $m->callback(CallbackName => 'BeforeDisplay', ARGSRef => \%ARGS, Child => $ChildObj, TicketObj => $inc_obj,
             results => \@results );
 
@@ -511,7 +567,9 @@ unless ( exists $ARGS{'Content'} ) {
 $Title                   => loc("Create a new Incident")
 $QuoteTransaction        => undef
 
-$CreateIncident          => 0
+$CreateWithInvestigation => 0
+$CreateIncident          => $CreateWithInvestigation
+$InvestigationRequestors => 0
 
 $Split                   => undef
 
diff --git a/html/RTIR/Investigation/Elements/Create b/html/RTIR/Investigation/Elements/Create
index 69d5680b..351668c1 100644
--- a/html/RTIR/Investigation/Elements/Create
+++ b/html/RTIR/Investigation/Elements/Create
@@ -212,6 +212,13 @@ email addresses. These people <b>will</b> receive future updates.)</&></font></i
 % }
 
 </table></&>
+
+<& /Elements/Submit,
+    Name => 'CreateWithInvestigation',
+    Label => loc("Create Incident and run Investigation"),
+    SubmitId => 'create-ticket-with-investigation'
+&>
+
 % $m->callback( CallbackName => 'AfterTable', ARGSRef => \%ARGS, TicketObj  => $ticket,
 %    QueueObj   => $QueueObj, DefaultsFrom => $TicketObj );
 </div>

commit e42f27e22dbf70858b6d8a6b0ed5f2a5bb32c557
Author: Blaine Motsinger <blaine at bestpractical.com>
Date:   Mon May 18 19:05:39 2020 -0500

    Migrate Investigation/Elements/Create to elevator themes

diff --git a/html/RTIR/Investigation/Elements/Create b/html/RTIR/Investigation/Elements/Create
index 351668c1..9460de5c 100644
--- a/html/RTIR/Investigation/Elements/Create
+++ b/html/RTIR/Investigation/Elements/Create
@@ -50,60 +50,95 @@
 
 <div class="ticket-create-basics">
 <&| /Widgets/TitleBox, title => loc("Basics"), class => 'ticket-info-basics' &>
-<table width="100%" border="0">
-% if($Constituency) {
-%
-<tr class="constituency">
-  <td class="label"><%loc('Constituency') %>:</td>
-  <td><% $Constituency %></td>
-</tr>
+
+% if ($Constituency) {
+  <div class="form-row">
+    <div class="label col-3">
+      <% loc('Constituency') %>:
+    </div>
+    <div class="value col-9">
+      <span class="current-value"><% $Constituency %></span>
+    </div>
+  </div>
 % }
-<tr class="queue">
-  <td class="label"><&|/l&>Queue</&>:</td>
-  <td>
+
+  <div class="form-row">
+    <div class="label col-3">
+      <&|/l&>Queue</&>:
+    </div>
+    <div class="value col-9">
       <& /Ticket/Elements/ShowQueue, QueueObj => $QueueObj &>
-  </td>
-</tr>
+    </div>
+  </div>
+
 % unless ( $SkipField{'Owner'} || $HideField{'Owner'} ) {
-<tr>
-    <td class="label"><&|/l&>Owner</&>:</td>
-    <td class="value"><& /Elements/SelectOwner,
-    Name     => $NamePrefix ."Owner",
-    QueueObj => $QueueObj,
-    Default  => $value_cb->('Owner') || $session{'CurrentUser'}->Id,
-&></td></tr>
+  <div class="form-row owner">
+    <div class="label col-3">
+      <&|/l&>Owner</&>:
+    </div>
+    <div class="value col-9">
+      <& /Elements/SelectOwner,
+          Name     => $NamePrefix ."Owner",
+          QueueObj => $QueueObj,
+          Default  => $value_cb->('Owner') || $session{'CurrentUser'}->Id,
+      &>
+    </div>
+  </div>
 % }
 
 % unless ( $SkipField{'TimeFields'} ) {
-<tr class="time-worked">
-    <td class="label"><&|/l&>Time Worked</&>:</td>
-    <td class="value"><& /Elements/EditTimeValue,
-        Name => $NamePrefix .'TimeWorked',
+<div class="form-row">
+  <div class="label col-3">
+    <&|/l&>Time Worked</&>:
+  </div>
+  <div class="value col-9">
+    <& /Elements/EditTimeValue,
+        Name    => $NamePrefix . 'TimeWorked',
         Default => $value_cb->('TimeWorked') || '',
-    &></td>
-    </tr>
-<tr class="time-left">
-    <td class="label"><&|/l&>Time Left</&>:</td>
-    <td class="value"><& /Elements/EditTimeValue,
-        Name => $NamePrefix .'TimeLeft',
+    &>
+  </div>
+</div>
+<div class="form-row">
+  <div class="label col-3">
+    <&|/l&>Time Left</&>:
+  </div>
+  <div class="value col-9">
+    <& /Elements/EditTimeValue,
+        Name    => $NamePrefix . 'TimeLeft',
         Default => $value_cb->('TimeLeft') || '',
-    &></td>
-</tr>
+    &>
+  </div>
+</div>
 % }
 
 % unless ( $SkipField{'DateFields'} ) {
-<tr><td> </td><td valign="top"><&| /Widgets/TitleBox,
-    title => loc("Dates"),
-    class=> 'ticket-info-dates',
-&><table>
-
-<tr><td class="label"><&|/l&>Starts</&>:</td>
-<td class="value"><& /Elements/SelectDate, Name => $NamePrefix .'Starts', Default => $value_cb->('Starts') || '' &></td></tr>
+<&| /Widgets/TitleBox, title => loc("Dates"), class => 'ticket-info-dates' &>
+
+<div class="form-row">
+  <div class="label col-3">
+    <&|/l&>Starts</&>:
+  </div>
+  <div class="value col-9">
+    <& /Elements/SelectDate,
+        Name    => $NamePrefix . 'Starts',
+        Default => $value_cb->('Starts') || '',
+    &>
+  </div>
+</div>
 
-<tr><td class="label"><&|/l&>Due</&>:</td>
-<td class="value"><& /Elements/SelectDate, Name => $NamePrefix .'Due', Default => $value_cb->('Due') || '' &></td></tr>
+<div class="form-row">
+  <div class="label col-3">
+    <&|/l&>Due</&>:
+  </div>
+  <div class="value col-9">
+    <& /Elements/SelectDate,
+        Name    => $NamePrefix . 'Due',
+        Default => $value_cb->('Due') || '',
+    &>
+  </div>
+</div>
 
-</table></&></td></tr>
+</&>
 % }
 
 % if ( ($QueueObj || $TicketObj) && !$SkipField{'CustomFields'} ) {
@@ -118,7 +153,7 @@
 &>
 % }
 
-</table></&>
+</&>
 
 % if ( ($QueueObj || $TicketObj) && !$SkipField{'CustomFields'} ) {
 <& /Elements/EditCustomFieldCustomGroupings,
@@ -134,90 +169,143 @@
 
 <div class="ticket-create-details">
 <&| /Widgets/TitleBox,
-    title => loc("Launch Investigation"),
+    title => loc("Launch a new investigation"),
     class => 'ticket-info-message',
 &>
-<table width="100%" border="0">
 
 % unless ( $SkipField{'Requestors'} || $HideField{'Requestors'} ) {
-<tr><td class="label"><&|/l&>Correspondents</&>:</td>
-<td class="value"><& /Elements/EmailInput,
-    Name => $NamePrefix .'Requestors', Default => $value_cb->('Requestors'), Size => undef,
-&></td></tr>
+<div class="form-row">
+  <div class="label col-2">
+    <&|/l&>Correspondents</&>:
+  </div>
+  <div class="value col-9">
+    <& /Elements/EmailInput,
+        Name    => $NamePrefix . 'Requestors',
+        Default => $value_cb->('Requestors'),
+        Size    => undef,
+    &>
+  </div>
+</div>
 % $m->callback( CallbackName => 'AfterRequestors', ARGSRef => \%ARGS );
 % }
 
 % unless ( $SkipField{'Cc'} || $HideField{'Cc'} ) {
-<tr><td class="label"><&|/l&>Cc</&>:</td>
-<td class="value"><& /Elements/EmailInput,
-    Name => $NamePrefix .'Cc', Default => $value_cb->('Cc'), Size => undef,
-&></td></tr>
-<tr><td> </td><td class="comment">
-<i><font size="-2"><&|/l&>(Sends a carbon-copy of this update to a comma-delimited list of
-email addresses. These people <b>will</b> receive future updates.)</&></font></i>
-</td></tr>
+<div class="form-row">
+  <div class="label col-2">
+    <&|/l&>Cc</&>:
+  </div>
+  <div class="value col-9">
+    <& /Elements/EmailInput,
+        Name    => $NamePrefix . 'Cc',
+        Default => $value_cb->('Cc'),
+        Size    => undef,
+    &>
+  </div>
+</div>
+
+<div class="form-row">
+  <div class="label col-2"></div>
+  <div class="value col-9">
+    <i><&|/l&>(Sends a carbon-copy of this update to a comma-delimited list of email addresses. These people <b>will</b> receive future updates.)</&></i>
+  </div>
+</div>
 % }
 
 % unless ( $SkipField{'AdminCc'} && $HideField{'AdminCc'} ) {
-<tr><td class="label"><&|/l&>Admin Cc</&>:</td>
-<td class="value"><& /Elements/EmailInput,
-    Name => $NamePrefix .'AdminCc', Default => $value_cb->('AdminCc'), Size => undef,
-&></td></tr>
-<tr><td> </td><td class="comment">
-<i><font size="-2"><&|/l&>(Sends a carbon-copy of this update to a comma-delimited list of administrative
-email addresses. These people <b>will</b> receive future updates.)</&></font></i>
-</td></tr>
+<div class="form-row">
+  <div class="label col-2">
+    <&|/l&>Admin Cc</&>:
+  </div>
+  <div class="value col-9">
+    <& /Elements/EmailInput,
+        Name    => $NamePrefix . 'AdminCc',
+        Default => $value_cb->('AdminCc'),
+        Size    => undef,
+    &>
+  </div>
+</div>
+
+<div class="form-row">
+  <div class="label col-2"></div>
+  <div class="value col-9">
+    <i><&|/l&>(Sends a carbon-copy of this update to a comma-delimited list of administrative email addresses. These people <b>will</b> receive future updates.)</&></i>
+  </div>
+</div>
 % }
 
 % unless ( $SkipField{'Subject'} || $HideField{'Subject'} ) {
-<tr><td class="label"><&|/l&>Subject</&>:</td>
-<td class="value">
-<input type="text" name="<% $NamePrefix %>Subject" size="60" maxsize="100" value="<% $value_cb->('Subject') %>" />
-</td></tr>
+<div class="form-row">
+  <div class="form-group label col-2">
+    <&|/l&>Subject</&>:
+  </div>
+  <div class="form-group value col-9">
+    <input class="form-control" type="text" name="<% $NamePrefix %>Subject" value="<% $value_cb->('Subject') %>" />
+  </div>
+</div>
 % }
 
 % if ( !$SkipField{'SignEncrypt'} && RT->Config->Get('GnuPG')->{'Enable'} ) {
-<tr><td> </td><td>
-<% loc('Sign')%> <& /Widgets/Form/Boolean:InputOnly,
-    Name => $NamePrefix .'Sign',
-    CurrentValue => $ARGS{ $NamePrefix .'Sign' },
-&>
-   
-<% loc('Encrypt')%> <& /Widgets/Form/Boolean:InputOnly,
-    Name => $NamePrefix .'Encrypt',
-    CurrentValue => $ARGS{ $NamePrefix .'Encrypt' },
-&>
-</td></tr>
+<div class="form-row">
+  <div class="label col-2">
+     
+  </div>
+  <div class="value col-9">
+    <div class="form-row">
+      <div class="col-auto">
+        <& /Widgets/Form/Boolean:InputOnly,
+           Name         => $NamePrefix . 'Sign',
+           CurrentValue => $ARGS{ $NamePrefix . 'Sign' },
+           DefaultLabel => loc( 'Sign' ),
+        &>
+      </div>
+      <div class="col-auto">
+        <& /Widgets/Form/Boolean:InputOnly,
+           Name         => $NamePrefix . 'Encrypt',
+           CurrentValue => $ARGS{ $NamePrefix . 'Encrypt' },
+           DefaultLabel => loc( 'Encrypt' ),
+        &>
+      </div>
+    </div>
+  </div>
+</div>
 % }
 
 % unless ( $SkipField{'Content'} || $HideField{'Content'} ) {
-<tr><td class="labeltop"><&|/l&>Message</&>:</td>
-<td>
+<div class="form-group">
 % if ( RT->Config->Get('ArticleOnTicketCreate')) {
-<& /Articles/Elements/BeforeMessageBox, %ARGS, QueueObj => $QueueObj, MessageBoxName => $NamePrefix .'Content' &>
+  <& /Articles/Elements/BeforeMessageBox,
+     %ARGS,
+     QueueObj       => $QueueObj,
+     MessageBoxName => $NamePrefix . 'Content',
+  &>
 % }
-% $m->callback( %ARGS, MessageBoxName => $NamePrefix .'Content',
+% $m->callback( %ARGS, MessageBoxName => $NamePrefix . 'Content',
 %    CallbackPage => '/Ticket/Create.html', CallbackName => 'BeforeMessageBox' );
 % my $content = $value_cb->('Content');
-<& /Elements/MessageBox,
-    Name             => $NamePrefix .'Content',
-    Default          => $content,
-    IncludeSignature => exists $ARGS{'IncludeSignature'} ? $ARGS{'IncludeSignature'} : !$content,
-    QuoteTransaction => $value_cb->('QuoteTransaction'),
-&></td></tr>
+  <& /Elements/MessageBox,
+      Name             => $NamePrefix . 'Content',
+      Default          => $content,
+      IncludeSignature => exists $ARGS{'IncludeSignature'} ? $ARGS{'IncludeSignature'} : !$content,
+      QuoteTransaction => $value_cb->('QuoteTransaction'),
+  &>
+</div>
 % }
 
 % unless ( $SkipField{'Attachments'} ) {
 <& /RTIR/Create.html:AttachmentsForm &>
 % }
 
-</table></&>
+</&>
 
-<& /Elements/Submit,
-    Name => 'CreateWithInvestigation',
-    Label => loc("Create Incident and run Investigation"),
-    SubmitId => 'create-ticket-with-investigation'
-&>
+<div class="form-row">
+  <div class="col-12">
+    <& /Elements/Submit,
+        Name => 'CreateWithInvestigation',
+        Label => loc("Create Incident and run Investigation"),
+        SubmitId => 'create-ticket-with-investigation'
+    &>
+  </div>
+</div>
 
 % $m->callback( CallbackName => 'AfterTable', ARGSRef => \%ARGS, TicketObj  => $ticket,
 %    QueueObj   => $QueueObj, DefaultsFrom => $TicketObj );

commit cec52495269605d27a35582b2bd17e933a215c60
Author: Blaine Motsinger <blaine at bestpractical.com>
Date:   Wed May 20 17:47:16 2020 -0500

    Replace Cc and AdminCc helper text with tooltips
    
    This commit replaces the Cc and AdminCc helper text on the
    create investigation element with fontawesome icons and
    bootstrap tooltips.

diff --git a/html/RTIR/Investigation/Elements/Create b/html/RTIR/Investigation/Elements/Create
index 9460de5c..ede32b5f 100644
--- a/html/RTIR/Investigation/Elements/Create
+++ b/html/RTIR/Investigation/Elements/Create
@@ -193,6 +193,7 @@
 <div class="form-row">
   <div class="label col-2">
     <&|/l&>Cc</&>:
+    <span class="far fa-question-circle icon-helper" data-toggle="tooltip" data-placement="top" data-original-title="<&|/l&>Sends a carbon-copy of this update to a comma-delimited list of email addresses. These people will receive future updates.</&>"></span>
   </div>
   <div class="value col-9">
     <& /Elements/EmailInput,
@@ -202,19 +203,13 @@
     &>
   </div>
 </div>
-
-<div class="form-row">
-  <div class="label col-2"></div>
-  <div class="value col-9">
-    <i><&|/l&>(Sends a carbon-copy of this update to a comma-delimited list of email addresses. These people <b>will</b> receive future updates.)</&></i>
-  </div>
-</div>
 % }
 
 % unless ( $SkipField{'AdminCc'} && $HideField{'AdminCc'} ) {
 <div class="form-row">
   <div class="label col-2">
     <&|/l&>Admin Cc</&>:
+     <span class="far fa-question-circle icon-helper" data-toggle="tooltip" data-placement="top" data-original-title="<&|/l&>Sends a carbon-copy of this update to a comma-delimited list of administrative email addresses. These people will receive future updates.</&>"></span>
   </div>
   <div class="value col-9">
     <& /Elements/EmailInput,
@@ -224,13 +219,6 @@
     &>
   </div>
 </div>
-
-<div class="form-row">
-  <div class="label col-2"></div>
-  <div class="value col-9">
-    <i><&|/l&>(Sends a carbon-copy of this update to a comma-delimited list of administrative email addresses. These people <b>will</b> receive future updates.)</&></i>
-  </div>
-</div>
 % }
 
 % unless ( $SkipField{'Subject'} || $HideField{'Subject'} ) {

commit 4b128e385711a3965f96f25d9772c97223300373
Author: Blaine Motsinger <blaine at bestpractical.com>
Date:   Thu May 21 18:25:48 2020 -0500

    Allow investigation queue to be selected
    
    This commit updates the investigation on create element to allow
    changing the investigation queue.  Prior to this the queue was
    tied to the selected incident and couldn't be changed.
    
    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
index 22316991..0143d016 100644
--- a/html/RTIR/Incident/Create.html
+++ b/html/RTIR/Incident/Create.html
@@ -419,10 +419,31 @@ Abort( loc("Queue '[_1]' could not be loaded.", $queue) );
  }
 
 # Load appropriate Investigations queue
-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;
+$InvestigationsQueueObj->Load( $InvestigationsQueue );
+
+# 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 ) {
+    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
index ede32b5f..ad1ab604 100644
--- a/html/RTIR/Investigation/Elements/Create
+++ b/html/RTIR/Investigation/Elements/Create
@@ -46,7 +46,6 @@
 %#
 %# END BPS TAGGED BLOCK }}}
 <input type="hidden" name="<% $NamePrefix %>Status" value="<% $ARGS{ $NamePrefix .'Status' } || $QueueObj->LifecycleObj->DefaultOnCreate %>" />
-<input type="hidden" class="hidden" name="<% $NamePrefix %>Queue" value="<% $QueueObj->Id %>" />
 
 <div class="ticket-create-basics">
 <&| /Widgets/TitleBox, title => loc("Basics"), class => 'ticket-info-basics' &>
@@ -67,7 +66,14 @@
       <&|/l&>Queue</&>:
     </div>
     <div class="value col-9">
-      <& /Ticket/Elements/ShowQueue, QueueObj => $QueueObj &>
+      <& /RTIR/Elements/SelectRTIRQueue,
+          Name => $NamePrefix . 'Queue',
+          Default => $QueueObj->Name,
+          Lifecycle => $QueueObj->Lifecycle,
+          AutoSubmit => 1,
+          ShowNullOption => 0,
+          Constituency => $Constituency
+      &>
     </div>
   </div>
 

commit 383e0c4e3509ed3b8425b30a0311b39e4b5482dd
Author: Aaron Trevena <ast at bestpractical.com>
Date:   Fri Jun 12 15:46:03 2020 +0100

    Reinstate "Incident"/"Launch Investigation" page menu
    
    Reinstated tabbed switching view between incident and investigation

diff --git a/html/Callbacks/RTIR/Elements/Tabs/Privileged b/html/Callbacks/RTIR/Elements/Tabs/Privileged
index 88fda05c..ef33fcb6 100644
--- a/html/Callbacks/RTIR/Elements/Tabs/Privileged
+++ b/html/Callbacks/RTIR/Elements/Tabs/Privileged
@@ -607,6 +607,21 @@ PageWidgets()->child('simple_search')->raw_html( $m->scomp(
 PageWidgets()->child( create_ticket => raw_html => $HTML::Mason::Commands::m->scomp('/Elements/CreateTicket', SendTo => '/RTIR/Create.html?Queue=' . RT::IR::GetRTIRDefaultQueue()) );
 
 if ( $request_path =~ m{$re_rtir_path(?:Incident/)?Create\.html} ) {
+    if ( $request_path =~ m{${re_rtir_path}Incident/Create\.html} ) {
+        PageMenu->child(
+            create_incident => title => loc('Incident'),
+            path            => '#incident',
+            attributes =>
+                { onclick => "return switchVisibility('ticket-create-incident','ticket-create-investigation');", },
+        );
+        PageMenu->child(
+            create_investigation => title => loc('Launch Investigation'),
+            path                 => '#investigation',
+            attributes =>
+                { onclick => "return switchVisibility('ticket-create-investigation','ticket-create-incident');", },
+        );
+    }
+
     my $default_queue = GetDefaultQueue();
     my $queue;
     if ( $default_queue && !RT::IR->OurQueue($default_queue) ) {
diff --git a/html/RTIR/Incident/Create.html b/html/RTIR/Incident/Create.html
index 0143d016..2cd5d48b 100644
--- a/html/RTIR/Incident/Create.html
+++ b/html/RTIR/Incident/Create.html
@@ -47,6 +47,7 @@
 %# END BPS TAGGED BLOCK }}}
 <& /RTIR/Elements/Header,
     Title => $Title,
+    onload => "function () { hide('ticket-create-investigation') }",
 &>
 <& /Elements/Tabs &>
 

commit 5d1fe1dd1d182b13e676cab7962d87af587ef64c
Merge: 8445f60f 383e0c4e
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Sat Jun 13 05:48:11 2020 +0800

    Merge branch '5.0/restore-incidents-and-investigations-on-create'


-----------------------------------------------------------------------


More information about the rt-commit mailing list