the master control program has chosen YOU to serve your system on the game grid
[freeside.git] / httemplate / elements / mcp_lint.html
1 % foreach my $lint (@lint) {
2   <FONT COLOR="#FF0000"><% $lint %></FONT><BR>
3 % }
4
5 <%init>
6
7 my(%opt) = @_;
8
9 my $conf = new FS::Conf;
10
11 my @svc = ();
12 if ( $opt{svc} ) {
13   @svc = ref($opt{svc}) ? @{ $opt{svc} } : ( $opt{svc} );
14 } elsif ( $opt{cust_main} ) {
15   my $custnum = $opt{cust_main}->custnum;
16   @svc = qsearchs({
17            'table'     => 'cust_svc',
18            'addl_from' => ' LEFT JOIN cust_pkg  USING ( pkgnum ) '.
19                           ' LEFT JOIN cust_main USING ( custnum )',
20            'hashref'   => { 'svcpart' => $conf->config('mcp_svcpart') },
21            'extra_sql' => " AND custnum = $custnum ",
22          });
23 } else {
24   die 'neither svc nor cust_main options passed to mcp_lint';
25 }
26
27 my @lint = ();
28 foreach my $svc ( @svc ) {
29   my @svc_lint = tron_lint($svc);
30   if ( scalar(@svc) > 1 ) {
31     push @lint, map $svc->title.": $_", @svc_lint;
32   } else {
33     push @lint, @svc_lint;
34   }
35 }
36
37 </%init>