summaryrefslogtreecommitdiff
path: root/httemplate/edit
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2014-07-31 22:54:08 -0700
committerMark Wells <mark@freeside.biz>2014-07-31 22:54:08 -0700
commit0f359d5480aa1621d73ee802f420e8951abc620d (patch)
tree4bab32c865f9ef7b2bb03247a6be75215cfebf85 /httemplate/edit
parent6c284750de8fe49d7d4cdc6a9a4fb618697780e2 (diff)
new 477 report: deployment info, combined browse-edit UI, #24047
Diffstat (limited to 'httemplate/edit')
-rw-r--r--httemplate/edit/deploy_zone-fixed.html87
-rwxr-xr-xhttemplate/edit/part_pkg.cgi37
-rw-r--r--httemplate/edit/process/deploy_zone-fixed.html9
3 files changed, 117 insertions, 16 deletions
diff --git a/httemplate/edit/deploy_zone-fixed.html b/httemplate/edit/deploy_zone-fixed.html
new file mode 100644
index 000000000..ecec9c434
--- /dev/null
+++ b/httemplate/edit/deploy_zone-fixed.html
@@ -0,0 +1,87 @@
+<& elements/edit.html,
+ 'name_singular' => 'deployment zone',
+ 'table' => 'deploy_zone',
+ 'post_url' => popurl(1).'process/deploy_zone-fixed.html',
+ 'labels' => {
+ 'description' => 'Description',
+ 'agentnum' => 'Agent',
+ 'dbaname' => 'Business name (if different from agent)',
+ 'technology' => 'Technology',
+ 'adv_speed_up' => 'Upstream',
+ 'adv_speed_down' => 'Downstream',
+ 'cir_speed_up' => 'Upstream',
+ 'cir_speed_down' => 'Downstream',
+ 'is_consumer' => 'Consumer/mass market',
+ 'is_business' => 'Business/government',
+ 'blocknum' => '',
+ },
+ 'fields' => [
+ { field => 'zonetype',
+ type => 'hidden',
+ value => 'B'
+ },
+ { field => 'servicetype',
+ type => 'hidden',
+ value => 'broadband'
+ },
+ 'description',
+ { field => 'agentnum',
+ type => 'select-agent',
+ disable_empty => 1,
+ viewall_right => 'Edit FCC report configuration for all agents',
+ },
+ 'dbaname',
+ { field => 'technology',
+ type => 'select',
+ options => [ keys(%$technology_labels) ],
+ labels => $technology_labels,
+ },
+ { field => 'is_consumer', type => 'checkbox', value=>'Y' },
+ { field => 'is_business', type => 'checkbox', value=>'Y' },
+ { type => 'tablebreak-tr-title',
+ value => 'Advertised maximum speed (Mbps)' },
+ 'adv_speed_down',
+ 'adv_speed_up',
+ { type => 'tablebreak-tr-title',
+ value => 'Contractually guaranteed speed (Mbps)' },
+ 'cir_speed_down',
+ 'cir_speed_up',
+
+ { type => 'tablebreak-tr-title', value => 'Census blocks'},
+ { field => 'blocknum',
+ type => 'deploy_zone_block',
+ o2m_table => 'deploy_zone_block',
+ m2_label => ' ',
+ m2_error_callback => $m2_error_callback,
+ },
+ ],
+
+&>
+<%init>
+my $curuser = $FS::CurrentUser::CurrentUser;
+die "access denied"
+ unless $curuser->access_right([
+ 'Edit FCC report configuration',
+ 'Edit FCC report configuration for all agents',
+ ]);
+
+my $technology_labels = FS::part_pkg_fcc_option->technology_labels;
+
+my $m2_error_callback = sub {
+ my ($cgi, $deploy_zone) = @_;
+ my @blocknums = grep {
+ /^blocknum\d+/ and length($cgi->param($_.'_censusblock'))
+ } $cgi->param;
+
+ map {
+ my $k = $_;
+ FS::deploy_zone_block->new({
+ blocknum => scalar($cgi->param($k)),
+ zonenum => $deploy_zone->zonenum,
+ censusblock => scalar($cgi->param($k.'_censusblock')),
+ censusyear => scalar($cgi->param($k.'_censusyear')),
+ })
+ } @blocknums;
+};
+
+</%init>
diff --git a/httemplate/edit/part_pkg.cgi b/httemplate/edit/part_pkg.cgi
index 9e55d9f42..65eca6cf4 100755
--- a/httemplate/edit/part_pkg.cgi
+++ b/httemplate/edit/part_pkg.cgi
@@ -232,23 +232,26 @@
},
},
- { type => 'tablebreak-tr-title',
- value => 'FCC Form 477 information',
- },
- { field => 'fcc_options_string',
- type => 'input-fcc_options',
- curr_value_callback => sub {
- my ($cgi, $part_pkg, $fref) = @_;
- if ( $cgi->param('fcc_options_string') ) {
- # error redirect
- return $cgi->param('fcc_options_string');
- }
- my %hash;
- %hash = $part_pkg->fcc_options
- if ($part_pkg->pkgpart);
- return encode_json(\%hash);
+ ($fcc_opts ? (
+ { type => 'tablebreak-tr-title',
+ value => 'FCC Form 477 information',
},
- },
+ { field => 'fcc_options_string',
+ type => 'input-fcc_options',
+ curr_value_callback => sub {
+ my ($cgi, $part_pkg, $fref) = @_;
+ if ( $cgi->param('fcc_options_string') ) {
+ # error redirect
+ return $cgi->param('fcc_options_string');
+ }
+ my %hash;
+ %hash = $part_pkg->fcc_options
+ if ($part_pkg->pkgpart);
+ return encode_json(\%hash);
+ },
+ },
+ ) : ()
+ ),
{ type => 'tablebreak-tr-title',
value => 'External Links', #better name?
@@ -405,6 +408,8 @@ my $agent_clone_extra_sql =
my $conf = new FS::Conf;
my $taxproducts = $conf->exists('enable_taxproducts');
+my $fcc_opts = $conf->exists('part_pkg-show_fcc_options');
+
my @locales = grep { ! /^en_/i } $conf->config('available-locales'); #should filter from the default locale lang instead of en_
my %locale_labels = map {
( $_ => 'Package -- '. FS::Locales->description($_) )
diff --git a/httemplate/edit/process/deploy_zone-fixed.html b/httemplate/edit/process/deploy_zone-fixed.html
new file mode 100644
index 000000000..c14c81c58
--- /dev/null
+++ b/httemplate/edit/process/deploy_zone-fixed.html
@@ -0,0 +1,9 @@
+<& elements/process.html,
+ error_redirect => popurl(2).'deploy_zone-fixed.html?',
+ table => 'deploy_zone',
+ viewall_dir => 'browse',
+ process_o2m =>
+ { 'table' => 'deploy_zone_block',
+ 'fields' => [qw( censusblock censusyear )]
+ },
+&>