[freeside-commits] branch master updated. 110e4ab13ff3b0d7df2265a68e92170c59d76e61

Ivan ivan at 420.am
Tue Mar 21 19:15:29 PDT 2017


The branch, master has been updated
       via  110e4ab13ff3b0d7df2265a68e92170c59d76e61 (commit)
      from  8410cdd0df8c470b0d804be5e03539303f2a8079 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 110e4ab13ff3b0d7df2265a68e92170c59d76e61
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Tue Mar 21 19:15:27 2017 -0700

    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 d70929c..0b6b81b 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 e74ffbb..ef5cec6 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 8a91d7a..60cfcab 100644
--- a/httemplate/elements/select-did.html
+++ b/httemplate/elements/select-did.html
@@ -11,6 +11,46 @@ Example:
          );
 
 </%doc>
+% 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;
+
+</%init>
+<%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';
-
 </%init>
+</%method>

-----------------------------------------------------------------------

Summary of changes:
 FS/FS/part_export/vitelity.pm       |    7 ++++++
 httemplate/edit/svc_phone.cgi       |    3 ---
 httemplate/elements/select-did.html |   46 ++++++++++++++++++++++++++++++++---
 3 files changed, 49 insertions(+), 7 deletions(-)




More information about the freeside-commits mailing list