new 477 report: deployment info, combined browse-edit UI, #24047
[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, ],
56   align           => 'clllllr',
57   nohtmlheader    => 1,
58   disable_maxselect => 1,
59   disable_total     => 1,
60 &>
61 <%init>
62 my $curuser = $FS::CurrentUser::CurrentUser;
63 my $acl_edit = $curuser->access_right('Edit FCC report configuration');
64 my $acl_edit_global = $curuser->access_right('Edit FCC report configuration for all agents');
65 die "access denied"
66   unless $acl_edit or $acl_edit_global;
67
68 my $link_fixed = [ $p.'edit/deploy_zone-fixed.html?', 'zonenum' ];
69 my $link_mobile= [ $p.'edit/deploy_zone-mobile.html', 'zonenum' ];
70
71 my $tech_label = FS::part_pkg_fcc_option->technology_labels;
72 </%init>