diff options
Diffstat (limited to 'httemplate/elements')
-rw-r--r-- | httemplate/elements/input-fcc_options.html | 3 | ||||
-rw-r--r-- | httemplate/elements/location.html | 52 | ||||
-rw-r--r-- | httemplate/elements/menu.html | 8 | ||||
-rw-r--r-- | httemplate/elements/standardize_locations.js | 18 | ||||
-rw-r--r-- | httemplate/elements/tr-censustract.html | 2 | ||||
-rw-r--r-- | httemplate/elements/tr-input-fcc_options.html | 89 | ||||
-rwxr-xr-x | httemplate/elements/tr-select-reason.html | 233 | ||||
-rw-r--r-- | httemplate/elements/tr-select-svc_circuit.html | 41 |
8 files changed, 204 insertions, 242 deletions
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/location.html b/httemplate/elements/location.html index 5cdc424a7..214a7d5f2 100644 --- a/httemplate/elements/location.html +++ b/httemplate/elements/location.html @@ -59,12 +59,7 @@ Example: </TR> % } else { - - <INPUT TYPE = "hidden" - NAME = "<%$pre%>locationname" - ID = "<%$pre%>locationname" - VALUE = "<% $object->get('locationname') |h %>" - > + <& hidden.html, field => $pre.'locationname', value => $object->get('locationname') &> % } @@ -102,10 +97,7 @@ Example: % } else { # alternate format - <INPUT TYPE = "hidden" - NAME = "<%$pre%>address2" - VALUE = "<% $object->get('address2') |h %>" - > +<& hidden.html, field => $pre.'address2', value => $object->get('address2') &> <TR> <<%$th%> ALIGN="right">Unit type and #</<%$th%>> @@ -227,14 +219,14 @@ Example: </TR> % } else { % foreach (qw(latitude longitude)) { -<INPUT TYPE="hidden" NAME="<% $_ %>" ID="<% $_ %>" VALUE="<% $object->get($_) |h%>"> +<& hidden.html, field => $pre.$_, value => $object->get($_) &> % } % } -<INPUT TYPE="hidden" NAME="<%$pre%>coord_auto" VALUE="<% $object->coord_auto %>"> - -<INPUT TYPE="hidden" NAME="<%$pre%>geocode" VALUE="<% $object->geocode %>"> -<INPUT TYPE="hidden" NAME="<%$pre%>censustract" VALUE="<% $object->censustract %>"> -<INPUT TYPE="hidden" NAME="<%$pre%>censusyear" VALUE="<% $object->censusyear %>"> +% +% foreach (qw(coord_auto geocode censustract censusyear)) { + <& hidden.html, field => $pre.$_, value => $object->get($_) &> +% } +% % if ( $opt{enable_censustract} ) { <TR> <TD ALIGN="right">Census tract</TD> @@ -259,7 +251,7 @@ Example: </TD> </TR> % } else { - <INPUT TYPE="hidden" ID="<%$pre%>" NAME="<%$pre%>district" VALUE="<% $object->district %>"> + <& hidden.html, field => $pre.'district', value => $object->get('district') &> % } %# For address standardization: @@ -267,11 +259,11 @@ Example: %# to re-standardize % foreach (qw(address1 city state country zip latitude % longitude censustract district addr_clean) ) { -<INPUT TYPE="hidden" NAME="old_<%$pre.$_%>" ID="old_<%$pre.$_%>" VALUE="<% $object->get($_) |h%>"> +<& hidden.html, field => 'old_'.$pre.$_, value => $object->get($_) &> % } %# Placeholders -<INPUT TYPE="hidden" NAME="<%$pre%>cachenum" VALUE=""> -<INPUT TYPE="hidden" NAME="<%$pre%>addr_clean" VALUE=""> +<& hidden.html, field => $pre.'cachenum', value => '' &> +<& hidden.html, field => $pre.'addr_clean', value => '' &> <SCRIPT TYPE="text/javascript"> <&| /elements/onload.js &> @@ -306,6 +298,26 @@ Example: el.attachEvent('onchange', clear_coords); } } + function clear_censustract() { + // if the user manually edits the census tract, clear the 'hard' census + // tract field so that we can re-verify and present a confirmation popup + + // get the ID of the hidden censustract field + var censustract_id = this.id.replace('enter_', ''); + var el = document.getElementById(censustract_id); + if (el) { + el.value = ''; + } + } + var el = document.getElementById('<%$pre%>enter_censustract'); + if (el) { + if ( el.addEventListener ) { + el.addEventListener('change', clear_censustract); + } else if ( el.attachEvent ) { + el.attachEvent('onchange', clear_censustract); + } + } + </&> </SCRIPT> diff --git a/httemplate/elements/menu.html b/httemplate/elements/menu.html index 3236bc14b..03ce20185 100644 --- a/httemplate/elements/menu.html +++ b/httemplate/elements/menu.html @@ -564,6 +564,12 @@ tie my %config_conferencing, 'Tie::IxHash', 'Quality levels' => [ $fsurl.'browse/conferencing_quality.html', '' ], ; +tie my %config_circuit, 'Tie::IxHash', + 'Circuit types' => [ $fsurl.'browse/circuit_type.html', '' ], + 'Circuit providers' => [ $fsurl.'browse/circuit_provider.html', '' ], + 'Termination types' => [ $fsurl.'browse/circuit_termination.html', '' ], +; + tie my %config_export_svc, 'Tie::IxHash', (); if ( $curuser->access_right('Configuration') ) { $config_export_svc{'Service definitions'} = [ $fsurl.'browse/part_svc.cgi', 'Services are items you offer to your customers' ]; @@ -584,6 +590,8 @@ $config_export_svc{'Conferencing'} = [ \%config_conferencing, '' ] if $curuser->access_right('Configuration'); $config_export_svc{'Alarm'} = [ \%config_alarm, '' ] if $curuser->access_right(['Alarm configuration', 'Alarm global configuration']); +$config_export_svc{'Circuits'} = [ \%config_circuit, '' ] + if $curuser->access_right('Configuration'); $config_export_svc{'Hardware types'} = [ $fsurl.'browse/hardware_class.html', 'Set up hardware type catalog' ] if $curuser->access_right('Configuration'); diff --git a/httemplate/elements/standardize_locations.js b/httemplate/elements/standardize_locations.js index 817a2e357..ff7183b26 100644 --- a/httemplate/elements/standardize_locations.js +++ b/httemplate/elements/standardize_locations.js @@ -279,10 +279,7 @@ function setselect(el, value) { function confirm_censustract() { % if ( FS::Conf->new->exists('cust_main-require_censustract') ) { var form = document.<% $formname %>; - // this is the existing/confirmed censustract, not the manually entered one - if ( form.elements['censustract'].value == '' || - form.elements['censustract'].value != - form.elements['enter_censustract'].value ) { + if ( form.elements['censustract'].value == '' ) { var address_info = form_address_info(); address_info['latitude'] = form.elements['latitude'].value; address_info['longitude'] = form.elements['longitude'].value; @@ -290,10 +287,15 @@ function confirm_censustract() { '<%$p%>/misc/confirm-censustract.html', 'q=' + encodeURIComponent(JSON.stringify(address_info)), function() { - overlib( OLresponseAJAX, CAPTION, 'Confirm censustract', STICKY, - AUTOSTATUSCAP, CLOSETEXT, '', MIDX, 0, MIDY, 0, DRAGGABLE, WIDTH, - 576, HEIGHT, 268, BGCOLOR, '#333399', CGCOLOR, '#333399', - TEXTSIZE, 3 ); + if ( OLresponseAJAX ) { + overlib( OLresponseAJAX, CAPTION, 'Confirm censustract', STICKY, + AUTOSTATUSCAP, CLOSETEXT, '', MIDX, 0, MIDY, 0, DRAGGABLE, WIDTH, + 576, HEIGHT, 268, BGCOLOR, '#333399', CGCOLOR, '#333399', + TEXTSIZE, 3 ); + } else { + // no response + <% $post_censustract %>; + } }, 0); } else { diff --git a/httemplate/elements/tr-censustract.html b/httemplate/elements/tr-censustract.html index bd014f11b..7a4b34943 100644 --- a/httemplate/elements/tr-censustract.html +++ b/httemplate/elements/tr-censustract.html @@ -1,4 +1,4 @@ -% if ($censustract) { +% if ($location->country eq 'US' and $censustract) { <TR> <TD ALIGN="right"><% mt('Census tract') |h %></TD> <TD COLSPAN=5> 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/elements/tr-select-reason.html b/httemplate/elements/tr-select-reason.html index b7a715b42..0df7c058a 100755 --- a/httemplate/elements/tr-select-reason.html +++ b/httemplate/elements/tr-select-reason.html @@ -29,109 +29,119 @@ Example: </%doc> +% # note style improvements. +% # - no more conditionally included code here +% # - callers are not expected to pass javascript fragments +% # - no redundant checking of ACLs or parameters +% # - form fields are grouped for easy management +% # - use the standard select-table widget instead of ad hoc crap <SCRIPT TYPE="text/javascript"> - function sh_add<% $func_suffix %>() - { - var hints = <% encode_json(\@hints) %>; + function <% $id %>_changed() { + var hints = <% encode_json(\%all_hints) %>; var select_reason = document.getElementById('<% $id %>'); -% if ( $class eq 'S' ) { document.getElementById('<% $id %>_hint').innerHTML = - hints[select_reason.selectedIndex]; -% } + hints[select_reason.value] || ''; - if (select_reason.selectedIndex == 0){ - <% $controlledbutton ? $controlledbutton.'.disabled = true;' : ';' %> - }else{ - <% $controlledbutton ? $controlledbutton.'.disabled = false;' : ';' %> + // toggle submit button state + var submit_button = document.getElementById(<% $opt{control_button} |js_string %>); + if (submit_button) { + submit_button.disabled = ( select_reason.value == 0 ); } -%if ($curuser->access_right($add_access_right)){ - - if (select_reason.selectedIndex == - (select_reason.length - 1)) { - document.getElementById('new<% $id %>').disabled = false; - document.getElementById('new<% $id %>').style.display = 'inline'; - document.getElementById('new<% $id %>Label').style.display = 'inline'; - document.getElementById('new<% $id %>T').disabled = false; - document.getElementById('new<% $id %>T').style.display = 'inline'; - document.getElementById('new<% $id %>TLabel').style.display = 'inline'; + // toggle visibility of 'new reason' fields + var new_fields = document.getElementById('<% $id %>_new_fields'); + if ( select_reason.value == -1 ) { + new_fields.disabled = false; + new_fields.style.display = ''; } else { - document.getElementById('new<% $id %>').disabled = true; - document.getElementById('new<% $id %>').style.display = 'none'; - document.getElementById('new<% $id %>Label').style.display = 'none'; - document.getElementById('new<% $id %>T').disabled = true; - document.getElementById('new<% $id %>T').style.display = 'none'; - document.getElementById('new<% $id %>TLabel').style.display = 'none'; + new_fields.disabled = true; + new_fields.style.display = 'none'; } -%} - } + <&| onload.js &> <% $id %>_changed(); </&> </SCRIPT> -<TR> - <TD ALIGN="right"><% mt('Reason') |h %></TD> - <TD> - <SELECT id="<% $id %>" name="<% $name %>" onFocus="sh_add<% $func_suffix %>()" onChange="sh_add<% $func_suffix %>()"> - <OPTION VALUE="" <% ($init_reason eq '') ? 'SELECTED' : '' %>><% mt('Select Reason...') |h %></OPTION> -% foreach my $reason (@reasons) { - <OPTION VALUE="<% $reason->reasonnum %>" <% ($init_reason == $reason->reasonnum) ? 'SELECTED' : '' %>><% $reason->reasontype->type %> : <% $reason->reason %></OPTION> -% } -% if ($curuser->access_right($add_access_right)) { - <OPTION VALUE="-1" <% ($init_reason == -1) ? 'SELECTED' : '' %>><% mt('Add new reason') |h %></OPTION> -% } -% - </SELECT> - </TD> -</TR> - -% my @types = qsearch( 'reason_type', { 'class' => $class } ); -% if (scalar(@types) < 1) { # we should never reach this -<TR> - <TD ALIGN="right"> - <P><% mt('No reason types. Please add some.') |h %></P> - </TD> -</TR> -% }elsif (scalar(@types) == 1) { -<TR> - <TD ALIGN="right"> - <P id="new<% $name %>TLabel" style="display:<% $display %>"><% mt('Reason Type') |h %></P> - </TD> - <TD> - <P id="new<% $name %>T" disabled="<% $disabled %>" style="display:<% $display %>"><% $types[0]->type %> - <INPUT type="hidden" name="new<% $name %>T" value="<% $types[0]->typenum %>"> - </TD> -</TR> - -% }else{ - -<TR> - <TD ALIGN="right"> - <P id="new<% $id %>TLabel" style="display:<% $display %>"><% mt('Reason Type') |h %></P> - </TD> - <TD> - <SELECT id="new<% $id %>T" name="new<% $name %>T" "<% $disabled %>" style="display:<% $display %>"> -% for my $type (@types) { - <OPTION VALUE="<% $type->typenum %>" <% ($init_type == $type->typenum) ? 'SELECTED' : '' %>><% $type->type %></OPTION> -% } - </SELECT> - </TD> -</TR> -% } +%# sadly can't just use add_inline here, as we have non-text fields +<& tr-select-table.html, + 'label' => 'Reason', + 'field' => $name, + 'id' => $id, + 'table' => 'reason', + 'records' => \@reasons, + 'label_callback' => sub { my $reason = shift; + $reason->type . ' : ' . $reason->reason }, + 'disable_empty' => 1, + 'pre_options' => [ 0 => 'Select reason...' ], + 'post_options' => [ -1 => 'Add new reason' ], + 'curr_value' => $init_reason, + 'onchange' => $id.'_changed()', +&> + +% # "add new reason" fields +% # should be a <fieldset>, but that doesn't fit well into the table + +<TR id="<% $id %>_new_fields"> + <TD COLSPAN=2> + <TABLE CLASS="inv" STYLE="text-align: left"> + + <& tr-input-text.html, + label => 'New reason', + field => $id.'_new_reason' + &> + +% my @types = qsearch( 'reason_type', { 'class' => $class } ); +% if (scalar(@types) < 1) { # we should never reach this + <TR> + <TD ALIGN="right"> + <P><% mt('No reason types. Please add some.') |h %></P> + </TD> + </TR> +% } elsif (scalar(@types) == 1) { + <& tr-fixed.html, + label => 'Reason type', + field => $id.'_new_reason_type', + curr_value => $types[0]->typenum, + formatted_value => $types[0]->type, + &> +% } else { # more than one type, the normal case + <& tr-select-table.html, + label => 'Reason type', + field => $id.'_new_reason_type', + table => 'reason_type', + name_col => 'type', + hashref => { 'class' => $class }, + disable_empty => 1, + &> +% } # scalar(@types) % if ( $class eq 'S' ) { -<TR> - <TD COLSPAN=2 ALIGN="center" id="<% $id %>_hint"> - </TD> -</TR> + <& tr-checkbox.html, + label => 'Credit the unused portion of service when suspending', + field => $id.'_new_unused_credit', + value => 'Y' + &> + <& tr-select-part_pkg.html, + label => 'Charge this fee when unsuspending', + field => $id.'_new_unsuspend_pkgpart', + hashref => { disabled => '', freq => '0' }, + empty_label => 'none', + &> + <& tr-checkbox.html, + label => 'Hold unsuspension fee until the next bill', + field => $id.'_new_unsuspend_hold', + value => 'Y', + &> % } + </table> + </td> +</tr> +% # container for hints <TR> - <TD ALIGN="right"> - <P id="new<% $id %>Label" style="display:<% $display %>"><% mt('New Reason') |h %></P> + <TD COLSPAN=2 ALIGN="center" id="<% $id %>_hint" style="font-size:small"> </TD> - <TD><INPUT id="new<% $id %>" name="new<% $name %>" type="text" value="<% $init_newreason |h %>" "<% $disabled %>" style="display:<% $display %>"></TD> </TR> <%init> @@ -148,11 +158,8 @@ if ( $opt{'cgi'} ) { $init_reason = $opt{'curr_value'}; } -my $controlledbutton = $opt{'control_button'}; - -( my $func_suffix = $name ) =~ s/\./_/g; - -my $id = $opt{'id'} || $func_suffix; +my $id = $opt{'id'} || $name; +$id =~ s/\./_/g; # for edit/part_event my $add_access_right; if ($class eq 'C') { @@ -167,41 +174,21 @@ if ($class eq 'C') { die "illegal class: $class"; } -my( $display, $disabled ) = ( 'none', 'DISABLED' ); -my( $init_type, $init_newreason ) = ( '', '' ); -if ($init_reason == -1 || ref($init_reason) ) { - - $display = 'inline'; - $disabled = ''; - - if ( ref($init_reason) ) { - $init_type = $init_reason->{'typenum'}; - $init_newreason = $init_reason->{'reason'}; - $init_reason = -1; - } elsif ( $opt{'cgi'} ) { - $init_type = $opt{'cgi'}->param( "new${name}T" ); - $init_newreason = $opt{'cgi'}->param( "new$name" ); - } - -} - -my $extra_sql = - "WHERE class = '$class' and (disabled = '' OR disabled is NULL)"; - my @reasons = qsearch({ - table => 'reason', - hashref => {}, - extra_sql => $extra_sql, - addl_from => 'LEFT JOIN reason_type '. - ' ON reason_type.typenum = reason.reason_type', - order_by => 'ORDER BY reason_type.type ASC, reason.reason ASC', + 'table' => 'reason', + 'addl_from' => ' LEFT JOIN reason_type'. + ' ON (reason.reason_type = reason_type.typenum)', + 'hashref' => { disabled => '' }, + 'extra_sql' => " AND reason_type.class = '$class'", + 'order_by' => ' ORDER BY type, reason', }); -my @hints; +my %all_hints; if ( $class eq 'S' ) { my $conf = FS::Conf->new; - @hints = ( '' ); + %all_hints = ( 0 => '', -1 => '' ); foreach my $reason (@reasons) { + my @hints; if ( $reason->unsuspend_pkgpart ) { my $part_pkg = FS::part_pkg->by_key($reason->unsuspend_pkgpart); if ( $part_pkg ) { @@ -225,15 +212,13 @@ if ( $class eq 'S' ) { '<FONT COLOR="#ff0000">Unsuspend pkg #'.$reason->unsuspend_pkgpart. ' not found.</FONT>'; } - } else { #no unsuspend_pkgpart - push @hints, ''; } + if ( $reason->unused_credit ) { + push @hints, mt('The customer will be credited for unused time.'); + } + $all_hints{ $reason->reasonnum } = join('<BR>', @hints); } - push @hints, ''; # for the "new reason" case - @hints = map {'<FONT SIZE="-1">'.$_.'</FONT>'} @hints; } - my $curuser = $FS::CurrentUser::CurrentUser; - </%init> diff --git a/httemplate/elements/tr-select-svc_circuit.html b/httemplate/elements/tr-select-svc_circuit.html new file mode 100644 index 000000000..fb55501c5 --- /dev/null +++ b/httemplate/elements/tr-select-svc_circuit.html @@ -0,0 +1,41 @@ +% if ( $columnflag eq 'F' ) { # no good reason for this, but support it anyway + <INPUT TYPE="hidden" NAME="circuit_svcnum" VALUE="<% $circuit_svcnum %>"> +% } else { + <& tr-select-table.html, + 'table' => 'svc_circuit', + 'name_col' => 'circuit_id', + 'empty_label' => ' ', + %select_hash, + %opt + &> +% } +<%init> + +my %opt = @_; + +my $circuit_svcnum; +if ( $opt{'curr_value'} =~ /^(\d+)$/ ) { + $circuit_svcnum = $1; +} + +# generally not the svcpart of the circuit service (or any circuit service) +my $part_svc = $opt{'part_svc'} + || qsearchs('part_svc', { 'svcpart' => $opt{'svcpart'} }); + +my $columnflag = $part_svc->part_svc_column('circuit_svcnum')->columnflag; + +my $cust_pkg = $opt{'cust_pkg'}; +my $custnum; +$custnum = $cust_pkg->custnum if $cust_pkg; + +my %select_hash; +if ( $custnum =~ /^(\d+)$/ ) { + %select_hash = ( + 'addl_from' => ' LEFT JOIN cust_svc USING (svcnum)' . + ' LEFT JOIN cust_pkg USING (pkgnum)', + 'extra_sql' => " WHERE cust_pkg.custnum = $custnum". + " OR svcnum = $circuit_svcnum", + ); +} + +</%init> |