+% 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>