[Rt-commit] r4783 - rt/branches/3.5-TESTING/html/Prefs

ruz at bestpractical.com ruz at bestpractical.com
Mon Mar 20 19:26:01 EST 2006


Author: ruz
Date: Mon Mar 20 19:26:00 2006
New Revision: 4783

Modified:
   rt/branches/3.5-TESTING/html/Prefs/Search.html
   rt/branches/3.5-TESTING/html/Prefs/SearchOptions.html

Log:
* fix for multiple OrderBy on edit
** backport r4622 from 3.7

Modified: rt/branches/3.5-TESTING/html/Prefs/Search.html
==============================================================================
--- rt/branches/3.5-TESTING/html/Prefs/Search.html	(original)
+++ rt/branches/3.5-TESTING/html/Prefs/Search.html	Mon Mar 20 19:26:00 2006
@@ -75,7 +75,7 @@
 my $title = loc("Customize").' ';
 
 my @fields = qw(Format Order OrderBy RowsPerPage);
-my ($class, $id) = $ARGS{name} =~ m/^(.*)-(\d+)$/;
+my ($class, $id) = ( $ARGS{name} =~ m/^(.*)-(\d+)$/ );
 
 Abort('No search specified')
     unless $class eq 'RT::Attribute';
@@ -88,6 +88,9 @@
 for (@fields) {
     $ARGS{$_} = $SearchArg->{$_} unless defined $ARGS{$_};
 }
+$ARGS{'Order'} = join '|', grep defined && /\S/, (ref $ARGS{'Order'})? @{$ARGS{'Order'}}: $ARGS{'Order'};
+$ARGS{'OrderBy'} = join '|', grep defined && /\S/, (ref $ARGS{'OrderBy'})? @{$ARGS{'OrderBy'}}: $ARGS{'OrderBy'};
+
 my ( $AvailableColumns, $CurrentFormat );
 ( $ARGS{Format}, $AvailableColumns, $CurrentFormat ) = $m->comp(
     '/Search/Elements/BuildFormatString',

Modified: rt/branches/3.5-TESTING/html/Prefs/SearchOptions.html
==============================================================================
--- rt/branches/3.5-TESTING/html/Prefs/SearchOptions.html	(original)
+++ rt/branches/3.5-TESTING/html/Prefs/SearchOptions.html	Mon Mar 20 19:26:00 2006
@@ -66,14 +66,16 @@
 <%INIT>
 
 # {{{ If we're saving search preferences, do that now
+$Order = join '|', grep defined && /\S/, (ref $Order)? @{$Order}: $Order;
+$OrderBy = join '|', grep defined && /\S/, (ref $OrderBy)? @{$OrderBy}: $OrderBy;
 
 if ($ARGS{'SavePreferences'}) {
     $session{'CurrentUser'}->UserObj->SetPreferences("SearchDisplay",
     {
-       Format      => $ARGS{'Format'},
-       Order       => $ARGS{'Order'},
-       OrderBy     => $ARGS{'OrderBy'},
-       RowsPerPage => $ARGS{'RowsPerPage'}
+       Format      => $Format,
+       Order       => $Order,
+       OrderBy     => $OrderBy,
+       RowsPerPage => $RowsPerPage,
     });
 }
 
@@ -86,13 +88,12 @@
 
 
 # Read from user preferences
-my $prefs = $session{'CurrentUser'}->UserObj->Preferences("SearchDisplay") || {}
-;
+my $prefs = $session{'CurrentUser'}->UserObj->Preferences("SearchDisplay") || {};
 
 $Format      ||= $prefs->{'Format'};
 $Order       ||= $prefs->{'Order'} || 'ASC';
 $OrderBy     ||= $prefs->{'OrderBy'} || 'id';
-($RowsPerPage =  defined( $prefs->{'RowsPerPage'}) ? $prefs->{'RowsPerPage'}  : 50) unless defined ($RowsPerPage);
+($RowsPerPage =  defined( $prefs->{'RowsPerPage'} ) ? $prefs->{'RowsPerPage'}  : 50) unless defined ($RowsPerPage);
 
 my ( $AvailableColumns, $CurrentFormat );
 ( $Format, $AvailableColumns, $CurrentFormat ) = $m->comp(


More information about the Rt-commit mailing list