X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=rt%2Fhtml%2FSearch%2FResults.html;fp=rt%2Fhtml%2FSearch%2FResults.html;h=5849378a8f4a1b2b2640fabe486d6940b54100dc;hb=9c68254528b6f2c7d8c1921b452fa56064783782;hp=917cebfa571249a15f59d2dc9b6ba8948943bd06;hpb=ef20b2b6b1feb47ad02b5ff7525f1a0fd11d0fa4;p=freeside.git diff --git a/rt/html/Search/Results.html b/rt/html/Search/Results.html index 917cebfa5..5849378a8 100755 --- a/rt/html/Search/Results.html +++ b/rt/html/Search/Results.html @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -22,9 +22,7 @@ %# %# You should have received a copy of the GNU General Public License %# along with this program; if not, write to the Free Software -%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -%# 02110-1301 or visit their web page on the internet at -%# http://www.gnu.org/copyleft/gpl.html. +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. %# %# %# CONTRIBUTION SUBMISSION POLICY: @@ -45,8 +43,7 @@ %# those contributions and any derivatives thereof. %# %# END BPS TAGGED BLOCK }}} -<& /Elements/Header, Title => $title, Refresh => $session{'tickets_refresh_interval'}, - RSSAutoDiscovery => $RSSFeedURL &> +<& /Elements/Header, Title => $title, Refresh => $session{'tickets_refresh_interval'} &> <& /Ticket/Elements/Tabs, current_tab => "Search/Results.html".$QueryString, Title => $title, @@ -66,82 +63,45 @@ BaseURL => $RT::WebPath."/Search/Results.html?" &> -% my %hiddens = (Query => $Query, Format => $Format, Rows => $Rows, OrderBy => $OrderBy, Order => $Order, HideResults => $HideResults, Page => $Page ); -
-
-%foreach my $key (keys(%hiddens)) { - -%} +
+ + + + + + + + <& /Elements/Refresh, Name => 'TicketsRefreshInterval', Default => $session {'tickets_refresh_interval'} &> - +
-
-<&|/l&>Update multiple tickets
-<&|/l&>Bookmarkable link
+
+<&|/l&>Update multiple tickets
+<&|/l&>Bookmarkable link
<&|/l&>spreadsheet | -<&|/l&>RSS | -<&|/l&>Work offline
-
<&|/l&>chart -% %hiddens = (Query => $Query, Format => $Format, Rows => $Rows, OrderBy => $OrderBy, Order => $Order); -%foreach my $key (keys(%hiddens)) { - -%} -<&|/l, $m->scomp('Elements/SelectGroupBy', Name => 'PrimaryGroupBy', Query => $Query) &>grouped by [_1] -<&|/l, $m->scomp('Elements/SelectChartType', Name => 'ChartStyle') &>style: [_1] - -
+<&|/l&>RSS | +<&|/l&>Work offline
<& /Elements/Callback, _CallbackName => 'SearchActions', QueryString => $QueryString&>
<%INIT> -# Read from user preferences -my $prefs = $session{'CurrentUser'}->UserObj->Preferences("SearchDisplay") || {}; - -# These variables are what define a search_hash; this is also -# where we give sane defaults. -$Format ||= $prefs->{'Format'}; -$Order ||= $prefs->{'Order'} || 'ASC'; -$OrderBy ||= $prefs->{'OrderBy'} || 'id'; - -# Some forms pass in "RowsPerPage" rather than "Rows" -# We call it RowsPerPage everywhere else. - -if ( !defined($Rows) ) { - if ( $ARGS{'RowsPerPage'} ) { - $Rows = $ARGS{'RowsPerPage'}; - } elsif ( defined $prefs->{'RowsPerPage'} ) { - $Rows = $prefs->{'RowsPerPage'}; - } else { - $Rows = 50; - } -} - my ($title, $ticketcount); $session{'i'}++; $session{'tickets'} = RT::Tickets->new($session{'CurrentUser'}) ; $session{'tickets'}->FromSQL($Query) if ($Query); +$session{'tickets'}->OrderBy(FIELD => $OrderBy, ORDER => $Order); -if ($OrderBy =~ /\|/) { - # Multiple Sorts - my @OrderBy = split /\|/,$OrderBy; - my @Order = split /\|/,$Order; - $session{'tickets'}->OrderByCols( - map { { FIELD => $OrderBy[$_], ORDER => $Order[$_] } } ( 0 - .. $#OrderBy ) );; -} else { - $session{'tickets'}->OrderBy(FIELD => $OrderBy, ORDER => $Order); -} $session{'CurrentSearchHash'} = { Format => $Format, Query => $Query, - Page => $Page, Order => $Order, OrderBy => $OrderBy, RowsPerPage => $Rows }; + if ( $session{'tickets'}->Query()) { $ticketcount = $session{tickets}->CountAll(); $title = loc('Found [quant,_1,ticket]', $ticketcount); @@ -156,12 +116,13 @@ my $QueryString = "?".$m->comp('/Elements/QueryString', OrderBy => $OrderBy, Order => $Order, Page => $Page); + my $ShortQueryString = "?".$m->comp('/Elements/QueryString', Query => $Query); -my $RSSFeedURL = "$RT::WebPath/Search/Results.rdf$ShortQueryString"; if ($ARGS{'TicketsRefreshInterval'}) { $session{'tickets_refresh_interval'} = $ARGS{'TicketsRefreshInterval'}; } + <%CLEANUP> $session{'tickets'}->PrepForSerialization(); @@ -170,8 +131,8 @@ $session{'tickets'}->PrepForSerialization(); $Query => undef $Format => undef $HideResults => 0 -$Rows => undef +$Rows => 50 $Page => 1 -$OrderBy => undef -$Order => undef +$OrderBy => 'id' +$Order => 'ASC'