Added group icon to alerts commands view

This commit is contained in:
fermin831 2018-10-22 10:08:25 +02:00
parent 8b0b23dc27
commit b50b1c9f34

View File

@ -347,37 +347,41 @@ $table->class = 'databox data';
$table->data = array (); $table->data = array ();
$table->head = array (); $table->head = array ();
$table->head[0] = __('Name'); $table->head['name'] = __('Name');
$table->head[1] = __('ID'); $table->head['id'] = __('ID');
$table->head[2] = __('Description'); $table->head['group'] = __('Group');
$table->head[3] = __('Delete'); $table->head['description'] = __('Description');
$table->head['action'] = __('Delete');
$table->style = array (); $table->style = array ();
$table->style[0] = 'font-weight: bold'; $table->style['name'] = 'font-weight: bold';
$table->size = array (); $table->size = array ();
$table->size[3] = '40px'; $table->size['action'] = '40px';
$table->align = array (); $table->align = array ();
$table->align[3] = 'left'; $table->align['action'] = 'left';
$commands = db_get_all_rows_in_table ('talert_commands'); $commands = db_get_all_rows_filter(
if ($commands === false) 'talert_commands',
$commands = array (); array('id_group' => array_keys(users_get_groups(false, "LM")))
);
if ($commands === false) $commands = array ();
foreach ($commands as $command) { foreach ($commands as $command) {
$data = array (); $data = array ();
$data[0] = '<span style="font-size: 7.5pt">'; $data['name'] = '<span style="font-size: 7.5pt">';
if (! $command['internal']) if (! $command['internal'])
$data[0] .= '<a href="index.php?sec='.$sec.'&sec2=godmode/alerts/configure_alert_command&id='.$command['id'].'&pure='.$pure.'">'. $data['name'] .= '<a href="index.php?sec='.$sec.'&sec2=godmode/alerts/configure_alert_command&id='.$command['id'].'&pure='.$pure.'">'.
$command['name'].'</a>'; $command['name'].'</a>';
else else
$data[0] .= $command['name']; $data['name'] .= $command['name'];
$data[0] .= '</span>'; $data['name'] .= '</span>';
$data[1] = $command['id']; $data['id'] = $command['id'];
$data[2] = str_replace("\r\n","<br>", $data['group'] = ui_print_group_icon ($command["id_group"], true);
$data['description'] = str_replace("\r\n","<br>",
io_safe_output($command['description'])); io_safe_output($command['description']));
$data[3] = ''; $data['action'] = '';
if (! $command['internal']) { if (! $command['internal']) {
$data[3] = '<a href="index.php?sec='.$sec.'&sec2=godmode/alerts/alert_commands&delete_command=1&id='.$command['id'].'&pure='.$pure.'" $data['action'] = '<a href="index.php?sec='.$sec.'&sec2=godmode/alerts/alert_commands&delete_command=1&id='.$command['id'].'&pure='.$pure.'"
onClick="if (!confirm(\''.__('Are you sure?').'\')) return false;">'. onClick="if (!confirm(\''.__('Are you sure?').'\')) return false;">'.
html_print_image("images/cross.png", true) . '</a>'; html_print_image("images/cross.png", true) . '</a>';
} }
@ -385,7 +389,7 @@ foreach ($commands as $command) {
array_push ($table->data, $data); array_push ($table->data, $data);
} }
if (isset($data)) { if (count($table->data) > 0) {
html_print_table ($table); html_print_table ($table);
} }
else { else {