MT#13337 add subscriber lock level 5 ('ported')

Change-Id: Ief3c9b09653e634a271843899736ab334b47ae12
changes/50/4350/3
Rene Krenn 10 years ago
parent 40ed685a9e
commit 22607eedf3

@ -6,12 +6,13 @@ extends 'HTML::FormHandler::Field::Select';
sub build_options {
my ($self) = @_;
return [
return [
{ label => 'none', value => undef },
{ label => 'foreign', value => 1 },
{ label => 'outgoing', value => 2 },
{ label => 'all calls', value => 3 },
{ label => 'global', value => 4 },
{ label => 'ported', value => 5 },
];
}

@ -93,6 +93,7 @@ has_field 'fraud_interval_lock' => (
{ value => 2, label => 'all outgoing calls' },
{ value => 3, label => 'incoming and outgoing' },
{ value => 4, label => 'global (including CSC)' },
{ value => 5, label => 'ported (call forwarding only)' },
],
element_attr => {
rel => ['tooltip'],
@ -128,6 +129,7 @@ has_field 'fraud_daily_lock' => (
{ value => 2, label => 'all outgoing calls' },
{ value => 3, label => 'incoming and outgoing' },
{ value => 4, label => 'global (including CSC)' },
{ value => 5, label => 'ported (call forwarding only)' },
],
element_attr => {
rel => ['tooltip'],
@ -181,7 +183,7 @@ has_field 'save' => (
has_block 'fields' => (
tag => 'div',
class => [qw/modal-body/],
render_list => [qw/handle name prepaid interval_charge interval_free_time interval_free_cash
render_list => [qw/handle name prepaid interval_charge interval_free_time interval_free_cash
fraud_interval_limit fraud_interval_lock fraud_interval_notify
fraud_daily_limit fraud_daily_lock fraud_daily_notify fraud_use_reseller_rates
currency id
@ -207,7 +209,7 @@ sub validate {
my ($self) = @_;
my $c = $self->ctx;
return unless $c;
my $resource = Storable::dclone($self->values);
if (defined $resource->{reseller}) {
$resource->{reseller_id} = $resource->{reseller}{id};
@ -215,14 +217,14 @@ sub validate {
} else {
$resource->{reseller_id} = ($c->user->is_superuser ? undef : $c->user->reseller_id);
}
NGCP::Panel::Utils::Billing::check_profile_update_item($c,$resource,$c->stash->{profile_result},sub {
my ($err,@fields) = @_;
foreach my $field (@fields) {
$self->field($field)->add_error($err);
}
});
});
}
1

@ -30,6 +30,7 @@ has_field 'fraud_daily_lock' => (
{ value => 2, label => 'all outgoing calls' },
{ value => 3, label => 'incoming and outgoing' },
{ value => 4, label => 'global (including CSC)' },
{ value => 5, label => 'ported (call forwarding only)' },
],
);

@ -30,6 +30,7 @@ has_field 'fraud_interval_lock' => (
{ value => 2, label => 'all outgoing calls' },
{ value => 3, label => 'incoming and outgoing' },
{ value => 4, label => 'global (including CSC)' },
{ value => 5, label => 'ported (call forwarding only)' },
],
);

@ -94,7 +94,7 @@ has_field 'balance_interval_start_mode' => (
{ value => 'create', label => 'upon customer creation' },
{ value => '1st', label => '1st day of month' },
{ value => 'topup_interval', label => 'start interval upon top-up' },
{ value => 'topup', label => 'new interval for each top-up' },
{ value => 'topup', label => 'new interval for each top-up' },
],
element_attr => {
rel => ['tooltip'],
@ -165,13 +165,14 @@ has_field 'underrun_lock_level' => (
{ value => '2', label => 'outgoing' },
{ value => '3', label => 'all calls' },
{ value => '4', label => 'global' },
{ value => '5', label => 'ported (call forwarding only)' },
],
element_attr => {
rel => ['tooltip'],
title => ['The lock level to set all customer\'s subscribers to in case the balance underruns "underrun_lock_threshold".']
},
deflate_value_method => \&_deflate_lock_level,
inflate_default_method => \&_deflate_lock_level,
inflate_default_method => \&_deflate_lock_level,
);
has_field 'underrun_profile_threshold' => (
@ -213,13 +214,14 @@ has_field 'topup_lock_level' => (
{ value => '2', label => 'outgoing' },
{ value => '3', label => 'all calls' },
{ value => '4', label => 'global' },
{ value => '5', label => 'ported (call forwarding only)' },
],
element_attr => {
rel => ['tooltip'],
title => ['The lock level to reset all customer\'s subscribers to after a successful top-up (usually 0).']
},
deflate_value_method => \&_deflate_lock_level,
inflate_default_method => \&_deflate_lock_level,
inflate_default_method => \&_deflate_lock_level,
);
has_field 'service_charge' => (
@ -266,4 +268,4 @@ sub _inflate_lock_level {
return $value;
}
1;
1;

@ -30,7 +30,7 @@ has_field 'name' => (
has_field 'description' => (
type => 'Text',
label => 'Description',
label => 'Description',
required => 1,
maxlength => 255,
element_attr => {
@ -43,7 +43,7 @@ has_field 'initial_balance' => (
type => 'Money',
label => 'Initial Balance',
#inflate_method => sub { return $_[1] * 100.0 },
#deflate_method => sub { return $_[1] / 100.0 },
#deflate_method => sub { return $_[1] / 100.0 },
element_attr => {
rel => ['tooltip'],
title => ['The initial balance (in cents) that will be set for the very first balance interval.']
@ -58,7 +58,7 @@ has_field 'initial_profiles' => (
setup_for_js => 1,
do_wrapper => 1,
do_label => 0,
tags => {
tags => {
controls_div => 1,
},
wrapper_class => [qw/hfh-rep/],
@ -67,7 +67,7 @@ has_field 'initial_profiles' => (
title => ['An array of objects with keys "profile_id" and "network_id" to create profile mappings from when applying this profile package to a customer.']
},
deflate_value_method => \&_deflate_mappings,
inflate_default_method => \&_inflate_mappings,
inflate_default_method => \&_inflate_mappings,
);
has_field 'initial_profiles.row' => (
@ -94,7 +94,7 @@ has_field 'initial_profiles_add' => (
has_field 'balance_interval' => (
type => '+NGCP::Panel::Field::Interval',
label => 'Balance Interval',
label => 'Balance Interval',
do_label => 1,
tags => {
before_element => '<div class="ngcp-interval-row control-group">',
@ -109,7 +109,7 @@ has_field 'balance_interval_start_mode' => (
{ value => '1st', label => '1st day of month' },
{ value => 'create', label => 'upon customer creation' },
{ value => 'topup_interval', label => 'start interval upon top-up' },
{ value => 'topup', label => 'new interval for each top-up' },
{ value => 'topup', label => 'new interval for each top-up' },
],
element_attr => {
rel => ['tooltip'],
@ -134,7 +134,7 @@ has_field 'carry_over_mode' => (
has_field 'timely_duration' => (
type => '+NGCP::Panel::Field::Interval',
label => '"Timely" Duration',
label => '"Timely" Duration',
do_label => 1,
tags => {
before_element => '<div class="ngcp-interval-row control-group">',
@ -144,7 +144,7 @@ has_field 'timely_duration' => (
has_field 'notopup_discard_intervals' => (
type => 'PosInteger',
label => 'Discard balance after intervals',
label => 'Discard balance after intervals',
element_attr => {
rel => ['tooltip'],
title => ['The balance will be discarded if no top-up happened for the the given number of balance intervals.']
@ -156,7 +156,7 @@ has_field 'underrun_lock_threshold' => (
type => 'Money',
label => 'Underrun lock threshold',
#inflate_method => sub { return $_[1] * 100.0 },
#deflate_method => sub { return $_[1] / 100.0 },
#deflate_method => sub { return $_[1] / 100.0 },
element_attr => {
rel => ['tooltip'],
title => ['The balance threshold (in cents) for the underrun lock level to come into effect.']
@ -172,21 +172,22 @@ has_field 'underrun_lock_level' => (
{ value => '2', label => 'outgoing' },
{ value => '3', label => 'all calls' },
{ value => '4', label => 'global' },
{ value => '5', label => 'ported (call forwarding only)' },
],
label => 'Underrun lock level',
label => 'Underrun lock level',
element_attr => {
rel => ['tooltip'],
title => ['The lock level to set all customer\'s subscribers to in case the balance underruns "underrun_lock_threshold".']
},
deflate_value_method => \&_deflate_lock_level,
inflate_default_method => \&_deflate_lock_level,
inflate_default_method => \&_deflate_lock_level,
);
has_field 'underrun_profile_threshold' => (
type => 'Money',
label => 'Underrun profile threshold',
#inflate_method => sub { return $_[1] * 100.0 },
#deflate_method => sub { return $_[1] / 100.0 },
#deflate_method => sub { return $_[1] / 100.0 },
element_attr => {
rel => ['tooltip'],
title => ['The balance threshold (in cents) for underrun profiles to come into effect.']
@ -199,7 +200,7 @@ has_field 'underrun_profiles' => (
setup_for_js => 1,
do_wrapper => 1,
do_label => 0,
tags => {
tags => {
controls_div => 1,
},
wrapper_class => [qw/hfh-rep/],
@ -208,7 +209,7 @@ has_field 'underrun_profiles' => (
title => ['An array of objects with keys "profile_id" and "network_id" to create profile mappings from when the balance underruns the "underrun_profile_threshold" value.']
},
deflate_value_method => \&_deflate_mappings,
inflate_default_method => \&_inflate_mappings,
inflate_default_method => \&_inflate_mappings,
);
has_field 'underrun_profiles.row' => (
@ -241,6 +242,7 @@ has_field 'topup_lock_level' => (
{ value => '2', label => 'outgoing' },
{ value => '3', label => 'all calls' },
{ value => '4', label => 'global' },
{ value => '5', label => 'ported (call forwarding only)' },
],
label => 'Top-up lock level',
element_attr => {
@ -255,7 +257,7 @@ has_field 'service_charge' => (
type => 'Money',
label => 'Service Charge',
#inflate_method => sub { return $_[1] * 100.0 },
#deflate_method => sub { return $_[1] / 100.0 },
#deflate_method => sub { return $_[1] / 100.0 },
element_attr => {
rel => ['tooltip'],
title => ['The service charge amount (in cents) will be subtracted from the voucher amount upon every top-up.']
@ -269,16 +271,16 @@ has_field 'topup_profiles' => (
setup_for_js => 1,
do_wrapper => 1,
do_label => 0,
tags => {
tags => {
controls_div => 1,
},
wrapper_class => [qw/hfh-rep/],
element_attr => {
rel => ['tooltip'],
title => ['An array of objects with keys "profile_id" and "network_id" to create profile mappings from when a customer top-ups with a voucher associated with this profile package.']
},
},
deflate_value_method => \&_deflate_mappings,
inflate_default_method => \&_inflate_mappings,
inflate_default_method => \&_inflate_mappings,
);
has_field 'topup_profiles.row' => (
@ -383,7 +385,7 @@ sub validate {
my ($self) = @_;
my $c = $self->ctx;
return unless $c;
my $resource = Storable::dclone($self->values);
if (defined $resource->{reseller}) {
$resource->{reseller_id} = $resource->{reseller}{id};
@ -396,7 +398,7 @@ sub validate {
$resource->{$_.'_value'} = $resource->{$_}{value} || undef;
delete $resource->{$_};
}
NGCP::Panel::Utils::ProfilePackages::check_balance_interval(
c => $c,
resource => $resource,
@ -412,8 +414,8 @@ sub validate {
foreach my $field (@fields) {
$self->field($field)->add_error($err);
}
});
});
my $mappings_to_create = [];
NGCP::Panel::Utils::ProfilePackages::prepare_profile_package(
c => $c,
@ -425,7 +427,7 @@ sub validate {
$self->field($field)->add_error($err);
}
});
}
1;
1;

@ -128,6 +128,7 @@ has_field 'lock_level_before' => (
{ value => '2', label => 'outgoing' },
{ value => '3', label => 'all calls' },
{ value => '4', label => 'global' },
{ value => '5', label => 'ported (call forwarding only)' },
],
deflate_value_method => \&_deflate_lock_level,
inflate_default_method => \&_deflate_lock_level,
@ -144,6 +145,7 @@ has_field 'lock_level_after' => (
{ value => '2', label => 'outgoing' },
{ value => '3', label => 'all calls' },
{ value => '4', label => 'global' },
{ value => '5', label => 'ported (call forwarding only)' },
],
deflate_value_method => \&_deflate_lock_level,
inflate_default_method => \&_deflate_lock_level,

@ -19,6 +19,7 @@ my %LOCK = (
2, 'outgoing',
3, 'incoming and outgoing',
4, 'global',
5, 'ported',
);
@ -26,7 +27,7 @@ sub period_as_string {
my $set = shift;
my @wdays = (qw/
invalid Sunday Monday Tuesday Wednesday Thursday Friday Saturday
invalid Sunday Monday Tuesday Wednesday Thursday Friday Saturday
/);
my @months = (qw/
invalid January February March April May June July August September October November December
@ -100,7 +101,7 @@ sub destination_as_string {
sub lock_provisoning_voip_subscriber {
my %params = @_;
NGCP::Panel::Utils::Preferences::set_provisoning_voip_subscriber_first_int_attr_value(%params,
value => $params{level},
attribute => 'lock'
@ -109,7 +110,7 @@ sub lock_provisoning_voip_subscriber {
sub get_provisoning_voip_subscriber_lock_level {
my %params = @_;
NGCP::Panel::Utils::Preferences::get_provisoning_voip_subscriber_first_int_attr_value(%params,
attribute => 'lock'
);
@ -117,12 +118,12 @@ sub get_provisoning_voip_subscriber_lock_level {
sub switch_prepaid {
my %params = @_;
NGCP::Panel::Utils::Preferences::set_provisoning_voip_subscriber_first_int_attr_value(%params,
value => ($params{prepaid} ? 1 : 0),
attribute => 'prepaid'
);
);
}
sub switch_prepaid_contract {
@ -134,7 +135,7 @@ sub switch_prepaid_contract {
prov_subscriber => $subscriber->provisioning_voip_subscriber,
) if ($subscriber->provisioning_voip_subscriber);
}
}
sub get_lock_string {
@ -266,9 +267,9 @@ sub create_subscriber {
foreach my $ext(0 .. int("9" x $len)) {
$range->{e164range}{sn} = sprintf("%s%0".$len."d", $range->{e164range}{snbase}, $ext);
push @alias_numbers, { e164 => {
cc => $range->{e164range}{cc},
ac => $range->{e164range}{ac},
sn => $range->{e164range}{sn},
cc => $range->{e164range}{cc},
ac => $range->{e164range}{ac},
sn => $range->{e164range}{sn},
}};
}
}
@ -318,8 +319,8 @@ sub create_subscriber {
$preferences->{cc} = $params->{e164}{cc}
if(defined $params->{e164}{cc} && length($params->{e164}{cc}) > 0);
update_preferences(c => $c,
prov_subscriber => $prov_subscriber,
update_preferences(c => $c,
prov_subscriber => $prov_subscriber,
preferences => $preferences
);
@ -366,12 +367,12 @@ sub update_preferences {
unless(defined $preferences->{$k}) {
$pref->first->delete;
} else {
$pref->first->update({
$pref->first->update({
'value' => $preferences->{$k},
});
}
} else {
$pref->create({
$pref->create({
'value' => $preferences->{$k},
}) if(defined $preferences->{$k});
}
@ -415,9 +416,9 @@ sub get_pbx_subscribers_by_ids{
my (@items,@absent_items_ids);
@items = $pbx_subscribers_rs->all();
my %items_ids_exists = map{ $_->id => 0 } @items;
if(@$ids){
my $order_hash = { %items_ids_exists };
@$order_hash{@$ids} = (1..$#$ids+1);
@ -427,7 +428,7 @@ sub get_pbx_subscribers_by_ids{
if($#items < $#$ids){
@absent_items_ids = grep { !exists $items_ids_exists{$_} } @{$params{ids}};
}
return wantarray ? (\@items, (( 0 < @absent_items_ids) ? \@absent_items_ids : undef )) : \@items;
}
sub get_subscriber_pbx_items{
@ -487,18 +488,18 @@ sub manage_pbx_groups{
my $subscriber = $params{subscriber};
my $customer = $params{customer} // $subscriber->contract;
my $groups = $params{groups} // ( @$group_ids ? get_pbx_subscribers_by_ids(
c => $c,
schema => $schema,
ids => $group_ids,
customer_id => $customer->id,
my $groups = $params{groups} // ( @$group_ids ? get_pbx_subscribers_by_ids(
c => $c,
schema => $schema,
ids => $group_ids,
customer_id => $customer->id,
is_group => 1,
) : [] );
my $groupmembers = $params{groupmembers} // ( @$groupmember_ids ? get_pbx_subscribers_by_ids(
c => $c,
schema => $schema,
ids => $groupmember_ids,
customer_id => $customer->id,
my $groupmembers = $params{groupmembers} // ( @$groupmember_ids ? get_pbx_subscribers_by_ids(
c => $c,
schema => $schema,
ids => $groupmember_ids,
customer_id => $customer->id,
is_group => 0,
) : [] );
@ -506,13 +507,13 @@ sub manage_pbx_groups{
my $prov_subscriber = $subscriber->provisioning_voip_subscriber;
my $subscriber_uri = get_pbx_group_member_name( subscriber => $subscriber );
my $member_preferences_rs = NGCP::Panel::Utils::Preferences::get_usr_preference_rs(
c => $c,
attribute => 'cloud_pbx_hunt_group',
c => $c,
attribute => 'cloud_pbx_hunt_group',
)->search_rs({
subscriber_id => { -in => [ $prov_subscriber->voip_pbx_groups->get_column('group_id')->all ] },
value => $subscriber_uri,
});
$member_preferences_rs->delete;
$prov_subscriber->voip_pbx_groups->delete;
@ -524,8 +525,8 @@ sub manage_pbx_groups{
group_id => $group_prov_subscriber->id,
});
my $preferences_rs = NGCP::Panel::Utils::Preferences::get_usr_preference_rs(
c => $c,
attribute => 'cloud_pbx_hunt_group',
c => $c,
attribute => 'cloud_pbx_hunt_group',
prov_subscriber => $group_prov_subscriber,
);
$preferences_rs->create({ value => $subscriber_uri });
@ -534,8 +535,8 @@ sub manage_pbx_groups{
#delete old members to support correct order
$prov_subscriber->voip_pbx_group_members->delete;
my $group_preferences_rs = NGCP::Panel::Utils::Preferences::get_usr_preference_rs(
c => $c,
attribute => 'cloud_pbx_hunt_group',
c => $c,
attribute => 'cloud_pbx_hunt_group',
prov_subscriber => $prov_subscriber,
);
$group_preferences_rs->delete;
@ -591,11 +592,11 @@ sub update_subscriber_numbers {
my $cli_pref = NGCP::Panel::Utils::Preferences::get_usr_preference_rs(
c => $c, attribute => 'cli', prov_subscriber => $prov_subs);
if(defined $cli_pref) {
if($cli_pref->first
&& defined $primary_number_old
if($cli_pref->first
&& defined $primary_number_old
&& ( $cli_pref->first->value eq number_as_string($primary_number_old) )
&& $c->config->{numbermanagement}->{auto_sync_cli}){
$cli_pref->delete;
}
}
@ -658,17 +659,17 @@ sub update_subscriber_numbers {
my $cli_pref = NGCP::Panel::Utils::Preferences::get_usr_preference_rs(
c => $c, attribute => 'cli', prov_subscriber => $prov_subs);
if($cli_pref->first) {
if(defined $primary_number_old
&& ( number_as_string($primary_number_old) eq $cli_pref->first->value )
if(defined $primary_number_old
&& ( number_as_string($primary_number_old) eq $cli_pref->first->value )
&& $c->config->{numbermanagement}->{auto_sync_cli} ){
$cli_pref->first->update({ value => $primary_number->{cc} . ($primary_number->{ac} // '') . $primary_number->{sn} });
}
} else {
if( ! defined $primary_number_old && $c->config->{numbermanagement}->{auto_sync_cli} ){
$cli_pref->create({
subscriber_id => $prov_subs->id,
value => $primary_number->{cc} . ($primary_number->{ac} // '') . $primary_number->{sn}
value => $primary_number->{cc} . ($primary_number->{ac} // '') . $primary_number->{sn}
});
}
}
@ -680,8 +681,8 @@ sub update_subscriber_numbers {
if(defined $billing_subs->primary_number
&& $billing_subs->primary_number_id != $number->id) {
$old_cli = $billing_subs->primary_number->cc .
($billing_subs->primary_number->ac // '') .
$old_cli = $billing_subs->primary_number->cc .
($billing_subs->primary_number->ac // '') .
$billing_subs->primary_number->sn;
$billing_subs->primary_number->delete;
}
@ -952,8 +953,8 @@ sub terminate {
my $prov_subscriber = $subscriber->provisioning_voip_subscriber;
if($prov_subscriber && $prov_subscriber->profile_id) {
NGCP::Panel::Utils::Events::insert(
c => $c, schema => $schema,
subscriber => $subscriber, type => 'stop_profile',
c => $c, schema => $schema,
subscriber => $subscriber, type => 'stop_profile',
old => $prov_subscriber->profile_id, new => undef,
);
}
@ -1447,7 +1448,7 @@ sub mark_voicemail_read{
sub number_as_string{
my ($number_row, %params) = @_;
return 'HASH' eq ref $number_row
return 'HASH' eq ref $number_row
? $number_row->{cc} . ($number_row->{ac} // '') . $number_row->{sn}
: $number_row->cc . ($number_row->ac // '') . $number_row->sn;
}

@ -11,6 +11,7 @@
{ level = 2, text = c.loc("all outgoing calls") },
{ level = 3, text = c.loc("incoming and outgoing") },
{ level = 4, text = c.loc("global (including web login)") },
{ level = 5, text = c.loc("ported (call forwarding only)") },
];
-%]
<script src="/js/jquery.dump.js"></script>
@ -332,8 +333,8 @@
</div>
[% END -%]
[% IF
c.config.features.cloudpbx &&
[% IF
c.config.features.cloudpbx &&
(c.user.roles == 'admin' || c.user.roles == 'reseller' || c.user.roles == 'subscriberadmin')
-%]
<div class="accordion-group">
@ -342,7 +343,7 @@
</div>
<div class="accordion-body collapse" id="collapse_soundsets">
<div class="accordion-inner">
[%
helper.name = c.loc('Sound Set');
helper.identifier = 'sound_sets';
@ -383,12 +384,12 @@
<span>
[% IF c.user.billing_data -%]
<a class="btn btn-primary btn-large" href="[% c.uri_for_action("/customer/topup_voucher", [contract.id]) %]"><i class="icon-repeat"></i> [% c.loc('Top-up Voucher') %]</a>
[% END -%]
[% END -%]
<a class="btn btn-primary btn-large" href="[% c.uri_for_action("/customer/topup_cash", [contract.id]) %]"><i class="icon-repeat"></i> [% c.loc('Top-up Cash') %]</a>
<a class="btn btn-primary btn-large" href="[% c.uri_for_action("/customer/edit_balance", [contract.id]) %]"><i class="icon-edit"></i> [% c.loc('Set Cash Balance') %]</a>
</span>
<div class="ngcp-separator"></div>
[% END -%]
[% END -%]
<table class="table table-bordered table-striped table-highlight table-hover">
<thead>
@ -411,11 +412,11 @@
<td>[% c.loc('Free time balance') %]</td>
<td>[% balance.free_time_balance %]</td>
<td>[% c.loc('Free time spent') %]</td>
<td>[% balance.free_time_balance_interval %]</td>
<td>[% balance.free_time_balance_interval %]</td>
</tr>
</tbody>
</table>
</table>
<table class="table table-bordered table-striped table-highlight table-hover">
<thead>
<th>
@ -429,19 +430,19 @@
<td>[% c.loc('Interval to') %]</td>
<td>[% balance.end %]</td>
</tr>
<tr>
<td>[% c.loc('"Timely" top-ups from') %]</td>
<td>[% timely_topup_start %]</td>
<td>[% c.loc('"Timely" top-ups to') %]</td>
<td>[% timely_topup_end %]</td>
</tr>
<tr>
<td colspan="2">[% c.loc('Balance will be discarded, if no tup-up happens until') %]</td>
<td colspan="2">[% notopup_expiration %]</td>
</tr>
</tr>
</tbody>
</table>
@ -466,15 +467,15 @@
<td>[% c.loc('Balance threshold when underrun profiles get applied') %]</td>
<td>[% package.underrun_profile_threshold ? money_format( package.underrun_lock_threshold / 100 ) : '' %]</td>
<td>[% c.loc('Balance threshold when subscribers will be locked') %]</td>
<td>[% package.underrun_lock_threshold ? money_format( package.underrun_lock_threshold / 100 ) : '' %]</td>
<td>[% package.underrun_lock_threshold ? money_format( package.underrun_lock_threshold / 100 ) : '' %]</td>
</tr>
</tbody>
</table>
</table>
</div>
</div>
</div>
<div class="accordion-group">
<div class="accordion-heading">
@ -483,8 +484,8 @@
<div class="accordion-body collapse" id="collapse_balanceintervals">
<div class="accordion-inner">
[%
[%
helper.name = c.loc('Balance Interval');
helper.identifier = 'balance_intervals';
helper.dt_columns = balanceinterval_dt_columns;
@ -497,7 +498,7 @@
%]
</div>
</div>
</div>
</div>
<div class="accordion-group">
<div class="accordion-heading">
@ -506,8 +507,8 @@
<div class="accordion-body collapse" id="collapse_topuplog">
<div class="accordion-inner">
[%
[%
helper.name = c.loc('Topuplog');
helper.identifier = 'topup_logs';
helper.dt_columns = topuplog_dt_columns;
@ -520,8 +521,8 @@
%]
</div>
</div>
</div>
</div>
[% IF c.user.roles == 'admin' || c.user.roles == 'reseller' %]
<div class="accordion-group">
<div class="accordion-heading">
@ -558,11 +559,11 @@
<td>[% fraud.fraud_interval_notify.defined ? fraud.fraud_interval_notify : fraud_def_message %]</td>
<td class="ngcp-actions-column">
<div class="sw_actions pull-right">
<a class="btn btn-small btn-primary"
<a class="btn btn-small btn-primary"
href="[% c.uri_for_action("/customer/edit_fraud", [c.req.captures.0], "month") %]">
<i class="icon-edit"></i> [% c.loc('Edit') %]
</a>
<a class="btn btn-small btn-secondary" data-confirm="Delete"
<a class="btn btn-small btn-secondary" data-confirm="Delete"
href="[% c.uri_for_action("/customer/delete_fraud", [c.req.captures.0], "month") %]">
<i class="icon-trash"></i> [% c.loc('Delete') %]
</a>
@ -587,11 +588,11 @@
<td>[% fraud.fraud_daily_notify.defined ? fraud.fraud_daily_notify : fraud_def_message %]</td>
<td class="ngcp-actions-column">
<div class="sw_actions pull-right">
<a class="btn btn-small btn-primary"
<a class="btn btn-small btn-primary"
href="[% c.uri_for_action("/customer/edit_fraud", [c.req.captures.0], "day") %]">
<i class="icon-edit"></i> [% c.loc('Edit') %]
</a>
<a class="btn btn-small btn-secondary" data-confirm="Delete"
<a class="btn btn-small btn-secondary" data-confirm="Delete"
href="[% c.uri_for_action("/customer/delete_fraud", [c.req.captures.0], "day") %]">
<i class="icon-trash"></i> [% c.loc('Delete') %]
</a>
@ -611,7 +612,7 @@
</div>
<div class="accordion-body collapse" id="collapse_invoices">
<div class="accordion-inner">
[%
helper.name = c.loc('Invoice');
helper.identifier = 'invoices';
@ -775,7 +776,7 @@ if(!linekeys){
[%END%]
};
[%END%]
linekeys['[% line.linerange_id %].[% line.key_num %].[% line.extension_unit %]'] = {
linekeys['[% line.linerange_id %].[% line.key_num %].[% line.extension_unit %]'] = {
'mode': '[% line.line_type %]',
'sub': '[% line.provisioning_voip_subscriber.username %]@[% line.provisioning_voip_subscriber.domain.domain%]',
'subid': [% line.provisioning_voip_subscriber.id %],
@ -827,7 +828,7 @@ function create_ranges_annotations(id,type,ranges){
}
[% END -%]
var action = '<i class="fa '+(linekeyCurrent ? 'fa-plus-square' : 'fa-user')+' fa-fw"></i> ' +
'<select class="subselect" name="line.' + linecmt + '.subscriber_id" id="line.' + linecmt + '.subscriber_id">' +
'<select class="subselect" name="line.' + linecmt + '.subscriber_id" id="line.' + linecmt + '.subscriber_id">' +
'<option value="0">'+(linekeyCurrent ? '[% c.loc("Subscriber") %]' : '[% c.loc("None") %]' )+'</option>' +
[% FOR sub IN subscribers.all -%]
'<option value="[% sub.provisioning_voip_subscriber.id %]"'+((linekeyCurrent && linekeyCurrent.subid == '[% sub.provisioning_voip_subscriber.id %]')? ' selected="selected"' : '')+'>[% sub.provisioning_voip_subscriber.display_name ? sub.provisioning_voip_subscriber.display_name : sub.username %][% sub.provisioning_voip_subscriber.pbx_extension.defined ? " (" _ sub.provisioning_voip_subscriber.pbx_extension _ ")" : "" %]</option>' +
@ -836,14 +837,14 @@ function create_ranges_annotations(id,type,ranges){
'<option value="[% sub.provisioning_voip_subscriber.id %]"'+((linekeyCurrent && linekeyCurrent.subid == '[% sub.provisioning_voip_subscriber.id %]')? ' selected="selected"' : '')+'>[% sub.provisioning_voip_subscriber.display_name ? sub.provisioning_voip_subscriber.display_name : sub.username %][% sub.provisioning_voip_subscriber.pbx_extension.defined ? " (" _ sub.provisioning_voip_subscriber.pbx_extension _ ")" : "" %]</option>' +
[% END -%]
'</select>' +
'<select class="modeselect" name="line.' + linecmt + '.type" id="line.' + linecmt + '.type">' +
'<select class="modeselect" name="line.' + linecmt + '.type" id="line.' + linecmt + '.type">' +
[% FOR opt IN ["private", "shared", "blf"] -%]
(range.can_[% opt %] == "1" ?
(range.can_[% opt %] == "1" ?
'<option value="[% opt %]"'+((linekeyCurrent && linekeyCurrent.mode == '[% opt %]' ) ? ' selected="selected"' : '')+'>[% opt %]</option>' : '') +
[% END -%]
'</select>' +
'<input type="hidden" name="line.' + linecmt + '.line" id="line.' + linecmt + '.line" value="' + a.range_id + '.' + a.line_index + '.' + unit + '"/>' +
'<input type="hidden" name="line.' + linecmt + '.extension_unit" id="line.' + linecmt + '.extension_unit" value="' + unit + '"/>' +
'</select>' +
'<input type="hidden" name="line.' + linecmt + '.line" id="line.' + linecmt + '.line" value="' + a.range_id + '.' + a.line_index + '.' + unit + '"/>' +
'<input type="hidden" name="line.' + linecmt + '.extension_unit" id="line.' + linecmt + '.extension_unit" value="' + unit + '"/>' +
'';
markup += '<div class="caption ' + status + '" style="top:' + a.y + 'px; left:' + a.x + 'px;" data-pos="' + a.position + '" data-pos-top="' + a.y + '" data-pos-left="' + a.x + '">' + action + '</div>';
}
@ -951,7 +952,7 @@ function add_extension_button(){
}
}
function get_linecmt(){
var linecmt = [];
var linecmt = [];
$("select[id^='line.']").each(function (i, element) {
var found = element.id.match(/line\.(\d+)\.type/);
if(found && found[1]){
@ -966,7 +967,7 @@ function get_linecmt(){
return linecmt_max;
}
function get_extension_divcnt(id_in){
var divcnt = {};
var divcnt = {};
$("div[id^='annotated_extension_']").each(function (i, element) {
var found = element.id.match(/annotated_extension_(\d+)_(\d+)/);
if(found && found[1] && found[2]){

Loading…
Cancel
Save