X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=rt%2Fhtml%2FSearch%2FResults.html;h=917cebfa571249a15f59d2dc9b6ba8948943bd06;hp=5849378a8f4a1b2b2640fabe486d6940b54100dc;hb=ef20b2b6b1feb47ad02b5ff7525f1a0fd11d0fa4;hpb=a513c0bef534d05f03c1242831b6f3be19b97dae diff --git a/rt/html/Search/Results.html b/rt/html/Search/Results.html index 5849378a8..917cebfa5 100755 --- a/rt/html/Search/Results.html +++ b/rt/html/Search/Results.html @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -22,7 +22,9 @@ %# %# 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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# 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. %# %# %# CONTRIBUTION SUBMISSION POLICY: @@ -43,7 +45,8 @@ %# those contributions and any derivatives thereof. %# %# END BPS TAGGED BLOCK }}} -<& /Elements/Header, Title => $title, Refresh => $session{'tickets_refresh_interval'} &> +<& /Elements/Header, Title => $title, Refresh => $session{'tickets_refresh_interval'}, + RSSAutoDiscovery => $RSSFeedURL &> <& /Ticket/Elements/Tabs, current_tab => "Search/Results.html".$QueryString, Title => $title, @@ -63,45 +66,82 @@ 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&>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] + +
<& /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); @@ -116,13 +156,12 @@ 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(); @@ -131,8 +170,8 @@ $session{'tickets'}->PrepForSerialization(); $Query => undef $Format => undef $HideResults => 0 -$Rows => 50 +$Rows => undef $Page => 1 -$OrderBy => 'id' -$Order => 'ASC' +$OrderBy => undef +$Order => undef