From 6cc3e679908ad79f0080960d30b1cab689326a07 Mon Sep 17 00:00:00 2001 From: Mark Wells Date: Fri, 21 Nov 2014 16:33:04 -0800 Subject: fix several UI nits in FCC 477 report configuration, #24047 --- httemplate/elements/input-fcc_options.html | 3 +- httemplate/elements/tr-input-fcc_options.html | 89 +-------------------------- 2 files changed, 3 insertions(+), 89 deletions(-) (limited to 'httemplate/elements') 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 += '
  • VoIP telephone service
  • '; + out += '
  • VoIP telephone service over ' + + media + '
  • '; out += '
  • ' + curr_values['voip_sessions'] + ' sessions allowed
  • '; 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 @@ - <& hidden.html, 'id' => $id, @_ &> -%# <& input-text.html, 'id' => $id, @_ &> # XXX debugging - - -% # show some kind of useful summary of the FCC options here + <& input-fcc_options.html, 'id' => $id, @_ &> - <%init> my %opt = @_; my $id = $opt{id} || $opt{field}; -- cgit v1.2.1 From 3cda3a85eb0daa5b8b9f4d30cd0896da6ccf4a9b Mon Sep 17 00:00:00 2001 From: Mark Wells Date: Tue, 25 Nov 2014 19:39:23 -0800 Subject: option to credit unused time on suspension as part of suspend reason, #31702 --- httemplate/elements/tr-select-reason.html | 232 ++++++++++++++---------------- 1 file changed, 108 insertions(+), 124 deletions(-) (limited to 'httemplate/elements') diff --git a/httemplate/elements/tr-select-reason.html b/httemplate/elements/tr-select-reason.html index b7a715b42..c5b3d6f6c 100755 --- a/httemplate/elements/tr-select-reason.html +++ b/httemplate/elements/tr-select-reason.html @@ -29,109 +29,119 @@ Example: +% # 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 - - <% mt('Reason') |h %> - - - - - -% my @types = qsearch( 'reason_type', { 'class' => $class } ); -% if (scalar(@types) < 1) { # we should never reach this - - -

    <% mt('No reason types. Please add some.') |h %>

    - - -% }elsif (scalar(@types) == 1) { - - -

    <% mt('Reason Type') |h %>

    - - -

    <% $types[0]->type %> - - - - -% }else{ - - - -

    <% mt('Reason Type') |h %>

    - - - - - -% } +%# 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
    , but that doesn't fit well into the table + + + + + + <& 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 + + + +% } 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-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', + &> % } +
    +

    <% mt('No reason types. Please add some.') |h %>

    +
    -
    + + +% # container for hints - -

    <% mt('New Reason') |h %>

    + - " style="display:<% $display %>"> <%init> @@ -148,11 +158,7 @@ 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; my $add_access_right; if ($class eq 'C') { @@ -167,41 +173,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 +211,13 @@ if ( $class eq 'S' ) { 'Unsuspend pkg #'.$reason->unsuspend_pkgpart. ' not found.'; } - } 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('
    ', @hints); } - push @hints, ''; # for the "new reason" case - @hints = map {''.$_.''} @hints; } - my $curuser = $FS::CurrentUser::CurrentUser; - -- cgit v1.2.1 From 0f0bc1ef7aafc6b3869c0f71ee2528c1c9897ce6 Mon Sep 17 00:00:00 2001 From: Mark Wells Date: Wed, 26 Nov 2014 16:55:41 -0800 Subject: don't look up or display census tracts for non-U.S. addresses, #32249 --- httemplate/elements/standardize_locations.js | 13 +++++++++---- httemplate/elements/tr-censustract.html | 2 +- 2 files changed, 10 insertions(+), 5 deletions(-) (limited to 'httemplate/elements') diff --git a/httemplate/elements/standardize_locations.js b/httemplate/elements/standardize_locations.js index 817a2e357..a4f13d78d 100644 --- a/httemplate/elements/standardize_locations.js +++ b/httemplate/elements/standardize_locations.js @@ -290,10 +290,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) { <% mt('Census tract') |h %> -- cgit v1.2.1 From 1af8ff7f48f7259fc99f090c301c84b9680fdb4d Mon Sep 17 00:00:00 2001 From: Mark Wells Date: Thu, 27 Nov 2014 15:21:29 -0800 Subject: svc_circuit, #23879, #25933, #30830 --- httemplate/elements/menu.html | 8 +++++ httemplate/elements/tr-select-svc_circuit.html | 41 ++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 httemplate/elements/tr-select-svc_circuit.html (limited to 'httemplate/elements') diff --git a/httemplate/elements/menu.html b/httemplate/elements/menu.html index f26882b1f..b4ecdc490 100644 --- a/httemplate/elements/menu.html +++ b/httemplate/elements/menu.html @@ -552,6 +552,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' ]; @@ -572,6 +578,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/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 + +% } 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", + ); +} + + -- cgit v1.2.1 From ffda3975d8eefa8d08ae9e468dba33448e207ae6 Mon Sep 17 00:00:00 2001 From: Mark Wells Date: Sat, 29 Nov 2014 16:36:19 -0800 Subject: fix editing of events that have reasons, from #31702 --- httemplate/elements/tr-select-reason.html | 1 + 1 file changed, 1 insertion(+) (limited to 'httemplate/elements') diff --git a/httemplate/elements/tr-select-reason.html b/httemplate/elements/tr-select-reason.html index c5b3d6f6c..0df7c058a 100755 --- a/httemplate/elements/tr-select-reason.html +++ b/httemplate/elements/tr-select-reason.html @@ -159,6 +159,7 @@ if ( $opt{'cgi'} ) { } my $id = $opt{'id'} || $name; +$id =~ s/\./_/g; # for edit/part_event my $add_access_right; if ($class eq 'C') { -- cgit v1.2.1 From 801cd481b579d387dbe21266c717ef5d0b9aa422 Mon Sep 17 00:00:00 2001 From: Mark Wells Date: Tue, 2 Dec 2014 15:43:34 -0800 Subject: when address standardization returns a censustract, don't try to look it up through FFIEC also, #32459 --- httemplate/elements/location.html | 52 +++++++++++++++++----------- httemplate/elements/standardize_locations.js | 5 +-- 2 files changed, 33 insertions(+), 24 deletions(-) (limited to 'httemplate/elements') 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: % } else { - - + <& hidden.html, field => $pre.'locationname', value => $object->get('locationname') &> % } @@ -102,10 +97,7 @@ Example: % } else { # alternate format - +<& hidden.html, field => $pre.'address2', value => $object->get('address2') &> <<%$th%> ALIGN="right">Unit type and #> @@ -227,14 +219,14 @@ Example: % } else { % foreach (qw(latitude longitude)) { - +<& hidden.html, field => $pre.$_, value => $object->get($_) &> % } % } - - - - - +% +% foreach (qw(coord_auto geocode censustract censusyear)) { + <& hidden.html, field => $pre.$_, value => $object->get($_) &> +% } +% % if ( $opt{enable_censustract} ) { Census tract @@ -259,7 +251,7 @@ Example: % } else { - + <& 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) ) { - +<& hidden.html, field => 'old_'.$pre.$_, value => $object->get($_) &> % } %# Placeholders - - +<& hidden.html, field => $pre.'cachenum', value => '' &> +<& hidden.html, field => $pre.'addr_clean', value => '' &> diff --git a/httemplate/elements/standardize_locations.js b/httemplate/elements/standardize_locations.js index a4f13d78d..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; -- cgit v1.2.1