fixed pagination (started by 1 instead 0, select2 requirement)

This commit is contained in:
fbsanchez 2020-09-11 14:53:29 +02:00
parent 3374a89ae0
commit 426286b8b5
2 changed files with 3 additions and 3 deletions
pandora_console/include

View File

@ -558,7 +558,7 @@ function html_print_select_groups(
method: 'getGroupsForSelect',
exclusions: '<?php echo $json_exclusions; ?>',
inclusions: '<?php echo $json_inclusions; ?>',
step: params.page || 0,
step: params.page || 1,
strict: "<?php echo $strict_user; ?>",
}

View File

@ -270,7 +270,7 @@ class Group extends Entity
$id_group = get_parameter('id_group', false);
$keys_field = get_parameter('keys_field', 'id_grupo');
$search = get_parameter('search', '');
$step = get_parameter('step', 0);
$step = get_parameter('step', 1);
$limit = get_parameter('limit', false);
$exclusions = get_parameter('exclusions', '[]');
$inclusions = get_parameter('inclusions', '[]');
@ -312,7 +312,7 @@ class Group extends Entity
// Use global block size configuration.
global $config;
$limit = $config['block_size'];
$offset = ($step * $limit);
$offset = (($step - 1) * $limit);
// Pagination over effective groups retrieved.
// Calculation is faster than transference.