X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Felements%2Fselect-did.html;h=60cfcabbab4eebec8616c5f29c014cc7f96d6725;hb=110e4ab13ff3b0d7df2265a68e92170c59d76e61;hp=fe1e5d1639665b268e21ee7b552eabcb78335a8d;hpb=db3e520bad7240b3f6f0d53a2b55a64ef116890b;p=freeside.git diff --git a/httemplate/elements/select-did.html b/httemplate/elements/select-did.html index fe1e5d163..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' @@ -34,6 +74,7 @@ Example: NAME = "phonenum_which" VALUE = "phonenum" onChange = "phonenum_which_changed(this)" + onClick = "phonenum_which_changed(this)" <% $phonenum_checked %> > Inventory @@ -80,18 +121,18 @@ Example: % # if/when other folks need an areacode-less DID selector that goes % # directly from state to region - - <% include('/elements/select.html', - 'field' => 'phonenum_state', - 'id' => 'phonenum_state', - 'options' => [ '', @{ $export->get_dids } ], - 'labels' => { '' => 'Select province' }, - 'onchange' => 'phonenum_state_changed(this);', - 'disabled' => ( $manual_checked ? 1 : 0 ), - ) - %> -
>Province - + + <% include('/elements/select.html', + 'field' => 'phonenum_state', + 'id' => 'phonenum_state', + 'options' => [ '', @{ $export->get_dids } ], + 'labels' => { '' => 'Select province' }, + 'onchange' => 'phonenum_state_changed(this);', + 'disabled' => ( $manual_checked ? 1 : 0 ), + ) + %> +
>Province + <% include('/elements/select-region.html', @@ -127,11 +168,12 @@ Example: NAME = "phonenum_which" VALUE = "phonenum_manual" onChange = "phonenum_which_changed(this)" + onClick = "phonenum_which_changed(this)" <% $manual_checked %> > Manual entry - + <& /elements/input-text.html, %opt, field => 'phonenum_manual', @@ -296,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; @@ -308,6 +349,5 @@ my $country = ( $export && $export->option('country') ) || $conf->config('countrydefault') || 'US'; -#my $field = $opt{'field'} || 'phonenum'; - +