#10493 fixed pagination in alerts
This commit is contained in:
parent
776f0a69f5
commit
2b185b5754
|
@ -391,7 +391,7 @@ foreach ($actions as $action) {
|
|||
|
||||
$data = [];
|
||||
|
||||
$data[0] = '<a href="index.php?sec='.$sec.'&sec2=godmode/alerts/configure_alert_action&id='.$action['id'].'&pure='.$pure.'">'.$action['name'].'</a>';
|
||||
$data[0] = '<a href="index.php?sec='.$sec.'&sec2=godmode/alerts/configure_alert_action&id='.$action['id'].'&pure='.$pure.'&offset='.$offset.'">'.$action['name'].'</a>';
|
||||
if ($action['id_group'] == 0 && $can_edit_all == false) {
|
||||
$data[0] .= ui_print_help_tip(__('You cannot edit this action, You don\'t have the permission to edit All group.'), true);
|
||||
}
|
||||
|
@ -467,7 +467,7 @@ if (isset($data)) {
|
|||
|
||||
if (is_management_allowed() === true) {
|
||||
echo '<div class="action-buttons" style="width: '.$table->width.'">';
|
||||
echo '<form method="post" action="index.php?sec='.$sec.'&sec2=godmode/alerts/configure_alert_action&pure='.$pure.'">';
|
||||
echo '<form method="post" action="index.php?sec='.$sec.'&sec2=godmode/alerts/configure_alert_action&pure='.$pure.'&offset='.$offset.'">';
|
||||
html_print_submit_button(__('Create'), 'create', false, 'class="sub next"');
|
||||
html_print_input_hidden('create_alert', 1);
|
||||
echo '</form>';
|
||||
|
|
|
@ -795,15 +795,15 @@ foreach ($commands as $command) {
|
|||
);
|
||||
$data['action'] = '';
|
||||
$table->cellclass[]['action'] = 'action_buttons';
|
||||
|
||||
$offset_delete = ($offset >= ($total_commands - 1)) ? ($offset - $limit) : $offset;
|
||||
// (IMPORTANT, DO NOT CHANGE!) only users with permissions over "All" group have access to edition of commands belonging to "All" group.
|
||||
if ($is_management_allowed === true && !$command['internal'] && check_acl_restricted_all($config['id_user'], $command['id_group'], 'LM')) {
|
||||
if (is_user_admin($config['id_user']) === true) {
|
||||
$data['action'] = '<span class="inline_flex">';
|
||||
$data['action'] .= '<a href="index.php?sec='.$sec.'&sec2=godmode/alerts/alert_commands&copy_command=1&id='.$command['id'].'&pure='.$pure.'"
|
||||
$data['action'] .= '<a href="index.php?sec='.$sec.'&sec2=godmode/alerts/alert_commands&copy_command=1&id='.$command['id'].'&pure='.$pure.'&offset='.$offset.'"
|
||||
onClick="if (!confirm(\''.__('Are you sure?').'\')) return false;">'.html_print_image('images/copy.png', true, ['class' => 'invert_filter']).'</a>';
|
||||
|
||||
$data['action'] .= '<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.'&offset='.$offset_delete.'"
|
||||
onClick="if (!confirm(\''.__('Are you sure?').'\')) return false;">'.html_print_image('images/cross.png', true, ['class' => 'invert_filter']).'</a>';
|
||||
$data['action'] .= '</span>';
|
||||
}
|
||||
|
|
|
@ -352,7 +352,8 @@ if ($search_string) {
|
|||
$filter[] = "(name LIKE '%".$search_string."%' OR description LIKE '%".$search_string."%' OR value LIKE '%".$search_string."%')";
|
||||
}
|
||||
|
||||
$filter['offset'] = (int) get_parameter('offset');
|
||||
$offset = (int) get_parameter('offset');
|
||||
$filter['offset'] = $offset;
|
||||
$filter['limit'] = (int) $config['block_size'];
|
||||
if (!is_user_admin($config['id_user'])) {
|
||||
$filter['id_group'] = array_keys(users_get_groups(false, 'LM'));
|
||||
|
@ -420,7 +421,7 @@ foreach ($templates as $template) {
|
|||
&& check_acl($config['id_user'], $template['id_group'], 'LM')
|
||||
) {
|
||||
$table->cellclass[][4] = 'action_buttons';
|
||||
$data[4] = '<form method="post" action="index.php?sec='.$sec.'&sec2=godmode/alerts/configure_alert_template&pure='.$pure.'" class="float-left inline_line">';
|
||||
$data[4] = '<form method="post" action="index.php?sec='.$sec.'&sec2=godmode/alerts/configure_alert_template&pure='.$pure.'&offset='.$offset.'" class="float-left inline_line">';
|
||||
$data[4] .= html_print_input_hidden('duplicate_template', 1, true);
|
||||
$data[4] .= html_print_input_hidden('source_id', $template['id'], true);
|
||||
$data[4] .= html_print_input_image(
|
||||
|
|
|
@ -372,8 +372,9 @@ for ($i = 1; $i <= $config['max_macro_fields']; $i++) {
|
|||
);
|
||||
}
|
||||
|
||||
$offset = (int) get_parameter('offset', 0);
|
||||
|
||||
echo '<form method="post" action="index.php?sec='.$sec.'&sec2=godmode/alerts/alert_actions&pure='.$pure.'">';
|
||||
echo '<form method="post" action="index.php?sec='.$sec.'&sec2=godmode/alerts/alert_actions&pure='.$pure.'&offset='.$offset.'">';
|
||||
$table_html = html_print_table($table, true);
|
||||
|
||||
echo $table_html;
|
||||
|
|
|
@ -1147,9 +1147,10 @@ if ($step == 2) {
|
|||
echo ui_get_using_system_timezone_warning();
|
||||
}
|
||||
|
||||
$offset = (int) get_parameter('offset');
|
||||
// If it's the last step it will redirect to template lists.
|
||||
if ($step >= LAST_STEP) {
|
||||
echo '<form method="post" action="index.php?sec='.$sec.'&sec2=godmode/alerts/alert_templates&pure='.$pure.'">';
|
||||
echo '<form method="post" action="index.php?sec='.$sec.'&sec2=godmode/alerts/alert_templates&pure='.$pure.'&offset='.$offset.'">';
|
||||
} else {
|
||||
echo '<form method="post">';
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue