%doc> Example: <& elements/report_svc_Common.html, #required 'table' => 'svc_something', 'title' => 'Page title', #optional 'action' => 'svc_tablename.html', #defaults to svc_tablename.html &> %doc> <& /elements/header.html, $title &>
<& /elements/footer.html &> <%init> my(%opt) = @_; my $svcdb = $opt{'table'}; my $name = "FS::$svcdb"->table_info->{'name_plural'} || PL( "FS::$svcdb"->table_info->{'name'} ); die "access denied" unless $FS::CurrentUser::CurrentUser->access_right("Services: $name: Advanced search"); my $title = $opt{'title'}; #false laziness w/report_cust_pkg.html my( $custnum, $cust_main) = ('', ''); if ( $cgi->param('custnum') =~ /^(\d+)$/ ) { $custnum = $1; my $cust_main = qsearchs({ 'table' => 'cust_main', 'hashref' => { 'custnum' => $custnum }, 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql, }) or die "unknown custnum $custnum"; $title = mt("$title: [_1]", $cust_main->name); } %init>