4 my $curuser = $FS::CurrentUser::CurrentUser;
5 my $acl_edit = $curuser->access_right('Edit FCC report configuration');
6 my $acl_edit_global = $curuser->access_right('Edit FCC report configuration for all agents');
8 unless $acl_edit or $acl_edit_global;
12 my($query) = $cgi->keywords;
13 if ( $query =~ /^(\d+)$/ || $cgi->param('zonenum') =~ /^(\d+$)/ ) {
16 my $deploy_zone = qsearchs('deploy_zone', { 'zonenum' => $zonenum })
17 or die 'unknown zonenum';
19 $content = $deploy_zone->geo_json_feature->to_json;
21 } elsif ( $cgi->param('zonetype') =~ /^(\w)$/ ) {
24 my @deploy_zone = qsearch('deploy_zone', { 'zonetype' => $zonetype,
27 my $fc = Geo::JSON::FeatureCollection->new({
28 features => [ map $_->geo_json_feature, @deploy_zone ],
31 $content = $fc->to_json;
34 die "no zonenum or zonetype\n";
37 http_header('Content-Type' => 'application/geo+json' );
38 http_header('Content-Disposition' => "filename=$name.geojson" );
39 http_header('Content-Length' => length($content) );
40 http_header('Cache-control' => 'max-age=60' );