From 3402ff329fde97d6ac96723b5c2a4ed46ed2ce25 Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 8 Mar 2010 07:03:00 +0000 Subject: domain names in netsapiens export (domain name association w/svc_phone), RT#5864 --- httemplate/edit/elements/svc_Common.html | 5 +++- httemplate/edit/svc_phone.cgi | 39 +++++++++++++++++++++----------- 2 files changed, 30 insertions(+), 14 deletions(-) (limited to 'httemplate/edit') diff --git a/httemplate/edit/elements/svc_Common.html b/httemplate/edit/elements/svc_Common.html index 453d07f88..2e98a1b25 100644 --- a/httemplate/edit/elements/svc_Common.html +++ b/httemplate/edit/elements/svc_Common.html @@ -81,7 +81,10 @@ $f->{'disable_empty'} = $object->svcnum ? 1 : 0, } - if ( $f->{'type'} eq 'select-svc_pbx' ) { + if ( $f->{'type'} eq 'select-svc_pbx' + || $f->{'type'} eq 'select-svc-domain' + ) + { $f->{'include_opt_callback'} = sub { ( 'pkgnum' => $pkgnum, 'svcpart' => $svcpart, diff --git a/httemplate/edit/svc_phone.cgi b/httemplate/edit/svc_phone.cgi index 55ee890f4..3c7b75249 100644 --- a/httemplate/edit/svc_phone.cgi +++ b/httemplate/edit/svc_phone.cgi @@ -1,22 +1,11 @@ <% include( 'elements/svc_Common.html', 'name' => 'Phone number', 'table' => 'svc_phone', - 'fields' => [ 'countrycode', - { field => 'phonenum', - type => 'select-did', - label => 'Phone number', - }, - { field => 'pbxsvc', - type => 'select-svc_pbx', - label => 'PBX', - }, - 'sip_password', - 'pin', - 'phone_name', - ], + 'fields' => \@fields, 'labels' => { 'countrycode' => 'Country code', 'phonenum' => 'Phone number', + 'domsvc' => 'Domain', 'sip_password' => 'SIP password', 'pin' => 'Voicemail PIN', 'phone_name' => 'Name', @@ -29,4 +18,28 @@ 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', + 'phone_name', +; + -- cgit v1.2.1