RT# 82949 - changes section name from fees to pricing, better opiton
[freeside.git] / httemplate / browse / deploy_zone.html
1 <& /elements/header.html, 'Deployment zones' &>
2 <& /elements/menubar.html,
3   'Add a new fixed broadband zone' => $p.'edit/deploy_zone-fixed.html',
4   'Add a new mobile zone'          => $p.'edit/deploy_zone-mobile.html',
5 &>
6 <P><FONT SIZE="+1"><B>Fixed Broadband Zones</B></FONT></P>
7 <& elements/browse.html,
8   name_singular   => 'zone',
9   query           => { table      => 'deploy_zone',
10                        hashref    => { zonetype => 'B' },
11                      },
12   count_query     => "SELECT COUNT(*) FROM deploy_zone WHERE zonetype = 'B'",
13   agent_virt      => 1,
14   header          => [  '#',
15                         'Description',
16                         'Technology',
17                         'Market',
18                         'Advertised Mbps',
19                         'Contractual Mbps',
20                         'Vertices',
21                         'Census blocks',
22                      ],
23   fields          => [  'zonenum',
24                         'description',
25                         sub { my $self = shift;
26                               $tech_label->{$self->technology} },
27                         sub { my $self = shift;
28                               join( ' / ',
29                                 $self->is_consumer ? 'consumer' : (),
30                                 $self->is_business ? 'business' : ()
31                               )
32                             },
33                         sub { my $self = shift;
34                               join( ' / ', grep $_,
35                                 $self->adv_speed_down,
36                                 $self->adv_speed_up
37                               )
38                             },
39                         sub { my $self = shift;
40                               join( ' / ', grep $_,
41                                 $self->cir_speed_down,
42                                 $self->cir_speed_up
43                               )
44                             },
45                         sub { my $self = shift;
46                               FS::deploy_zone_vertex->count('zonenum = '.$self->zonenum)
47                             },
48                         sub { my $self = shift;
49                               FS::deploy_zone_block->count('zonenum = '.$self->zonenum)
50                             },
51                      ],
52   sort_fields     => [ 'zonenum',
53                        'description',
54                        'technology',
55                        '(is_consumer is not null, is_business is not null)',
56                        '(adv_speed_down, adv_speed_up)',
57                        '(cir_speed_down, cir_speed_up)',
58                      ],
59   links           => [  $link_fixed, $link_fixed, ],
60   align           => 'cllllrrr',
61   nohtmlheader    => 1,
62   disable_maxselect => 1,
63   disable_total     => 1,
64 &>
65 <P><FONT SIZE="+1"><B>Mobile Zones</B></FONT></P>
66 <& elements/browse.html,
67   name_singular   => 'zone',
68   query           => { table      => 'deploy_zone',
69                        hashref    => { zonetype => 'P' },
70                      },
71   count_query     => "SELECT COUNT(*) FROM deploy_zone WHERE zonetype = 'P'",
72   agent_virt      => 1,
73   header          => [  '#',
74                         'Description',
75                         'Technology',
76                         'Spectrum',
77                         'Service Type',
78                         'Advertised Mbps',
79                         'Vertices', # number of vertices? not so useful
80                      ],
81   fields          => [  'zonenum',
82                         'description',
83                         sub { my $self = shift;
84                               $tech_label->{$self->technology} },
85                         sub { my $self = shift;
86                               $spec_label->{$self->spectrum} },
87                         sub { my $self = shift;
88                               join( ' / ',
89                                 $self->is_voice ? 'voice' : (),
90                                 $self->is_broadband ? 'broadband' : (),
91                               )
92                             },
93                         sub { my $self = shift;
94                               join( ' / ', grep $_,
95                                 $self->adv_speed_down,
96                                 $self->adv_speed_up
97                               )
98                             },
99                         sub { my $self = shift;
100                               FS::deploy_zone_vertex->count('zonenum = '.$self->zonenum)
101                             },
102                      ],
103   sort_fields     => [ 'zonenum',
104                        'description',
105                        'technology',
106                        'spectrum',
107                        '(is_voice is not null, is_broadband is not null)',
108                        '(adv_speed_down, adv_speed_up)',
109                      ],
110   links           => [  '', $link_mobile, ],
111   align           => 'clllllr',
112   nohtmlheader    => 1,
113   disable_maxselect => 1,
114   disable_total     => 1,
115 &>
116
117 <& /elements/footer.html &>
118 <%init>
119 my $curuser = $FS::CurrentUser::CurrentUser;
120 my $acl_edit = $curuser->access_right('Edit FCC report configuration');
121 my $acl_edit_global = $curuser->access_right('Edit FCC report configuration for all agents');
122 die "access denied"
123   unless $acl_edit or $acl_edit_global;
124
125 my $link_fixed = [ $p.'edit/deploy_zone-fixed.html?', 'zonenum' ];
126 my $link_mobile= [ $p.'edit/deploy_zone-mobile.html?', 'zonenum' ];
127
128 my $tech_label = FS::part_pkg_fcc_option->technology_labels;
129 my $spec_label = FS::part_pkg_fcc_option->spectrum_labels;
130 </%init>