TT#101300 remove devid_alias field

* dbaliases->devid_alias field is no longer in use
  and available via the UI/API

Change-Id: I3ec1a82ef76822595aa37e94ec002d11a0cce58c
mr9.2
Kirill Solomko 6 years ago
parent 1885af6b7d
commit 96ce7b1143

@ -35,9 +35,6 @@ sub pre_process_form_resource {
if (!exists $resource->{is_devid} && defined $item->voip_dbalias) {
$resource->{is_devid} = $item->voip_dbalias->is_devid;
}
if (!exists $resource->{devid_alias} && defined $item->voip_dbalias) {
$resource->{devid_alias} = $item->voip_dbalias->devid_alias;
}
return 1;
}
@ -109,15 +106,9 @@ sub update_item_model {
();
} else {
# otherwise keep number
if (!defined $_->voip_dbalias) {
$c->log->debug("+++ no oldsub dbalias for sn " . $_->sn);
} else {
$c->log->debug("+++ oldsub dbalias for sn " . $_->sn . " is " . ($_->voip_dbalias->devid_alias//"undef"));
}
{ e164 => {
cc => $_->cc, ac => $_->ac, sn => $_->sn,
is_devid => (defined $_->voip_dbalias ? $_->voip_dbalias->is_devid : 0),
devid_alias => (defined $_->voip_dbalias ? $_->voip_dbalias->devid_alias : undef),
}
};
}
@ -142,16 +133,9 @@ sub update_item_model {
# filter number we're about to remove
();
} else {
# otherwise keep number
if (!defined $_->voip_dbalias) {
$c->log->debug("+++ no newsub dbalias for sn " . $_->sn);
} else {
$c->log->debug("+++ newsub dbalias for sn " . $_->sn . " is " . ($_->voip_dbalias->devid_alias//"undef"));
}
{ e164 => {
cc => $_->cc, ac => $_->ac, sn => $_->sn,
is_devid => (defined $_->voip_dbalias ? $_->voip_dbalias->is_devid : 0),
devid_alias => (defined $_->voip_dbalias ? $_->voip_dbalias->devid_alias : undef),
}
};
}
@ -162,7 +146,6 @@ sub update_item_model {
push @{ $newalias }, { e164 => {
cc => $item->cc, ac => $item->ac, sn => $item->sn,
is_devid => $resource->{is_devid} // 0,
devid_alias => $resource->{devid_alias},
}
};

@ -29,26 +29,10 @@ has_field 'is_devid' => (
order => 98,
element_attr => {
rel => ['tooltip'],
title => ['When selected, a call to this alias number is only sent to registered devices indicating either the alias number or the optional alternative device id during registration in the Display-Name.']
title => ['When selected, it is possible to register with the alias and recieve calls directed to the alias only']
},
);
has_field 'devid_alias' => (
type => 'Text',
required => 0,
maxlength => 127,
label => 'Alternative Device ID',
do_label => 1,
do_wrapper => 1,
wrapper_class => [qw/hfh-rep-field/],
order => 99,
element_attr => {
rel => ['tooltip'],
title => ['An optional device id to be configured on a phone, which is associated with this alias number (e.g. "softphone").']
},
);
has_field 'rm' => (
type => 'RmElement',
value => 'Remove',
@ -59,7 +43,7 @@ has_field 'rm' => (
has_block 'fields' => (
tag => 'div',
class => [qw/modal-body/],
render_list => [qw/e164 is_devid devid_alias/ ],
render_list => [qw/e164 is_devid/ ],
);

@ -13,22 +13,7 @@ has_field 'is_devid' => (
order => 98,
element_attr => {
rel => ['tooltip'],
title => ['When selected, a call to this alias number is only sent to registered devices indicating either the alias number or the optional alternative device id during registration in the Display-Name.']
},
);
has_field 'devid_alias' => (
type => 'Text',
required => 0,
maxlength => 127,
label => 'Alternative Device ID',
do_label => 1,
do_wrapper => 1,
wrapper_class => [qw/hfh-rep-field/],
order => 99,
element_attr => {
rel => ['tooltip'],
title => ['An optional device id to be configured on a phone, which is associated with this alias number (e.g. "softphone").']
title => ['When selected, it is possible to register with the alias and recieve calls directed to the alias only']
},
);

@ -48,20 +48,9 @@ has_field 'is_devid' => (
type => 'Boolean',
element_attr => {
rel => ['tooltip'],
title => ['When selected, a call to this alias number is only sent to registered devices indicating either the alias number or the optional alternative device id during registration in the Display-Name.']
title => ['When selected, it is possible to register with the alias and recieve calls directed to the alias only']
},
);
has_field 'devid_alias' => (
type => 'Text',
required => 0,
maxlength => 127,
element_attr => {
rel => ['tooltip'],
title => ['An optional device id to be configured on a phone, which is associated with this alias number (e.g. "softphone").']
},
);
1;
# vim: set tabstop=4 expandtab:

@ -44,8 +44,8 @@ sub _item_rs {
'me.subscriber_id' => { '!=' => undef },
'subscriber.status' => { '!=' => 'terminated' },
},{
'+select' => [\'if(me.id=subscriber.primary_number_id,1,0)','voip_dbalias.is_devid','voip_dbalias.devid_alias'],
'+as' => ['is_primary','is_devid','devid_alias'],
'+select' => [\'if(me.id=subscriber.primary_number_id,1,0)','voip_dbalias.is_devid'],
'+as' => ['is_primary','is_devid'],
join => ['subscriber', 'voip_dbalias'],
});
if($c->user->roles eq "admin") {
@ -89,10 +89,8 @@ sub post_process_hal_resource {
}
if ($item->voip_dbalias) {
$resource->{is_devid} = bool $item->voip_dbalias->is_devid;
$resource->{devid_alias} = $item->voip_dbalias->devid_alias;
} else {
$resource->{is_devid} = JSON::false;
$resource->{devid_alias} = undef;
}
return $resource;
}

@ -116,7 +116,6 @@ sub resource_from_item {
compare($resource{primary_number}, $alias));
if (defined $n->voip_dbalias) {
$alias->{is_devid} = bool $n->voip_dbalias->is_devid;
$alias->{devid_alias} = $n->voip_dbalias->devid_alias;
}
push @{ $resource{alias_numbers} }, $alias;
}

@ -1503,9 +1503,6 @@ sub update_subscriber_numbers {
if (exists $alias->{is_devid} && !exists $alias->{e164}->{is_devid}) {
$alias->{e164}->{is_devid} = delete $alias->{is_devid};
}
if (exists $alias->{devid_alias} && !exists $alias->{e164}->{devid_alias}) {
$alias->{e164}->{devid_alias} = delete $alias->{devid_alias};
}
my $dbalias = $prov_subs->voip_dbaliases->find({
username => $cli,
@ -1514,7 +1511,6 @@ sub update_subscriber_numbers {
$dbalias->update({
is_primary => 0,
is_devid => $alias->{e164}->{is_devid} // 0,
devid_alias => $alias->{e164}->{devid_alias},
});
} else {
$dbalias = $prov_subs->voip_dbaliases->create({
@ -1522,7 +1518,6 @@ sub update_subscriber_numbers {
domain_id => $prov_subs->domain->id,
is_primary => 0,
is_devid => $alias->{e164}->{is_devid} // 0,
devid_alias => $alias->{e164}->{devid_alias},
});
}
if(defined $acli_pref) {
@ -1921,7 +1916,6 @@ sub prepare_alias_select {
e164 => { cc => $num->cc, ac => $num->ac, sn => $num->sn },
$num->voip_dbalias ? (
is_devid => $num->voip_dbalias->is_devid,
devid_alias => $num->voip_dbalias->devid_alias,
) : (),
};
unless($unselect) {

@ -114,7 +114,7 @@
<td>
[% FOR num IN subscriber.voip_numbers.all -%]
[% NEXT IF num.id == subscriber.primary_number.id -%]
[% num.cc %] [% num.ac %] [% num.sn %] [% IF num.voip_dbalias.is_devid %]<span class="icon-phone"></span> [% num.voip_dbalias.devid_alias.length ? "(" _ num.voip_dbalias.devid_alias _ ")" : "" %] [% END %]<br/>
[% num.cc %] [% num.ac %] [% num.sn %] [% IF num.voip_dbalias.is_devid %]<span class="icon-phone"></span>[% END %]<br/>
[% END -%]
</td>
</tr>

Loading…
Cancel
Save