disable fcc 477 deployment zones, RT#85668
[freeside.git] / httemplate / edit / deploy_zone-fixed.html
1 <& elements/edit.html,
2     'name_singular' => 'deployment zone',
3     'table'         => 'deploy_zone',
4     'post_url'      => popurl(1).'process/deploy_zone-fixed.html',
5     'viewall_dir'   => 'browse',
6     'labels'        => {
7         'zonenum'         => 'Deployment zone',
8         'description'     => 'Description',
9         'agentnum'        => 'Agent',
10         'dbaname'         => 'Business name (if different from agent)',
11         'technology'      => 'Technology',
12         'adv_speed_up'    => 'Upstream',
13         'adv_speed_down'  => 'Downstream',
14         'cir_speed_up'    => 'Upstream',
15         'cir_speed_down'  => 'Downstream',
16         'is_consumer'     => 'Consumer/mass market',
17         'is_business'     => 'Business/government',
18         'disabled'        => 'Disabled',
19         'blocknum'        => '',
20         'active_date'     => 'Active since',
21         'file'            => 'Import blocks from text file',
22         'censusyear'      => 'as census year',
23     },
24
25     'fields'        => [
26         { field         => 'zonetype',
27           type          => 'hidden',
28           value         => 'B'
29         },
30         { field         => 'is_broadband',
31           type          => 'hidden',
32           value         => 'Y',
33         },
34         'description',
35         { field         => 'active_date',
36           type          => 'input-date-field',
37           curr_value_callback => sub {
38             my ($cgi, $object) = @_;
39             $cgi->param('active_date') || $object->active_date || time;
40           },
41         },
42         { field         => 'expire_date',
43           type          => 'hidden',
44         },
45         { field         => 'agentnum',
46           type          => 'select-agent',
47           disable_empty => 1,
48           viewall_right => 'Edit FCC report configuration for all agents',
49         },
50         'dbaname',
51         { field         => 'technology',
52           type          => 'select',
53           options       => [ map { @$_ } values(%$media_types) ],
54           labels        => $technology_labels,
55         },
56         { field         => 'is_consumer', type => 'checkbox', value=>'Y' },
57         { field         => 'is_business', type => 'checkbox', value=>'Y' },
58         { field         => 'disabled', type=>'checkbox', value=>'Y', },
59         { type => 'tablebreak-tr-title',
60           value => 'Advertised maximum speed (Mbps)' },
61         'adv_speed_down',
62         'adv_speed_up',
63         { type => 'tablebreak-tr-title',
64           value => 'Contractually guaranteed speed (Mbps)' },
65         'cir_speed_down',
66         'cir_speed_up',
67         { type => 'tablebreak-tr-title', value => 'Footprint'},
68         { field               => 'vertices',
69           type                => 'polygon',
70           curr_value_callback => sub {
71             my ($cgi, $object) = @_;
72             $cgi->param('vertices') || $object->vertices_json;
73           },
74         }
75 #
76 #        { type => 'tablebreak-tr-title', value => 'Census blocks'},
77 #        { field => 'file',
78 #          type  => 'file-upload',
79 #        },
80 #        { field => 'format',
81 #          type  => 'hidden',
82 #          value => 'plain',
83 #        },
84 #        { field => 'censusyear',
85 #          type  => 'hidden',
86 #          options => [ '', qw( 2013 2012 2011 ) ],
87 #        },
88 #
89 #        { type => 'tablebreak-tr-title', value => '', },
90 #        { field => 'blocknum',
91 #          type              => 'deploy_zone_block',
92 #          o2m_table         => 'deploy_zone_block',
93 #          m2_label          => ' ',
94 #          m2_error_callback => $m2_error_callback,
95 #        },
96     ],
97 &>
98 <%init>
99 my $curuser = $FS::CurrentUser::CurrentUser;
100 die "access denied"
101   unless $curuser->access_right([
102     'Edit FCC report configuration',
103     'Edit FCC report configuration for all agents',
104   ]);
105
106 my $technology_labels = FS::part_pkg_fcc_option->technology_labels;
107 my $media_types = FS::part_pkg_fcc_option->media_types;
108 delete $media_types->{'Mobile Wireless'}; # cause this is the fixed zone page
109
110 #my $m2_error_callback = sub {
111 #  my ($cgi, $deploy_zone) = @_;
112 #  my @blocknums = grep {
113 #    /^blocknum\d+/ and length($cgi->param($_.'_censusblock'))
114 #  } $cgi->param;
115 #
116 #  sort { $a->censusblock <=> $b->censusblock }
117 #  map {
118 #    my $k = $_;
119 #    FS::deploy_zone_block->new({
120 #      blocknum    => scalar($cgi->param($k)),
121 #      zonenum     => $deploy_zone->zonenum,
122 #      censusblock => scalar($cgi->param($k.'_censusblock')),
123 #      censusyear  => scalar($cgi->param($k.'_censusyear')),
124 #    })
125 #  } @blocknums;
126 #};
127
128 </%init>