summaryrefslogtreecommitdiff
path: root/httemplate
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2017-03-21 19:15:27 -0700
committerIvan Kohler <ivan@freeside.biz>2017-03-21 19:15:27 -0700
commit110e4ab13ff3b0d7df2265a68e92170c59d76e61 (patch)
tree237e0572fedc3f22019f581260c7e066f3435d2a /httemplate
parent8410cdd0df8c470b0d804be5e03539303f2a8079 (diff)
UI improvments porting in when there's an inventory selector: can enter a phone number instead of selecting from inventory, RT#73618
Diffstat (limited to 'httemplate')
-rw-r--r--httemplate/edit/svc_phone.cgi3
-rw-r--r--httemplate/elements/select-did.html46
2 files changed, 42 insertions, 7 deletions
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:
);
</%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>