[Rt-commit] [svn] r1141 - in rt/branches/rt-3.1: html/Search
html/Ticket/Elements lib/RT
alexmv at pallas.eruditorum.org
alexmv at pallas.eruditorum.org
Thu Jun 24 03:48:40 EDT 2004
Author: alexmv
Date: Thu Jun 24 03:48:39 2004
New Revision: 1141
Modified:
rt/branches/rt-3.1/html/Search/Build.html
rt/branches/rt-3.1/html/Search/Results.html
rt/branches/rt-3.1/html/Ticket/Elements/Tabs
rt/branches/rt-3.1/lib/RT/Tickets_Overlay.pm
Log:
* Further changes to keep sort order
* Remove RT::Tickets_Overlay::ItemsArrayRef, which seemed to only
duplicate the effect of RT::SearchBuilder but without the OrderBy
feature.
Modified: rt/branches/rt-3.1/html/Search/Build.html
==============================================================================
--- rt/branches/rt-3.1/html/Search/Build.html (original)
+++ rt/branches/rt-3.1/html/Search/Build.html Thu Jun 24 03:48:39 2004
@@ -24,9 +24,11 @@
<& /Elements/Header, Title => $title &>
<& /Ticket/Elements/Tabs,
current_tab => "Search/Build.html".$QueryString,
- Title => $title, Format => $Format,
+ Title => $title,
+ Format => $Format,
Query => $Query,
Rows => $ARGS{'Rows'},
+ OrderBy => $ARGS{'OrderBy'}
&>
<table width=100%>
@@ -106,6 +108,7 @@
$Format ||= $search_hash->{'Format'};
$Description ||= $search_hash->{'Description'};
$SearchId ||= $search_hash->{'SearchId'} || 'new';
+ $ARGS{'OrderBy'} ||= $search_hash->{'OrderBy'} || 'id';
$search ||= $search_hash->{'Object'};
}
@@ -732,6 +735,7 @@
$search_hash->{'Query'} = $Query;
$search_hash->{'Description'} = $Description;
$search_hash->{'Object'} = $search;
+$search_hash->{'OrderBy'} = $ARGS{'OrderBy'};
$session{'CurrentSearchHash'} = $search_hash;
# }}}
Modified: rt/branches/rt-3.1/html/Search/Results.html
==============================================================================
--- rt/branches/rt-3.1/html/Search/Results.html (original)
+++ rt/branches/rt-3.1/html/Search/Results.html Thu Jun 24 03:48:39 2004
@@ -53,9 +53,14 @@
$session{'i'}++;
$session{'tickets'} = RT::Tickets->new($session{'CurrentUser'}) unless ($session{'tickets'});
$session{'tickets'}->FromSQL($Query) if ($Query);
+$session{'tickets'}->OrderBy(FIELD => $OrderBy, ORDER => $Order);
-
-
+if ($OrderBy ne $session{'CurrentSearchHash'}->{'OrderBy'}
+ or $Order ne $session{'CurrentSearchHash'}->{'Order'}) {
+ $session{'CurrentSearchHash'}->{'OrderBy'} = $OrderBy;
+ $session{'CurrentSearchHash'}->{'Order'} = $Order;
+ undef $session{'tickets'}->{'item_map'};
+}
if ( $session{'tickets'}->Query()) {
Modified: rt/branches/rt-3.1/html/Ticket/Elements/Tabs
==============================================================================
--- rt/branches/rt-3.1/html/Ticket/Elements/Tabs (original)
+++ rt/branches/rt-3.1/html/Ticket/Elements/Tabs Thu Jun 24 03:48:39 2004
@@ -159,10 +159,10 @@
my $args = "?" . $m->comp(
'/Elements/QueryString',
- Query => $ARGS{'Query'} || $session{'CurrentSearchHash'}->{'Query'},
- Format => $ARGS{'Format'} || $session{'CurrentSearchHash'}->{'Format'},
- OrderBy => $ARGS{'OrderBy'},
- Order => $ARGS{'Order'},
+ Query => $ARGS{'Query'} || $session{'CurrentSearchHash'}->{'Query'},
+ Format => $ARGS{'Format'} || $session{'CurrentSearchHash'}->{'Format'},
+ OrderBy => $ARGS{'OrderBy'} || $session{'CurrentSearchHash'}->{'OrderBy'},
+ Order => $ARGS{'Order'} || $session{'CurrentSearchHash'}->{'Order'},
Rows => $ARGS{'Rows'},
) if ($ARGS{'Query'} or $session{'CurrentSearchHash'}->{'Query'});
Modified: rt/branches/rt-3.1/lib/RT/Tickets_Overlay.pm
==============================================================================
--- rt/branches/rt-3.1/lib/RT/Tickets_Overlay.pm (original)
+++ rt/branches/rt-3.1/lib/RT/Tickets_Overlay.pm Thu Jun 24 03:48:39 2004
@@ -1781,31 +1781,6 @@
# }}}
-# {{{ sub ItemsArrayRef
-
-=head2 ItemsArrayRef
-
-Returns a reference to the set of all items found in this search
-
-=cut
-
-sub ItemsArrayRef {
- my $self = shift;
- my @items;
-
- unless ( $self->{'items_array'} ) {
-
- my $placeholder = $self->_ItemsCounter;
- $self->GotoFirstItem();
- while ( my $item = $self->Next ) {
- push ( @{ $self->{'items_array'} }, $item );
- }
- $self->GotoItem($placeholder);
- }
- return ( $self->{'items_array'} );
-}
-# }}}
-
# {{{ sub Next
sub Next {
my $self = shift;
More information about the Rt-commit
mailing list