summaryrefslogtreecommitdiff
path: root/httemplate/view/svc_circuit.cgi
blob: 500993ece898802a22d8940ce12ff41773b67073 (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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<& elements/svc_Common.html,
  'table'       => 'svc_circuit',
  'labels'      => \%labels,
  'fields'      => \@fields,
  'html_foot'   => sub { $self->call_method('.foot', @_) },
  'edit_url'    => $fsurl.'edit/svc_circuit.html?',
&>
<%method .foot>
% my $svc_circuit = shift;
% my $link = [ 'svc_phone.cgi?', 'svcnum' ];
% if ( FS::svc_phone->count('circuit_svcnum = '.$svc_circuit->svcnum) ) {
<& /search/elements/search.html,

  'title' => 'Provisioned phone services',
  'name_singular' => 'phone number',
  'query' => { 'table'      => 'svc_phone',
               'hashref'    => { 'circuit_svcnum' => $svc_circuit->svcnum },
               'addl_from'  => ' LEFT JOIN cust_svc USING (svcnum)'.
                               ' LEFT JOIN part_svc USING (svcpart)',
               'select'     => 'svc_phone.*, part_svc.*',
             },
  'count_query' => 'SELECT COUNT(*) FROM svc_phone WHERE circuit_svcnum = '.
                    $svc_circuit->svcnum,
  'header' => [ '#', 'Service', 'Phone number', ],
  'fields' => [ 'svcnum', 'svc', 'phonenum' ],
  'links'  => [ $link, $link, $link ],
  'align'  => 'rlr',

  'html_form' => '<SPAN CLASS="fsinnerbox-title">Phone services</SPAN>',
  'nohtmlheader' => 1,
  'disable_total' => 1,
  'disable_maxselect' => 1,
  'really_disable_download' => 1,
&>
  <BR>
% }
</%method>
<%init>

my @fields = (
  'circuit_id',
  { field     => 'providernum',
    type      => 'select-table',
    table     => 'circuit_provider',
    name_col  => 'provider',
  },
  { field     => 'typenum',
    type      => 'select-table',
    table     => 'circuit_type',
    name_col  => 'typename',
  },
  { field     => 'termnum',
    type      => 'select-table',
    table     => 'circuit_termination',
    name_col  => 'termination',
  },
  qw( vendor_qual_id vendor_order_id vendor_order_type vendor_order_status ),
  { field     => 'desired_due_date', type => 'date' },
  { field     => 'due_date', type => 'date' },
  'endpoint_ip_addr',
  { field     => 'endpoint_mac_addr', type => 'mac_addr' },
  'internal_circuit_id',
);


my %labels = (
  circuit_id          => 'Provider Circuit ID',
  providernum         => 'Provider',
  typenum             => 'Circuit type',
  termnum             => 'Termination',
  vendor_qual_id      => 'Qualification ID',
  vendor_order_id     => 'Order ID',
  vendor_order_type   => 'Order type',
  vendor_order_status => 'Order status',
  desired_due_date    => 'Desired due date',
  due_date            => 'Due date',
  endpoint_ip_addr    => 'Endpoint IP address',
  endpoint_mac_addr   => 'MAC address',
  internal_circuit_id => 'Internal Circuit Id',
);

my $self = $m->request_comp;
</%init>