summaryrefslogtreecommitdiff
path: root/httemplate/browse/deploy_zone.html
blob: 489a226585f50314816899c8705e445682dacba8 (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
<& /elements/header.html, 'Deployment zones' &>
<& /elements/menubar.html,
  'Add a new fixed broadband zone' => $p.'edit/deploy_zone-fixed.html',
  'Add a new mobile zone'          => $p.'edit/deploy_zone-mobile.html',
&>
<P><FONT SIZE="+1"><B>Fixed Broadband Zones</B></FONT></P>
<& elements/browse.html,
  name_singular   => 'zone',
  query           => { table      => 'deploy_zone',
                       hashref    => { zonetype => 'B' },
                     },
  count_query     => "SELECT COUNT(*) FROM deploy_zone WHERE zonetype = 'B'",
  agent_virt      => 1,
  header          => [  '#',
                        'Description',
                        'Technology',
                        'Market',
                        'Advertised Mbps',
                        'Contractual Mbps',
                        'Census blocks',
                     ],
  fields          => [  'zonenum',
                        'description',
                        sub { my $self = shift;
                              $tech_label->{$self->technology} },
                        sub { my $self = shift;
                              join( ' / ',
                                $self->is_consumer ? 'consumer' : (),
                                $self->is_business ? 'business' : ()
                              )
                            },
                        sub { my $self = shift;
                              join( ' / ', grep $_,
                                $self->adv_speed_down,
                                $self->adv_speed_up
                              )
                            },
                        sub { my $self = shift;
                              join( ' / ', grep $_,
                                $self->cir_speed_down,
                                $self->cir_speed_up
                              )
                            },
                        sub { my $self = shift;
                              FS::deploy_zone_block->count('zonenum = '.$self->zonenum)
                            },
                     ],
  sort_fields     => [ 'zonenum',
                       'description',
                       'technology',
                       'is_consumer is not null, is_business is not null',
                       'adv_speed_down, adv_speed_up',
                       'cir_speed_down, cir_speed_up',
                     ],
  links           => [  '', $link_fixed, ],
  align           => 'clllllr',
  nohtmlheader    => 1,
  disable_maxselect => 1,
  disable_total     => 1,
&>
<%init>
my $curuser = $FS::CurrentUser::CurrentUser;
my $acl_edit = $curuser->access_right('Edit FCC report configuration');
my $acl_edit_global = $curuser->access_right('Edit FCC report configuration for all agents');
die "access denied"
  unless $acl_edit or $acl_edit_global;

my $link_fixed = [ $p.'edit/deploy_zone-fixed.html?', 'zonenum' ];
my $link_mobile= [ $p.'edit/deploy_zone-mobile.html', 'zonenum' ];

my $tech_label = FS::part_pkg_fcc_option->technology_labels;
</%init>