signup with agent selection
[freeside.git] / rt / html / index.html
1 %# BEGIN LICENSE BLOCK
2 %# 
3 %# Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com>
4 %# 
5 %# (Except where explictly superceded by other copyright notices)
6 %# 
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
10 %# from www.gnu.org.
11 %# 
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.
16 %# 
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.
21 %# 
22 %# 
23 %# END LICENSE BLOCK
24 <& /Elements/Header, Title=>loc("RT at a glance"), Refresh => $session{'home_refresh_interval'} &>
25 <& /Elements/Tabs, 
26     current_toptab => '', 
27     Title=>loc("RT at a glance") &>
28 <TABLE BORDER=0 WIDTH=100%>
29 <TR VALIGN=TOP>
30 <TD WIDTH=70%>
31 <& /Elements/MyTickets &>
32 <BR>
33 <& /Elements/MyRequests &>
34 </TD>
35 <TD>
36 <& /Elements/Quicksearch &>
37 <BR>
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>
41 </form>
42 </TD>
43 </TR>
44 </TABLE>
45 <%init>
46 if ( $ARGS{'q'} ) {
47     my $query = $ARGS{'q'};
48
49     if ( $query =~ m/^\s*(\d+)\s*$/ ) {
50         $m->redirect("$RT::WebPath/Ticket/Display.html?id=$1");
51     }
52
53     $session{'tickets'} = RT::Tickets->new( $session{'CurrentUser'} );
54
55     if ( $query =~ m/\@/ ) {
56         $session{'tickets'}->LimitRequestor( VALUE    => $query,
57                                              OPERATOR => '=', );
58         $m->redirect("$RT::WebPath/Search/Listing.html");
59     }
60
61     #
62     # Any search on queue name or subject will be for new/open tickets
63     # only.
64     #
65     $session{'tickets'}->LimitStatus( VALUE    => $_,
66                                       OPERATOR => '=', ) for qw(open new);
67
68     my $queue = RT::Queue->new( $session{'CurrentUser'} );
69     if ( $queue->Load($query) && $queue->Id ) {
70         $session{'tickets'}->LimitQueue( VALUE    => $queue->Id,
71                                          OPERATOR => '=', );
72         $m->redirect("$RT::WebPath/Search/Listing.html");
73     }
74     $session{'tickets'}->LimitSubject( VALUE    =>  $query,
75                                        OPERATOR => 'LIKE' );
76
77     $m->redirect("$RT::WebPath/Search/Listing.html");
78 }
79
80 if ($ARGS{'HomeRefreshInterval'}) {
81         $session{'home_refresh_interval'} = $ARGS{'HomeRefreshInterval'};
82 }
83
84 </%init>