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

Ruslan Zakirov ruz at bestpractical.com
Thu May 23 07:41:56 EDT 2013


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

- Log -----------------------------------------------------------------
commit fddd7cfafa1fa2963f4fea7ff3bd79a1611a3a74
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..94ac180 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