-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,