[Rt-commit] rtir branch, 2.9/remove-check-all-ticket-workaround, created. 3.0.0rc1-15-g1dda1b7

Jim Brandt jbrandt at bestpractical.com
Tue Oct 2 11:56:06 EDT 2012


The branch, 2.9/remove-check-all-ticket-workaround has been created
        at  1dda1b71ab0626a52c8218d85aafb68812842c74 (commit)

- Log -----------------------------------------------------------------
commit 1dda1b71ab0626a52c8218d85aafb68812842c74
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Tue Oct 2 11:46:54 2012 -0400

    Move checkbox select flags to links and remove arg changing code
    
    Code in the Reply template was inserting arguments in request_args
    to auto-select checkboxes and recent changes to use $DECODED_ARGS
    in favor of request_args no longer picked up the flags.
    
    Move the flags to GET params on the incoming links so they are
    passed as actual args and remove the self-confessed hack.

diff --git a/html/Callbacks/RTIR/Elements/Tabs/Privileged b/html/Callbacks/RTIR/Elements/Tabs/Privileged
index 429aa60..51c8693 100644
--- a/html/Callbacks/RTIR/Elements/Tabs/Privileged
+++ b/html/Callbacks/RTIR/Elements/Tabs/Privileged
@@ -177,11 +177,11 @@ if ( $request_path =~ m{^/RTIR/(?:$re_rtir_types/)?(Display|Edit|Update)\.html$}
         if ( $type eq 'Incident' ) {
             $actions_tab->child(
                 reply_reporters => title => loc('Reply to Reporters'),
-                path  => "/RTIR/Incident/Reply/?id=$id&SelectAllTickets=1",
+                path  => "/RTIR/Incident/Reply/?id=$id&SelectAllTickets=1&SelectedReportsAll=1",
             );
             $actions_tab->child(
                 reply_all => title => loc('Reply to All'),
-                path  => "/RTIR/Incident/Reply/?id=$id&SelectAllTickets=1&All=1",
+                path  => "/RTIR/Incident/Reply/?id=$id&SelectAllTickets=1&All=1&SelectedReportsAll=1&SelectedInvestigationsAll=1&SelectedBlocksAll=1",
             );
         } else {
             $actions_tab->child(
@@ -362,7 +362,7 @@ if ( $request_path =~ m{^/RTIR/(?:$re_rtir_types/)?(Display|Edit|Update)\.html$}
 
     PageMenu()->child(
         link => title => loc('Reply'),
-        path => "/RTIR/Incident/Reply/?". $query_string->( %args ),
+        path => "/RTIR/Incident/Reply/?SelectedReportsAll=1&". $query_string->( %args ),
     );
     PageMenu()->child(
         edit_search => title => loc('Edit Search'),
diff --git a/html/RTIR/Incident/Reply/index.html b/html/RTIR/Incident/Reply/index.html
index 50e03df..70e4011 100644
--- a/html/RTIR/Incident/Reply/index.html
+++ b/html/RTIR/Incident/Reply/index.html
@@ -188,15 +188,6 @@ if ( $SubmitTicket && !$checks_failure ) {
     );
 }
 
-# XXX, BLOODY-DIRTY-EVIL HACK: when we load the page first time we should
-# select all children by default, but we have no way to do that right now
-# without something like this
-foreach (qw(SelectedReports SelectedInvestigations SelectedBlocks)) {
-    if ( !exists $ARGS{ $_ } && !exists $ARGS{ $_ .'All'} ) {
-        push @{ $m->{'request_args'} }, $_ .'All' => 1;
-    }
-}
-
 my $title;
 if ($Status eq 'resolved') {
     $title = loc("Resolve Incident #[_1] (including children)", $id);
diff --git a/t/009-attachments-processing.t b/t/009-attachments-processing.t
index ed415d5..b537263 100644
--- a/t/009-attachments-processing.t
+++ b/t/009-attachments-processing.t
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 
-use RT::IR::Test tests => 77;
+use RT::IR::Test tests => 80;
 
 RT::Test->started_ok;
 my $agent = default_agent();
@@ -199,7 +199,14 @@ $agent->goto_create_rtir_ticket('Blocks');
     my $ir2_id = $agent->create_ir( {Subject => "ir1 for merging", Incident => $inc_id} );
 
     $agent->display_ticket( $inc_id);
-    $agent->follow_link_ok({text => 'Reply to Reporters'}, "go to 'Reply'");
+    $agent->follow_link_ok({text => 'Reply to Reporters'}, "go to 'Reply to Reporters'");
+    $agent->content_contains( "<input type=\"checkbox\" name=\"SelectedReportsAll\" value=\"1\" checked=\"checked\"",
+                              'Checkboxes checked for reply all');
+
+    $agent->follow_link_ok({text => 'Reply'}, "Confirm 'Reply' link returns here in same state");
+
+    $agent->content_contains( "<input type=\"checkbox\" name=\"SelectedReportsAll\" value=\"1\" checked=\"checked\"",
+                              'Checkboxes checked for reply all');
 
     my $content = "this is test";
     my $filename = tempfile($content);
@@ -226,4 +233,3 @@ $agent->goto_create_rtir_ticket('Blocks');
 
     unlink $filename or die "couldn't delete file '$filename': $!";
 }
-

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


More information about the Rt-commit mailing list