[Rt-commit] rt branch, 4.2/top-checkbox-on-bulk-update, created. rt-4.1.8-269-gcf8ee85

Alex Vandiver alexmv at bestpractical.com
Thu Jun 13 20:04:10 EDT 2013


The branch, 4.2/top-checkbox-on-bulk-update has been created
        at  cf8ee85f5873cd84c83973f4ac95130fd67e4747 (commit)

- Log -----------------------------------------------------------------
commit cf8ee85f5873cd84c83973f4ac95130fd67e4747
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Tue May 14 18:00:20 2013 +0400

    use CheckBox column map on Bulk update page
    
    This gives us [de]select all tickets checkbox at the top
    of the page.

diff --git a/share/html/Search/Bulk.html b/share/html/Search/Bulk.html
index e361550..30335e1 100644
--- a/share/html/Search/Bulk.html
+++ b/share/html/Search/Bulk.html
@@ -55,8 +55,8 @@
 %}
 <& /Elements/CollectionList, 
     Query => $Query,
-    DisplayFormat => $Format,
-    Format => $ARGS{'Format'},
+    DisplayFormat => $DisplayFormat,
+    Format => $Format,
     Verbatim => 1,
     AllowSorting => 1,
     OrderBy => $OrderBy,
@@ -71,7 +71,7 @@
 
 <hr />
 
-<& /Elements/Submit, Label => loc('Update'), CheckboxNameRegex => '/^UpdateTicket\d+$/', CheckAll => 1, ClearAll => 1 &>
+<& /Elements/Submit, Label => loc('Update'), CheckboxNameRegex => '/^UpdateTicket(All)?$/', CheckAll => 1, ClearAll => 1 &>
 <br />
 <&|/Widgets/TitleBox, title => $title &>
 <table>
@@ -232,8 +232,10 @@ $Page ||= 1;
 
 $Format ||= RT->Config->Get('DefaultSearchResultFormat');
 
-# inject _CHECKBOX to the first field.
-$Format =~ s/'?([^']+)'?,/'___CHECKBOX__$1',/;
+my $DisplayFormat = "'__CheckBox.{UpdateTicket}__',". $Format;
+$DisplayFormat =~ s/\s*,\s*('?__NEWLINE__'?)/,$1,''/gi;
+
+$DECODED_ARGS->{'UpdateTicketAll'} = 1 unless @UpdateTicket;
 
 my $Tickets = RT::Tickets->new( $session{'CurrentUser'} );
 $Tickets->FromSQL($Query);
@@ -277,7 +279,8 @@ $Tickets->RedoSearch();
 
 unless ( $ARGS{'AddMoreAttach'} ) {
     while ( my $Ticket = $Tickets->Next ) {
-        next unless ( $ARGS{ "UpdateTicket" . $Ticket->Id } );
+        my $tid = $Ticket->id;
+        next unless grep $tid == $_, @UpdateTicket;
 
         #Update the links
         $ARGS{'id'} = $Ticket->id;
@@ -375,4 +378,5 @@ $OrderBy => 'id'
 $Query => undef
 $SavedSearchId => undef
 $SavedChartSearchId => undef
+ at UpdateTicket => ()
 </%args>

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


More information about the Rt-commit mailing list