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 = curr_values['media'] || 'unknown media';
43 media = media.toLowerCase();
44 if ( curr_values['is_consumer'] ) {
45 out += '<li><strong>Consumer-grade</strong></li>>';
47 out += '<li><strong>Business-grade</strong></li>';
49 if ( curr_values['is_broadband'] ) {
50 out += '<li>Broadband via <strong>' + tech + '</strong>'
51 + '<li><strong>' + curr_values['broadband_downstream']
52 + 'Mbps </strong> down / '
53 + '<strong>' + curr_values['broadband_upstream']
54 + 'Mbps </strong> up</li>';
56 if ( curr_values['is_phone'] ) {
57 if ( curr_values['phone_wholesale'] ) {
58 out += '<li>Wholesale telephone</li>';
59 if ( curr_values['phone_vges'] ) {
60 out += '<li><strong>' + curr_values['phone_vges'] + '</strong>'
61 + ' switched voice-grade lines</li>';
63 if ( curr_values['phone_circuits'] ) {
64 out += '<li><strong>' + curr_values['phone_circuits'] + '</strong>'
65 + ' unswitched circuits</li>';
69 out += '<li>Local telephone over <strong>' + media + '</strong></li>'
70 + '<li><strong>' + curr_values['phone_lines']
71 + '</strong> voice-grade lines</li>';
72 if ( curr_values['phone_localloop'] == 'resale' ) {
73 out += '<li><strong>Resold</strong> from another carrier</li>>';
74 } else if ( curr_values['phone_localloop'] == 'leased' ) {
75 out += '<li>Using <strong>leased circuits</strong> from another carrier</li>';
76 } else if ( curr_values['phone_localloop'] == 'owned' ) {
77 out += '<li>Using <strong>our own circuits</strong></li>';
79 if ( curr_values['phone_longdistance'] ) {
80 out += '<li>Includes <strong>long-distance service</strong></li>';
84 if ( curr_values['is_voip'] ) {
85 out += '<li><strong>VoIP</strong> telephone service</li>';
86 if ( curr_values['voip_ott'] ) {
87 out += '<li>Using a <strong>separate</strong> last-mile connection</li>';
89 out += '<li><strong>Including</strong> last-mile connection</li>';
93 var out_ul = document.getElementById('<% $id %>_display_fcc_options');
94 out_ul.innerHTML = out;
102 my $id = $opt{id} || $opt{field};