default to a session cookie instead of setting an explicit timeout, weird timezone...
[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         { type => 'note',
66           value => 'Only required for filings as of June 30th, 2019 (due Sep. 3rd, 2019) and before',
67         },
68         'cir_speed_down',
69         'cir_speed_up',
70         { type => 'tablebreak-tr-title', value => 'Footprint'},
71         { field               => 'vertices',
72           type                => 'polygon',
73           curr_value_callback => sub {
74             my ($cgi, $object) = @_;
75             $cgi->param('vertices') || $object->vertices_json;
76           },
77         }
78 #
79 #        { type => 'tablebreak-tr-title', value => 'Census blocks'},
80 #        { field => 'file',
81 #          type  => 'file-upload',
82 #        },
83 #        { field => 'format',
84 #          type  => 'hidden',
85 #          value => 'plain',
86 #        },
87 #        { field => 'censusyear',
88 #          type  => 'hidden',
89 #          options => [ '', qw( 2013 2012 2011 ) ],
90 #        },
91 #
92 #        { type => 'tablebreak-tr-title', value => '', },
93 #        { field => 'blocknum',
94 #          type              => 'deploy_zone_block',
95 #          o2m_table         => 'deploy_zone_block',
96 #          m2_label          => ' ',
97 #          m2_error_callback => $m2_error_callback,
98 #        },
99     ],
100 &>
101 <%init>
102 my $curuser = $FS::CurrentUser::CurrentUser;
103 die "access denied"
104   unless $curuser->access_right([
105     'Edit FCC report configuration',
106     'Edit FCC report configuration for all agents',
107   ]);
108
109 my $technology_labels = FS::part_pkg_fcc_option->technology_labels;
110 my $media_types = FS::part_pkg_fcc_option->media_types;
111 delete $media_types->{'Mobile Wireless'}; # cause this is the fixed zone page
112
113 #my $m2_error_callback = sub {
114 #  my ($cgi, $deploy_zone) = @_;
115 #  my @blocknums = grep {
116 #    /^blocknum\d+/ and length($cgi->param($_.'_censusblock'))
117 #  } $cgi->param;
118 #
119 #  sort { $a->censusblock <=> $b->censusblock }
120 #  map {
121 #    my $k = $_;
122 #    FS::deploy_zone_block->new({
123 #      blocknum    => scalar($cgi->param($k)),
124 #      zonenum     => $deploy_zone->zonenum,
125 #      censusblock => scalar($cgi->param($k.'_censusblock')),
126 #      censusyear  => scalar($cgi->param($k.'_censusyear')),
127 #    })
128 #  } @blocknums;
129 #};
130
131 </%init>