[Rt-commit] rtir branch, 3.4/popup-ticket-create, created. 3.3.0-104-g5a5cebc

Dustin Graves dustin at bestpractical.com
Tue May 24 18:54:10 EDT 2016


The branch, 3.4/popup-ticket-create has been created
        at  5a5cebc077c43e75375a01a0e468ff0c944922c8 (commit)

- Log -----------------------------------------------------------------
commit debc038101883b51b885131890c1592d04d3c905
Author: Dustin Graves <dustin at bestpractical.com>
Date:   Sat Feb 27 00:28:52 2016 +0000

    popup select queues for RTIR ticket create
    
    Fixes: I#31743, I#31750

diff --git a/html/RTIR/Create.html b/html/RTIR/Create.html
index 6c14392..1f27811 100644
--- a/html/RTIR/Create.html
+++ b/html/RTIR/Create.html
@@ -64,6 +64,7 @@
 <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'} %>" />
 % if ( $Split ) {
 <input type="hidden" name="Split" value="<% $SplitObj->id %>" />
@@ -100,15 +101,10 @@
     QueueObj => $QueueObj,
     fields  => [
         {   name => 'Queue',
-            comp => '/RTIR/Elements/SelectRTIRQueue',
+            comp => '/Ticket/Elements/ShowQueue',
             args => {
-                Name => 'Queue',
-                Default => $ARGS{'Queue'} || $QueueObj->Id,
-                ShowNullOption => 0,
-                Lifecycle => $QueueObj->Lifecycle,
-                LimitToConstituency => (RT::IR->StrictConstituencyLinking ? 1:0),
-                Constituency => $constituency
-            }
+                QueueObj => $QueueObj,
+            },
         },
         {
             name => 'Status',
diff --git a/html/RTIR/Elements/CreateInRTIRQueueModal b/html/RTIR/Elements/CreateInRTIRQueueModal
new file mode 100644
index 0000000..cf98050
--- /dev/null
+++ b/html/RTIR/Elements/CreateInRTIRQueueModal
@@ -0,0 +1,70 @@
+%# BEGIN BPS TAGGED BLOCK {{{
+%#
+%# COPYRIGHT:
+%#
+%# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC
+%#                                          <sales at bestpractical.com>
+%#
+%# (Except where explicitly superseded by other copyright notices)
+%#
+%#
+%# LICENSE:
+%#
+%# This work is made available to you under the terms of Version 2 of
+%# the GNU General Public License. A copy of that license should have
+%# been provided with this software, but in any event can be snarfed
+%# from www.gnu.org.
+%#
+%# This work is distributed in the hope that it will be useful, but
+%# WITHOUT ANY WARRANTY; without even the implied warranty of
+%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+%# General Public License for more details.
+%#
+%# You should have received a copy of the GNU General Public License
+%# along with this program; if not, write to the Free Software
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
+%#
+%#
+%# CONTRIBUTION SUBMISSION POLICY:
+%#
+%# (The following paragraph is not intended to limit the rights granted
+%# to you to modify and distribute this software under the terms of
+%# the GNU General Public License and is only of importance to you if
+%# you choose to contribute your changes and enhancements to the
+%# community by submitting them to Best Practical Solutions, LLC.)
+%#
+%# By intentionally submitting any modifications, corrections or
+%# derivatives to this work, or any other work intended for use with
+%# Request Tracker, to Best Practical Solutions, LLC, you confirm that
+%# you are the copyright holder for those contributions and you grant
+%# Best Practical Solutions,  LLC a nonexclusive, worldwide, irrevocable,
+%# royalty-free, perpetual, license to use, copy, create derivative
+%# works based on those contributions, and sublicense and distribute
+%# those contributions and any derivatives thereof.
+%#
+%# END BPS TAGGED BLOCK }}}
+<%ARGS>
+$Lifecycle
+$LifecycleDesc => $Lifecycle
+$Incident => undef
+</%ARGS>
+<%INIT>
+$Lifecycle = $Lifecycle->[0] if (ref $Lifecycle eq 'ARRAY');
+</%INIT>
+<form action="<% RT::IR->HREFTo('Create.html') %>" id="CreateInQueue">
+% if ($Incident) {
+<input type="hidden" name="Incident" value="<%$Incident%>"/>
+% }
+  <&|/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'})
+    &>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>
diff --git a/html/RTIR/Helpers/CreateInRTIRQueueModal b/html/RTIR/Helpers/CreateInRTIRQueueModal
new file mode 100644
index 0000000..39ef32a
--- /dev/null
+++ b/html/RTIR/Helpers/CreateInRTIRQueueModal
@@ -0,0 +1,49 @@
+%# BEGIN BPS TAGGED BLOCK {{{
+%#
+%# COPYRIGHT:
+%#
+%# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC
+%#                                          <sales at bestpractical.com>
+%#
+%# (Except where explicitly superseded by other copyright notices)
+%#
+%#
+%# LICENSE:
+%#
+%# This work is made available to you under the terms of Version 2 of
+%# the GNU General Public License. A copy of that license should have
+%# been provided with this software, but in any event can be snarfed
+%# from www.gnu.org.
+%#
+%# This work is distributed in the hope that it will be useful, but
+%# WITHOUT ANY WARRANTY; without even the implied warranty of
+%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+%# General Public License for more details.
+%#
+%# You should have received a copy of the GNU General Public License
+%# along with this program; if not, write to the Free Software
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
+%#
+%#
+%# CONTRIBUTION SUBMISSION POLICY:
+%#
+%# (The following paragraph is not intended to limit the rights granted
+%# to you to modify and distribute this software under the terms of
+%# the GNU General Public License and is only of importance to you if
+%# you choose to contribute your changes and enhancements to the
+%# community by submitting them to Best Practical Solutions, LLC.)
+%#
+%# By intentionally submitting any modifications, corrections or
+%# derivatives to this work, or any other work intended for use with
+%# Request Tracker, to Best Practical Solutions, LLC, you confirm that
+%# you are the copyright holder for those contributions and you grant
+%# Best Practical Solutions,  LLC a nonexclusive, worldwide, irrevocable,
+%# royalty-free, perpetual, license to use, copy, create derivative
+%# works based on those contributions, and sublicense and distribute
+%# those contributions and any derivatives thereof.
+%#
+%# END BPS TAGGED BLOCK }}}
+<& /RTIR/Elements/CreateInRTIRQueueModal, %ARGS &>
+% $m->abort;
diff --git a/html/RTIR/Incident/Create.html b/html/RTIR/Incident/Create.html
index 3494189..c9aefce 100644
--- a/html/RTIR/Incident/Create.html
+++ b/html/RTIR/Incident/Create.html
@@ -72,6 +72,7 @@ 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'} %>" />
 % if ( $ChildObj ) {
 <input type="hidden" name="Child"        value="<% $Child %>" />
@@ -108,13 +109,7 @@ if ( $ChildObj && $ChildObj->id && !$ChildObj->CurrentUserHasRight('ModifyTicket
 <tr class="queue">
   <td class="label"><&|/l&>Queue</&>:</td>
   <td colspan="2">
-      <& /RTIR/Elements/SelectRTIRQueue,
-                Name => 'Queue',
-                Default => $ARGS{'Queue'} || $QueueObj->Id,
-                Lifecycle => RT::IR->lifecycle_incident,
-                LimitToConstituency => ($m->{'RTIR_ConstituencyFilter'} || RT::IR->StrictConstituencyLinking ) ? 1:0,
-                Constituency => $constituency
-    &>
+      <& /Ticket/Elements/ShowQueue, QueueObj => $QueueObj &>
   </td>
 </tr>
  
@@ -270,6 +265,7 @@ if ( $ChildObj && $ChildObj->id && !$ChildObj->CurrentUserHasRight('ModifyTicket
 <& /RTIR/Investigation/Elements/Create,
     %ARGS,
     NamePrefix => 'Investigation',
+    Queue => $ARGS{InvestigationQueue},
     Lifecycle => RT::IR->lifecycle_investigation,
     Constituency => $constituency,
     SkipField => { Owner => 1, Attachments => 1, DateFields => 1 },
@@ -332,22 +328,14 @@ for my $related_ticket ($ChildObj, $SplitObj) {
 }
 
 
-my $QueueObj;
+my $QueueObj = RT::Queue->new($session{'CurrentUser'});
+$QueueObj->Load( $ARGS{Queue} );
+
+if (!$QueueObj->Name) {
+Abort( loc("Queue '[_1]' could not be loaded.", $ARGS{Queue}) );
+ }
 
-# XXX TODO refactor this into library code
-# that 'finds the first plausible queue with the right constituency
-my $collection = RT::Queues->new($session{'CurrentUser'});
-$collection->Limit(FIELD => 'Lifecycle', VALUE => RT::IR->lifecycle_incident);
-while (my $queue = $collection->Next) {
-    if ((RT::IR->ConstituencyFor($queue)||'') eq ($constituency||'')) {
-        $QueueObj = $queue;
-        last;
-    }
-}
 
-if (!$QueueObj) {
-    Abort( loc("Queue could not be loaded.") );
-}
 
 
 my $ticket = RT::Ticket->new($session{'CurrentUser'}); # empty ticket object
diff --git a/html/RTIR/Incident/Elements/ShowChildren b/html/RTIR/Incident/Elements/ShowChildren
index 6402c72..fe6b278 100644
--- a/html/RTIR/Incident/Elements/ShowChildren
+++ b/html/RTIR/Incident/Elements/ShowChildren
@@ -115,6 +115,7 @@ if ( $IncidentObj->CurrentUserHasRight('ModifyTicket') ) {
     # $QueueObj->Id and $QueueObj->CurrentUserHasRight('CreateTicket') ) {
         push @box_actions, {
             title => $Lifecycle ne RT::IR->lifecycle_investigation? loc('Create') : loc('Launch'),
+            class => 'create_child' . ($Lifecycle ? '_'.$Lifecycle : ''),
             path => RT::IR->HREFTo("Create.html?Incident=$id&Lifecycle=".$Lifecycle),
         };
     }
@@ -131,7 +132,7 @@ if ( $total_count > $Rows ) {
     };
 }
 my $box_actions = join ' 'x3,
-    map qq{<a href="}. $_->{'path'} .q{">}
+    map q{<a href="} . $_->{'path'} . ( $_->{'class'} ? q{" class="} . $_->{'class'} : '' ) . q{">}
         . $m->interp->apply_escapes( $_->{title}, 'h' ) . q{</a>},
     @box_actions;
 
diff --git a/html/RTIR/Investigation/Elements/Create b/html/RTIR/Investigation/Elements/Create
index 06f3da6..2d28013 100644
--- a/html/RTIR/Investigation/Elements/Create
+++ b/html/RTIR/Investigation/Elements/Create
@@ -46,6 +46,7 @@
 %#
 %# 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' &>
@@ -60,13 +61,7 @@
 <tr class="queue">
   <td class="label"><&|/l&>Queue</&>:</td>
   <td>
-      <& /RTIR/Elements/SelectRTIRQueue,
-                Name => $NamePrefix.'Queue',
-                Default => $ARGS{'Queue'} || $QueueObj->Id,
-                Lifecycle => RT::IR->lifecycle_investigation,
-                LimitToConstituency => ($m->{'RTIR_ConstituencyFilter'} || RT::IR->StrictConstituencyLinking ) ? 1:0,
-                Constituency => $Constituency
-    &>
+      <& /Ticket/Elements/ShowQueue, QueueObj => $QueueObj &>
   </td>
 </tr>
 % unless ( $SkipField{'Owner'} || $HideField{'Owner'} ) {
diff --git a/lib/RT/IR.pm b/lib/RT/IR.pm
index c03f5cf..29b3b5f 100644
--- a/lib/RT/IR.pm
+++ b/lib/RT/IR.pm
@@ -132,6 +132,7 @@ use Parse::BooleanLogic;
 my $ticket_sql_parser = Parse::BooleanLogic->new;
 
 RT->AddJavaScript('jquery.uncheckable-radio-0.1.js');
+RT->AddJavaScript('rtir.js');
 RT->AddStyleSheets( 'rtir-styles.css' );
 
 # Add the RTIR search result page to the whitelist to allow
diff --git a/static/js/rtir.js b/static/js/rtir.js
new file mode 100644
index 0000000..94abd8c
--- /dev/null
+++ b/static/js/rtir.js
@@ -0,0 +1,52 @@
+jQuery(function() {
+    var getQueryString = function(element) {
+        var href = jQuery(element).attr('href');
+        if (!href) return '';
+        var questionMarkIndex = href.indexOf('?');
+        if (!questionMarkIndex) return '';
+        return href.substring(questionMarkIndex+1);
+    };
+
+    var showModal = function(lifecycle, lifecycleDesc) {
+        var queryString = getQueryString(this);
+        jQuery.get(
+            RT.Config.WebHomePath + '/RTIR/Helpers/CreateInRTIRQueueModal?Lifecycle=' + lifecycle + '&LifecycleDesc=' + lifecycleDesc + '&' + queryString,
+            function(html) {
+                jQuery("<div class='modal'></div>")
+                    .append(html).appendTo("body")
+                    .bind('modal:close', function(ev,modal) { modal.elm.remove(); })
+                    .modal();
+            }
+        );
+    };
+
+    var showReportsModal = function(e) {
+        e.preventDefault();
+        showModal('incident_reports', 'report');
+    };
+
+    var showInvestigationsModal = function(e) {
+        e.preventDefault();
+        showModal('investigations', 'investigation');
+    };
+
+    var showBlocksModal = function(e) {
+        e.preventDefault();
+        showModal('blocks', 'block');
+    };
+
+    var showIncidentsModal = function(e) {
+        e.preventDefault();
+        showModal('incidents', 'incident');
+    };
+
+    jQuery("#reports-create").click(showReportsModal);
+    jQuery("#investigations-launch").click(showInvestigationsModal);
+    jQuery("#blocks-create").click(showBlocksModal);
+    jQuery("#incidents-create").click(showIncidentsModal);
+    jQuery("#create-incident").click(showIncidentsModal);
+
+    jQuery(".create_child_incident_reports").click(showReportsModal);
+    jQuery(".create_child_investigations").click(showInvestigationsModal);
+    jQuery(".create_child_blocks").click(showBlocksModal);
+});

commit aa24b8ccb1ad35bf81fd1652585634aeff7f0d49
Author: Dustin Graves <dustin at bestpractical.com>
Date:   Wed Mar 23 18:25:43 2016 +0000

    remove "Create With Investigation" functionality
    
    this prevents having to make incidents/investigations dropdowns dynamic
    based on constituency selected

diff --git a/html/RTIR/Incident/Create.html b/html/RTIR/Incident/Create.html
index c9aefce..91d2306 100644
--- a/html/RTIR/Incident/Create.html
+++ b/html/RTIR/Incident/Create.html
@@ -47,7 +47,6 @@
 %# END BPS TAGGED BLOCK }}}
 <& /RTIR/Elements/Header,
     Title => $Title,
-    onload => "function () { hide('ticket-create-investigation') }",
 &>
 <& /Elements/Tabs &>
 
@@ -260,24 +259,6 @@ if ( $ChildObj && $ChildObj->id && !$ChildObj->CurrentUserHasRight('ModifyTicket
 
 </div>
 
-<div id="ticket-create-investigation">
-<a name="investigation"></a>
-<& /RTIR/Investigation/Elements/Create,
-    %ARGS,
-    NamePrefix => 'Investigation',
-    Queue => $ARGS{InvestigationQueue},
-    Lifecycle => RT::IR->lifecycle_investigation,
-    Constituency => $constituency,
-    SkipField => { Owner => 1, Attachments => 1, DateFields => 1 },
-    IncludeSignature => (exists $ARGS{'InvestigationContent'} ? 0 : 1),
-&>
-<& /Elements/Submit,
-    Name => 'CreateWithInvestigation',
-    Label => loc("Create Incident and run Investigation"),
-    SubmitId => 'create-ticket-with-investigation'
-&>
-</div>
-
 </form>
 
 
@@ -382,24 +363,6 @@ if ( $CreateIncident ) {
         Fields => { Requestors => 'Requestor', Cc => 'Cc', AdminCc => 'AdminCc' },
         results => \@results,
     );
-
-    if ( $CreateWithInvestigation ) {
-        $checks_failure += RT::IR->FilterRTAddresses(
-            ARGSRef => \%ARGS,
-            Fields => {
-                InvestigationRequestors => 'Requestor',
-                InvestigationCc => 'Cc',
-                InvestigationAdminCc => 'AdminCc',
-            },
-            results => \@results,
-        );
-    }
-
-    if ( $CreateWithInvestigation && !$ARGS{'InvestigationRequestors'} ) {
-        push @results, loc( "You must enter a correspondent for the investigation" );
-        $checks_failure = 1;
-    }
-
 }
 
 if ( !$checks_failure && $CreateIncident ) {
@@ -413,25 +376,6 @@ if ( !$checks_failure && $CreateIncident ) {
     );
     push @results, @tmp;
 
-    my $inv_obj;
-    if ( $inc_obj && $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;
-        }
-    }
     if( $inc_obj ) {
         $m->callback(CallbackName => 'BeforeDisplay', ARGSRef => \%ARGS, Child => $ChildObj);
 
@@ -451,19 +395,6 @@ else {
     $SubmitLabel = loc('Create');
 }
 
-PageMenu->child(
-    incident => raw_html =>
-    q{<a href="#incident"}
-    . q{onclick="return switchVisibility('ticket-create-incident','ticket-create-investigation');"}
-    . q{>} . loc('Incident') . q{</a>}
-);
-PageMenu->child(
-    investigation => raw_html =>
-    q[<a href="#investigation"]
-    . q[ onclick="return switchVisibility('ticket-create-investigation','ticket-create-incident');"]
-    . q[>] . loc('Launch Investigation') . q[</a>]
-);
-
 unless ( exists $ARGS{'Content'} ) {
     my $Transactions;
     if ( $SplitObj ) {
@@ -486,8 +417,7 @@ unless ( exists $ARGS{'Content'} ) {
 $Title                   => loc("Create a new Incident")
 $QuoteTransaction        => undef
 
-$CreateWithInvestigation => 0
-$CreateIncident          => $CreateWithInvestigation
+$CreateIncident          => 0
 
 $Split                   => undef
 

commit b4b0a1c1d25f81d3e20d614f58bec98bddbf8679
Author: Dustin Graves <dustin at bestpractical.com>
Date:   Fri Apr 29 22:34:12 2016 +0000

    skip RTIR ticket create modal if there's only one choice
    
    Like Self Service, if there is only one queue the user can create a
    ticket it, they should be taken directly to the create page with no
    popup.

diff --git a/static/js/rtir.js b/static/js/rtir.js
index 94abd8c..e583cd0 100644
--- a/static/js/rtir.js
+++ b/static/js/rtir.js
@@ -12,6 +12,13 @@ jQuery(function() {
         jQuery.get(
             RT.Config.WebHomePath + '/RTIR/Helpers/CreateInRTIRQueueModal?Lifecycle=' + lifecycle + '&LifecycleDesc=' + lifecycleDesc + '&' + queryString,
             function(html) {
+                // If there's only one queue, just create a ticket in it and skip the modal
+                var queues = jQuery(html).find("select[name='Queue'] > option");
+                if (queues.length === 1) {
+                    window.location.href = RT.Config .WebHomePath + '/RTIR/Create.html?Queue=' + queues.first().val();
+                    return;
+                }
+
                 jQuery("<div class='modal'></div>")
                     .append(html).appendTo("body")
                     .bind('modal:close', function(ev,modal) { modal.elm.remove(); })

commit 73f9b63c418fac29b303a206eb6635020cb5d419
Author: Dustin Graves <dustin at bestpractical.com>
Date:   Fri Apr 29 22:44:08 2016 +0000

    fix incident child ticket creation
    
    On an incident, if you click on the Create or Launch links for IRs
    or Investigations, the resulting ticket should be linked to the
    originating Incident. It appears the incident linking is getting lost
    with the new popup.

diff --git a/static/js/rtir.js b/static/js/rtir.js
index e583cd0..7a134d9 100644
--- a/static/js/rtir.js
+++ b/static/js/rtir.js
@@ -7,16 +7,17 @@ jQuery(function() {
         return href.substring(questionMarkIndex+1);
     };
 
-    var showModal = function(lifecycle, lifecycleDesc) {
-        var queryString = getQueryString(this);
+    var showModal = function(lifecycle, lifecycleDesc, triggeringObject) {
+        var queryString = getQueryString(triggeringObject);
+        console.log(queryString);
         jQuery.get(
             RT.Config.WebHomePath + '/RTIR/Helpers/CreateInRTIRQueueModal?Lifecycle=' + lifecycle + '&LifecycleDesc=' + lifecycleDesc + '&' + queryString,
             function(html) {
                 // If there's only one queue, just create a ticket in it and skip the modal
                 var queues = jQuery(html).find("select[name='Queue'] > option");
                 if (queues.length === 1) {
-                    window.location.href = RT.Config .WebHomePath + '/RTIR/Create.html?Queue=' + queues.first().val();
-                    return;
+                    window.location.href = RT.Config .WebHomePath + '/RTIR/Create.html?Queue=' + queues.first().val() + '&' + queryString;
+                     return;
                 }
 
                 jQuery("<div class='modal'></div>")
@@ -29,22 +30,22 @@ jQuery(function() {
 
     var showReportsModal = function(e) {
         e.preventDefault();
-        showModal('incident_reports', 'report');
+        showModal('incident_reports', 'report', this);
     };
 
     var showInvestigationsModal = function(e) {
         e.preventDefault();
-        showModal('investigations', 'investigation');
+        showModal('investigations', 'investigation', this);
     };
 
     var showBlocksModal = function(e) {
         e.preventDefault();
-        showModal('blocks', 'block');
+        showModal('blocks', 'block', this);
     };
 
     var showIncidentsModal = function(e) {
         e.preventDefault();
-        showModal('incidents', 'incident');
+        showModal('incidents', 'incident', this);
     };
 
     jQuery("#reports-create").click(showReportsModal);

commit 2a8b9943a54e7492ef94f72f4e9206f507a561ba
Author: Dustin Graves <dustin at bestpractical.com>
Date:   Thu May 12 23:28:41 2016 +0000

    support constituency filtering with RTIR create in queue modal

diff --git a/static/js/rtir.js b/static/js/rtir.js
index 7a134d9..9bb4fe7 100644
--- a/static/js/rtir.js
+++ b/static/js/rtir.js
@@ -9,9 +9,18 @@ jQuery(function() {
 
     var showModal = function(lifecycle, lifecycleDesc, triggeringObject) {
         var queryString = getQueryString(triggeringObject);
-        console.log(queryString);
+        var constituency = '';
+
+        var uri = window.location.href.split('/');
+        for (var i = 0; i < uri.length; i++) {
+            if (uri[i] === 'c') {
+                constituency = '/c/' + uri[i+1];
+                break;
+            }
+        }
+
         jQuery.get(
-            RT.Config.WebHomePath + '/RTIR/Helpers/CreateInRTIRQueueModal?Lifecycle=' + lifecycle + '&LifecycleDesc=' + lifecycleDesc + '&' + queryString,
+            RT.Config.WebHomePath + '/RTIR' + constituency + '/Helpers/CreateInRTIRQueueModal?Lifecycle=' + lifecycle + '&LifecycleDesc=' + lifecycleDesc + '&' + queryString,
             function(html) {
                 // If there's only one queue, just create a ticket in it and skip the modal
                 var queues = jQuery(html).find("select[name='Queue'] > option");

commit 873f43f782f5bed77dacb1e7984c1e71a71fd3a7
Author: Dustin Graves <dustin at bestpractical.com>
Date:   Thu May 12 23:32:33 2016 +0000

    fix error and warnings in RT::Action::RTIR_ChangeChildConstituencies
    
    error occured due to commit 9e9afd6c566 missing a variable declaration
    warnings occured when moving to/from queue with no constituency

diff --git a/lib/RT/Action/RTIR_ChangeChildConstituencies.pm b/lib/RT/Action/RTIR_ChangeChildConstituencies.pm
index 29bb92c..b61f4aa 100644
--- a/lib/RT/Action/RTIR_ChangeChildConstituencies.pm
+++ b/lib/RT/Action/RTIR_ChangeChildConstituencies.pm
@@ -67,10 +67,10 @@ sub Prepare {
     my $q2 = RT::Queue->new(RT->SystemUser);
     $q2->Load($self->TransactionObj->NewValue);
 
-    return 0 unless (RT::IR->ConstituencyFor($q2) ne RT::IR->ConstituencyFor($q1));
+    return 0 unless ((RT::IR->ConstituencyFor($q2)||'') ne (RT::IR->ConstituencyFor($q1)||''));
 
-    $self->{'old_constituency'} = RT::IR->ConstituencyFor($q1);
-    $self->{'new_constituency'} = RT::IR->ConstituencyFor($q2);
+    $self->{'old_constituency'} = RT::IR->ConstituencyFor($q1) || '';
+    $self->{'new_constituency'} = RT::IR->ConstituencyFor($q2) || '';
     return 1;
 }
 
@@ -85,6 +85,7 @@ sub Commit {
     my $self = shift;
 
     my $new_constituency = $self->{'new_constituency'};
+    my $old_constituency = $self->{'old_constituency'};
 
     # find all the tickets related to this ticket
 
@@ -92,7 +93,7 @@ sub Commit {
 
     # for each ticket,
     while ( my $ticket = $kids->Next) {
-        my $kid_constituency = RT::IR->ConstituencyFor($ticket);
+        my $kid_constituency = RT::IR->ConstituencyFor($ticket) || '';
         next if ($kid_constituency eq $new_constituency);
         next if ($kid_constituency ne $old_constituency);
         # if the constituency of the other ticket isn't the same as the new 
@@ -104,12 +105,12 @@ sub Commit {
         my $new_queue = RT::Queue->new(RT->SystemUser);
         $new_queue->Load($kid_queue);
         if (    !$new_queue->id
-             || ( RT::IR->ConstituencyFor($new_queue) ne $new_constituency) 
+             || ( (RT::IR->ConstituencyFor($new_queue)||'') ne $new_constituency)
              || ($new_queue->Lifecycle ne $ticket->QueueObj->Lifecycle)) {
             my $queues = RT::Queues->new(RT->SystemUser);
             $queues->Limit(FIELD => 'Lifecycle', VALUE => $ticket->QueueObj->Lifecycle);
             while (my $temp_queue = $queues->Next) {
-                if (RT::IR->ConstituencyFor($temp_queue) eq $new_constituency) {
+                if ((RT::IR->ConstituencyFor($temp_queue)||'') eq $new_constituency) {
                     $new_queue = $temp_queue;
                     last;
                 }

commit e6f391a809bd1115f64908d49499a217c1d3ee04
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

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>

commit 767d065f94b00fce1f680ee9ae9320a942a253c0
Author: Dustin Graves <dustin at bestpractical.com>
Date:   Tue May 17 23:45:42 2016 +0000

    reordered CreateInRTIRQueueModal template to html/init/args convention

diff --git a/html/RTIR/Elements/CreateInRTIRQueueModal b/html/RTIR/Elements/CreateInRTIRQueueModal
index 5c6b479..7c7a9c2 100644
--- a/html/RTIR/Elements/CreateInRTIRQueueModal
+++ b/html/RTIR/Elements/CreateInRTIRQueueModal
@@ -45,12 +45,24 @@
 %# those contributions and any derivatives thereof.
 %#
 %# END BPS TAGGED BLOCK }}}
-<%ARGS>
-$Lifecycle
-$LifecycleDesc => $Lifecycle
-$Incident => undef
-$Child => undef
-</%ARGS>
+<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,
+        ShowNullOption => 0,
+        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>
 <%INIT>
 $Lifecycle = $Lifecycle->[0] if (ref $Lifecycle eq 'ARRAY');
 
@@ -77,21 +89,10 @@ my $limit_to_constituency =
     (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,
-        ShowNullOption => 0,
-        LimitToConstituency => $limit_to_constituency,
-        Constituency => $m->{'RTIR_ConstituencyFilter'} || $linked_constituency)
+<%ARGS>
+$Lifecycle
+$LifecycleDesc => $Lifecycle
+$Incident => undef
+$Child => undef
+</%ARGS>
 
-    &>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>

commit 175f690442c42935b6241c401359aae1ecff8855
Author: Dustin Graves <dustin at bestpractical.com>
Date:   Tue May 17 23:55:59 2016 +0000

    added documentation in UPGRADING-3.4 to reflect the removal of "Launch Investigation" on incident creation

diff --git a/docs/UPGRADING-3.4 b/docs/UPGRADING-3.4
index fa8a14d..775fa70 100644
--- a/docs/UPGRADING-3.4
+++ b/docs/UPGRADING-3.4
@@ -12,6 +12,12 @@ When working inside RTIR, RT's menus are moved under the C<RT>
 heading and RTIR's menus are expanded. We'd greatly appreciate your
 suggestions for filling out RTIR's menus with additional useful functionality.
 
+=head3 Incidents and Investigations
+
+It is no longer possible to launch an investigation on the incident creation
+page. Users will find the 'Launch Investigation' menu item missing when
+creating an incident. This removal is a result of the flexibility granted by
+the constituency rewrite in RTIR 3.4.
 
 =head2 Queues
 

commit 5e51506840db7c1f5ba45869a7d7a471a7a8cd33
Author: Dustin Graves <dustin at bestpractical.com>
Date:   Wed May 18 21:07:53 2016 +0000

    added tests for the new RTIR ticket create modal

diff --git a/t/constituency/modal.t b/t/constituency/modal.t
new file mode 100644
index 0000000..67a6ded
--- /dev/null
+++ b/t/constituency/modal.t
@@ -0,0 +1,163 @@
+use strict;
+use warnings;
+
+use RT::IR::Test tests => undef;
+
+use_ok('RT::IR');
+
+my ($baseurl) = RT::Test->started_ok;
+my $m = default_agent();
+my $rtir_user = RT::CurrentUser->new( rtir_user() );
+my ($ok, $msg);
+
+diag "create constituencies EDUNET and GOVNET" if $ENV{'TEST_VERBOSE'};
+{
+    for my $constituency_name ( qw(EDUNET GOVNET) ) {
+        ok !system("bin/add_constituency --quiet --force --name $constituency_name 2>&1"), "add_constituency $constituency_name ran successfully";
+    }
+}
+
+my $eduhandler = RT::Test->load_or_create_user( Name => 'eduhandler', Password => 'eduhandler' );
+ok $eduhandler->id, "Created eduhandler";
+
+my $govhandler = RT::Test->load_or_create_user( Name => 'govhandler', Password => 'govhandler' );
+ok $govhandler->id, "Created govhandler";
+
+my $edugroup = RT::Group->new( RT->SystemUser );
+$edugroup->LoadUserDefinedGroup('DutyTeam EDUNET');
+$edugroup->AddMember( $eduhandler->PrincipalId );
+$edugroup->AddMember( $rtir_user->PrincipalId );
+
+my $govgroup = RT::Group->new( RT->SystemUser );
+$govgroup->LoadUserDefinedGroup('DutyTeam GOVNET');
+$govgroup->AddMember( $govhandler->PrincipalId );
+$govgroup->AddMember( $rtir_user->PrincipalId );
+
+diag "check queue visibility in modal" if $ENV{'TEST_VERBOSE'};
+{
+    $m->get("$baseurl/RTIR/Helpers/CreateInRTIRQueueModal?Lifecycle=incident_reports");
+    $m->content_like(qr{<option value="\d+">Incident Reports</option>}, 'Queue dropdown has standard incident reports queue');
+    $m->content_like(qr{<option value="\d+">Incident Reports - EDUNET</option>}, 'Queue dropdown has EDUNET incident reports queue');
+    $m->content_like(qr{<option value="\d+">Incident Reports - GOVNET</option>}, 'Queue dropdown has GOVNET incident reports queue');
+
+    $m->get("$baseurl/RTIR/Helpers/CreateInRTIRQueueModal?Lifecycle=incidents");
+    $m->content_like(qr{<option value="\d+">Incidents</option>}, 'Queue dropdown has standard incidents queue');
+    $m->content_like(qr{<option value="\d+">Incidents - EDUNET</option>}, 'Queue dropdown has EDUNET incidents queue');
+    $m->content_like(qr{<option value="\d+">Incidents - GOVNET</option>}, 'Queue dropdown has GOVNET incidents queue');
+
+    $m->get("$baseurl/RTIR/Helpers/CreateInRTIRQueueModal?Lifecycle=investigations");
+    $m->content_like(qr{<option value="\d+">Investigations</option>}, 'Queue dropdown has standard investigations queue');
+    $m->content_like(qr{<option value="\d+">Investigations - EDUNET</option>}, 'Queue dropdown has EDUNET investigations queue');
+    $m->content_like(qr{<option value="\d+">Investigations - GOVNET</option>}, 'Queue dropdown has GOVNET investigations queue');
+
+    $m->get("$baseurl/RTIR/Helpers/CreateInRTIRQueueModal?Lifecycle=blocks");
+    $m->content_like(qr{<option value="\d+">Blocks</option>}, 'Queue dropdown has standard blocks queue');
+    $m->content_like(qr{<option value="\d+">Blocks - EDUNET</option>}, 'Queue dropdown has EDUNET blocks queue');
+    $m->content_like(qr{<option value="\d+">Blocks - GOVNET</option>}, 'Queue dropdown has GOVNET blocks queue');
+}
+
+diag "check queue visibility in modal when created from incident" if $ENV{'TEST_VERBOSE'};
+{
+    my $i = RT::Ticket->new( $rtir_user );
+    ($ok, $msg) = $i->Create(
+        Subject => 'test incident',
+        Queue => 'Incidents - GOVNET',
+    );
+    ok($ok, 'created test incident');
+
+    $m->get("$baseurl/RTIR/Helpers/CreateInRTIRQueueModal?Lifecycle=incident_reports&Incident=".$i->id);
+    $m->content_like(qr{<option value="\d+">Incident Reports - GOVNET</option>}, 'Queue dropdown has GOVNET incident reports queue');
+    $m->content_unlike(qr{<option value="\d+">Incident Reports</option>}, 'Queue dropdown doesn\'t have standard incident reports queue');
+    $m->content_unlike(qr{<option value="\d+">Incident Reports - EDUNET</option>}, 'Queue dropdown doesn\'t have EDUNET incident reports queue');
+
+    $m->get("$baseurl/RTIR/Helpers/CreateInRTIRQueueModal?Lifecycle=investigations&Incident=".$i->id);
+    $m->content_like(qr{<option value="\d+">Investigations - GOVNET</option>}, 'Queue dropdown has GOVNET investigations queue');
+    $m->content_unlike(qr{<option value="\d+">Investigations</option>}, 'Queue dropdown doesn\'t have standard investigations queue');
+    $m->content_unlike(qr{<option value="\d+">Investigations - EDUNET</option>}, 'Queue dropdown doesn\'t have EDUNET investigations queue');
+
+    $m->get("$baseurl/RTIR/Helpers/CreateInRTIRQueueModal?Lifecycle=blocks&Incident=".$i->id);
+    $m->content_like(qr{<option value="\d+">Blocks - GOVNET</option>}, 'Queue dropdown has GOVNET blocks queue');
+    $m->content_unlike(qr{<option value="\d+">Blocks</option>}, 'Queue dropdown doesn\'t have standard blocks queue');
+    $m->content_unlike(qr{<option value="\d+">Blocks - EDUNET</option>}, 'Queue dropdown doesn\'t have EDUNET blocks queue');
+}
+
+diag "check queue visibility in modal when created from incident report" if $ENV{'TEST_VERBOSE'};
+{
+    my $r = RT::Ticket->new( $rtir_user );
+    ($ok, $msg) = $r->Create(
+        Subject => 'test incident report',
+        Queue => 'Incident Reports - GOVNET',
+    );
+    ok($ok, 'created test incident report');
+
+    $m->get("$baseurl/RTIR/Helpers/CreateInRTIRQueueModal?Lifecycle=incidents&Child=".$r->id);
+    $m->content_like(qr{<option value="\d+">Incidents - GOVNET</option>}, 'Queue dropdown has GOVNET incidents queue');
+    $m->content_unlike(qr{<option value="\d+">Incidents</option>}, 'Queue dropdown doesn\'t have standard incidents queue');
+    $m->content_unlike(qr{<option value="\d+">Incidents - EDUNET</option>}, 'Queue dropdown doesn\'t have EDUNET incidents queue');
+}
+
+diag "check queue visibility in modal when filtering constituency" if $ENV{'TEST_VERBOSE'};
+{
+    $m->get("$baseurl/RTIR/c/GOVNET/Helpers/CreateInRTIRQueueModal?Lifecycle=incidents");
+    $m->content_like(qr{<option value="\d+">Incidents - GOVNET</option>}, 'Queue dropdown has GOVNET incidents queue');
+    $m->content_unlike(qr{<option value="\d+">Incidents - EDUNET</option>}, 'Queue dropdown doesn\'t have EDUNET incidents queue');
+    $m->content_unlike(qr{<option value="\d+">Incidents</option>}, 'Queue dropdown doesn\'t have standard incidents queue');
+
+    $m->get("$baseurl/RTIR/c/EDUNET/Helpers/CreateInRTIRQueueModal?Lifecycle=incidents");
+    $m->content_like(qr{<option value="\d+">Incidents - EDUNET</option>}, 'Queue dropdown has EDUNET incidents queue');
+    $m->content_unlike(qr{<option value="\d+">Incidents</option>}, 'Queue dropdown doesn\'t have standard incidents queue');
+    $m->content_unlike(qr{<option value="\d+">Incidents - GOVNET</option>}, 'Queue dropdown doesn\'t have GOVNET incidents queue');
+}
+
+diag "check queue visibility in modal - eduhandler" if $ENV{'TEST_VERBOSE'};
+{
+    $m->login('eduhandler', 'eduhandler', logout => 1);
+
+    $m->get("$baseurl/RTIR/Helpers/CreateInRTIRQueueModal?Lifecycle=incident_reports");
+    $m->content_like(qr{<option value="\d+">Incident Reports - EDUNET</option>}, 'Queue dropdown has EDUNET incident reports queue');
+    $m->content_unlike(qr{<option value="\d+">Incident Reports</option>}, 'Queue dropdown doesn\'t have standard incident reports queue');
+    $m->content_unlike(qr{<option value="\d+">Incident Reports - GOVNET</option>}, 'Queue dropdown doesn\'t have GOVNET incident reports queue');
+
+    $m->get("$baseurl/RTIR/Helpers/CreateInRTIRQueueModal?Lifecycle=incidents");
+    $m->content_like(qr{<option value="\d+">Incidents - EDUNET</option>}, 'Queue dropdown has EDUNET incidents queue');
+    $m->content_unlike(qr{<option value="\d+">Incidents</option>}, 'Queue dropdown doesn\'t have standard incidents queue');
+    $m->content_unlike(qr{<option value="\d+">Incidents - GOVNET</option>}, 'Queue dropdown doesn\'t have GOVNET incidents queue');
+
+    $m->get("$baseurl/RTIR/Helpers/CreateInRTIRQueueModal?Lifecycle=investigations");
+    $m->content_like(qr{<option value="\d+">Investigations - EDUNET</option>}, 'Queue dropdown has EDUNET investigations queue');
+    $m->content_unlike(qr{<option value="\d+">Investigations</option>}, 'Queue dropdown doesn\'t have standard investigations queue');
+    $m->content_unlike(qr{<option value="\d+">Investigations - GOVNET</option>}, 'Queue dropdown doesn\'t have GOVNET investigations queue');
+
+    $m->get("$baseurl/RTIR/Helpers/CreateInRTIRQueueModal?Lifecycle=blocks");
+    $m->content_like(qr{<option value="\d+">Blocks - EDUNET</option>}, 'Queue dropdown has EDUNET blocks queue');
+    $m->content_unlike(qr{<option value="\d+">Blocks</option>}, 'Queue dropdown doesn\'t have standard blocks queue');
+    $m->content_unlike(qr{<option value="\d+">Blocks - GOVNET</option>}, 'Queue dropdown doesn\'t have GOVNET blocks queue');
+}
+
+diag "check queue visibility in modal - govhandler" if $ENV{'TEST_VERBOSE'};
+{
+    $m->login('govhandler', 'govhandler', logout => 1);
+
+    $m->get("$baseurl/RTIR/Helpers/CreateInRTIRQueueModal?Lifecycle=incident_reports");
+    $m->content_like(qr{<option value="\d+">Incident Reports - GOVNET</option>}, 'Queue dropdown has GOVNET incident reports queue');
+    $m->content_unlike(qr{<option value="\d+">Incident Reports - EDUNET</option>}, 'Queue dropdown doesn\'t have EDUNET incident reports queue');
+    $m->content_unlike(qr{<option value="\d+">Incident Reports</option>}, 'Queue dropdown doesn\'t have standard incident reports queue');
+
+    $m->get("$baseurl/RTIR/Helpers/CreateInRTIRQueueModal?Lifecycle=incidents");
+    $m->content_like(qr{<option value="\d+">Incidents - GOVNET</option>}, 'Queue dropdown has GOVNET incidents queue');
+    $m->content_unlike(qr{<option value="\d+">Incidents - EDUNET</option>}, 'Queue dropdown doesn\'t have EDUNET incidents queue');
+    $m->content_unlike(qr{<option value="\d+">Incidents</option>}, 'Queue dropdown doesn\'t have standard incidents queue');
+
+    $m->get("$baseurl/RTIR/Helpers/CreateInRTIRQueueModal?Lifecycle=investigations");
+    $m->content_like(qr{<option value="\d+">Investigations - GOVNET</option>}, 'Queue dropdown has GOVNET investigations queue');
+    $m->content_unlike(qr{<option value="\d+">Investigations - EDUNET</option>}, 'Queue dropdown doesn\'t have EDUNET investigations queue');
+    $m->content_unlike(qr{<option value="\d+">Investigations</option>}, 'Queue dropdown doesn\'t have standard investigations queue');
+
+    $m->get("$baseurl/RTIR/Helpers/CreateInRTIRQueueModal?Lifecycle=blocks");
+    $m->content_like(qr{<option value="\d+">Blocks - GOVNET</option>}, 'Queue dropdown has GOVNET blocks queue');
+    $m->content_unlike(qr{<option value="\d+">Blocks - EDUNET</option>}, 'Queue dropdown doesn\'t have EDUNET blocks queue');
+    $m->content_unlike(qr{<option value="\d+">Blocks</option>}, 'Queue dropdown doesn\'t have standard blocks queue');
+}
+
+undef $m;
+done_testing;

commit cd3f6b5f2dd49d5366d975307ad9f7660cf20513
Author: Dustin Graves <dustin at bestpractical.com>
Date:   Mon May 23 23:00:04 2016 +0000

    add js fallback ticket create page CreateInQueue
    
    this also fixes certain create conditions that were missing modal
    functionality

diff --git a/html/Callbacks/RTIR/Elements/MakeClicky/Default b/html/Callbacks/RTIR/Elements/MakeClicky/Default
index daf9553..760d5f8 100644
--- a/html/Callbacks/RTIR/Elements/MakeClicky/Default
+++ b/html/Callbacks/RTIR/Elements/MakeClicky/Default
@@ -105,8 +105,8 @@ my %actions;
         my $result .= qq{<a class="button" href="}. RT::IR->HREFTo("Tools/Lookup.html?".$args{lookup_params}."type=ip&q=".$escaped_host).qq{">}
                       .loc('Lookup IP') .q{</a>};
         if ( $args{incident} && !RT->Config->Get('RTIR_DisableBlocksQueue') ) {
-            $result .= qq{<a class="button" href="} .
-            RT::IR->HREFTo("Create.html?Incident=".$args{incident}."&Lifecycle=".RT::IR->lifecycle_countermeasure.qq{&IP-Value=$escaped_host})
+            $result .= qq{<a class="button create_child_blocks" href="} .
+            RT::IR->HREFTo("CreateInQueue.html?Incident=".$args{incident}."&Lifecycle=".RT::IR->lifecycle_countermeasure.qq{&IP-Value=$escaped_host})
             .qq{">block</a>};
         }
         if ( $args{'object'} && $args{'object'}->id ) {
@@ -156,7 +156,7 @@ my %actions;
                 $result .= qq{<input type="checkbox" name="Requestorbox-$escaped_email" unchecked />};
             }
             $result .= qq{<a class="button" href="}.
-                RT::IR->HREFTo( "Create.html"
+                RT::IR->HREFTo( "CreateInQueue.html"
                 . qq{?Incident=$args{'incident'}}
                 . qq{&Lifecycle=}.RT::IR->lifecycle_investigation
                 . "&Requestors=$escaped_email")
diff --git a/html/Callbacks/RTIR/Elements/RT__Ticket/ColumnMap/Once b/html/Callbacks/RTIR/Elements/RT__Ticket/ColumnMap/Once
index 06aab26..0cef225 100644
--- a/html/Callbacks/RTIR/Elements/RT__Ticket/ColumnMap/Once
+++ b/html/Callbacks/RTIR/Elements/RT__Ticket/ColumnMap/Once
@@ -153,9 +153,9 @@ $COLUMN_MAP->{'LookupToolIncidentActions'} = {
             ;
         }
         push @res, \'<a href="',
-            RT::IR->HREFTo('Create.html?Lifecycle='.RT::IR->lifecycle_investigation
+            RT::IR->HREFTo('CreateInQueue.html?Lifecycle='.RT::IR->lifecycle_investigation
             .'&Incident='. $t->id),
-            \'">',
+            \'" class="create_child_blocks">',
             '[' . $t->loc("Investigate") .']',
             \'</a>'
         ;
diff --git a/html/Callbacks/RTIR/Elements/Tabs/Privileged b/html/Callbacks/RTIR/Elements/Tabs/Privileged
index a8fa11e..24c99a1 100644
--- a/html/Callbacks/RTIR/Elements/Tabs/Privileged
+++ b/html/Callbacks/RTIR/Elements/Tabs/Privileged
@@ -110,21 +110,21 @@ $root->child(
     path => RT::IR->HREFTo('Search/Results.html?Lifecycle='.RT::IR->lifecycle_incident, IncludeWebPath => 0)
 )->child(
     create => title => loc('Create'),
-    path => RT::IR->HREFTo('Create.html?Lifecycle='.RT::IR->lifecycle_incident, IncludeWebPath => 0),
+    path => RT::IR->HREFTo('CreateInQueue.html?Lifecycle='.RT::IR->lifecycle_incident, IncludeWebPath => 0),
 );
 $root->child(
     reports => title => loc('Reports'),
     path => RT::IR->HREFTo('Search/Results.html?Lifecycle='. RT::IR->lifecycle_report, IncludeWebPath => 0)
 )->child(
     create => title => loc('Create'),
-    path => RT::IR->HREFTo('Create.html?Lifecycle='. RT::IR->lifecycle_report, IncludeWebPath => 0),
+    path => RT::IR->HREFTo('CreateInQueue.html?Lifecycle='. RT::IR->lifecycle_report, IncludeWebPath => 0),
 );
 $root->child(
     investigations => title => loc('Investigations'),
     path => RT::IR->HREFTo('Search/Results.html?Lifecycle='.RT::IR->lifecycle_investigation, IncludeWebPath => 0)
 )->child(
     launch => title => loc('Launch'),
-    path => RT::IR->HREFTo('Create.html?Lifecycle='.RT::IR->lifecycle_investigation, IncludeWebPath => 0),
+    path => RT::IR->HREFTo('CreateInQueue.html?Lifecycle='.RT::IR->lifecycle_investigation, IncludeWebPath => 0),
 );
 unless ( RT->Config->Get('RTIR_DisableBlocksQueue') ) {
     $root->child(
@@ -132,7 +132,7 @@ unless ( RT->Config->Get('RTIR_DisableBlocksQueue') ) {
         path => RT::IR->HREFTo('Search/Results.html?Lifecycle='.RT::IR->lifecycle_countermeasure, IncludeWebPath => 0)
     )->child(
         create => title => loc('Create'),
-        path => RT::IR->HREFTo('Create.html?Lifecycle='.RT::IR->lifecycle_countermeasure, IncludeWebPath => 0),
+        path => RT::IR->HREFTo('CreateInQueue.html?Lifecycle='.RT::IR->lifecycle_countermeasure, IncludeWebPath => 0),
     );
 }
 
@@ -348,8 +348,8 @@ if ( $request_path =~ m{(?:$re_rtir_path)(?:$re_rtir_types/)?(Display|Edit|Updat
     PageMenu()->child(
         new => title => loc("New [_1]", RT::IR::TicketType( Lifecycle => $lifecycle || RT::IR->lifecycle_incident ) ),
         path => !$lifecycle
-            ? RT::IR->HREFTo("Create.html?Child=$id&Lifecycle=".RT::IR->lifecycle_incident, IncludeWebPath => 0)
-            : RT::IR->HREFTo("Create.html?". $query_string->( Incident => $id, Lifecycle => $lifecycle ), IncludeWebPath => 0)
+            ? RT::IR->HREFTo("CreateInQueue.html?Child=$id&Lifecycle=".RT::IR->lifecycle_incident, IncludeWebPath => 0)
+            : RT::IR->HREFTo("CreateInQueue.html?". $query_string->( Incident => $id, Lifecycle => $lifecycle ), IncludeWebPath => 0)
         ,
     );
     PageMenu()->child(
@@ -370,7 +370,7 @@ if ( $request_path =~ m{(?:$re_rtir_path)(?:$re_rtir_types/)?(Display|Edit|Updat
 
     PageMenu()->child(
         new => title => loc("New [_1]",RT::IR::TicketType( Lifecycle => $lifecycle ) ),
-        path => RT::IR->HREFTo("Create.html?". $query_string->( Incident => $id, Lifecycle => $lifecycle ), IncludeWebPath => 0),
+        path => RT::IR->HREFTo("CreateInQueue.html?". $query_string->( Incident => $id, Lifecycle => $lifecycle ), IncludeWebPath => 0),
     );
     PageMenu()->child(
         back => title => loc('Back to [_1] #[_2]', lc RT::IR::TicketType( Lifecycle => $ticket->QueueObj->Lifecycle), $id),
diff --git a/html/RTIR/Elements/CreateInRTIRQueueModal b/html/RTIR/CreateInQueue.html
similarity index 57%
copy from html/RTIR/Elements/CreateInRTIRQueueModal
copy to html/RTIR/CreateInQueue.html
index 7c7a9c2..e79f746 100644
--- a/html/RTIR/Elements/CreateInRTIRQueueModal
+++ b/html/RTIR/CreateInQueue.html
@@ -45,54 +45,21 @@
 %# those contributions and any derivatives thereof.
 %#
 %# END BPS TAGGED BLOCK }}}
-<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,
-        ShowNullOption => 0,
-        LimitToConstituency => $limit_to_constituency,
-        Constituency => $m->{'RTIR_ConstituencyFilter'} || $linked_constituency)
+<& /RTIR/Elements/Header,
+    Title => $title,
+&>
+<& /Elements/Tabs &>
 
-    &>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>
-<%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);
-}
+<& /RTIR/Elements/CreateInRTIRQueueModal, %ARGS &>
 
-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);
-}
+<%INIT>
+my $lifecycle_desc = $Lifecycle eq 'incidents'        ? 'Incident'        :
+                     $Lifecycle eq 'incident_reports' ? 'Incident Report' :
+                     $Lifecycle eq 'blocks'           ? 'Block'           :
+                     $Lifecycle eq 'investigations'   ? 'Investigation'   : '';
 
-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;
+my $title = "Select Queue for New $lifecycle_desc";
 </%INIT>
 <%ARGS>
 $Lifecycle
-$LifecycleDesc => $Lifecycle
-$Incident => undef
-$Child => undef
 </%ARGS>
-
diff --git a/html/RTIR/Elements/CreateInRTIRQueueModal b/html/RTIR/Elements/CreateInRTIRQueueModal
index 7c7a9c2..764b953 100644
--- a/html/RTIR/Elements/CreateInRTIRQueueModal
+++ b/html/RTIR/Elements/CreateInRTIRQueueModal
@@ -52,7 +52,7 @@
 % if ($Child) {
 <input type="hidden" name="Child" value="<%$Child%>"/>
 % }
-  <&|/l_unsafe, $LifecycleDesc,
+  <&|/l_unsafe, $lifecycle_desc,
       $m->scomp('/RTIR/Elements/SelectRTIRQueue',
         Name => 'Queue',
         Lifecycle => $Lifecycle,
@@ -61,7 +61,7 @@
         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) &>
+  <& /Elements/Submit, Label => loc("Go"), Caption => loc("This will take you to a partially prefilled [_1] creation form.", $lifecycle_desc) &>
 </form>
 <%INIT>
 $Lifecycle = $Lifecycle->[0] if (ref $Lifecycle eq 'ARRAY');
@@ -88,10 +88,14 @@ my $limit_to_constituency =
     # Also limit if we have a linked constituency and StrictConstituencyLinking is set
     (RT::IR->StrictConstituencyLinking && $linked_constituency)
     ? 1:0;
+
+my $lifecycle_desc = $Lifecycle eq 'incidents'        ? 'incident'        :
+                     $Lifecycle eq 'incident_reports' ? 'incident report' :
+                     $Lifecycle eq 'blocks'           ? 'block'           :
+                     $Lifecycle eq 'investigations'   ? 'investigation'   : '';
 </%INIT>
 <%ARGS>
 $Lifecycle
-$LifecycleDesc => $Lifecycle
 $Incident => undef
 $Child => undef
 </%ARGS>
diff --git a/html/RTIR/Elements/ShowIncidents b/html/RTIR/Elements/ShowIncidents
index dffb5a5..cb78b53 100644
--- a/html/RTIR/Elements/ShowIncidents
+++ b/html/RTIR/Elements/ShowIncidents
@@ -58,7 +58,7 @@
 <div class="actions">
 % unless ( $action ) {
 <a class="button" id="link-incident" href="<% RT::IR->HREFTo('Link/ToIncident/?id='. $id ) %>">Link</a>
-<a class="button" id="create-incident" href="<% RT::IR->HREFTo('Incident/Create.html?Child='. $id ) %>">New</a>
+<a class="button" id="create-incident" href="<% RT::IR->HREFTo('CreateInQueue.html?Lifecycle=' . RT::IR->lifecycle_incident . '&Child='. $id ) %>">New</a>
 % } elsif ( $action ne 'No' ) {
 <a class="button" href="<% RT::IR->HREFTo('Display.html?Action='. $action.'&id='. $id) %>"><% loc( $action ) %></a>
 % }
diff --git a/html/RTIR/Incident/Elements/ShowChildren b/html/RTIR/Incident/Elements/ShowChildren
index fe6b278..681655e 100644
--- a/html/RTIR/Incident/Elements/ShowChildren
+++ b/html/RTIR/Incident/Elements/ShowChildren
@@ -116,7 +116,7 @@ if ( $IncidentObj->CurrentUserHasRight('ModifyTicket') ) {
         push @box_actions, {
             title => $Lifecycle ne RT::IR->lifecycle_investigation? loc('Create') : loc('Launch'),
             class => 'create_child' . ($Lifecycle ? '_'.$Lifecycle : ''),
-            path => RT::IR->HREFTo("Create.html?Incident=$id&Lifecycle=".$Lifecycle),
+            path => RT::IR->HREFTo("CreateInQueue.html?Incident=$id&Lifecycle=".$Lifecycle),
         };
     }
     push @box_actions, {
diff --git a/html/RTIR/Tools/Elements/LookupSummary b/html/RTIR/Tools/Elements/LookupSummary
index 36a3418..88f4db4 100644
--- a/html/RTIR/Tools/Elements/LookupSummary
+++ b/html/RTIR/Tools/Elements/LookupSummary
@@ -109,7 +109,8 @@ if ( $TicketObj && RT::IR->IsIncidentQueue($TicketObj->QueueObj)
     if ($Lifecycle eq RT::IR->lifecycle_investigation && $LookupType eq 'email') {
         push @box_actions, {
             title => loc('Launch'),
-            path => RT::IR->HREFTo("Create.html?". $m->comp('/Elements/QueryString',
+            class => 'create_child' . ($Lifecycle ? '_'.$Lifecycle : ''),
+            path => RT::IR->HREFTo("CreateInQueue.html?". $m->comp('/Elements/QueryString',
                 Incident => $TicketObj->id,
                 Lifecycle => $Lifecycle,
                 Requestors => $q,
@@ -118,7 +119,8 @@ if ( $TicketObj && RT::IR->IsIncidentQueue($TicketObj->QueueObj)
     } elsif ( $Lifecycle eq RT::IR->lifecycle_countermeasure && $LookupType eq 'ip' && !RT->Config->Get('RTIR_DisableBlocksQueue') ) {
         push @box_actions, {
             title => loc('Create'),
-            path => RT::IR->HREFTo("Create.html?". $m->comp('/Elements/QueryString',
+            class => 'create_child' . ($Lifecycle ? '_'.$Lifecycle : ''),
+            path => RT::IR->HREFTo("CreateInQueue.html?". $m->comp('/Elements/QueryString',
                 Incident => $TicketObj->id,
                 Lifecycle => $Lifecycle,
                 'IP-Value' => $q,
@@ -131,14 +133,15 @@ elsif ( $TicketObj && !RT::IR->IsIncidentQueue($TicketObj->QueueObj)
 ) {
     push @box_actions, {
         title => loc('Create'),
-        path => RT::IR->HREFTo("Create.html?". $m->comp('/Elements/QueryString',
+        class => 'create_child' . ($Lifecycle ? '_'.$Lifecycle : ''),
+        path => RT::IR->HREFTo("CreateInQueue.html?". $m->comp('/Elements/QueryString',
             Child => $TicketObj->id,
             Lifecycle => $Lifecycle
         )),
     };
 }
 my $box_actions = join ' 'x3,
-    map qq{<a href="}.  $_->{'path'} .q{">}
+    map qq{<a href="} . $_->{'path'} . q{"} . ( $_->{'class'} ? q{ class="} . $_->{'class'} . q{"} : '' ) . '>'
         . $m->interp->apply_escapes( $_->{title}, 'h' ) . q{</a>},
     @box_actions;
 
diff --git a/static/js/rtir.js b/static/js/rtir.js
index 9bb4fe7..c88f4c2 100644
--- a/static/js/rtir.js
+++ b/static/js/rtir.js
@@ -7,7 +7,7 @@ jQuery(function() {
         return href.substring(questionMarkIndex+1);
     };
 
-    var showModal = function(lifecycle, lifecycleDesc, triggeringObject) {
+    var showModal = function(lifecycle, triggeringObject) {
         var queryString = getQueryString(triggeringObject);
         var constituency = '';
 
@@ -20,7 +20,7 @@ jQuery(function() {
         }
 
         jQuery.get(
-            RT.Config.WebHomePath + '/RTIR' + constituency + '/Helpers/CreateInRTIRQueueModal?Lifecycle=' + lifecycle + '&LifecycleDesc=' + lifecycleDesc + '&' + queryString,
+            RT.Config.WebHomePath + '/RTIR' + constituency + '/Helpers/CreateInRTIRQueueModal?Lifecycle=' + lifecycle + '&' + queryString,
             function(html) {
                 // If there's only one queue, just create a ticket in it and skip the modal
                 var queues = jQuery(html).find("select[name='Queue'] > option");
@@ -39,31 +39,31 @@ jQuery(function() {
 
     var showReportsModal = function(e) {
         e.preventDefault();
-        showModal('incident_reports', 'report', this);
+        showModal('incident_reports', this);
     };
 
     var showInvestigationsModal = function(e) {
         e.preventDefault();
-        showModal('investigations', 'investigation', this);
+        showModal('investigations', this);
     };
 
     var showBlocksModal = function(e) {
         e.preventDefault();
-        showModal('blocks', 'block', this);
+        showModal('blocks', this);
     };
 
     var showIncidentsModal = function(e) {
         e.preventDefault();
-        showModal('incidents', 'incident', this);
+        showModal('incidents', this);
     };
 
-    jQuery("#reports-create").click(showReportsModal);
-    jQuery("#investigations-launch").click(showInvestigationsModal);
-    jQuery("#blocks-create").click(showBlocksModal);
-    jQuery("#incidents-create").click(showIncidentsModal);
-    jQuery("#create-incident").click(showIncidentsModal);
+    jQuery('body').on('click', '#reports-create', showReportsModal);
+    jQuery('body').on('click', '#investigations-launch', showInvestigationsModal);
+    jQuery('body').on('click', '#blocks-create', showBlocksModal);
+    jQuery('body').on('click', '#incidents-create', showIncidentsModal);
+    jQuery('body').on('click', '#create-incident', showIncidentsModal);
 
-    jQuery(".create_child_incident_reports").click(showReportsModal);
-    jQuery(".create_child_investigations").click(showInvestigationsModal);
-    jQuery(".create_child_blocks").click(showBlocksModal);
+    jQuery('body').on('click', '.create_child_incident_reports', showReportsModal);
+    jQuery('body').on('click', '.create_child_investigations', showInvestigationsModal);
+    jQuery('body').on('click', '.create_child_blocks', showBlocksModal);
 });

commit 5a5cebc077c43e75375a01a0e468ff0c944922c8
Author: Dustin Graves <dustin at bestpractical.com>
Date:   Tue May 24 18:49:47 2016 +0000

    add create in queue pop-up (using js fallback) support to RTIR tests

diff --git a/lib/RT/IR/Test/Web.pm b/lib/RT/IR/Test/Web.pm
index 93da117..9b90ef8 100644
--- a/lib/RT/IR/Test/Web.pm
+++ b/lib/RT/IR/Test/Web.pm
@@ -77,11 +77,9 @@ sub goto_create_rtir_ticket {
     local $Test::Builder::Level = $Test::Builder::Level + 1;
     my $lifecycle = lc( $queue);
     $lifecycle =~ s/ /_/;
-   
-#    $self->get_ok("/RTIR/Create.html?Lifecycle=$lifecycle");
 
-
-    $self->get_ok("/RTIR/Create.html?Queue=$queue");
+    $self->get_ok("/RTIR/CreateInQueue.html?Lifecycle=$lifecycle");
+    $self->click_through_createinqueue( $queue );
 
     # set the form
     return $self->form_number(3);
@@ -143,6 +141,7 @@ sub create_incident_for_ir {
     # Select the "New" link from the Display page
     $self->follow_link_ok({id => 'create-incident'}, "Followed 'New (Incident)' link")
         or Test::More::diag $self->content;
+    $self->click_through_createinqueue;
 
     $self->form_number(3);
 
@@ -388,4 +387,19 @@ sub bulk_abandon {
     return;
 }
 
+
+sub click_through_createinqueue
+{
+    my $self = shift;
+    my $queue = shift || undef;
+
+    my %args;
+    $args{fields} = { Queue => $queue } if $queue;
+
+    $self->submit_form(
+        form_id => 'CreateInQueue',
+        %args,
+    );
+}
+
 1;
diff --git a/t/019-watchers-on-create.t b/t/019-watchers-on-create.t
index d347da8..af3b151 100644
--- a/t/019-watchers-on-create.t
+++ b/t/019-watchers-on-create.t
@@ -13,6 +13,7 @@ my $ir = $agent->create_ir( {Subject => 'IR to test watcher add bug',
 
 
 SKIP: {
+	skip "Create incident and investigation functionality disabled for now", 19;
 	skip "No IR created", 19 if(!$ir);
 
 	$agent->content_unlike(qr/permission denied/i, "No permissions problems");
@@ -46,7 +47,7 @@ SKIP: {
 }
 
 
-
+SKIP: { skip "Create incident and investigation functionality disabled for now", 5;
 # Testing creating an incident and investigation not from an incident report
 my ($inc, $inv) = $agent->create_incident_and_investigation( '',
 	{Subject => "Incident to test adding watchers", 
@@ -66,6 +67,7 @@ SKIP: {
 	$agent->has_watchers( $inv, 'AdminCc');
 
 }
+}
 
 
 # Testing creating an investigation by itself
diff --git a/t/020-incident-and-investigation.t b/t/020-incident-and-investigation.t
index 5684799..1e04b5d 100755
--- a/t/020-incident-and-investigation.t
+++ b/t/020-incident-and-investigation.t
@@ -19,7 +19,7 @@ $agent->display_ticket( $ir);
 # that function is not used here is that we want to check that the creation failed in the case
 # of an empty correspondents field, while the above function tests if the creation succeeded,
 # and thus will fail if we get the result we want, and succeed if we don't!
-{
+SKIP: { skip 'Create incident and investigation functionality disabled for now', 3;
     $agent->follow_link_ok({text => "New"}, "Followed 'New (Incident)' link");
     $agent->form_number(3);
     $agent->field('Subject', 'Incident for testing empty Investigation correspondent');
@@ -33,7 +33,7 @@ $agent->display_ticket( $ir);
 
 
 # Okay, enough funny business. Now for some straightforward tests, how it should work
-{
+SKIP: { skip 'Create incident and investigation functionality disabled for now', 4;
     my ($inc_id, $inv_id) = $agent->create_incident_and_investigation( '',
         {Subject => 'Incident for testing Incident-and-investigation-from-IR creation',
         InvestigationSubject => 'Investigation for testing Incident-and-Investigation-from-IR creation', 
@@ -72,6 +72,7 @@ my $incident_bar = $agent->create_incident(
 $agent->display_ticket($incident_foo);
 
 $agent->follow_link_ok({text => 'Launch', n => 2}, "Followed 'Launch' link");
+$agent->click_through_createinqueue;
 $agent->form_name('TicketCreate');
 is($agent->value('Incident'), $incident_foo, 'Incident foo is checked');
 $agent->field('Incident', $incident_bar);
diff --git a/t/articles/on-create.t b/t/articles/on-create.t
index b7cd039..1f440b4 100644
--- a/t/articles/on-create.t
+++ b/t/articles/on-create.t
@@ -35,7 +35,9 @@ diag "create an article" if $ENV{'TEST_VERBOSE'};
     is($agent->status, 200, "attempt to create succeeded");
 }
 
-foreach ( 'Incidents', 'Incident Reports', 'Investigations', 'Blocks' ) {
+# TODO: Once incident+investigation creation is re-added, this should be put back
+#foreach ( 'Incidents', 'Incident Reports', 'Investigations', 'Blocks' ) {
+foreach ( 'Incident Reports', 'Investigations', 'Blocks' ) {
     my $queue = RT::Queue->new(RT->SystemUser);
     $queue->Load( $_ );
     ok $agent->goto_create_ticket( $queue ), "UI -> create ticket";
diff --git a/t/constituency/basics.t b/t/constituency/basics.t
index 03a5abb..c3311f2 100644
--- a/t/constituency/basics.t
+++ b/t/constituency/basics.t
@@ -142,6 +142,7 @@ diag "check queue names on page - govhandler";
     }
 }
 
+SKIP: { skip "Create incident and investigation functionality disabled for now", 6;
 diag "check queues when creating inc with inv - govhandler";
 {
     $agent->login('govhandler', 'govhandler', logout => 1);
@@ -155,7 +156,9 @@ diag "check queues when creating inc with inv - govhandler";
     $agent->content_contains('Incidents'.$govnet_suffix);
     $agent->content_contains('Investigations'.$govnet_suffix);
 }
+}
 
+SKIP: { skip "Create incident and investigation functionality disabled for now", 6;
 diag "check queues when creating inc with inv - eduhandler";
 {
     $agent->login('eduhandler', 'eduhandler', logout => 1);
@@ -169,6 +172,7 @@ diag "check queues when creating inc with inv - eduhandler";
     $agent->content_contains('Incidents'.$edunet_suffix);
     $agent->content_contains('Investigations'.$edunet_suffix);
 }
+}
 
 undef $agent;
 done_testing;
diff --git a/t/custom-fields/defaults-on-linking.t b/t/custom-fields/defaults-on-linking.t
index c5fc932..807a0a1 100644
--- a/t/custom-fields/defaults-on-linking.t
+++ b/t/custom-fields/defaults-on-linking.t
@@ -55,6 +55,7 @@ my $agent = default_agent();
         $agent->display_ticket( $ir_id );
         $agent->follow_link_ok({text => "New"}, "Followed 'New (Incident)' link")
             or diag $agent->content;
+        $agent->click_through_createinqueue;
         $agent->form_number(3);
 
         my $input = $agent->custom_field_input( 'Incidents', $cf_name );
diff --git a/t/incident/split.t b/t/incident/split.t
index e6568c4..8e8e313 100644
--- a/t/incident/split.t
+++ b/t/incident/split.t
@@ -26,10 +26,11 @@ my $rtir_user = rtir_user();
     ok ($new_id, "Ticket created successfully: #$new_id.");
 
     $agent->follow_link_ok({text => "Launch", n => 2 }, "Followed link");
+    $agent->click_through_createinqueue;
     $agent->form_number(3);
     $agent->field('Requestors', $rtir_user->EmailAddress);
     $agent->click('Create');
-    
+
     is ($agent->status, 200, "Attempted to create the ticket");
     my $inv_id = ($agent->content =~ /.*Ticket (\d+) created.*/i )[0];
     ok ($inv_id, "Ticket created successfully: #$inv_id.");

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


More information about the rt-commit mailing list