diff options
Diffstat (limited to 'httemplate/elements')
-rw-r--r-- | httemplate/elements/deploy_zone_block.html | 47 | ||||
-rw-r--r-- | httemplate/elements/deploy_zone_vertex.html | 45 | ||||
-rw-r--r-- | httemplate/elements/input-fcc_options.html | 114 | ||||
-rw-r--r-- | httemplate/elements/menu.html | 4 | ||||
-rw-r--r-- | httemplate/elements/tr-input-fcc_options.html | 102 |
5 files changed, 310 insertions, 2 deletions
diff --git a/httemplate/elements/deploy_zone_block.html b/httemplate/elements/deploy_zone_block.html new file mode 100644 index 000000000..9985944bd --- /dev/null +++ b/httemplate/elements/deploy_zone_block.html @@ -0,0 +1,47 @@ +% unless ( $opt{'js_only'} ) { + + <INPUT TYPE="hidden" NAME="<%$name%>" ID="<%$id%>" VALUE="<% $curr_value %>"> + Block + <INPUT TYPE = "text" + NAME = "<%$name%>_censusblock" + ID = "<%$id%>_censusblock" + VALUE = "<% scalar($cgi->param($name.'_censusblock')) + || $deploy_zone_block->censusblock + %>" + SIZE = 17 + MAXLENGTH = 15 + <% $onchange %> + > + + Year + <INPUT TYPE = "text" + NAME = "<%$name%>_censusyear" + ID = "<%$id%>_censusyear" + VALUE = "<% scalar($cgi->param($name.'_censusyear')) + || $deploy_zone_block->censusyear + %>" + SIZE = 5 + MAXLENGTH = 4 + <% $onchange %> + > +% } +<%init> + +my( %opt ) = @_; + +my $name = $opt{'element_name'} || $opt{'field'} || 'blocknum'; +my $id = $opt{'id'} || 'blocknum'; + +my $curr_value = $opt{'curr_value'} || $opt{'value'}; + +my $onchange = $opt{'onchange'}; +if ( $onchange ) { + $onchange =~ s/\(what\);/(this);/; + $onchange = 'onchange="'.$onchange.'"'; +} + +my $deploy_zone_block = $curr_value + ? FS::deploy_zone_block->by_key($curr_value) + : FS::deploy_zone_block->new; + +</%init> 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/elements/input-fcc_options.html b/httemplate/elements/input-fcc_options.html new file mode 100644 index 000000000..85a647043 --- /dev/null +++ b/httemplate/elements/input-fcc_options.html @@ -0,0 +1,114 @@ +% unless ($opt{js_only}) { +<& hidden.html, 'field' => $id, @_ &> +%# <& input-text.html, 'id' => $id, @_ &> # XXX debugging +<UL ID="<%$id%>_display_fcc_options" CLASS="fcc_options"> +</UL> +<button type="button" class="edit_fcc_button" data-target="<% $id %>"> + Edit +</button> +% } +% unless ($opt{html_only}) { +% my $popup = $fsurl.'misc/part_pkg_fcc_options.html?id='; +% my $popup_name = 'popup-'.time. "-$$-". rand() * 2**32; +<SCRIPT TYPE="text/javascript"> +function edit_fcc_options() { + var id = this.dataset['target']; + overlib( + OLiframeContent( '<% $popup %>' + id, + 760, 600, '<% $popup_name %>', 0, 'auto' ), + CAPTION, 'FCC Form 477 options', + STICKY, AUTOSTATUSCAP, MIDX, 0, MIDY, 0, + DRAGGABLE, CLOSECLICK, + BGCOLOR, '#333399', CGCOLOR, '#333399', + CLOSETEXT, 'Close' + ); +} + +var technology_labels = <% encode_json(FS::part_pkg_fcc_option->technology_labels) %>; +function show_fcc_options(id) { + 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 = String.toLowerCase(curr_values['media'] || 'unknown media'); + if ( curr_values['is_consumer'] ) { + out += '<li><strong>Consumer-grade</strong> service</li>'; + } else { + out += '<li><strong>Business-grade</strong> service</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>'; + out += '<li><strong>' + curr_values['voip_sessions'] + + '</strong> sessions allowed</li>'; + if ( curr_values['voip_lastmile'] ) { + out += '<li><strong>Including</strong> last-mile connection</li>'; + } else { + out += '<li>Using a <strong>separate</strong> last-mile connection</li>'; + } + } // is_voip + if ( curr_values['is_mobile'] ) { + out += '<li><strong>Mobile</strong> telephone service</li>'; + if ( curr_values['mobile_direct'] ) { + out += '<li>Billed <strong>directly to the user</strong></li>'; + } + } // is_mobile + + var out_ul = document.getElementById(id + '_display_fcc_options'); + out_ul.innerHTML = out; +} +<&| onload.js &> + var edit_fcc_buttons = document.getElementsByClassName('edit_fcc_button'); + for(var i = 0; i < edit_fcc_buttons.length; i++) { + var button = edit_fcc_buttons[i]; + show_fcc_options( button.dataset['target'] ); + button.addEventListener('click', edit_fcc_options); + } +</&> +</SCRIPT> +% } +<%init> +my %opt = @_; +my $id = $opt{id} || $opt{field}; +</%init> diff --git a/httemplate/elements/menu.html b/httemplate/elements/menu.html index 8355d7a2c..7e329cf23 100644 --- a/httemplate/elements/menu.html +++ b/httemplate/elements/menu.html @@ -258,8 +258,8 @@ $report_packages{'Suspended customer packages'} = [ $fsurl.'search/cust_pkg.cgi $report_packages{'Suspension summary'} = [ $fsurl.'search/cust_pkg_susp.html', 'Show suspension activity', ] if $curuser->access_right('Summarize packages'); $report_packages{'Customer packages with unconfigured services'} = [ $fsurl.'search/cust_pkg.cgi?APKG_pkgnum', 'List packages which have provisionable services' ]; -$report_packages{'FCC Form 477 packages'} = [ $fsurl.'search/report_477.html', 'Summarize packages by census tract for particular types' ] - if $conf->exists('cust_main-require_censustract'); +$report_packages{'FCC Form 477'} = [ $fsurl.'search/report_477.html' ] + if $conf->exists('part_pkg-show_fcc_options'); $report_packages{'Advanced package reports'} = [ $fsurl.'search/report_cust_pkg.html', 'by agent, date range, status, package definition' ]; tie my %report_inventory, 'Tie::IxHash', diff --git a/httemplate/elements/tr-input-fcc_options.html b/httemplate/elements/tr-input-fcc_options.html new file mode 100644 index 000000000..58f7247c4 --- /dev/null +++ b/httemplate/elements/tr-input-fcc_options.html @@ -0,0 +1,102 @@ +<STYLE> + ul.fcc_options { + font-weight: normal; + text-align: left; + padding: 0em 1em 0em 2em; + } +</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 + </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 = String.toLowerCase(curr_values['media'] || 'unknown media'); + 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}; +</%init> |