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