default to a session cookie instead of setting an explicit timeout, weird timezone...
[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                         'Vertices',
21                         'Census blocks',
22                         'Shapefile',
23                         'KMZ',
24                         'GeoJSON',
25                      ],
26   footer          => [ '',
27                        'All fixed zones',
28                        '',
29                        '',
30                        '',
31                        '',
32                        '',
33                        '',
34                        '<A HREF="'. $fixed_shp.  '">download</A>',
35                        '<A HREF="'. $fixed_kmz.  '">download</A>',
36                        '<A HREF="'. $fixed_json. '">download</A>',
37                      ],
38   fields          => [  'zonenum',
39                         'description',
40                         sub { my $self = shift;
41                               $tech_label->{$self->technology} },
42                         sub { my $self = shift;
43                               join( ' / ',
44                                 $self->is_consumer ? 'consumer' : (),
45                                 $self->is_business ? 'business' : ()
46                               )
47                             },
48                         sub { my $self = shift;
49                               join( ' / ', grep $_,
50                                 $self->adv_speed_down,
51                                 $self->adv_speed_up
52                               )
53                             },
54                         sub { my $self = shift;
55                               join( ' / ', grep $_,
56                                 $self->cir_speed_down,
57                                 $self->cir_speed_up
58                               )
59                             },
60                         sub { my $self = shift;
61                               FS::deploy_zone_vertex->count('zonenum = '.$self->zonenum)
62                             },
63                         sub { my $self = shift;
64                               FS::deploy_zone_block->count('zonenum = '.$self->zonenum)
65                             },
66                         sub { my $self = shift;
67                               FS::deploy_zone_vertex->count('zonenum = '.$self->zonenum)
68                               ? 'download' : ''
69                             },
70                         sub { my $self = shift;
71                               FS::deploy_zone_vertex->count('zonenum = '.$self->zonenum)
72                               ? 'download' : ''
73                             },
74                         sub { my $self = shift;
75                               FS::deploy_zone_vertex->count('zonenum = '.$self->zonenum)
76                               ? 'download' : ''
77                             },
78                      ],
79   sort_fields     => [ 'zonenum',
80                        'description',
81                        'technology',
82                        '(is_consumer is not null, is_business is not null)',
83                        '(adv_speed_down, adv_speed_up)',
84                        '(cir_speed_down, cir_speed_up)',
85                      ],
86   links           => [  $link_fixed, $link_fixed, '', '', '', '', '', '', $link_shp, $link_kmz, $link_json, ],
87   align           => 'cllllrrr',
88   nohtmlheader    => 1,
89   disable_maxselect => 1,
90   disable_total     => 1,
91   disableable       => 1,
92   disabled_statuspos => 2,
93 &>
94 <P><FONT SIZE="+1"><B>Mobile Zones</B></FONT></P>
95 <& elements/browse.html,
96   name_singular   => 'zone',
97   query           => { table      => 'deploy_zone',
98                        hashref    => { zonetype => 'P' },
99                      },
100   count_query     => "SELECT COUNT(*) FROM deploy_zone WHERE zonetype = 'P'",
101   agent_virt      => 1,
102   header          => [  '#',
103                         'Description',
104                         'Technology',
105                         'Spectrum',
106                         'Service Type',
107                         'Advertised Mbps',
108                         'Vertices', # number of vertices? not so useful
109                         'Shapefile',
110                         'KMZ',
111                         'GeoJSON',
112                      ],
113   fields          => [  'zonenum',
114                         'description',
115                         sub { my $self = shift;
116                               $tech_label->{$self->technology} },
117                         sub { my $self = shift;
118                               $spec_label->{$self->spectrum} },
119                         sub { my $self = shift;
120                               join( ' / ',
121                                 $self->is_voice ? 'voice' : (),
122                                 $self->is_broadband ? 'broadband' : (),
123                               )
124                             },
125                         sub { my $self = shift;
126                               join( ' / ', grep $_,
127                                 $self->adv_speed_down,
128                                 $self->adv_speed_up
129                               )
130                             },
131                         sub { my $self = shift;
132                               FS::deploy_zone_vertex->count('zonenum = '.$self->zonenum)
133                             },
134                         sub { my $self = shift;
135                               FS::deploy_zone_vertex->count('zonenum = '.$self->zonenum)
136                               ? 'download' : ''
137                             },
138                         sub { my $self = shift;
139                               FS::deploy_zone_vertex->count('zonenum = '.$self->zonenum)
140                               ? 'download' : ''
141                             },
142                         sub { my $self = shift;
143                               FS::deploy_zone_vertex->count('zonenum = '.$self->zonenum)
144                               ? 'download' : ''
145                             },
146                      ],
147   sort_fields     => [ 'zonenum',
148                        'description',
149                        'technology',
150                        'spectrum',
151                        '(is_voice is not null, is_broadband is not null)',
152                        '(adv_speed_down, adv_speed_up)',
153                      ],
154   links           => [  $link_mobile, $link_mobile, '', '', '', '', '', $link_shp, $link_kmz, $link_json, ],
155   align           => 'clllllr',
156   nohtmlheader    => 1,
157   disable_maxselect => 1,
158   disable_total     => 1,
159   disableable       => 1,
160   disabled_statuspos => 2,
161 &>
162
163 <& /elements/footer.html &>
164 <%init>
165
166 my $curuser = $FS::CurrentUser::CurrentUser;
167 my $acl_edit = $curuser->access_right('Edit FCC report configuration');
168 my $acl_edit_global = $curuser->access_right('Edit FCC report configuration for all agents');
169 die "access denied"
170   unless $acl_edit or $acl_edit_global;
171
172 my $link_fixed  = [ $p.'edit/deploy_zone-fixed.html?', 'zonenum' ];
173 my $link_mobile = [ $p.'edit/deploy_zone-mobile.html?', 'zonenum' ];
174 my $link_shp    = [ $p.'view/deploy_zone-shp.cgi?', 'zonenum' ];
175 my $link_kmz    = [ $p.'view/deploy_zone-kmz.cgi?', 'zonenum' ];
176 my $link_json   = [ $p.'view/deploy_zone-geojson.cgi?', 'zonenum' ];
177
178 my $fixed_shp    = $p.'view/deploy_zone-shp.cgi?zonetype=B';
179 my $fixed_kmz    = $p.'view/deploy_zone-kmz.cgi?zonetype=B';
180 my $fixed_json   = $p.'view/deploy_zone-geojson.cgi?zonetype=B';
181
182 my $tech_label  = FS::part_pkg_fcc_option->technology_labels;
183 my $spec_label  = FS::part_pkg_fcc_option->spectrum_labels;
184
185 </%init>