Reporting Custom Graphs change visual

This commit is contained in:
Jonathan 2023-03-02 14:35:01 +01:00
parent a5e6e569e8
commit dd1b58b83a
6 changed files with 426 additions and 305 deletions

View File

@ -15,9 +15,6 @@ global $config;
check_login(); check_login();
ui_require_css_file('first_task'); ui_require_css_file('first_task');
?> ?>
<?php
ui_print_info_message(['no_close' => true, 'message' => __('There are no custom graphs defined yet.') ]);
?>
<div class="new_task"> <div class="new_task">
<div class="image_task"> <div class="image_task">
@ -36,7 +33,17 @@ ui_print_info_message(['no_close' => true, 'message' => __('There are no custom
?> ?>
</p> </p>
<form action="index.php?sec=reporting&sec2=godmode/reporting/graph_builder" method="post"> <form action="index.php?sec=reporting&sec2=godmode/reporting/graph_builder" method="post">
<input type="submit" class="button_task" value="<?php echo __('Create Custom Graph'); ?>" /> <?php
html_print_action_buttons(
html_print_submit_button(
__('Create Custom Graph'),
'button_task',
false,
['icon' => 'wand'],
true
)
);
?>
</form> </form>
</div> </div>
</div> </div>

View File

@ -115,20 +115,18 @@ if ($edit_graph === true) {
// ----------------------- // -----------------------
$url = 'index.php?sec=reporting&sec2=godmode/reporting/graph_builder&edit_graph=1'; $url = 'index.php?sec=reporting&sec2=godmode/reporting/graph_builder&edit_graph=1';
if ($edit_graph === true) { if ($edit_graph === true) {
$output = "<form method='post' action='".$url.'&update_graph=1&id='.$id_graph."'>"; $output = "<form method='post' class='max_floating_element_size' action='".$url.'&update_graph=1&id='.$id_graph."'>";
} else { } else {
$output = "<form method='post' action='".$url."&add_graph=1'>"; $output = "<form method='post' class='max_floating_element_size' action='".$url."&add_graph=1'>";
} }
$output .= "<table width='100%' cellpadding=4 cellspacing=4 class='databox filters'>"; $output .= "<table width='100%' cellpadding=4 cellspacing=4 class='filter-table-adv databox'>";
$output .= '<tr>'; $output .= '<tbody width="100%">';
$output .= "<td class='datos'><b>".__('Name').'</b></td>'; $output .= '<tr class="datos2">';
$output .= "<td class='datos'><input type='text' name='name' size='25' "; $graphInTgraph['name'] = (isset($graphInTgraph['name']) === true) ? $graphInTgraph['name'] : '';
if ($edit_graph === true) { $output .= '<td width="50%">';
$output .= "value='".$graphInTgraph['name']."' "; $output .= html_print_label_input_block(__('Name'), html_print_input_text('name', $graphInTgraph['name'], '', '', 255, true), ['style' => 'width:50%']);
} $output .= '</td>';
$output .= '>';
$own_info = get_user_info($config['id_user']); $own_info = get_user_info($config['id_user']);
@ -140,9 +138,9 @@ if (users_can_manage_group_all('RW') === false
$return_all_group = false; $return_all_group = false;
} }
$output .= '<td><b>'.__('Group').'</b></td><td>'; $output .= '<td width="50%">';
if (check_acl($config['id_user'], 0, 'RW')) { if (check_acl($config['id_user'], 0, 'RW')) {
$output .= html_print_input( $inputGroup = html_print_input(
[ [
'type' => 'select_groups', 'type' => 'select_groups',
'id_user' => $config['id_user'], 'id_user' => $config['id_user'],
@ -158,7 +156,7 @@ if (check_acl($config['id_user'], 0, 'RW')) {
] ]
); );
} else if (check_acl($config['id_user'], 0, 'RM')) { } else if (check_acl($config['id_user'], 0, 'RM')) {
$output .= html_print_input( $inputGroup = html_print_input(
[ [
'type' => 'select_groups', 'type' => 'select_groups',
'id_user' => $config['id_user'], 'id_user' => $config['id_user'],
@ -175,38 +173,34 @@ if (check_acl($config['id_user'], 0, 'RW')) {
); );
} }
$output .= html_print_label_input_block(__('Group'), $inputGroup);
$output .= '</td></tr>'; $output .= '</td></tr>';
$output .= '<tr>'; $output .= '<tr class="datos2">';
$output .= "<td class='datos2'><b>".__('Description').'</b></td>'; $output .= '<td width="100%" colspan="2">';
$output .= "<td class='datos2' colspan=3><textarea name='description' class='height_45px' cols=55 rows=2>"; $graphInTgraph['description'] = (isset($graphInTgraph['description']) === true) ? $graphInTgraph['description'] : '';
if ($edit_graph === true) { $output .= html_print_label_input_block(
$output .= $graphInTgraph['description']; __('Description'),
} html_print_textarea('description', 10, 5, $graphInTgraph['description'], '', true)
$output .= '</textarea>';
$output .= '</td></tr>';
if ($stacked == CUSTOM_GRAPH_GAUGE) {
$hidden = ' class="invisible" ';
} else {
$hidden = '';
}
$output .= '<tr>';
$output .= "<td class='datos'>";
$output .= '<b>'.__('Period').'</b></td>';
$output .= "<td class='datos'>";
$output .= html_print_extended_select_for_time(
'period',
$period,
'',
'',
'0',
10,
true
); );
$output .= "</td><td class='datos2'>"; $output .= '</td>';
$output .= '<b>'.__('Type of graph').'</b></td>'; $output .= '</tr><tr class="datos2">';
$output .= "<td class='datos2'> <div class='left inline'>"; $output .= "<td class='datos' width='50%''>";
$output .= html_print_label_input_block(
__('Period'),
html_print_extended_select_for_time(
'period',
$period,
'',
'',
'0',
false,
true,
false,
false,
'w100p'
)
);
$output .= "</td><td class='datos2' width='50%'>";
require_once $config['homedir'].'/include/functions_graph.php'; require_once $config['homedir'].'/include/functions_graph.php';
@ -221,90 +215,116 @@ $stackeds = [
CUSTOM_GRAPH_VBARS => __('Vertical bars'), CUSTOM_GRAPH_VBARS => __('Vertical bars'),
CUSTOM_GRAPH_PIE => __('Pie'), CUSTOM_GRAPH_PIE => __('Pie'),
]; ];
$output .= html_print_select($stackeds, 'stacked', $stacked, '', '', 0, true); $output .= html_print_label_input_block(
__('Type of graph'),
$output .= '</div></td></tr>'; html_print_select(
$stackeds,
$output .= '<tr>'; 'stacked',
$output .= "<td class='datos2 thresholdDiv'><b>"; $stacked,
$output .= __('Equalize maximum thresholds'); '',
$output .= '</b></td>'; '',
$output .= "<td class='datos2 thresholdDiv'>"; 0,
$output .= html_print_checkbox( true
'threshold', )
CUSTOM_GRAPH_BULLET_CHART_THRESHOLD,
$check,
true,
false,
'',
false
); );
$output .= '</td></tr>'; $output .= '</td></tr>';
$output .= "<tr><td class='datos2 sparse_graph '><b>"; $output .= '<tr class="datos2">';
$output .= __('Percentil'); $output .= "<td class='datos2 thresholdDiv' width='50%'>";
$output .= '</b></td>'; $output .= html_print_label_input_block(
$output .= "<td class='datos2 sparse_graph'>"; __('Equalize maximum thresholds'),
$output .= html_print_checkbox( html_print_checkbox(
'percentil', 'threshold',
1, CUSTOM_GRAPH_BULLET_CHART_THRESHOLD,
$percentil, $check,
true true,
false,
'',
false
)
);
$output .= '</td>';
$output .= '<td class="datos2 sparse_graph" width="50%">';
$output .= html_print_label_input_block(
__('Percentil'),
html_print_checkbox(
'percentil',
1,
$percentil,
true
)
); );
$output .= '</td>'; $output .= '</td>';
$output .= '</tr>'; $output .= '</tr>';
$output .= "<tr><td class='datos2 sparse_graph'><b>"; $output .= '<tr class="datos2"><td class="datos2 sparse_graph" width="50%">';
$output .= __('Add summatory series'); $output .= html_print_label_input_block(
$output .= '</b></td>'; __('Add summatory series'),
$output .= "<td class='datos2 sparse_graph'>"; html_print_checkbox(
$output .= html_print_checkbox( 'summatory_series',
'summatory_series', 1,
1, $summatory_series,
$summatory_series, true
true )
); );
$output .= "</td><td class='datos2 sparse_graph'><b>"; $output .= "</td><td class='datos2 sparse_graph' width='50%'>";
$output .= __('Add average series'); $output .= html_print_label_input_block(
$output .= '</b></td>'; __('Add average series'),
$output .= "<td class='datos2 sparse_graph'>"; html_print_checkbox(
$output .= html_print_checkbox( 'average_series',
'average_series', 1,
1, $average_series,
$average_series, true
true )
); );
$output .= '</td></tr>'; $output .= '</td></tr>';
$output .= "<tr><td class='datos2 sparse_graph'><b>"; $output .= '<tr class="datos2"><td class="datos2 sparse_graph" width="50%">';
$output .= __('Modules and series'); $output .= html_print_label_input_block(
$output .= '</b></td>'; __('Modules and series'),
$output .= "<td class='datos2 sparse_graph'>"; html_print_checkbox('modules_series', 1, $modules_series, true)
$output .= html_print_checkbox('modules_series', 1, $modules_series, true); );
$output .= '</td>'; $output .= '</td>';
$output .= "<td class='datos2 sparse_graph'><b>"; $output .= "<td class='datos2 sparse_graph' width='50%'>";
$output .= __('Show full scale graph (TIP)'); $output .= html_print_label_input_block(
$output .= '</td>'; __('Show full scale graph (TIP)'),
$output .= "<td class='datos2 sparse_graph'>"; html_print_checkbox('fullscale', 1, $fullscale, true)
$output .= html_print_checkbox('fullscale', 1, $fullscale, true); );
$output .= '</td>'; $output .= '</td>';
$output .= '</tr>'; $output .= '</tr>';
$output .= '</tbody>';
$output .= '</table>'; $output .= '</table>';
$labelButton = ($edit_graph === true) ? __('Update') : __('Create');
$ActionButtons[] = html_print_submit_button(
$labelButton,
'store',
false,
[
'class' => 'sub ok submitButton',
'icon' => 'next',
],
true
);
$ActionButtons[] = html_print_button(
__('Go back'),
'back',
false,
"window.location.href = 'index.php?sec=reporting&sec2=godmode/reporting/graphs'",
[
'class' => 'sub ok submitButton',
'icon' => 'back',
'mode' => 'secondary',
],
true
);
$output .= html_print_div( $output .= html_print_div(
[ [
'class' => 'action-buttons', 'class' => 'action-buttons',
'content' => html_print_submit_button( 'content' => html_print_action_buttons(implode('', $ActionButtons), ['type' => 'form_action'], true),
($edit_graph === true) ? __('Update') : __('Create'),
'store',
false,
[ 'icon' => 'next' ],
true
).html_print_go_back_button(
'index.php?sec=reporting&sec2=godmode/reporting/graphs',
[],
true
),
], ],
true true
); );

View File

@ -222,217 +222,309 @@ $graphs = custom_graphs_get_user($config['id_user'], false, true, $access);
$offset = (int) get_parameter('offset'); $offset = (int) get_parameter('offset');
$table_aux = new stdClass(); $table_aux = new stdClass();
$table_aux->width = '100%'; $table_aux->width = '100%';
$table_aux->class = 'databox filters'; if (is_metaconsole() === true) {
$table_aux->cellpadding = 0; $table_aux->class = 'databox filters';
$table_aux->cellspacing = 0; $table_aux->cellpadding = 0;
$table_aux->cellspacing = 0;
$table_aux->colspan[0][0] = 4;
$table_aux->data[0][0] = '<b>'.__('Group').'</b>';
$table_aux->data[0][1] = html_print_select_groups(false, $access, true, 'id_group', $id_group, '', '', '', true, false, true, '', false, '', false, false, 'id_grupo', $strict_user).'<br>';
$table_aux->data[0][2] = '<b>'.__('Free text for search: ').ui_print_help_tip(
__('Search by report name or description, list matches.'),
true
).'</b>';
$table_aux->data[0][3] = html_print_input_text('search', $search, '', 30, '', true);
$table_aux->data[0][6] = html_print_submit_button(__('Search'), 'search_submit', false, 'class="sub upd"', true);
$filter = "<form class ='' action='index.php?sec=reporting&sec2=godmode/reporting/graphs&id_group=$id_group&pure=$pure'
method='post'>";
$filter .= html_print_table($table_aux, true);
$filter .= '</form>';
ui_toggle($filter, __('Show Option'));
} else {
$table_aux->class = 'filter-table-adv';
$table_aux->size[0] = '50%';
$table_aux->colspan[0][0] = 4; $table_aux->data[0][0] = html_print_label_input_block(
$table_aux->data[0][0] = '<b>'.__('Group').'</b>'; __('Group'),
html_print_select_groups(
false,
$access,
true,
'id_group',
$id_group,
'',
'',
'',
true,
false,
true,
'',
false,
'',
false,
false,
'id_grupo',
$strict_user
)
);
$table_aux->data[0][1] = html_print_label_input_block(
__('Free text for search: ').ui_print_help_tip(__('Search by report name or description, list matches.'), true),
html_print_input_text('search', $search, '', 30, '', true)
);
$table_aux->data[0][1] = html_print_select_groups(false, $access, true, 'id_group', $id_group, '', '', '', true, false, true, '', false, '', false, false, 'id_grupo', $strict_user).'<br>'; $searchForm .= '<form action="index.php?sec=reporting&sec2=godmode/reporting/graphs&id_group='.$id_group.'&pure='.$pure.'"method="post">';
$searchForm .= html_print_table($table_aux, true);
$table_aux->data[0][2] = '<b>'.__('Free text for search: ').ui_print_help_tip( $searchForm .= html_print_div(
__('Search by report name or description, list matches.'), [
true 'class' => 'action-buttons',
).'</b>'; 'content' => html_print_submit_button(
$table_aux->data[0][3] = html_print_input_text('search', $search, '', 30, '', true); __('Filter'),
'search_submit',
false,
[
'mode' => 'mini',
'icon' => 'search',
],
true
),
],
true
);
$searchForm .= '</form>';
$table_aux->data[0][6] = html_print_submit_button(__('Search'), 'search_submit', false, 'class="sub upd"', true); ui_toggle(
$searchForm,
'<span class="subsection_header_title">'.__('Filters').'</span>',
'filter_form',
'',
true,
false,
'',
'white-box-content',
'box-flat white_table_graph fixed_filter_bar'
);
}
if (is_metaconsole()) { // Show only selected groups.
$filter = "<form class ='' action='index.php?sec=reporting&sec2=godmode/reporting/graphs&id_group=$id_group&pure=$pure' if ($id_group > 0) {
method='post'>"; $group = ["$id_group" => $id_group];
$filter .= html_print_table($table_aux, true); } else {
$filter .= '</form>'; $group = false;
ui_toggle($filter, __('Show Option')); }
} else {
echo "<form action='index.php?sec=reporting&sec2=godmode/reporting/graphs&id_group=$id_group&pure=$pure' $own_info = get_user_info($config['id_user']);
method='post'>"; if ($own_info['is_admin'] || check_acl($config['id_user'], 0, 'RM')) {
html_print_table($table_aux); $return_all_group = true;
} else {
$return_all_group = false;
}
if ($search != '') {
$filter = [
'name' => $search_name,
'order' => 'name',
];
} else {
$filter = ['order' => 'name'];
}
// Fix : group filter was not working
// Show only selected groups.
if ($id_group > 0) {
$group = ["$id_group" => $id_group];
$filter['id_group'] = $id_group;
} else {
$group = false;
}
// Filter normal and metaconsole reports.
if ($config['metaconsole'] == 1 && defined('METACONSOLE')) {
$filter['metaconsole'] = 1;
} else {
$filter['metaconsole'] = 0;
}
if ($id_group != null || $search != null) {
$graphs = custom_graphs_search($id_group, $search);
}
if (!empty($graphs)) {
$table = new stdClass();
$table->width = '100%';
$table->class = 'info_table';
$table->cellpadding = 0;
$table->cellspacing = 0;
$table->align = [];
$table->head = [];
$table->head[0] = __('Graph name');
$table->head[1] = __('Description');
$table->head[2] = __('Number of Graphs');
$table->head[3] = __('Group');
$table->size[0] = '30%';
$table->size[2] = '200px';
$table->size[3] = '200px';
$table->align[2] = 'left';
$table->align[3] = 'left';
$op_column = false;
if ($report_w || $report_m) {
$op_column = true;
$table->align[4] = 'left';
$table->head[4] = __('Op.');
$table->size[4] = '90px';
}
if ($report_w || $report_m) {
$table->align[5] = 'left';
$table->head[5] = html_print_checkbox('all_delete', 0, false, true, false);
$table->size[5] = '20px';
}
$table->data = [];
$result_graphs = array_slice($graphs, $offset, $config['block_size']);
foreach ($result_graphs as $graph) {
$data = [];
$data[0] = '<a href="index.php?sec=reporting&sec2=operation/reporting/graph_viewer&view_graph=1&id='.$graph['id_graph'].'">'.ui_print_truncate_text(
$graph['name'],
70
).'</a>';
$data[1] = ui_print_truncate_text($graph['description'], 70);
$data[2] = $graph['graphs_count'];
$data[3] = ui_print_group_icon($graph['id_group'], true);
$data[4] = '';
$table->cellclass[][4] = 'table_action_buttons';
if (($report_w || $report_m)) {
$data[4] = '<a href="index.php?sec=reporting&sec2=godmode/reporting/graph_builder&edit_graph=1&id='.$graph['id_graph'].'">'.html_print_image(
'images/edit.svg',
true,
['class' => 'invert_filter main_menu_icon']
).'</a>';
}
$data[5] = '';
if (check_acl_restricted_all($config['id_user'], $graph['id_group'], 'RM')) {
$data[4] .= '<a href="index.php?sec=reporting&sec2=godmode/reporting/graphs&delete_graph=1&id='.$graph['id_graph'].'" onClick="if (!confirm(\''.__('Are you sure?').'\'))
return false;">'.html_print_image(
'images/delete.svg',
true,
[
'alt' => __('Delete'),
'title' => __('Delete'),
'class' => 'invert_filter main_menu_icon',
]
).'</a>';
$data[5] .= html_print_checkbox_extended(
'delete_multiple[]',
$graph['id_graph'],
false,
false,
'',
[
'class' => 'check_delete mrgn_lft_2px check_delete',
'form' => 'form_delete',
'data-value' => $graph['id_graph'],
],
true
);
}
array_push($table->data, $data);
}
if (is_metaconsole() === true) {
if (!empty($result_graphs)) {
echo "<form method='post' action='index.php?sec=reporting&sec2=godmode/reporting/graphs'>";
html_print_input_hidden('multiple_delete', 1);
html_print_table($table);
ui_pagination(count($graphs), false, 0, 0, false, 'offset', true, 'pagination-bottom');
echo "<div class='right'>";
html_print_submit_button(__('Delete'), 'delete_btn', false, 'class="sub delete"');
echo '</form>'; echo '</form>';
} }
// Show only selected groups.
if ($id_group > 0) { echo "<div class='right'>";
$group = ["$id_group" => $id_group]; if ($report_w || $report_m) {
} else { echo '<form method="post" class="right" action="index.php?sec=reporting&sec2=godmode/reporting/graph_builder">';
$group = false; html_print_submit_button(__('Create graph'), 'create', false, 'class="sub next mrgn_right_5px"');
echo '</form>';
}
} else {
if ($report_w || $report_m) {
$ActionButtons[] = '<form method="post" class="right mrgn_lft_10px" action="index.php?sec=reporting&sec2=godmode/reporting/graph_builder">';
$ActionButtons[] = html_print_submit_button(
__('Create graph'),
'create',
false,
[
'class' => 'sub ok',
'icon' => 'next',
],
true
);
$ActionButtons[] = '</form>';
} }
$own_info = get_user_info($config['id_user']); if (!empty($result_graphs)) {
if ($own_info['is_admin'] || check_acl($config['id_user'], 0, 'RM')) { $ActionButtons[] = "<form method='post' id='form_delete' action='index.php?sec=reporting&sec2=godmode/reporting/graphs'>";
$return_all_group = true; $ActionButtons[] = html_print_input_hidden('multiple_delete', 1, true);
} else { $ActionButtons[] = html_print_submit_button(
$return_all_group = false; __('Delete'),
'delete_btn',
false,
[
'class' => 'secondary',
'icon' => 'delete',
],
true
);
$ActionButtons[] = '</form>';
} }
if ($search != '') { // FALTA METER EL PRINT TABLE.
$filter = [ html_print_table($table);
'name' => $search_name, html_print_action_buttons(
'order' => 'name', implode('', $ActionButtons),
]; ['type' => 'form_action']
} else { );
$filter = ['order' => 'name']; }
}
// Fix : group filter was not working echo '</div>';
// Show only selected groups.
if ($id_group > 0) {
$group = ["$id_group" => $id_group];
$filter['id_group'] = $id_group;
} else {
$group = false;
}
// Filter normal and metaconsole reports. echo '</div>';
if ($config['metaconsole'] == 1 && defined('METACONSOLE')) { } else {
$filter['metaconsole'] = 1; include_once $config['homedir'].'/general/first_task/custom_graphs.php';
} else { }
$filter['metaconsole'] = 0;
}
if ($id_group != null || $search != null) { ?>
$graphs = custom_graphs_search($id_group, $search);
}
ui_pagination(count($graphs));
if (!empty($graphs)) {
$table = new stdClass();
$table->width = '100%';
$table->class = 'info_table';
$table->cellpadding = 0;
$table->cellspacing = 0;
$table->align = [];
$table->head = [];
$table->head[0] = __('Graph name');
$table->head[1] = __('Description');
$table->head[2] = __('Number of Graphs');
$table->head[3] = __('Group');
$table->size[0] = '30%';
$table->size[2] = '200px';
$table->size[3] = '200px';
$table->align[2] = 'left';
$table->align[3] = 'left';
$op_column = false;
if ($report_w || $report_m) {
$op_column = true;
$table->align[4] = 'left';
$table->head[4] = __('Op.');
$table->size[4] = '90px';
}
if ($report_w || $report_m) {
$table->align[5] = 'left';
$table->head[5] = html_print_checkbox('all_delete', 0, false, true, false);
$table->size[5] = '20px';
}
$table->data = [];
$result_graphs = array_slice($graphs, $offset, $config['block_size']);
foreach ($result_graphs as $graph) {
$data = [];
$data[0] = '<a href="index.php?sec=reporting&sec2=operation/reporting/graph_viewer&view_graph=1&id='.$graph['id_graph'].'">'.ui_print_truncate_text(
$graph['name'],
70
).'</a>';
$data[1] = ui_print_truncate_text($graph['description'], 70);
$data[2] = $graph['graphs_count'];
$data[3] = ui_print_group_icon($graph['id_group'], true);
$data[4] = '';
$table->cellclass[][4] = 'table_action_buttons';
if (($report_w || $report_m)) {
$data[4] = '<a href="index.php?sec=reporting&sec2=godmode/reporting/graph_builder&edit_graph=1&id='.$graph['id_graph'].'">'.html_print_image(
'images/config.png',
true,
['class' => 'invert_filter']
).'</a>';
}
$data[5] = '';
if (check_acl_restricted_all($config['id_user'], $graph['id_group'], 'RM')) {
$data[4] .= '<a href="index.php?sec=reporting&sec2=godmode/reporting/graphs&delete_graph=1&id='.$graph['id_graph'].'" onClick="if (!confirm(\''.__('Are you sure?').'\'))
return false;">'.html_print_image(
'images/cross.png',
true,
[
'alt' => __('Delete'),
'title' => __('Delete'),
'class' => 'invert_filter',
]
).'</a>';
$data[5] .= html_print_checkbox_extended(
'delete_multiple[]',
$graph['id_graph'],
false,
false,
'',
'class="check_delete mrgn_lft_2px"',
true
);
}
array_push($table->data, $data);
}
if (!empty($result_graphs)) {
echo "<form method='post' action='index.php?sec=reporting&sec2=godmode/reporting/graphs'>";
html_print_input_hidden('multiple_delete', 1);
html_print_table($table);
ui_pagination(count($graphs), false, 0, 0, false, 'offset', true, 'pagination-bottom');
echo "<div class='right'>";
html_print_submit_button(__('Delete'), 'delete_btn', false, 'class="sub delete"');
echo '</form>';
}
echo "<div class='right'>";
if ($report_w || $report_m) {
echo '<form method="post" class="right" action="index.php?sec=reporting&sec2=godmode/reporting/graph_builder">';
html_print_submit_button(__('Create graph'), 'create', false, 'class="sub next mrgn_right_5px"');
echo '</form>';
}
echo '</div>';
echo '</div>';
} else {
include_once $config['homedir'].'/general/first_task/custom_graphs.php';
}
?>
<script type="text/javascript"> <script type="text/javascript">
$( document ).ready(function() { $( document ).ready(function() {
$('[id^=checkbox-delete_multiple]').change(function(){ $('[id^=checkbox-delete_multiple]').click(function(){
if($(this).parent().parent().hasClass('checkselected')){ if($(this).prop("checked") === false ){
$(this).parent().parent().removeClass('checkselected'); $(this).prop("checked", false);
} } else {
else{ $(this).prop("checked", true);
$(this).parent().parent().addClass('checkselected');
} }
}); });
$('[id^=checkbox-all_delete]').change(function(){ $('#checkbox-all_delete').click(function(){
if ($("#checkbox-all_delete").prop("checked")) { if ($("#checkbox-all_delete").prop("checked") === true) {
$('[id^=checkbox-delete_multiple]').parent().parent().addClass('checkselected'); $("[id^=checkbox-delete_multiple]").prop("checked", true);
$(".check_delete").prop("checked", true);
} }
else{ else{
$('[id^=checkbox-delete_multiple]').parent().parent().removeClass('checkselected'); $("[id^=checkbox-delete_multiple]").prop("checked", false);
$(".check_delete").prop("checked", false);
} }
}); });

View File

@ -821,7 +821,7 @@ switch ($action) {
[ [
'class' => 'action-buttons', 'class' => 'action-buttons',
'content' => html_print_submit_button( 'content' => html_print_submit_button(
__('Search'), __('Filter'),
'search_submit', 'search_submit',
false, false,
[ [

View File

@ -198,10 +198,12 @@ if ($edit_filter > -2) {
$table->id = 'filter_table'; $table->id = 'filter_table';
$table->width = '100%'; $table->width = '100%';
$table->class = 'databox filters'; $table->class = 'databox filters';
$table->rowclass[0] = 'row-title-font-child';
$table->rowclass[1] = 'row-title-font-child';
$table->data[0][0] = __('Description'); $table->data[0][0] = __('Description');
$table->data[0][1] = html_print_input_text('description', $description, '', 60, 100, true); $table->data[0][1] = html_print_input_text('description', $description, '', 60, 100, true);
$table->data[0][1] .= html_print_image( $table->data[0][1] .= html_print_image(
'images/add.png', 'images/plus.png',
true, true,
[ [
'id' => 'add_filter', 'id' => 'add_filter',
@ -243,7 +245,7 @@ if ($edit_filter > -2) {
} }
$index++; $index++;
echo '<form action="index.php?sec=snmpconsole&sec2=godmode/snmpconsole/snmp_filters" method="post">'; echo '<form class="max_floating_element_size" action="index.php?sec=snmpconsole&sec2=godmode/snmpconsole/snmp_filters" method="post">';
html_print_input_hidden('update_filter', $edit_filter); html_print_input_hidden('update_filter', $edit_filter);
html_print_input_hidden('index_post', $index); html_print_input_hidden('index_post', $index);
if ($edit_filter > -1) { if ($edit_filter > -1) {

View File

@ -77,7 +77,7 @@ if ($generate_trap) {
} }
$table = new stdClass(); $table = new stdClass();
$traps_generator = '<form method="POST" action="index.php?sec=snmpconsole&sec2=godmode/snmpconsole/snmp_trap_generator">'; $traps_generator = '<form class="max_floating_element_size" method="POST" action="index.php?sec=snmpconsole&sec2=godmode/snmpconsole/snmp_trap_generator">';
$table->width = '100%'; $table->width = '100%';
$table->class = 'filter-table-adv databox'; $table->class = 'filter-table-adv databox';
$table->size = []; $table->size = [];