TT#28510 Remove "domain" from resource for subscriberadmin

For subscriberadmin domain is taken from the pilot

Change-Id: I6aa8da07014c18732df4ffc66bd5c2744fc0e81f
changes/50/18150/1
Irina Peshinskaya 8 years ago
parent 6cc6f21fa9
commit 61bf07b038

@ -104,6 +104,16 @@ has_field 'password' => (
},
);
has_field 'administrative' => (
type => 'Boolean',
label => 'Administrative',
required => 0,
element_attr => {
rel => ['tooltip'],
title => ['Whether the subscriber can configure other subscribers within his Customer account.']
},
);
has_field 'lock' => (
type => '+NGCP::Panel::Field::SubscriberLockSelect',
label => 'Lock Level',
@ -119,13 +129,12 @@ has_field 'status' => (
},
);
has_field 'administrative' => (
type => 'Boolean',
label => 'Administrative',
required => 0,
has_field 'timezone' => (
type => '+NGCP::Panel::Field::TimezoneSelect',
label => 'Timezone',
element_attr => {
rel => ['tooltip'],
title => ['Whether the subscriber can configure other subscribers within his Customer account.']
title => ['The timezone of the subscriber.']
},
);
@ -139,14 +148,7 @@ has_field 'external_id' => (
},
);
has_field 'timezone' => (
type => '+NGCP::Panel::Field::TimezoneSelect',
label => 'Timezone',
element_attr => {
rel => ['tooltip'],
title => ['The timezone of the subscriber.']
},
);
has_field 'profile_set' => (
type => '+NGCP::Panel::Field::SubscriberProfileSet',

@ -4,6 +4,26 @@ use HTML::FormHandler::Moose;
extends 'HTML::FormHandler';
use NGCP::Panel::Utils::Form qw();
has_field 'contract' => (
type => '+NGCP::Panel::Field::CustomerContract',
label => 'Customer',
validate_when_empty => 1,
element_attr => {
rel => ['tooltip'],
title => ['The contract used for this subscriber.']
},
);
has_field 'email' => (
type => 'Email',
required => 0,
maxlength => 255,
element_attr => {
rel => ['tooltip'],
title => ['The email address of the subscriber.']
},
);
has_field 'webusername' => (
type => 'Text',
label => 'Web Username',
@ -24,6 +44,19 @@ has_field 'webpassword' => (
},
);
has_field 'e164' => (
type => '+NGCP::Panel::Field::E164',
order => 99,
required => 0,
label => 'E164 Number',
do_label => 1,
do_wrapper => 1,
element_attr => {
rel => ['tooltip'],
title => ['The main E.164 number (containing a cc, ac and sn attribute) used for inbound and outbound calls.']
},
);
has_field 'username' => (
type => '+NGCP::Panel::Field::Identifier',
label => 'SIP Username',
@ -63,28 +96,7 @@ has_field 'password' => (
},
);
has_field 'email' => (
type => 'Email',
required => 0,
maxlength => 255,
element_attr => {
rel => ['tooltip'],
title => ['The email address of the subscriber.']
},
);
has_field 'e164' => (
type => '+NGCP::Panel::Field::E164',
order => 99,
required => 0,
label => 'E164 Number',
do_label => 1,
do_wrapper => 1,
element_attr => {
rel => ['tooltip'],
title => ['The main E.164 number (containing a cc, ac and sn attribute) used for inbound and outbound calls.']
},
);
has_field 'administrative' => (
type => 'Boolean',
@ -96,6 +108,15 @@ has_field 'administrative' => (
},
);
has_field 'status' => (
type => '+NGCP::Panel::Field::SubscriberStatusSelect',
label => 'Status',
element_attr => {
rel => ['tooltip'],
title => ['The status of the subscriber (one of "active", "locked", "terminated").']
},
);
has_field 'timezone' => (
type => '+NGCP::Panel::Field::TimezoneSelect',
label => 'Timezone',
@ -119,15 +140,6 @@ has_field 'customer_id' => (
},
);
has_field 'contract' => (
type => '+NGCP::Panel::Field::CustomerContract',
label => 'Customer',
validate_when_empty => 1,
element_attr => {
rel => ['tooltip'],
title => ['The contract used for this subscriber.']
},
);
has_field 'display_name' => (
type => 'Text',
@ -258,14 +270,6 @@ has_field 'cloud_pbx_hunt_timeout' => (
},
);
has_field 'status' => (
type => '+NGCP::Panel::Field::SubscriberStatusSelect',
label => 'Status',
element_attr => {
rel => ['tooltip'],
title => ['The status of the subscriber (one of "active", "locked", "terminated").']
},
);
sub validate_password {

@ -323,6 +323,7 @@ sub prepare_resource {
})->first;
if($pilot) {
$domain = $pilot->voip_subscriber->domain;
delete $resource->{domain};
$resource->{domain_id} = $domain->id;
} else {
$self->error($c, HTTP_UNPROCESSABLE_ENTITY, "Unable to find PBX pilot for this customer.");
@ -364,6 +365,7 @@ sub prepare_resource {
}
my ($form,$form_exceptions) = $self->get_form($c);
return unless $self->validate_form(
c => $c,
resource => $resource,

Loading…
Cancel
Save