3 %# Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com>
5 %# (Except where explictly superceded by other copyright notices)
7 %# This work is made available to you under the terms of Version 2 of
8 %# the GNU General Public License. A copy of that license should have
9 %# been provided with this software, but in any event can be snarfed
12 %# This work is distributed in the hope that it will be useful, but
13 %# WITHOUT ANY WARRANTY; without even the implied warranty of
14 %# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 %# General Public License for more details.
17 %# Unless otherwise specified, all modifications, corrections or
18 %# extensions to this work which alter its source code become the
19 %# property of Best Practical Solutions, LLC when submitted for
20 %# inclusion in the work.
24 <& /Elements/Header, Title=>loc("RT at a glance"), Refresh => $session{'home_refresh_interval'} &>
27 Title=>loc("RT at a glance") &>
28 <TABLE BORDER=0 WIDTH=100%>
31 <& /Elements/MyTickets &>
33 <& /Elements/MyRequests &>
36 <& /Elements/Quicksearch &>
38 <form method=get action="index.html">
39 <& /Elements/Refresh, Name => 'HomeRefreshInterval', Default => $session {'home_refresh_interval'} &>
40 <div align=right><input type=submit value="<&|/l&>Go!</&>"></div>
47 my $query = $ARGS{'q'};
49 if ( $query =~ m/^\s*(\d+)\s*$/ ) {
50 $m->redirect("$RT::WebPath/Ticket/Display.html?id=$1");
53 $session{'tickets'} = RT::Tickets->new( $session{'CurrentUser'} );
55 if ( $query =~ m/\@/ ) {
56 $session{'tickets'}->LimitWatcher( VALUE => $query,
59 $m->redirect("$RT::WebPath/Search/Listing.html");
63 # Any search on queue name or subject will be for new/open tickets
66 $session{'tickets'}->LimitStatus( VALUE => $_,
67 OPERATOR => '=', ) for qw(open new);
69 my $queue = RT::Queue->new( $session{'CurrentUser'} );
70 if ( $queue->Load($query) && $queue->Id ) {
71 $session{'tickets'}->LimitQueue( VALUE => $queue->Id,
73 $m->redirect("$RT::WebPath/Search/Listing.html");
75 $session{'tickets'}->LimitSubject( VALUE => $query,
78 $m->redirect("$RT::WebPath/Search/Listing.html");
81 if ($ARGS{'HomeRefreshInterval'}) {
82 $session{'home_refresh_interval'} = $ARGS{'HomeRefreshInterval'};