* NCOS Levels and NCOS Sets now have expose_to_customer option (boolean). If enabled, the NCOS Level/Set can be seen and used by Customers in their and their subscribers' preferences * NCOS Levels and NCOS Sets with expose_to_customer = 0 (default) are not visible anymore to subscribers. * API GET /api/ncoslevels is now accessible by 'subscriberadmin' role and returns a list of NCOS Levels that belong to the same reseller and with expose_to_customer = 1 (fields are limited to id,name,description). * When NCOS Level is expose_to_customer is set from 1 to 0, all assigned ncos preferences for contracts and subscribers are that contain the NCOS Level are removed. Change-Id: Id7c444b4a0834939a128179ded6670705258519bmr11.4
parent
f79c7a5820
commit
9d9c0d0669
@ -0,0 +1,34 @@
|
||||
package NGCP::Panel::Form::NCOS::SubAdminLevelAPI;
|
||||
|
||||
use HTML::FormHandler::Moose;
|
||||
extends 'HTML::FormHandler';
|
||||
|
||||
use HTML::FormHandler::Widget::Block::Bootstrap;
|
||||
|
||||
has '+widget_wrapper' => ( default => 'Bootstrap' );
|
||||
has_field 'submitid' => ( type => 'Hidden' );
|
||||
sub build_render_list {[qw/submitid fields actions/]}
|
||||
sub build_form_element_class {[qw(form-horizontal)]}
|
||||
|
||||
has_field 'level' => (
|
||||
type => 'Text',
|
||||
label => 'Level Name',
|
||||
required => 1,
|
||||
element_attr => {
|
||||
rel => ['tooltip'],
|
||||
title => ['The level name']
|
||||
},
|
||||
);
|
||||
|
||||
has_field 'description' => (
|
||||
type => 'Text',
|
||||
required => 0,
|
||||
element_attr => {
|
||||
rel => ['tooltip'],
|
||||
title => ['The description of the level']
|
||||
},
|
||||
);
|
||||
|
||||
1;
|
||||
|
||||
# vim: set tabstop=4 expandtab:
|
||||
@ -0,0 +1,30 @@
|
||||
package NGCP::Panel::Utils::NCOS;
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use English;
|
||||
use NGCP::Panel::Utils::Preferences;
|
||||
|
||||
sub revoke_exposed_ncos_level {
|
||||
my ($c, $ncos_level_id) = @_;
|
||||
|
||||
my $used_contract_prefs_rs = $c->model('DB')->resultset('voip_contract_preferences')->search({
|
||||
'attribute.attribute' => 'ncos_id',
|
||||
value => $ncos_level_id,
|
||||
},{
|
||||
join => 'attribute',
|
||||
});
|
||||
$used_contract_prefs_rs->delete;
|
||||
|
||||
my $used_subscriber_prefs_rs = $c->model('DB')->resultset('voip_usr_preferences')->search({
|
||||
'attribute.attribute' => 'ncos_id',
|
||||
value => $ncos_level_id,
|
||||
},{
|
||||
join => 'attribute',
|
||||
});
|
||||
$used_subscriber_prefs_rs->delete;
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
# vim: set tabstop=4 expandtab:
|
||||
Loading…
Reference in new issue