From b50b1c9f34bf97d345bacfa66e1576532e0bccd4 Mon Sep 17 00:00:00 2001 From: fermin831 Date: Mon, 22 Oct 2018 10:08:25 +0200 Subject: [PATCH] Added group icon to alerts commands view --- .../godmode/alerts/alert_commands.php | 46 ++++++++++--------- 1 file changed, 25 insertions(+), 21 deletions(-) diff --git a/pandora_console/godmode/alerts/alert_commands.php b/pandora_console/godmode/alerts/alert_commands.php index f71b724947..033a59436c 100644 --- a/pandora_console/godmode/alerts/alert_commands.php +++ b/pandora_console/godmode/alerts/alert_commands.php @@ -347,45 +347,49 @@ $table->class = 'databox data'; $table->data = array (); $table->head = array (); -$table->head[0] = __('Name'); -$table->head[1] = __('ID'); -$table->head[2] = __('Description'); -$table->head[3] = __('Delete'); +$table->head['name'] = __('Name'); +$table->head['id'] = __('ID'); +$table->head['group'] = __('Group'); +$table->head['description'] = __('Description'); +$table->head['action'] = __('Delete'); $table->style = array (); -$table->style[0] = 'font-weight: bold'; +$table->style['name'] = 'font-weight: bold'; $table->size = array (); -$table->size[3] = '40px'; +$table->size['action'] = '40px'; $table->align = array (); -$table->align[3] = 'left'; +$table->align['action'] = 'left'; -$commands = db_get_all_rows_in_table ('talert_commands'); -if ($commands === false) - $commands = array (); +$commands = db_get_all_rows_filter( + 'talert_commands', + array('id_group' => array_keys(users_get_groups(false, "LM"))) +); +if ($commands === false) $commands = array (); foreach ($commands as $command) { $data = array (); - - $data[0] = ''; + + $data['name'] = ''; if (! $command['internal']) - $data[0] .= ''. + $data['name'] .= ''. $command['name'].''; else - $data[0] .= $command['name']; - $data[0] .= ''; - $data[1] = $command['id']; - $data[2] = str_replace("\r\n","
", + $data['name'] .= $command['name']; + $data['name'] .= '
'; + $data['id'] = $command['id']; + $data['group'] = ui_print_group_icon ($command["id_group"], true); + $data['description'] = str_replace("\r\n","
", io_safe_output($command['description'])); - $data[3] = ''; + $data['action'] = ''; if (! $command['internal']) { - $data[3] = ''. html_print_image("images/cross.png", true) . ''; } - + array_push ($table->data, $data); } -if (isset($data)) { +if (count($table->data) > 0) { html_print_table ($table); } else {