summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--FS/FS/Report/FCC_477.pm4
-rwxr-xr-xhttemplate/browse/part_pkg-fcc.html33
-rwxr-xr-xhttemplate/edit/part_pkg.cgi5
-rw-r--r--httemplate/edit/process/bulk-part_pkg-fcc.html6
-rw-r--r--httemplate/elements/input-fcc_options.html3
-rw-r--r--httemplate/elements/tr-input-fcc_options.html89
-rw-r--r--httemplate/misc/part_pkg_fcc_options.html3
-rw-r--r--httemplate/search/477.html2
8 files changed, 38 insertions, 107 deletions
diff --git a/FS/FS/Report/FCC_477.pm b/FS/FS/Report/FCC_477.pm
index ff29d1953..f5d6a06ec 100644
--- a/FS/FS/Report/FCC_477.pm
+++ b/FS/FS/Report/FCC_477.pm
@@ -4,14 +4,13 @@ use base qw( FS::Report );
use strict;
use vars qw( @upload @download @technology @part2aoption @part2boption
%states
- $DEBUG
);
use FS::Record qw( dbh );
use Tie::IxHash;
use Storable;
-$DEBUG = 0;
+our $DEBUG = 0;
=head1 NAME
@@ -305,6 +304,7 @@ sub report {
unless $class->can($method);
my $statement = $class->$method(%opt);
+ warn $statement if $DEBUG;
my $sth = dbh->prepare($statement);
$sth->execute or die $sth->errstr;
$sth->fetchall_arrayref;
diff --git a/httemplate/browse/part_pkg-fcc.html b/httemplate/browse/part_pkg-fcc.html
index e3fd97ccf..bdfb99a59 100755
--- a/httemplate/browse/part_pkg-fcc.html
+++ b/httemplate/browse/part_pkg-fcc.html
@@ -180,9 +180,11 @@ if ( $cgi->param('redirect') ) {
my $html_init =
include('/elements/init_overlib.html') .
include('/elements/input-fcc_options.html', js_only => 1) .
- include('.style');
+ include('.style') .
+ include('.script');
-my $html_form = qq!<FORM ACTION="${p}edit/process/bulk-part_pkg-fcc.html" METHOD="POST">
+my $html_form = qq!<FORM ACTION="${p}edit/process/bulk-part_pkg-fcc.html" METHOD="POST" NAME="bulk-part_pkg-fcc">
+ <INPUT TYPE="hidden" NAME="jump">
( show class: !.
include('/elements/select-pkg_class.html',
#'curr_value' => $classnum,
@@ -193,20 +195,13 @@ my $html_form = qq!<FORM ACTION="${p}edit/process/bulk-part_pkg-fcc.html" METHOD
'disable_empty' => 1,
).
' )
- <BR><BR>' .
- qq!<SCRIPT TYPE="text/javascript">
- function filter_change() {
- window.location = '! . $cgi->self_url . qq!?classnum='
- + document.getElementById('classnum').value;
- }
- </SCRIPT>!;
+ <BR><BR>';
+
# restore this only after creating $html_form
$cgi->param('classnum', $classnum) if length($classnum);
-my $html_foot = qq!
- <INPUT TYPE="submit" VALUE="Save changes">
- </FORM>!;
+my $html_foot = '</FORM>';
my @menubar =
( 'Package definitions' => $p.'browse/part_pkg.cgi' );
@@ -224,3 +219,17 @@ my @menubar =
}
</style>
</%def>
+<%def .script>
+<script type="text/javascript">
+ function finish_edit_fcc(id) {
+ cClick();
+ document.forms['bulk-part_pkg-fcc']['jump'].value = id;
+ document.forms['bulk-part_pkg-fcc'].submit(); //immediately save/refresh
+ }
+
+ function filter_change() {
+ window.location = '! . $cgi->self_url . qq!?classnum='
+ + document.getElementById('classnum').value;
+ }
+</script>
+</%def>
diff --git a/httemplate/edit/part_pkg.cgi b/httemplate/edit/part_pkg.cgi
index 5e42687f9..dca5b3943 100755
--- a/httemplate/edit/part_pkg.cgi
+++ b/httemplate/edit/part_pkg.cgi
@@ -805,6 +805,11 @@ my $javascript = <<'END';
}
}
+ function finish_edit_fcc(id) {
+ cClick();
+ show_fcc_options(id); // refresh the display
+ }
+
END
my $warning =
diff --git a/httemplate/edit/process/bulk-part_pkg-fcc.html b/httemplate/edit/process/bulk-part_pkg-fcc.html
index 4a0fb2a22..8ef330829 100644
--- a/httemplate/edit/process/bulk-part_pkg-fcc.html
+++ b/httemplate/edit/process/bulk-part_pkg-fcc.html
@@ -17,7 +17,7 @@
% }
<% $cgi->redirect($fsurl.'browse/part_pkg-fcc.html?redirect='.$session) %>
% } else {
-<% $cgi->redirect($fsurl.'browse/part_pkg-fcc.html?classnum='.$classnum) %>
+<% $cgi->redirect($fsurl.'browse/part_pkg-fcc.html?classnum='.$classnum.$jump) %>
% }
<%init>
my $curuser = $FS::CurrentUser::CurrentUser;
@@ -40,4 +40,8 @@ foreach my $param ($cgi->param) {
my $classnum = $cgi->param('classnum');
+my $jump = '';
+if ( $cgi->param('jump') =~ /^pkgpart(\d+)$/ ) {
+ $jump = '#'.$1;
+}
</%init>
diff --git a/httemplate/elements/input-fcc_options.html b/httemplate/elements/input-fcc_options.html
index fb2500fa5..064c647fc 100644
--- a/httemplate/elements/input-fcc_options.html
+++ b/httemplate/elements/input-fcc_options.html
@@ -80,7 +80,8 @@ function show_fcc_options(id) {
}
} // is_phone
if ( curr_values['is_voip'] ) {
- out += '<li><strong>VoIP</strong> telephone service</li>';
+ out += '<li><strong>VoIP</strong> telephone service over <strong>'
+ + media + '</strong></li>';
out += '<li><strong>' + curr_values['voip_sessions'] +
'</strong> sessions allowed</li>';
if ( curr_values['voip_lastmile'] ) {
diff --git a/httemplate/elements/tr-input-fcc_options.html b/httemplate/elements/tr-input-fcc_options.html
index 87117ef1e..1f63588ad 100644
--- a/httemplate/elements/tr-input-fcc_options.html
+++ b/httemplate/elements/tr-input-fcc_options.html
@@ -7,96 +7,9 @@
</STYLE>
<TR>
<TH COLSPAN=2>
- <& hidden.html, 'id' => $id, @_ &>
-%# <& input-text.html, 'id' => $id, @_ &> # XXX debugging
- <UL ID="<%$id%>_display_fcc_options" CLASS="fcc_options">
- </UL>
- <BUTTON TYPE="button" onclick="edit_fcc_options()">
- Edit
- </BUTTON>
-% # show some kind of useful summary of the FCC options here
+ <& input-fcc_options.html, 'id' => $id, @_ &>
</TH>
</TR>
-<SCRIPT TYPE="text/javascript">
-function edit_fcc_options() {
- <& popup_link_onclick.html,
- 'action' => $fsurl.'misc/part_pkg_fcc_options.html?id=' . $id,
- 'actionlabel' => 'FCC Form 477 options',
- 'width' => 760,
- 'height' => 600,
- &>
-}
-var technology_labels = <% encode_json(FS::part_pkg_fcc_option->technology_labels) %>;
-function show_fcc_options() {
- var curr_values = JSON.parse(document.getElementById('<% $id %>').value);
- // hardcoded for the same reasons as misc/part_pkg_fcc_options
- var out = '';
- var tech = curr_values['technology'];
- if ( tech ) {
- if (technology_labels[tech]) {
- tech = technology_labels[tech];
- } else {
- tech = 'Technology '+tech; // unknown?
- }
- }
- var media = curr_values['media'] || 'unknown media';
- media = media.toLowerCase();
- if ( curr_values['is_consumer'] ) {
- out += '<li><strong>Consumer-grade</strong></li>>';
- } else {
- out += '<li><strong>Business-grade</strong></li>';
- }
- if ( curr_values['is_broadband'] ) {
- out += '<li>Broadband via <strong>' + tech + '</strong>'
- + '<li><strong>' + curr_values['broadband_downstream']
- + 'Mbps </strong> down / '
- + '<strong>' + curr_values['broadband_upstream']
- + 'Mbps </strong> up</li>';
- }
- if ( curr_values['is_phone'] ) {
- if ( curr_values['phone_wholesale'] ) {
- out += '<li>Wholesale telephone</li>';
- if ( curr_values['phone_vges'] ) {
- out += '<li><strong>' + curr_values['phone_vges'] + '</strong>'
- + ' switched voice-grade lines</li>';
- }
- if ( curr_values['phone_circuits'] ) {
- out += '<li><strong>' + curr_values['phone_circuits'] + '</strong>'
- + ' unswitched circuits</li>';
- }
- } else {
- // enduser service
- out += '<li>Local telephone over <strong>' + media + '</strong></li>'
- + '<li><strong>' + curr_values['phone_lines']
- + '</strong> voice-grade lines</li>';
- if ( curr_values['phone_localloop'] == 'resale' ) {
- out += '<li><strong>Resold</strong> from another carrier</li>>';
- } else if ( curr_values['phone_localloop'] == 'leased' ) {
- out += '<li>Using <strong>leased circuits</strong> from another carrier</li>';
- } else if ( curr_values['phone_localloop'] == 'owned' ) {
- out += '<li>Using <strong>our own circuits</strong></li>';
- }
- if ( curr_values['phone_longdistance'] ) {
- out += '<li>Includes <strong>long-distance service</strong></li>';
- }
- }
- } // is_phone
- if ( curr_values['is_voip'] ) {
- out += '<li><strong>VoIP</strong> telephone service</li>';
- if ( curr_values['voip_ott'] ) {
- out += '<li>Using a <strong>separate</strong> last-mile connection</li>';
- } else {
- out += '<li><strong>Including</strong> last-mile connection</li>';
- }
- } // is_voip
-
- var out_ul = document.getElementById('<% $id %>_display_fcc_options');
- out_ul.innerHTML = out;
-}
-<&| onload.js &>
- show_fcc_options();
-</&>
-</SCRIPT>
<%init>
my %opt = @_;
my $id = $opt{id} || $opt{field};
diff --git a/httemplate/misc/part_pkg_fcc_options.html b/httemplate/misc/part_pkg_fcc_options.html
index 27b45e003..0db4e2503 100644
--- a/httemplate/misc/part_pkg_fcc_options.html
+++ b/httemplate/misc/part_pkg_fcc_options.html
@@ -156,8 +156,7 @@ function save_changes() {
}
parent_input.value = JSON.stringify(data);
// update the display
- parent.show_fcc_options(parent_input.id);
- parent.cClick(); //overlib
+ parent.finish_edit_fcc(parent_input.id);
}
function enable_fieldset(fieldset_id) {
diff --git a/httemplate/search/477.html b/httemplate/search/477.html
index 244bfa1df..ff2ac8638 100644
--- a/httemplate/search/477.html
+++ b/httemplate/search/477.html
@@ -212,7 +212,7 @@ my $part_titles = FS::Report::FCC_477->parts;
</%def>
<%def .header_voip>
<TR CLASS="head">
- <TD ROWSPAN=2>State</TD>
+ <TD ROWSPAN=3>State</TD>
<TD COLSPAN=2>VoIP OTT</TD>
<TD COLSPAN=8>VoIP Non-OTT</TD>
</TR>