width = '100%'; $table->class = 'info_table'; $table->data = []; $table->head = []; $table->head[0] = __('Name'); $table->head[1] = __('Group'); $table->head[2] = __('Copy'); $table->head[3] = __('Delete'); $table->style = []; $table->style[0] = 'font-weight: bold'; $table->size = []; $table->size[1] = '200px'; $table->size[2] = '40px'; $table->size[3] = '40px'; $table->align = []; $table->align[1] = 'left'; $table->align[2] = 'left'; $table->align[3] = 'left'; $filter = []; if (!is_user_admin($config['id_user'])) { $filter['talert_actions.id_group'] = array_keys(users_get_groups(false, 'LM')); } $actions = db_get_all_rows_filter( 'talert_actions INNER JOIN talert_commands ON talert_actions.id_alert_command = talert_commands.id', $filter, 'talert_actions.* , talert_commands.id_group AS command_group' ); if ($actions === false) { $actions = []; } $rowPair = true; $iterator = 0; foreach ($actions as $action) { if ($rowPair) { $table->rowclass[$iterator] = 'rowPair'; } else { $table->rowclass[$iterator] = 'rowOdd'; } $rowPair = !$rowPair; $iterator++; $data = []; $data[0] = ''.$action['name'].''; $data[1] = ui_print_group_icon($action['id_group'], true).' '; if (!alerts_validate_command_to_action($action['id_group'], $action['command_group'])) { $data[1] .= html_print_image( 'images/error.png', true, // FIXME: Translation. [ 'title' => __('The action and the command associated with it do not have the same group. Please contact an administrator to fix it.'), ] ); } if (check_acl($config['id_user'], $action['id_group'], 'LM')) { $table->cellclass[] = [ 2 => 'action_buttons', 3 => 'action_buttons', ]; $data[2] = ''.html_print_image('images/copy.png', true).''; $data[3] = ''.html_print_image('images/cross.png', true).''; } array_push($table->data, $data); } if (isset($data)) { html_print_table($table); } else { ui_print_info_message(['no_close' => true, 'message' => __('No alert actions configured') ]); } echo '
'; echo '
'; html_print_submit_button(__('Create'), 'create', false, 'class="sub next"'); html_print_input_hidden('create_alert', 1); echo '
'; echo '
'; enterprise_hook('close_meta_frame');