X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fsvc_phone.cgi;h=9647b6887fc5fb86c32e30674a2d15dee7b436c0;hb=7aef2e455fe8a4722036f231ee8609ac63b2a9c9;hp=1623ed38a326385a7c51bbfcd33043f508141009;hpb=1e1d4445682c0e69781654ea7f2851d861031e9f;p=freeside.git diff --git a/httemplate/edit/svc_phone.cgi b/httemplate/edit/svc_phone.cgi index 1623ed38a..9647b6887 100644 --- a/httemplate/edit/svc_phone.cgi +++ b/httemplate/edit/svc_phone.cgi @@ -1,49 +1,68 @@ -<% include( 'elements/svc_Common.html', - 'table' => 'svc_phone', - 'fields' => \@fields, - 'svc_new_callback' => sub { - my( $cgi, $svc_x, $part_svc, $cust_pkg, $fields, $opt ) = @_; - $svc_x->locationnum($cust_pkg->locationnum) if $cust_pkg; - }, - ) -%> +<& elements/svc_Common.html, + 'table' => 'svc_phone', + 'fields' => [], + 'begin_callback' => $begin_callback, + 'svc_new_callback' => sub { + my( $cgi, $svc_x, $part_svc, $cust_pkg, $fields, $opt ) = @_; + $svc_x->locationnum($cust_pkg->locationnum) if $cust_pkg; + }, +&> <%init> -die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('Provision customer service'); #something else more specific? +my $begin_callback = sub { + my( $cgi, $fields, $opt ) = @_; -my $conf = new FS::Conf; + my $bulk = $cgi->param('bulk') ? 1 : 0; -my @fields = ( 'countrycode', - { field => 'phonenum', - type => 'select-did', - label => 'Phone number', - }, - ); + my $right = $bulk ? 'Bulk provision customer service' + : 'Provision customer service'; -push @fields, { field => 'domsvc', - type => 'select-svc-domain', - label => 'Domain', - } - if $conf->exists('svc_phone-domain'); + die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right($right); -push @fields, { field => 'pbxsvc', - type => 'select-svc_pbx', - label => 'PBX', - }, + my $conf = new FS::Conf; + + push @$fields, + 'countrycode', + { field => 'phonenum', + type => 'select-did', + label => 'Phone number', + multiple => $bulk, + }; + + push @$fields, { field => 'domsvc', + type => 'select-svc-domain', + label => 'Domain', + } + if $conf->exists('svc_phone-domain'); + + push @$fields, { field => 'pbxsvc', + type => 'select-svc_pbx', + label => 'PBX', + }; + + if ( $bulk ) { + + push @$fields, { field => 'bulk', + type => 'hidden', + value => '1', + }; + + } else { + + push @$fields, 'sip_password', 'pin', { field => 'phone_name', type => 'text', maxlength => $conf->config('svc_phone-phone_name-max_length'), }, - 'route', 'forwarddst', 'email', { value => 'E911 Information', type => 'tablebreak-tr-title', - colspan => 7, + colspan => 8, }, { field => 'locationnum', type => 'select-cust_location', @@ -63,13 +82,14 @@ push @fields, { field => 'pbxsvc', }, }, { field => 'custnum', type=> 'hidden' }, #for new cust_locations -; + ; + } -if ( $conf->exists('svc_phone-lnp') ) { - push @fields, + if ( $conf->exists('svc_phone-lnp') && !$bulk ) { + push @$fields, { value => 'Number Portability', type => 'tablebreak-tr-title', - colspan => 7, + colspan => 8, }, { field => 'lnp_status', type => 'select-lnp_status', @@ -88,7 +108,9 @@ if ( $conf->exists('svc_phone-lnp') ) { }, 'lnp_other_provider', 'lnp_other_provider_account', -; -} + ; + } + +};