[Rt-commit] rt branch, 4.0/update-check-all-flag, created. rt-4.0.7-60-gf231fd2

Jim Brandt jbrandt at bestpractical.com
Mon Oct 1 16:01:54 EDT 2012


The branch, 4.0/update-check-all-flag has been created
        at  f231fd2d44ab9dedabe1623c4e24677e813e4e45 (commit)

- Log -----------------------------------------------------------------
commit f231fd2d44ab9dedabe1623c4e24677e813e4e45
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Mon Oct 1 14:45:25 2012 -0400

    Update check all flag in Checkbox handling
    
    Previously, the checkbox code looked for keys in %ARGS like
    'SelectedReportsAll' and 'SelectedInvestigationsAll' and
    set all checkboxes to 'checked' if found. Updates to
    use the new $DECODED_ARGS broke this because the
    '...All' flags were being injected into the request_args hash
    in an RTIR template so they weren't present when $DECODED_ARGS
    is populated.
    
    Update to look instead for a 'SelectAllTickets' flag which comes
    through as a true argument in the request to the RTIR page,
    and thus is present in $DECODED_ARGS.
    
    This fixes 4 failing tests in the RTIR test suite, 2 each in:
    009-attachments-processing.t and incident/abandon.t

diff --git a/share/html/Elements/ColumnMap b/share/html/Elements/ColumnMap
index 7295e3f..77c8788 100644
--- a/share/html/Elements/ColumnMap
+++ b/share/html/Elements/ColumnMap
@@ -116,7 +116,8 @@ my $COLUMN_MAP = {
     CheckBox => {
         title => sub {
             my $name = $_[1] || 'SelectedTickets';
-            my $checked = $DECODED_ARGS->{ $name .'All' }? 'checked="checked"': '';
+
+            my $checked = $DECODED_ARGS->{'SelectAllTickets'} ? 'checked="checked"' : '';
 
             return \qq{<input type="checkbox" name="}, $name, \qq{All" value="1" $checked
                               onclick="setCheckbox(this.form, },
@@ -128,7 +129,7 @@ my $COLUMN_MAP = {
 
             my $name = $_[2] || 'SelectedTickets';
             return \qq{<input type="checkbox" name="}, $name, \qq{" value="$id" checked="checked" />}
-                if $DECODED_ARGS->{ $name . 'All'};
+                if $DECODED_ARGS->{'SelectAllTickets'};
 
             my $arg = $DECODED_ARGS->{ $name };
             my $checked = '';

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


More information about the Rt-commit mailing list