MT#2452 Add vendor specific prefixes filtering

Change-Id: I3f319c34ec2b088810219bdffe61f2885a19d282
changes/83/8083/2
Irina Peshinskaya 9 years ago
parent 17333c7b30
commit 08e0a0f2e5

@ -1952,12 +1952,19 @@ sub devices_preferences_list :Chained('devmod_base') :PathPart('preferences') :C
type => 'dev',
id => $c->stash->{devmod}->id,
);
my $pref_values = get_inflated_columns_all($dev_pref_rs,'hash' => 'attribute', 'column' => 'value', 'force_array' => 1);
NGCP::Panel::Utils::Preferences::load_preference_list(
c => $c,
pref_values => $pref_values,
dev_pref => 1,
search_conditions => {
'-or' => [
{'attribute' => {'like' => 'vnd_'.lc($c->stash->{devmod}->vendor).'%' } },
{'attribute' => {'-not_like' => 'vnd_%' }}
],
}
);
$c->stash(template => 'device/preferences.tt');
@ -2024,6 +2031,12 @@ sub profile_preferences_list :Chained('devprof_base') :PathPart('preferences') :
c => $c,
pref_values => $pref_values,
'devprof_pref' => 1,
search_conditions => {
'-or' => [
{'attribute' => {'like' => 'vnd_'.lc($c->stash->{devprof}->config->device->vendor).'%' } },
{'attribute' => {'-not_like' => 'vnd_%' }}
],
}
);
$c->stash(template => 'device/profilepreferences.tt');

@ -47,6 +47,8 @@ sub load_preference_list {
my $customer_view = $params{customer_view} // 0;
my $cloudpbx_enabled = $c->config->{features}{cloudpbx};
my $search_conditions = $params{search_conditions};
my $pref_rs = $c->model('DB')
->resultset('voip_preference_groups')
->search({ 'voip_preferences.internal' => { '<=' => 0 },
@ -85,6 +87,13 @@ sub load_preference_list {
'voip_preferences.id' => { in => \@prof_attributes }
});
}
if($search_conditions) {
if('ARRAY' eq $search_conditions){
$pref_rs = $pref_rs->search(@$search_conditions);
}else{
$pref_rs = $pref_rs->search($search_conditions);
}
}
my @pref_groups = $pref_rs->all;
foreach my $group(@pref_groups) {

Loading…
Cancel
Save