diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 0dbff09ab9..7751e0f299 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,12 @@ +2013-09-03 Miguel de Dios + + * include/functions_ui.php: into the function "ui_pagination" + added the parameter "print_total_items" to show the total of + item in the list. It is showed althought the pagination does not. + + * operation/agentes/estado_agente.php: changed to don't show the + total in the pagination block in the bottom. + 2013-09-03 Ramon Novoa * extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql, diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index 91ed82cb67..ab110f23b0 100644 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -1472,10 +1472,12 @@ function ui_process_page_body ($string, $bitfield) { * @param int $pagination Current pagination size. If a user requests a larger * pagination than config["block_size"] * @param bool $return Whether to return or print this + * @param string $offset_name The name of parameter for the offset. + * @param bool $print_total_items Show the text with the total items. By default true. * * @return string The pagination div or nothing if no pagination needs to be done */ -function ui_pagination ($count, $url = false, $offset = 0, $pagination = 0, $return = false, $offset_name = 'offset') { +function ui_pagination ($count, $url = false, $offset = 0, $pagination = 0, $return = false, $offset_name = 'offset', $print_total_items = true) { global $config; if (empty ($pagination)) { @@ -1503,6 +1505,20 @@ function ui_pagination ($count, $url = false, $offset = 0, $pagination = 0, $ret */ $block_limit = 15; // Visualize only $block_limit blocks if ($count <= $pagination) { + + if ($print_total_items) { + $output = '"; + + if ($return === false) + echo $output; + + return $output; + } + return false; } // If exists more registers than I can put in a page, calculate index markers @@ -1533,6 +1549,13 @@ function ui_pagination ($count, $url = false, $offset = 0, $pagination = 0, $ret $inicio_pag = 0; $output = '"; @@ -1639,7 +1663,7 @@ function ui_print_session_action_icon ($action, $return = false) { break; } } - + if ($return) return $output; echo $output; diff --git a/pandora_console/operation/agentes/estado_agente.php b/pandora_console/operation/agentes/estado_agente.php index c41b9fd1b6..6c06ac7b71 100644 --- a/pandora_console/operation/agentes/estado_agente.php +++ b/pandora_console/operation/agentes/estado_agente.php @@ -505,7 +505,14 @@ foreach ($agents as $agent) { if (!empty ($table->data)) { html_print_table ($table); - ui_pagination ($total_agents, ui_get_url_refresh (array ('group_id' => $group_id, 'search' => $search, 'sort_field' => $sortField, 'sort' => $sort, 'status' => $status))); + ui_pagination ($total_agents, + ui_get_url_refresh(array( + 'group_id' => $group_id, + 'search' => $search, + 'sort_field' => $sortField, + 'sort' => $sort, + 'status' => $status)), + 0, 0, false, 'offset', false); unset ($table); } else {