X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fedit%2Fsvc_phone.cgi;h=ef5cec66372ea08cd8d62c0c429798131d54c232;hp=d48e6353b0912a7d856e9c0f74f21419dcb6146a;hb=c49cfd25a8f92c7a2f44b51d72506a21f6b8d09f;hpb=3d0a1bb06b895c5be6e3f0517d355442a6b1e125 diff --git a/httemplate/edit/svc_phone.cgi b/httemplate/edit/svc_phone.cgi index d48e6353b..ef5cec663 100644 --- a/httemplate/edit/svc_phone.cgi +++ b/httemplate/edit/svc_phone.cgi @@ -2,17 +2,12 @@ '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; - }, - 'svc_edit_callback' => sub { - my( $cgi, $svc_x, $part_svc, $cust_pkg, $fields, $opt) = @_; - my $conf = new FS::Conf; - $svc_x->sip_password('*HIDDEN*') unless $conf->exists('showpasswords'); - }, + 'svc_new_callback' => $svc_callback, + 'svc_edit_callback' => $svc_callback, + 'svc_error_callback' => $svc_callback, &> <%init> +my $conf = new FS::Conf; my $begin_callback = sub { my( $cgi, $fields, $opt ) = @_; @@ -25,8 +20,6 @@ my $begin_callback = sub { die "access denied" unless $FS::CurrentUser::CurrentUser->access_right($right); - my $conf = new FS::Conf; - push @$fields, 'countrycode', { field => 'phonenum', @@ -67,6 +60,9 @@ my $begin_callback = sub { type => 'text', maxlength => $conf->config('svc_phone-phone_name-max_length'), }, + { field => 'forward_svcnum', + type => 'select-svc_phone-forward', + }, 'forwarddst', 'email', @@ -91,6 +87,16 @@ my $begin_callback = sub { ); }, }, + { field => 'e911_class', + type => 'select', + options => [ keys(%{ FS::svc_phone->e911_classes }) ], + labels => FS::svc_phone->e911_classes, + }, + { field => 'e911_type', + type => 'select', + options => [ keys(%{ FS::svc_phone->e911_types }) ], + labels => FS::svc_phone->e911_types, + }, { field => 'custnum', type=> 'hidden' }, #for new cust_locations ; } @@ -101,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', @@ -129,6 +132,9 @@ my $begin_callback = sub { value => 'Carrier Information', colspan => 8, }, + { field => 'sip_server', + type => 'select-sip_server', + }, { field => 'sms_carrierid', label => 'SMS Carrier', type => 'select-cdr_carrier', @@ -139,7 +145,26 @@ my $begin_callback = sub { } -}; +}; # begin_callback + +# svc_edit_callback / svc_new_callback +my $svc_callback = sub { + my ($cgi, $svc_x, $part_svc, $cust_pkg, $fields, $opt) = @_; + + push @$fields, { + field => 'circuit_svcnum', + type => 'select-svc_circuit', + cust_pkg => $cust_pkg, + part_svc => $part_svc, + }; + if ( $cust_pkg and not $svc_x->svcnum ) { + # new service, default to package location + $svc_x->set('locationnum', $cust_pkg->locationnum); + } + if ( not $conf->exists('showpasswords') and $svc_x->svcnum ) { + $svc_x->sip_password('*HIDDEN*'); + } +};