Merge branch 'ent-fix-bulk-alert-operations' into 'develop'

Fixed that restricted users can add/delete all alert templates using bulk alert operations.

See merge request artica/pandorafms!4171
This commit is contained in:
Daniel Rodriguez 2021-06-04 10:24:51 +00:00
commit 77b05de784
2 changed files with 8 additions and 2 deletions

View File

@ -261,7 +261,10 @@ $table->data[1][2] .= html_print_select(
);
$table->data[1][3] = html_print_select([], 'module[]', '', false, '', '', true, true, false, '', false, 'width:180px;');
$templates = alerts_get_alert_templates(false, ['id', 'name']);
$usr_groups = users_get_groups($config['id_user'], 'LW', true);
$filter_groups = '';
$filter_groups = implode(',', array_keys($usr_groups));
$templates = alerts_get_alert_templates(['id_group IN ('.$filter_groups.')'], ['id', 'name']);
$table->data[2][0] = __('Alert template');
$table->data[2][1] = html_print_select(
index_array($templates, 'id', 'name'),

View File

@ -252,7 +252,10 @@ $table->size[3] = '40%';
$table->data = [];
$templates = alerts_get_alert_templates(false, ['id', 'name']);
$usr_groups = users_get_groups($config['id_user'], 'LW', true);
$filter_groups = '';
$filter_groups = implode(',', array_keys($usr_groups));
$templates = alerts_get_alert_templates(['id_group IN ('.$filter_groups.')'], ['id', 'name']);
$table->data[0][0] = __('Alert template');
$table->data[0][1] = html_print_select(
index_array($templates, 'id', 'name'),