From: Ivan Kohler Date: Wed, 22 Mar 2017 02:15:27 +0000 (-0700) Subject: UI improvments porting in when there's an inventory selector: can enter a phone numbe... X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=110e4ab13ff3b0d7df2265a68e92170c59d76e61 UI improvments porting in when there's an inventory selector: can enter a phone number instead of selecting from inventory, RT#73618 --- diff --git a/FS/FS/part_export/vitelity.pm b/FS/FS/part_export/vitelity.pm index d70929c8b..0b6b81b27 100644 --- a/FS/FS/part_export/vitelity.pm +++ b/FS/FS/part_export/vitelity.pm @@ -45,6 +45,7 @@ sub rebless { shift; } sub can_get_dids { 1; } sub get_dids_can_tollfree { 1; }; +sub can_lnp { 1; } sub get_dids { my $self = shift; @@ -500,6 +501,12 @@ sub check_lnp { warn "ERROR setting lnp_status for DID ". $svc_phone->phonenum. ": $error" if $error; } + } elsif ( $result ne $svc_phone->lnp_reject_reason ) { + $svc_phone->lnp_reject_reason($result); + $error = $svc_phone->replace; + #XXX log this using our internal log instead, so we can alert on it + warn "ERROR setting lnp_reject_reason for DID ". $svc_phone->phonenum. ": $error" if $error; + } } diff --git a/httemplate/edit/svc_phone.cgi b/httemplate/edit/svc_phone.cgi index e74ffbb84..ef5cec663 100644 --- a/httemplate/edit/svc_phone.cgi +++ b/httemplate/edit/svc_phone.cgi @@ -107,9 +107,6 @@ my $begin_callback = sub { type => 'tablebreak-tr-title', colspan => 8, }, - { field => 'lnp_status', - type => 'select-lnp_status', - }, 'lnp_reject_reason', { field => 'portable', type => 'checkbox', diff --git a/httemplate/elements/select-did.html b/httemplate/elements/select-did.html index 8a91d7a61..60cfcabba 100644 --- a/httemplate/elements/select-did.html +++ b/httemplate/elements/select-did.html @@ -11,6 +11,46 @@ Example: ); +% if ( $conf->exists('svc_phone-lnp') ) { #ask exports if they can_lnp instead? + <& /elements/selectlayers.html, + 'field' => 'lnp_status', + 'curr_value' => $opt{'lnp_status'}, + 'options' => [ '', 'portingin', 'native', 'portedin', 'portingout', + 'portin-reject', 'portout-reject', + ], + 'labels' => { '' => 'Select new number', + 'portingin' => 'Port an existing number', + 'native' => 'Native', + 'portedin' => 'Ported In', + 'portingout' => 'Porting Out', + 'portin-reject' => 'Port-In Reject', + 'portout-reject' => 'Port-Out Reject', + }, + 'layer_callback' => sub { + my( $layer, $layer_fields, $layer_values, $layer_prefix ) = @_; + if ( $layer eq 'portingin' ) { + $m->scomp('/elements/input-text.html', %opt, 'type'=>'text' ); + } elsif ( $layer ne '' ) { + $m->scomp('/elements/hidden.html', %opt). + $m->scomp('/elements/phonenumber.html', $opt{'curr_value'}, 'callable' => 1); + } else { + $m->scomp('/elements/select-did.html:not_porting', %opt); + } + }, + &> + + +% } else { + <& /elements/select-did.html:not_porting, %opt &> +% } +<%init> + +my %opt = @_; + +my $conf = new FS::Conf; + + +<%method not_porting> % if ( $use_selector ) { % if ( $export->option('restrict_selection') eq 'non-tollfree' @@ -298,8 +338,7 @@ my @exports = $part_svc->part_export_did; if ( scalar(@exports) > 1 ) { die "more than one DID-providing export attached to svcpart $svcpart"; } -my $export = ''; -$export = $exports[0] if scalar(@exports); +my $export = scalar(@exports) ? $exports[0] : ''; my $use_selector = scalar(@exports) ? 1 : 0; @@ -310,6 +349,5 @@ my $country = ( $export && $export->option('country') ) || $conf->config('countrydefault') || 'US'; -#my $field = $opt{'field'} || 'phonenum'; - +