5 <& elements/report_svc_Common.html,
8 'table' => 'svc_something',
9 'title' => 'Page title',
12 'action' => 'svc_tablename.html', #defaults to svc_tablename.html
17 <& /elements/header.html, $title &>
19 <FORM ACTION="<% $opt{'action'} || $opt{'table'}. '.html' %>" METHOD="GET">
20 <INPUT TYPE="hidden" NAME="magic" VALUE="advanced">
21 <INPUT TYPE="hidden" NAME="custnum" VALUE="<% $custnum %>">
23 <TABLE BGCOLOR="#cccccc" CELLSPACING=0>
26 <TH CLASS="background" COLSPAN=2 ALIGN="left"><FONT SIZE="+1"><% mt('Search options') |h %></FONT></TH>
29 % unless ( $custnum ) {
30 <& /elements/tr-select-agent.html,
31 'curr_value' => scalar( $cgi->param('agentnum') ),
35 % # just this customer's domains?
36 %# <& /elements/tr-select-domain.html,
37 %# 'element_name' => 'domsvc',
38 %# 'curr_value' => scalar( $cgi->param('domsvc') ),
39 %# 'disable_empty' => 0,
43 <& /elements/tr-selectmultiple-part_pkg.html &>
45 <& /elements/tr-select-part_svc.html, 'svcdb'=>$svcdb &>
48 <TH CLASS="background" COLSPAN=2> </TH>
52 <TH CLASS="background" COLSPAN=2 ALIGN="left"><FONT SIZE="+1"><% mt('Display options') |h %></FONT></TH>
55 % #"package fields" ala advanced svc_acct search?
56 % #move to /elements/tr-select-cust_pkg-fields and use it from there if so...
58 <& /elements/tr-select-cust-fields.html &>
63 <INPUT TYPE="submit" VALUE="<% mt('Get Report') |h %>">
67 <& /elements/footer.html &>
72 my $svcdb = $opt{'table'};
74 my $name = "FS::$svcdb"->table_info->{'name_plural'}
75 || PL( "FS::$svcdb"->table_info->{'name'} );
78 unless $FS::CurrentUser::CurrentUser->access_right("Services: $name: Advanced search");
80 my $title = $opt{'title'};
82 #false laziness w/report_cust_pkg.html
84 if ( $cgi->param('custnum') =~ /^(\d+)$/ ) {
86 my $cust_main = qsearchs({
87 'table' => 'cust_main',
88 'hashref' => { 'custnum' => $custnum },
89 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql,
90 }) or die "unknown custnum $custnum";
91 $title = mt("$title: [_1]", $cust_main->name);