[Rt-commit] r5133 - in rt/branches/3.5-TESTING: .
jesse at bestpractical.com
jesse at bestpractical.com
Fri Apr 28 12:29:02 EDT 2006
Author: jesse
Date: Fri Apr 28 12:29:01 2006
New Revision: 5133
Modified:
rt/branches/3.5-TESTING/ (props changed)
rt/branches/3.5-TESTING/html/Search/Bulk.html
rt/branches/3.5-TESTING/html/Search/Results.tsv
Log:
r12020 at hualien: jesse | 2006-04-28 12:28:09 -0400
David Schweikert pointed out that the new sorting behaviour can break the Bulk update page (and by extension, the spreadsheet download)
Modified: rt/branches/3.5-TESTING/html/Search/Bulk.html
==============================================================================
--- rt/branches/3.5-TESTING/html/Search/Bulk.html (original)
+++ rt/branches/3.5-TESTING/html/Search/Bulk.html Fri Apr 28 12:29:01 2006
@@ -213,7 +213,19 @@
my $Tickets = RT::Tickets->new( $session{'CurrentUser'} );
$Tickets->FromSQL($Query);
-$Tickets->OrderBy( FIELD => $OrderBy, ORDER => $Order );
+if ( $OrderBy =~ /\|/ ) {
+
+ # Multiple Sorts
+ my @OrderBy = split /\|/, $OrderBy;
+ my @Order = split /\|/, $Order;
+ $Tickets->OrderByCols(
+ map { { FIELD => $OrderBy[$_], ORDER => $Order[$_] } }
+ ( 0 .. $#OrderBy ) );
+}
+else {
+ $Tickets->OrderBy( FIELD => $OrderBy, ORDER => $Order );
+}
+
$Tickets->RowsPerPage($Rows) if ($Rows);
$Tickets->GotoPage( $Page - 1 ); # SB uses page 0 as the first page
Modified: rt/branches/3.5-TESTING/html/Search/Results.tsv
==============================================================================
--- rt/branches/3.5-TESTING/html/Search/Results.tsv (original)
+++ rt/branches/3.5-TESTING/html/Search/Results.tsv Fri Apr 28 12:29:01 2006
@@ -43,17 +43,33 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
+<%ARGS>
+$OrderBy => 'id'
+$Order => 'ASC'
+</%ARGS>
<%INIT>
-my $Tickets = RT::Tickets->new($session{'CurrentUser'});
-$Tickets->FromSQL($ARGS{'Query'});
+my $Tickets = RT::Tickets->new( $session{'CurrentUser'} );
+$Tickets->FromSQL( $ARGS{'Query'} );
+if ( $OrderBy =~ /\|/ ) {
+
+ # Multiple Sorts
+ my @OrderBy = split /\|/, $OrderBy;
+ my @Order = split /\|/, $Order;
+ $Tickets->OrderByCols(
+ map { { FIELD => $OrderBy[$_], ORDER => $Order[$_] } }
+ ( 0 .. $#OrderBy ) );
+}
+else {
+ $Tickets->OrderBy( FIELD => $OrderBy, ORDER => $Order );
+}
my @rows;
my %known_cfs;
my @attrs = qw( id QueueObj->Name Subject Status TimeEstimated TimeWorked TimeLeft Priority FinalPriority OwnerObj->Name
Requestors->MemberEmailAddressesAsString DueObj->ISO ToldObj->ISO
- CreatedObj->ISO ResolvedObj->ISO );
+ CreatedObj->ISO ResolvedObj->ISO LastUpdatedObj->ISO);
$r->content_type('application/vnd.ms-excel');
while ( my $Ticket = $Tickets->Next()) {
More information about the Rt-commit
mailing list