3 my $conf = new FS::Conf;
5 my($query)=$cgi->keywords;
6 $query ||= ''; #to avoid use of unitialized value errors
8 if ( $query eq 'svcnum' ) {
9 $orderby = 'ORDER BY svcnum';
11 eidiot('unimplemented');
14 my $count_query = 'SELECT COUNT(*) FROM svc_forward';
16 'table' => 'svc_forward',
18 'extra_sql' => $orderby,
21 # <TH>Service #<BR><FONT SIZE=-1>(click to view forward)</FONT></TH>
22 # <TH>Mail to<BR><FONT SIZE=-1>(click to view account)</FONT></TH>
23 # <TH>Forwards to<BR><FONT SIZE=-1>(click to view account)</FONT></TH>
25 my $link = [ "${p}/view/svc_forward.cgi?", 'svcnum' ];
27 my $format_src = sub {
28 my $svc_forward = shift;
29 if ( $svc_forward->srcsvc_acct ) {
30 $svc_forward->srcsvc_acct->email;
32 my $src = $svc_forward->src;
33 $src = "<I>(anything)</I>$src" if $src =~ /^@/;
39 my $svc_forward = shift;
40 if ( $svc_forward->srcsvc_acct ) {
41 [ "${p}view/svc_acct.cgi?", 'srcsvc' ];
47 my $format_dst = sub {
48 my $svc_forward = shift;
49 if ( $svc_forward->dstsvc_acct ) {
50 $svc_forward->dstsvc_acct->email;
57 my $svc_forward = shift;
58 if ( $svc_forward->dstsvc_acct ) {
59 [ "${p}view/svc_acct.cgi?", 'dstsvc' ];
65 #this would quite a bit more efficient as a left join as part of the main query
66 my $format_cust = sub {
67 my $svc_forward = shift;
68 my $cust_pkg = $svc_forward->cust_svc->cust_pkg;
70 $cust_pkg->cust_main->name;
77 my $svc_forward = shift;
78 my $cust_pkg = $svc_forward->cust_svc->cust_pkg;
80 [ "${p}view/cust_main.cgi?", sub { shift->cust_svc->cust_pkg->custnum } ];
86 %><%= include ('elements/search.html',
87 'title' => "Mail forward Search Results",
88 'name' => 'mail forwards',
89 'query' => $sql_query,
90 'count_query' => $count_query,
97 'fields' => [ 'svcnum',