Merge branch 'ent-10493-reinicio-de-la-paginacion-al-interactuar-con-un-elemento' into 'develop'
Ent 10493 reinicio de la paginacion al interactuar con un elemento See merge request artica/pandorafms!5556
This commit is contained in:
commit
86b7e278ad
pandora_console/godmode
|
@ -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">';
|
||||
}
|
||||
|
|
|
@ -40,6 +40,7 @@ $custom_id = '';
|
|||
|
||||
$create_group = (bool) get_parameter('create_group');
|
||||
$id_group = (int) get_parameter('id_group');
|
||||
$offset = (int) get_parameter('offset', 0);
|
||||
|
||||
if ($id_group) {
|
||||
$group = db_get_row('tmodule_group', 'id_mg', $id_group);
|
||||
|
@ -70,9 +71,9 @@ $table->data[0][1] = html_print_input_text('name', $name, '', 35, 100, true);
|
|||
|
||||
echo '</span>';
|
||||
if (is_metaconsole()) {
|
||||
echo '<form name="grupo" method="post" action="index.php?sec=advanced&sec2=advanced/component_management&tab=module_group">';
|
||||
echo '<form name="grupo" method="post" action="index.php?sec=advanced&sec2=advanced/component_management&tab=module_group&offset='.$offset.'">';
|
||||
} else {
|
||||
echo '<form name="grupo" method="post" action="index.php?sec=gmodules&sec2=godmode/groups/modu_group_list">';
|
||||
echo '<form name="grupo" method="post" action="index.php?sec=gmodules&sec2=godmode/groups/modu_group_list&offset='.$offset.'">';
|
||||
}
|
||||
|
||||
html_print_table($table);
|
||||
|
|
|
@ -262,18 +262,18 @@ if (empty($groups) === false) {
|
|||
}
|
||||
|
||||
$table->data = [];
|
||||
|
||||
$offset_delete = ($offset >= $total_groups - 1) ? ($offset - $config['block_size']) : $offset;
|
||||
foreach ($groups as $id_group) {
|
||||
$data = [];
|
||||
$data[0] = $id_group['id_mg'];
|
||||
|
||||
if ($is_management_allowed === true) {
|
||||
$data[1] = '<strong><a href="index.php?sec=gmodules&sec2=godmode/groups/configure_modu_group&id_group='.$id_group['id_mg'].'">'.ui_print_truncate_text($id_group['name'], GENERIC_SIZE_TEXT).'</a></strong>';
|
||||
$data[1] = '<strong><a href="index.php?sec=gmodules&sec2=godmode/groups/configure_modu_group&id_group='.$id_group['id_mg'].'&offset='.$offset.'">'.ui_print_truncate_text($id_group['name'], GENERIC_SIZE_TEXT).'</a></strong>';
|
||||
if (is_metaconsole() === true) {
|
||||
$data[2] = '<a href="index.php?sec=advanced&sec2=advanced/component_management&tab=module_group&id_group='.$id_group['id_mg'].'&delete_group=1" onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">'.html_print_image('images/cross.png', true, ['border' => '0']).'</a>';
|
||||
$data[2] = '<a href="index.php?sec=advanced&sec2=advanced/component_management&tab=module_group&id_group='.$id_group['id_mg'].'&delete_group=1&offset='.$offset_delete.'" onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">'.html_print_image('images/cross.png', true, ['border' => '0']).'</a>';
|
||||
} else {
|
||||
$table->cellclass[][2] = 'action_buttons';
|
||||
$data[2] = '<a href="index.php?sec=gmodules&sec2=godmode/groups/modu_group_list&id_group='.$id_group['id_mg'].'&delete_group=1" onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">'.html_print_image('images/cross.png', true, ['border' => '0']).'</a>';
|
||||
$data[2] = '<a href="index.php?sec=gmodules&sec2=godmode/groups/modu_group_list&id_group='.$id_group['id_mg'].'&delete_group=1&offset='.$offset_delete.'" onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">'.html_print_image('images/cross.png', true, ['border' => '0']).'</a>';
|
||||
}
|
||||
} else {
|
||||
$data[1] = '<strong>';
|
||||
|
|
|
@ -597,9 +597,10 @@ if ((bool) $id !== false || $new_component
|
|||
$search_id_group = (int) get_parameter('search_id_group');
|
||||
$search_string = (string) get_parameter('search_string');
|
||||
|
||||
$offset = (int) get_parameter('offset');
|
||||
$url = ui_get_url_refresh(
|
||||
[
|
||||
'offset' => false,
|
||||
'offset' => $offset,
|
||||
'search_string' => $search_string,
|
||||
'search_id_group' => $search_id_group,
|
||||
'id' => $id,
|
||||
|
@ -607,7 +608,7 @@ $url = ui_get_url_refresh(
|
|||
true,
|
||||
false
|
||||
);
|
||||
|
||||
$name_url = 'index.php?sec=templates&sec2=godmode/modules/manage_network_components';
|
||||
$table = new stdClass();
|
||||
$table->width = '100%';
|
||||
$table->class = 'databox filters';
|
||||
|
@ -712,8 +713,9 @@ $total_components = network_components_get_network_components(
|
|||
'COUNT(*) AS total'
|
||||
);
|
||||
$total_components = $total_components[0]['total'];
|
||||
ui_pagination($total_components, $url);
|
||||
$filter['offset'] = (int) get_parameter('offset');
|
||||
$offset_delete = ($offset >= ($total_components - 1)) ? ($offset - $config['block_size']) : $offset;
|
||||
ui_pagination($total_components, $name_url);
|
||||
$filter['offset'] = $offset;
|
||||
$filter['limit'] = (int) $config['block_size'];
|
||||
$components = network_components_get_network_components(
|
||||
false,
|
||||
|
@ -791,7 +793,7 @@ foreach ($components as $component) {
|
|||
true
|
||||
);
|
||||
|
||||
$data[0] = '<a href="index.php?sec='.$sec.'&sec2=godmode/modules/manage_network_components&id='.$component['id_nc'].'&pure='.$pure.'">';
|
||||
$data[0] = '<a href="index.php?sec='.$sec.'&sec2=godmode/modules/manage_network_components&id='.$component['id_nc'].'&pure='.$pure.'&offset='.$offset.'">';
|
||||
$data[0] .= io_safe_output($component['name']);
|
||||
$data[0] .= '</a>';
|
||||
} else {
|
||||
|
@ -855,7 +857,7 @@ foreach ($components as $component) {
|
|||
|
||||
if ($is_management_allowed === true) {
|
||||
$table->cellclass[][6] = 'action_buttons';
|
||||
$data[6] = '<a class="inline_line float-left" href="'.$url.'&search_id_group='.$search_id_group.'search_string='.$search_string.'&duplicate_network_component=1&source_id='.$component['id_nc'].'">'.html_print_image(
|
||||
$data[6] = '<a class="inline_line float-left" href="'.$url.'&search_id_group='.$search_id_group.'search_string='.$search_string.'&duplicate_network_component=1&source_id='.$component['id_nc'].'&offset='.$offset.'">'.html_print_image(
|
||||
'images/copy.png',
|
||||
true,
|
||||
[
|
||||
|
@ -864,7 +866,7 @@ foreach ($components as $component) {
|
|||
'class' => 'invert_filter',
|
||||
]
|
||||
).'</a>';
|
||||
$data[6] .= '<a href="'.$url.'&delete_component=1&id='.$component['id_nc'].'&search_id_group='.$search_id_group.'search_string='.$search_string.'" onclick="if (! confirm (\''.__('Are you sure?').'\')) return false" >'.html_print_image(
|
||||
$data[6] .= '<a href="'.$url.'&delete_component=1&id='.$component['id_nc'].'&search_id_group='.$search_id_group.'search_string='.$search_string.'&offset='.$offset_delete.'" onclick="if (! confirm (\''.__('Are you sure?').'\')) return false" >'.html_print_image(
|
||||
'images/cross.png',
|
||||
true,
|
||||
[
|
||||
|
@ -887,7 +889,7 @@ if (isset($data) === true) {
|
|||
html_print_table($table);
|
||||
ui_pagination(
|
||||
$total_components,
|
||||
$url,
|
||||
$name_url,
|
||||
0,
|
||||
0,
|
||||
false,
|
||||
|
|
|
@ -207,14 +207,14 @@ if (empty($tag_name) === false) {
|
|||
|
||||
// If the user has filtered the view.
|
||||
$filter_performed = !empty($filter);
|
||||
|
||||
$filter['offset'] = (int) get_parameter('offset');
|
||||
$offset = (int) get_parameter('offset');
|
||||
$filter['offset'] = $offset;
|
||||
$filter['limit'] = (int) $config['block_size'];
|
||||
|
||||
// Statements for pagination.
|
||||
$url = ui_get_url_refresh();
|
||||
$url = 'index.php?sec=gusuarios&sec2=godmode/tag/tag';
|
||||
$total_tags = tags_get_tag_count($filter);
|
||||
|
||||
$offset_delete = ($offset >= ($total_tags - 1)) ? ($offset - $config['block_size']) : $offset;
|
||||
$result = tags_search_tag(false, $filter);
|
||||
|
||||
// Filter form.
|
||||
|
@ -392,7 +392,7 @@ if (empty($result) === false) {
|
|||
]
|
||||
);
|
||||
$data[6] .= '</a>';
|
||||
$data[6] .= '<a href="index.php?sec='.$sec.'&sec2=godmode/tag/tag&delete_tag='.$tag['id_tag'].'"onclick="if (! confirm (\''.__('Are you sure?').'\')) return false">'.html_print_image(
|
||||
$data[6] .= '<a href="index.php?sec='.$sec.'&sec2=godmode/tag/tag&delete_tag='.$tag['id_tag'].'&offset='.$offset_delete.'"onclick="if (! confirm (\''.__('Are you sure?').'\')) return false">'.html_print_image(
|
||||
'images/cross.png',
|
||||
true,
|
||||
[
|
||||
|
|
|
@ -816,7 +816,7 @@ foreach ($info as $user_id => $user_info) {
|
|||
$toDoClass = 'filter_none';
|
||||
}
|
||||
|
||||
$data[6] = '<form method="POST" action="index.php?sec='.$sec.'&sec2=godmode/users/user_list&pure='.$pure.'" class="inline">';
|
||||
$data[6] = '<form method="POST" action="index.php?sec='.$sec.'&sec2=godmode/users/user_list&pure='.$pure.'&offset='.$offset.'" class="inline">';
|
||||
$data[6] .= html_print_input_hidden(
|
||||
'id',
|
||||
$user_info['id_user'],
|
||||
|
@ -874,7 +874,8 @@ foreach ($info as $user_id => $user_info) {
|
|||
&& $user_info['id_user'] != $config['id_user']
|
||||
&& isset($user_info['not_delete']) === false
|
||||
) {
|
||||
$data[6] .= '<form method="POST" action="index.php?sec='.$sec.'&sec2=godmode/users/user_list&pure='.$pure.'" class="inline">';
|
||||
$offset_delete = ($offset >= count($info) - 1) ? ($offset - $config['block_size']) : $offset;
|
||||
$data[6] .= '<form method="POST" action="index.php?sec='.$sec.'&sec2=godmode/users/user_list&pure='.$pure.'&offset='.$offset_delete.'" class="inline">';
|
||||
$data[6] .= html_print_input_hidden(
|
||||
'delete_user',
|
||||
$user_info['id_user'],
|
||||
|
|
Loading…
Reference in New Issue