Merge branch 'master' of git.freeside.biz:/home/git/freeside
[freeside.git] / httemplate / view / svc_circuit.html
1 <& elements/svc_Common.html,
2   'table'        => 'svc_circuit',
3   'labels'       => \%labels,
4   'fields'       => \@fields,
5   'html_foot'    => sub { $self->call_method('.foot', @_) },
6 &>
7 <%method .foot>
8 % my $svc_circuit = shift;
9 % my $link = [ 'svc_phone.cgi?', 'svcnum' ];
10 % if ( FS::svc_phone->count('circuit_svcnum = '.$svc_circuit->svcnum) ) {
11 <& /search/elements/search.html,
12
13   'title' => 'Provisioned phone services',
14   'name_singular' => 'phone number',
15   'query' => { 'table'      => 'svc_phone',
16                'hashref'    => { 'circuit_svcnum' => $svc_circuit->svcnum },
17                'addl_from'  => ' LEFT JOIN cust_svc USING (svcnum)'.
18                                ' LEFT JOIN part_svc USING (svcpart)',
19                'select'     => 'svc_phone.*, part_svc.*',
20              },
21   'count_query' => 'SELECT COUNT(*) FROM svc_phone WHERE circuit_svcnum = '.
22                     $svc_circuit->svcnum,
23   'header' => [ '#', 'Service', 'Phone number', ],
24   'fields' => [ 'svcnum', 'svc', 'phonenum' ],
25   'links'  => [ $link, $link, $link ],
26   'align'  => 'rlr',
27
28   'html_form' => '<SPAN CLASS="fsinnerbox-title">Phone services</SPAN>',
29   'nohtmlheader' => 1,
30   'disable_total' => 1,
31   'disable_maxselect' => 1,
32   'really_disable_download' => 1,
33 &>
34   <BR>
35 % }
36 </%method>
37 <%init>
38
39 my @fields = (
40   'circuit_id',
41   { field     => 'providernum',
42     type      => 'select-table',
43     table     => 'circuit_provider',
44     name_col  => 'provider',
45   },
46   { field     => 'typenum',
47     type      => 'select-table',
48     table     => 'circuit_type',
49     name_col  => 'typename',
50   },
51   { field     => 'termnum',
52     type      => 'select-table',
53     table     => 'circuit_termination',
54     name_col  => 'termination',
55   },
56   qw( vendor_qual_id vendor_order_id vendor_order_type vendor_order_status ),
57   { field     => 'desired_due_date', type => 'date' },
58   { field     => 'due_date', type => 'date' },
59   'endpoint_ip_addr',
60   { field     => 'endpoint_mac_addr', type => 'mac_addr' },
61 );
62
63
64 my %labels = (
65   circuit_id          => 'Circuit ID',
66   providernum         => 'Provider',
67   typenum             => 'Circuit type',
68   termnum             => 'Termination',
69   vendor_qual_id      => 'Qualification ID',
70   vendor_order_id     => 'Order ID',
71   vendor_order_type   => 'Order type',
72   vendor_order_status => 'Order status',
73   desired_due_date    => 'Desired due date',
74   due_date            => 'Due date',
75   endpoint_ip_addr    => 'Endpoint IP address',
76   endpoint_mac_addr   => 'MAC address',
77 );
78
79 my $self = $m->request_comp;
80 </%init>