summaryrefslogtreecommitdiff
path: root/httemplate/search/svc_circuit.cgi
blob: c14c55fdccc2f55e97670f7f66faac2159a85502 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<& elements/svc_Common.html,
  'title'       => 'Circuit Search Results',
  'name'        => 'circuit services',
  'query'       => $query,
  'count_query' => $query->{'count_query'},
  'redirect'    => [ popurl(2). "view/svc_circuit.html?", 'svcnum' ],
  'header'      => [ '#',
                     'Provider',
                     'Type',
                     'Termination',
                     'Circuit ID',
                     'IP Address',
                     FS::UI::Web::cust_header($cgi->param('cust_fields')),
                   ],
  'fields'      => [ 'svcnum',
                     'provider',
                     'typename',
                     'termination',
                     'circuit_id',
                     'ip_addr',
                     \&FS::UI::Web::cust_fields,
                   ],
  'links'       => [ $link,
                     '',
                     '',
                     '',
                     $link,
                     $link,
                     FS::UI::Web::cust_links($cgi->param('cust_fields')),
                   ],
  'align'       => 'rlllll'.  FS::UI::Web::cust_aligns(),
  'color'       => [ 
                     ('') x 6,
                     FS::UI::Web::cust_colors(),
                   ],
  'style'       => [ 
                     ('') x 6,
                     FS::UI::Web::cust_styles(),
                   ],

&>
<%init>

die "access denied" unless
  $FS::CurrentUser::CurrentUser->access_right('List services');

my $conf = new FS::Conf;

my %search_hash;
if ( $cgi->param('magic') eq 'unlinked' ) {
  %search_hash = ( 'unlinked' => 1 );
} else {
  foreach (qw( custnum agentnum svcpart cust_fields )) {
    $search_hash{$_} = $cgi->param($_) if $cgi->param($_);
  }
  foreach (qw(pkgpart routernum towernum sectornum)) {
    $search_hash{$_} = [ $cgi->param($_) ] if $cgi->param($_);
  }
}

my $query = FS::svc_circuit->search(\%search_hash);

my $link = [ $p.'view/svc_circuit.html?', 'svcnum' ];

</%init>