diff options
Diffstat (limited to 'httemplate')
-rw-r--r-- | httemplate/browse/deploy_zone.html | 62 | ||||
-rwxr-xr-x | httemplate/browse/part_pkg-fcc.html | 4 | ||||
-rw-r--r-- | httemplate/edit/deploy_zone-fixed.html | 9 | ||||
-rw-r--r-- | httemplate/edit/deploy_zone-mobile.html | 90 | ||||
-rw-r--r-- | httemplate/edit/process/deploy_zone-mobile.html | 9 | ||||
-rw-r--r-- | httemplate/elements/deploy_zone_vertex.html | 45 | ||||
-rw-r--r-- | httemplate/misc/part_pkg_fcc_options.html | 11 | ||||
-rwxr-xr-x | httemplate/search/report_477.html | 5 |
8 files changed, 224 insertions, 11 deletions
diff --git a/httemplate/browse/deploy_zone.html b/httemplate/browse/deploy_zone.html index 489a22658..ddfbde43d 100644 --- a/httemplate/browse/deploy_zone.html +++ b/httemplate/browse/deploy_zone.html @@ -48,9 +48,9 @@ sort_fields => [ 'zonenum', 'description', 'technology', - 'is_consumer is not null, is_business is not null', - 'adv_speed_down, adv_speed_up', - 'cir_speed_down, cir_speed_up', + '(is_consumer is not null, is_business is not null)', + '(adv_speed_down, adv_speed_up)', + '(cir_speed_down, cir_speed_up)', ], links => [ '', $link_fixed, ], align => 'clllllr', @@ -58,6 +58,59 @@ disable_maxselect => 1, disable_total => 1, &> +<P><FONT SIZE="+1"><B>Mobile Zones</B></FONT></P> +<& elements/browse.html, + name_singular => 'zone', + query => { table => 'deploy_zone', + hashref => { zonetype => 'P' }, + }, + count_query => "SELECT COUNT(*) FROM deploy_zone WHERE zonetype = 'P'", + agent_virt => 1, + header => [ '#', + 'Description', + 'Technology', + 'Spectrum', + 'Service Type', + 'Advertised Mbps', + 'Vertices', # number of vertices? not so useful + ], + fields => [ 'zonenum', + 'description', + sub { my $self = shift; + $tech_label->{$self->technology} }, + sub { my $self = shift; + $spec_label->{$self->spectrum} }, + sub { my $self = shift; + join( ' / ', + $self->is_voice ? 'voice' : (), + $self->is_broadband ? 'broadband' : (), + ) + }, + sub { my $self = shift; + join( ' / ', grep $_, + $self->adv_speed_down, + $self->adv_speed_up + ) + }, + sub { my $self = shift; + FS::deploy_zone_vertex->count('zonenum = '.$self->zonenum) + }, + ], + sort_fields => [ 'zonenum', + 'description', + 'technology', + 'spectrum', + '(is_voice is not null, is_broadband is not null)', + '(adv_speed_down, adv_speed_up)', + ], + links => [ '', $link_mobile, ], + align => 'clllllr', + nohtmlheader => 1, + disable_maxselect => 1, + disable_total => 1, +&> + +<& /elements/footer.html &> <%init> my $curuser = $FS::CurrentUser::CurrentUser; my $acl_edit = $curuser->access_right('Edit FCC report configuration'); @@ -66,7 +119,8 @@ die "access denied" unless $acl_edit or $acl_edit_global; my $link_fixed = [ $p.'edit/deploy_zone-fixed.html?', 'zonenum' ]; -my $link_mobile= [ $p.'edit/deploy_zone-mobile.html', 'zonenum' ]; +my $link_mobile= [ $p.'edit/deploy_zone-mobile.html?', 'zonenum' ]; my $tech_label = FS::part_pkg_fcc_option->technology_labels; +my $spec_label = FS::part_pkg_fcc_option->spectrum_labels; </%init> diff --git a/httemplate/browse/part_pkg-fcc.html b/httemplate/browse/part_pkg-fcc.html index 9facd10dc..14dfcba08 100755 --- a/httemplate/browse/part_pkg-fcc.html +++ b/httemplate/browse/part_pkg-fcc.html @@ -30,8 +30,8 @@ my $curuser = $FS::CurrentUser::CurrentUser; -my $edit = 'Edit package definitions'; -my $edit_global = 'Edit global package definitions'; +my $edit = 'Edit FCC report configuration'; +my $edit_global = 'Edit FCC report configuration for all agents'; my $acl_edit = $curuser->access_right($edit); my $acl_edit_global = $curuser->access_right($edit_global); diff --git a/httemplate/edit/deploy_zone-fixed.html b/httemplate/edit/deploy_zone-fixed.html index 8c6d54e5d..1a79500ff 100644 --- a/httemplate/edit/deploy_zone-fixed.html +++ b/httemplate/edit/deploy_zone-fixed.html @@ -21,9 +21,9 @@ type => 'hidden', value => 'B' }, - { field => 'servicetype', + { field => 'is_broadband', type => 'hidden', - value => 'broadband' + value => 'Y', }, 'description', { field => 'active_date', @@ -38,7 +38,7 @@ 'dbaname', { field => 'technology', type => 'select', - options => [ keys(%$technology_labels) ], + options => [ map { @$_ } values(%$media_types) ], labels => $technology_labels, }, { field => 'is_consumer', type => 'checkbox', value=>'Y' }, @@ -71,6 +71,8 @@ die "access denied" ]); my $technology_labels = FS::part_pkg_fcc_option->technology_labels; +my $media_types = FS::part_pkg_fcc_option->media_types; +delete $media_types->{'Mobile Wireless'}; # cause this is the fixed zone page my $m2_error_callback = sub { my ($cgi, $deploy_zone) = @_; @@ -78,6 +80,7 @@ my $m2_error_callback = sub { /^blocknum\d+/ and length($cgi->param($_.'_censusblock')) } $cgi->param; + sort { $a->censusblock <=> $b->censusblock } map { my $k = $_; FS::deploy_zone_block->new({ diff --git a/httemplate/edit/deploy_zone-mobile.html b/httemplate/edit/deploy_zone-mobile.html new file mode 100644 index 000000000..8e985b1c9 --- /dev/null +++ b/httemplate/edit/deploy_zone-mobile.html @@ -0,0 +1,90 @@ +<& elements/edit.html, + 'name_singular' => 'deployment zone', + 'table' => 'deploy_zone', + 'post_url' => popurl(1).'process/deploy_zone-mobile.html', + 'labels' => { + 'description' => 'Description', + 'agentnum' => 'Agent', + 'dbaname' => 'Business name (if different from agent)', + 'technology' => 'Technology', + 'spectrum' => 'Spectrum', + 'is_broadband', => 'Broadband Internet', + 'adv_speed_up' => 'Upstream', + 'adv_speed_down' => 'Downstream', + 'is_voice', => 'Voice', + 'vertexnum' => '', + 'active_date' => 'Active since', + }, + 'fields' => [ + { field => 'zonetype', + type => 'hidden', + value => 'P' + }, + 'description', + { field => 'active_date', + type => 'fixed-date', + value => time, + }, + { field => 'agentnum', + type => 'select-agent', + disable_empty => 1, + viewall_right => 'Edit FCC report configuration for all agents', + }, + 'dbaname', + { field => 'technology', + type => 'select', + options => $media_types->{'Mobile Wireless'}, + labels => $technology_labels, + }, + { field => 'spectrum', + type => 'select', + options => [ keys %$spectrum_labels ], + labels => $spectrum_labels, + }, + { field => 'is_broadband', type => 'checkbox', value=>'Y' }, + { field => 'is_voice', type => 'checkbox', value=>'Y' }, + { type => 'tablebreak-tr-title', + value => 'Advertised minimum speed (Mbps)' }, + 'adv_speed_down', + 'adv_speed_up', + { type => 'tablebreak-tr-title', value => 'Footprint'}, + { field => 'vertexnum', + type => 'deploy_zone_vertex', + o2m_table => 'deploy_zone_vertex', + 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 $spectrum_labels = FS::part_pkg_fcc_option->spectrum_labels; +my $media_types = FS::part_pkg_fcc_option->media_types; + +my $m2_error_callback = sub { + my ($cgi, $deploy_zone) = @_; + my @vertexnums = sort { $a <=> $b } grep { + /^vertexnum\d+/ and length($cgi->param($_.'_latitude')) + } $cgi->param; + + map { + my $k = $_; + my $s = 0; + FS::deploy_zone_vertex->new({ + vertexnum => scalar($cgi->param($k)), + zonenum => $deploy_zone->zonenum, + latitude => scalar($cgi->param($k.'_latitude')), + longitude => scalar($cgi->param($k.'_longitude')), + }) + } @vertexnums; +}; + +</%init> diff --git a/httemplate/edit/process/deploy_zone-mobile.html b/httemplate/edit/process/deploy_zone-mobile.html new file mode 100644 index 000000000..c913c5cd6 --- /dev/null +++ b/httemplate/edit/process/deploy_zone-mobile.html @@ -0,0 +1,9 @@ +<& elements/process.html, + error_redirect => popurl(2).'deploy_zone-mobile.html?', + table => 'deploy_zone', + viewall_dir => 'browse', + process_o2m => + { 'table' => 'deploy_zone_vertex', + 'fields' => [qw( latitude longitude )] + }, +&> diff --git a/httemplate/elements/deploy_zone_vertex.html b/httemplate/elements/deploy_zone_vertex.html new file mode 100644 index 000000000..b3c8b31ea --- /dev/null +++ b/httemplate/elements/deploy_zone_vertex.html @@ -0,0 +1,45 @@ +% unless ( $opt{'js_only'} ) { + + <INPUT TYPE="hidden" NAME="<%$name%>" ID="<%$id%>" VALUE="<% $curr_value %>"> + Latitude + <INPUT TYPE = "text" + NAME = "<%$name%>_latitude" + ID = "<%$id%>_latitude" + VALUE = "<% scalar($cgi->param($name.'_latitude')) + || $deploy_zone_vertex->latitude + %>" + SIZE = 18 + <% $onchange %> + > + + Longitude + <INPUT TYPE = "text" + NAME = "<%$name%>_longitude" + ID = "<%$id%>_longitude" + VALUE = "<% scalar($cgi->param($name.'_longitude')) + || $deploy_zone_vertex->longitude + %>" + SIZE = 18 + <% $onchange %> + > +% } +<%init> + +my( %opt ) = @_; + +my $name = $opt{'element_name'} || $opt{'field'} || 'vertexnum'; +my $id = $opt{'id'} || 'vertexnum'; + +my $curr_value = $opt{'curr_value'} || $opt{'value'}; + +my $onchange = $opt{'onchange'}; +if ( $onchange ) { + $onchange =~ s/\(what\);/(this);/; + $onchange = 'onchange="'.$onchange.'"'; +} + +my $deploy_zone_vertex = $curr_value + ? FS::deploy_zone_vertex->by_key($curr_value) + : FS::deploy_zone_vertex->new; + +</%init> diff --git a/httemplate/misc/part_pkg_fcc_options.html b/httemplate/misc/part_pkg_fcc_options.html index a5ecb12bc..27b45e003 100644 --- a/httemplate/misc/part_pkg_fcc_options.html +++ b/httemplate/misc/part_pkg_fcc_options.html @@ -92,10 +92,19 @@ <FIELDSET ID="voip"> <LABEL FOR="voip_sessions">Number of simultaneous calls possible</LABEL> <INPUT NAME="voip_sessions" ID="voip_sessions"> + <BR> <& .checkbox, 'voip_lastmile' &> <LABEL FOR="voip_lastmile">Do you also provide last-mile connectivity?</LABEL> </FIELDSET> </P> + <P> + <& .checkbox, 'is_mobile' &> + <LABEL FOR="is_mobile">This package provides mobile telephone service</LABEL> + <FIELDSET ID="mobile"> + <LABEL FOR="mobile_direct">Do you bill the customer directly?</LABEL> + <& .checkbox, 'mobile_direct' &> + </FIELDSET> + </P> <DIV WIDTH="100%" STYLE="text-align:center"> <INPUT TYPE="submit" VALUE="Save changes"> </DIV> @@ -168,7 +177,7 @@ function enable_fieldset(fieldset_id) { // set up all event handlers addEventListener(form, 'submit', save_changes); - var sections = [ 'broadband', 'phone', 'voip' ]; + var sections = [ 'broadband', 'phone', 'voip', 'mobile' ]; for(var i = 0; i < sections.length; i++) { var toggle = form.elements['is_'+sections[i]]; addEventListener(toggle, 'change', enable_fieldset(sections[i])); diff --git a/httemplate/search/report_477.html b/httemplate/search/report_477.html index 78ba35cfc..cbbd5d902 100755 --- a/httemplate/search/report_477.html +++ b/httemplate/search/report_477.html @@ -4,11 +4,13 @@ % $m->abort; % } <& /elements/header.html, 'FCC Form 477 Report' &> +% if ( $curuser->access_right('Edit FCC report configuration') ) { <FONT SIZE="+1"><STRONG>Preparation</STRONG></FONT> <UL> <LI> <A HREF="<% $p %>browse/part_pkg-fcc.html">Configure packages</A> for FCC reporting categories.</LI> <LI> <A HREF="<% $p %>browse/deploy_zone.html">Enter deployment zones</A> for broadband Internet or mobile phone.</LI> </UL> +% } <FORM ACTION="477.html" METHOD="GET"> @@ -48,8 +50,9 @@ <& /elements/footer.html &> <%init> +my $curuser = $FS::CurrentUser::CurrentUser; die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('List packages'); + unless $curuser->access_right('List packages'); my $conf = FS::Conf->new; |