5 padding: 0em 1em 0em 2em;
10 <& hidden.html, 'id' => $id, @_ &>
11 %# <& input-text.html, 'id' => $id, @_ &> # XXX debugging
12 <UL ID="<%$id%>_display_fcc_options" CLASS="fcc_options">
14 <BUTTON TYPE="button" onclick="edit_fcc_options()">
17 % # show some kind of useful summary of the FCC options here
20 <SCRIPT TYPE="text/javascript">
21 function edit_fcc_options() {
22 <& popup_link_onclick.html,
23 'action' => $fsurl.'misc/part_pkg_fcc_options.html?id=' . $id,
24 'actionlabel' => 'FCC Form 477 options',
29 var technology_labels = <% encode_json(FS::part_pkg_fcc_option->technology_labels) %>;
30 function show_fcc_options() {
31 var curr_values = JSON.parse(document.getElementById('<% $id %>').value);
32 // hardcoded for the same reasons as misc/part_pkg_fcc_options
34 var tech = curr_values['technology'];
36 if (technology_labels[tech]) {
37 tech = technology_labels[tech];
39 tech = 'Technology '+tech; // unknown?
42 var media = String.toLowerCase(curr_values['media'] || 'unknown media');
43 if ( curr_values['is_consumer'] ) {
44 out += '<li><strong>Consumer-grade</strong></li>>';
46 out += '<li><strong>Business-grade</strong></li>';
48 if ( curr_values['is_broadband'] ) {
49 out += '<li>Broadband via <strong>' + tech + '</strong>'
50 + '<li><strong>' + curr_values['broadband_downstream']
51 + 'Mbps </strong> down / '
52 + '<strong>' + curr_values['broadband_upstream']
53 + 'Mbps </strong> up</li>';
55 if ( curr_values['is_phone'] ) {
56 if ( curr_values['phone_wholesale'] ) {
57 out += '<li>Wholesale telephone</li>';
58 if ( curr_values['phone_vges'] ) {
59 out += '<li><strong>' + curr_values['phone_vges'] + '</strong>'
60 + ' switched voice-grade lines</li>';
62 if ( curr_values['phone_circuits'] ) {
63 out += '<li><strong>' + curr_values['phone_circuits'] + '</strong>'
64 + ' unswitched circuits</li>';
68 out += '<li>Local telephone over <strong>' + media + '</strong></li>'
69 + '<li><strong>' + curr_values['phone_lines']
70 + '</strong> voice-grade lines</li>';
71 if ( curr_values['phone_localloop'] == 'resale' ) {
72 out += '<li><strong>Resold</strong> from another carrier</li>>';
73 } else if ( curr_values['phone_localloop'] == 'leased' ) {
74 out += '<li>Using <strong>leased circuits</strong> from another carrier</li>';
75 } else if ( curr_values['phone_localloop'] == 'owned' ) {
76 out += '<li>Using <strong>our own circuits</strong></li>';
78 if ( curr_values['phone_longdistance'] ) {
79 out += '<li>Includes <strong>long-distance service</strong></li>';
83 if ( curr_values['is_voip'] ) {
84 out += '<li><strong>VoIP</strong> telephone service</li>';
85 if ( curr_values['voip_ott'] ) {
86 out += '<li>Using a <strong>separate</strong> last-mile connection</li>';
88 out += '<li><strong>Including</strong> last-mile connection</li>';
92 var out_ul = document.getElementById('<% $id %>_display_fcc_options');
93 out_ul.innerHTML = out;
101 my $id = $opt{id} || $opt{field};