X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fsvc_phone.cgi;h=b77d962338f84e0ea04f3a0cc4d9366992b4752c;hb=d6741df87df9e3352d7ae47a02d0e3f46154fef9;hp=d7629ab6f10c45af4073946cf433461936f7435b;hpb=63a268637b2d51a8766412617724b9436439deb6;p=freeside.git diff --git a/httemplate/edit/svc_phone.cgi b/httemplate/edit/svc_phone.cgi index d7629ab6f..b77d96233 100644 --- a/httemplate/edit/svc_phone.cgi +++ b/httemplate/edit/svc_phone.cgi @@ -1,22 +1,21 @@ <% include( 'elements/svc_Common.html', - 'name' => 'Phone number', 'table' => 'svc_phone', - 'fields' => [ 'countrycode', - { field => 'phonenum', - type => 'select-did', - label => 'Phone number', - }, - 'sip_password', - 'pin', - 'phone_name', - ], + 'fields' => \@fields, 'labels' => { + 'svcnum' => 'Service', 'countrycode' => 'Country code', 'phonenum' => 'Phone number', + 'domsvc' => 'Domain', 'sip_password' => 'SIP password', 'pin' => 'Voicemail PIN', 'phone_name' => 'Name', + 'pbxsvc' => 'PBX', + 'locationnum' => 'E911 location', }, + 'svc_new_callback' => sub { + my( $cgi, $svc_x, $part_svc, $cust_pkg, $fields, $opt ) = @_; + $svc_x->locationnum($cust_pkg->locationnum) if $cust_pkg; + }, ) %> <%init> @@ -24,4 +23,55 @@ die "access denied" unless $FS::CurrentUser::CurrentUser->access_right('Provision customer service'); #something else more specific? +my $conf = new FS::Conf; + +my @fields = ( 'countrycode', + { field => 'phonenum', + type => 'select-did', + label => 'Phone number', + }, + ); + +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', + }, + 'sip_password', + 'pin', + { field => 'phone_name', + type => 'text', + maxlength => $conf->config('svc_phone-phone_name-max_length'), + }, + + { value => 'E911 Information', + type => 'tablebreak-tr-title', + colspan => 7, + }, + { field => 'locationnum', + type => 'select-cust_location', + label => 'E911 location', + include_opt_callback => sub { + my $svc_phone = shift; + my $pkgnum = $svc_phone->get('pkgnum') + || $cgi->param('pkgnum') + || $svc_phone->cust_svc->pkgnum; #hua? + #cross agent location exposure? sheesh + my $cust_pkg = qsearchs('cust_pkg', {'pkgnum' => $pkgnum}); + my $cust_main = $cust_pkg ? $cust_pkg->cust_main : ''; + ( 'no_bold' => 1, + 'cust_pkg' => $cust_pkg, + 'cust_main' => $cust_main, + ); + }, + }, + { field => 'custnum', type=> 'hidden' }, #for new cust_locations +; + +