From cd7843b7f32c8593e41a7b0767f0f9e0570b398c Mon Sep 17 00:00:00 2001 From: reliberate Date: Mon, 28 Mar 2016 23:02:11 -0600 Subject: [PATCH] Apps: Integrate ability to set paging via a Default/Domain/User Setting (domain > paging > numeric). --- app/access_controls/access_control_nodes.php | 2 +- app/access_controls/access_controls.php | 2 +- app/call_block/call_block.php | 2 +- app/call_broadcast/call_broadcast.php | 2 +- app/call_center_active/call_center_queue.php | 2 +- app/call_centers/call_center_agents.php | 2 +- app/call_centers/call_center_queues.php | 2 +- app/call_flows/call_flows.php | 2 +- app/calls/calls.php | 2 +- app/conference_centers/conference_centers.php | 2 +- app/conference_centers/conference_rooms.php | 2 +- app/conference_centers/conference_session_details.php | 2 +- app/conference_centers/conference_sessions.php | 2 +- app/conferences/conferences.php | 2 +- app/contacts/contacts.php | 2 +- app/destinations/destinations.php | 2 +- app/devices/device_profiles.php | 2 +- app/devices/device_settings.php | 2 +- app/devices/devices.php | 2 +- app/dialplan/dialplans.php | 2 +- app/emails/emails.php | 4 ++-- app/exec/sql_query_db.php | 2 +- app/extensions/extensions.php | 2 +- app/fax/fax.php | 2 +- app/fax/fax_files.php | 2 +- app/fax/fax_logs.php | 2 +- app/gateways/gateways.php | 2 +- app/ivr_menus/ivr_menu_options.php | 2 +- app/ivr_menus/ivr_menus.php | 2 +- app/phrases/phrases.php | 2 +- app/recordings/recordings.php | 2 +- app/ring_groups/ring_group_forward.php | 2 +- app/ring_groups/ring_groups.php | 2 +- app/services/services.php | 2 +- app/sip_profiles/sip_profile_settings.php | 2 +- app/sip_profiles/sip_profiles.php | 2 +- app/time_conditions/time_conditions.php | 2 +- app/voicemails/voicemails.php | 2 +- app/xml_cdr/xml_cdr.php | 2 +- app/xml_cdr/xml_cdr_export.php | 2 +- app/xml_cdr/xml_cdr_inc.php | 9 ++++++--- core/databases/databases.php | 2 +- core/default_settings/app_defaults.php | 7 +++++++ core/domain_settings/domain_settings.php | 2 +- core/domain_settings/domains.php | 2 +- core/menu/menu.php | 2 +- core/users/user_settings.php | 2 +- core/users/users.php | 2 +- resources/paging.php | 2 +- 49 files changed, 61 insertions(+), 51 deletions(-) diff --git a/app/access_controls/access_control_nodes.php b/app/access_controls/access_control_nodes.php index 81b9f1cf73..e05a89139d 100644 --- a/app/access_controls/access_control_nodes.php +++ b/app/access_controls/access_control_nodes.php @@ -48,7 +48,7 @@ else { } //prepare to page the results - $rows_per_page = 1000; + $rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50; $param = ""; $page = $_GET['page']; if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; } diff --git a/app/access_controls/access_controls.php b/app/access_controls/access_controls.php index 9c11d4cda2..f2a8cc6938 100644 --- a/app/access_controls/access_controls.php +++ b/app/access_controls/access_controls.php @@ -51,7 +51,7 @@ else { } //prepare to page the results - $rows_per_page = 10; + $rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50; $param = ""; $page = $_GET['page']; if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; } diff --git a/app/call_block/call_block.php b/app/call_block/call_block.php index b314f7345b..517b006bd1 100644 --- a/app/call_block/call_block.php +++ b/app/call_block/call_block.php @@ -80,7 +80,7 @@ require_once "resources/require.php"; } //prepare to page the results - $rows_per_page = 100; + $rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50; $param = ""; $page = $_GET['page']; if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; } diff --git a/app/call_broadcast/call_broadcast.php b/app/call_broadcast/call_broadcast.php index ea93f9581b..1dc1b9ea7e 100644 --- a/app/call_broadcast/call_broadcast.php +++ b/app/call_broadcast/call_broadcast.php @@ -62,7 +62,7 @@ else { $num_rows = count($result); unset ($prep_statement, $result, $sql); - $rows_per_page = 10; + $rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50; $param = ""; $page = $_GET['page']; if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; } diff --git a/app/call_center_active/call_center_queue.php b/app/call_center_active/call_center_queue.php index b5d596e50a..48a2249f58 100644 --- a/app/call_center_active/call_center_queue.php +++ b/app/call_center_active/call_center_queue.php @@ -69,7 +69,7 @@ else { $result = $prep_statement->fetchAll(PDO::FETCH_NAMED); $num_rows = count($result); unset ($prep_statement, $result, $sql); - $rows_per_page = 100; + $rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50; $param = ""; $page = $_GET['page']; if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; } diff --git a/app/call_centers/call_center_agents.php b/app/call_centers/call_center_agents.php index a5d8a29729..3cda98e46a 100644 --- a/app/call_centers/call_center_agents.php +++ b/app/call_centers/call_center_agents.php @@ -77,7 +77,7 @@ else { $result = $prep_statement->fetchAll(PDO::FETCH_NAMED); $num_rows = count($result); unset ($prep_statement, $result, $sql); - $rows_per_page = 100; + $rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50; $param = ""; $page = $_GET['page']; if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; } diff --git a/app/call_centers/call_center_queues.php b/app/call_centers/call_center_queues.php index 1581050b78..954663c257 100644 --- a/app/call_centers/call_center_queues.php +++ b/app/call_centers/call_center_queues.php @@ -86,7 +86,7 @@ else { $num_rows = count($result); unset ($prep_statement, $result, $sql); - $rows_per_page = 100; + $rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50; $param = ""; $page = $_GET['page']; if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; } diff --git a/app/call_flows/call_flows.php b/app/call_flows/call_flows.php index e1de399800..7b390b323e 100644 --- a/app/call_flows/call_flows.php +++ b/app/call_flows/call_flows.php @@ -77,7 +77,7 @@ require_once "resources/paging.php"; } //prepare to page the results - $rows_per_page = 10; + $rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50; $param = ""; $page = $_GET['page']; if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; } diff --git a/app/calls/calls.php b/app/calls/calls.php index 236fcff45d..a191654d94 100644 --- a/app/calls/calls.php +++ b/app/calls/calls.php @@ -91,7 +91,7 @@ else { } } else { - $rows_per_page = 150; + $rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50; } $param = "&search=".$search; $page = $_GET['page']; diff --git a/app/conference_centers/conference_centers.php b/app/conference_centers/conference_centers.php index 742819ac03..f431ee034c 100644 --- a/app/conference_centers/conference_centers.php +++ b/app/conference_centers/conference_centers.php @@ -95,7 +95,7 @@ else { } //prepare to page the results - $rows_per_page = 10; + $rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50; $param = ""; $page = $_GET['page']; if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; } diff --git a/app/conference_centers/conference_rooms.php b/app/conference_centers/conference_rooms.php index bff28dbb52..9e41328409 100644 --- a/app/conference_centers/conference_rooms.php +++ b/app/conference_centers/conference_rooms.php @@ -175,7 +175,7 @@ else { $row_count = $conference_center->room_count(); //prepare to page the results - $rows_per_page = 150; + $rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50; $param = ""; $page = check_str($_GET['page']); if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; } diff --git a/app/conference_centers/conference_session_details.php b/app/conference_centers/conference_session_details.php index 1ed402ab62..2935c20a91 100644 --- a/app/conference_centers/conference_session_details.php +++ b/app/conference_centers/conference_session_details.php @@ -127,7 +127,7 @@ else { } //prepare to page the results - $rows_per_page = 500; + $rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50; $param = ""; $page = $_GET['page']; if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; } diff --git a/app/conference_centers/conference_sessions.php b/app/conference_centers/conference_sessions.php index 4c669ac46a..e73f980b74 100644 --- a/app/conference_centers/conference_sessions.php +++ b/app/conference_centers/conference_sessions.php @@ -81,7 +81,7 @@ else { } //prepare to page the results - $rows_per_page = 150; + $rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50; $param = ""; $page = $_GET['page']; if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; } diff --git a/app/conferences/conferences.php b/app/conferences/conferences.php index 9595fec805..cf3ebd4a9e 100644 --- a/app/conferences/conferences.php +++ b/app/conferences/conferences.php @@ -88,7 +88,7 @@ else { } //prepare to page the results - $rows_per_page = 10; + $rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50; $param = ""; $page = $_GET['page']; if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; } diff --git a/app/contacts/contacts.php b/app/contacts/contacts.php index f48d8f2ae3..1c5ba73684 100644 --- a/app/contacts/contacts.php +++ b/app/contacts/contacts.php @@ -166,7 +166,7 @@ else { } //prepare to page the results - $rows_per_page = 100; + $rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50; $param = ""; $page = $_GET['page']; if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; } diff --git a/app/destinations/destinations.php b/app/destinations/destinations.php index f48e785139..ed537cce92 100644 --- a/app/destinations/destinations.php +++ b/app/destinations/destinations.php @@ -80,7 +80,7 @@ else { } //prepare to page the results - $rows_per_page = 150; + $rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50; $param = "&search=".$search; if ($_GET['showall'] && permission_exists('destination_all')) { $param .= "&showall=true"; diff --git a/app/devices/device_profiles.php b/app/devices/device_profiles.php index fd4e2c8262..6159bf520a 100644 --- a/app/devices/device_profiles.php +++ b/app/devices/device_profiles.php @@ -85,7 +85,7 @@ else { } //prepare to page the results - $rows_per_page = 50; + $rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50; $param = ""; $page = $_GET['page']; if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; } diff --git a/app/devices/device_settings.php b/app/devices/device_settings.php index 3ddb4c2d83..3848734134 100644 --- a/app/devices/device_settings.php +++ b/app/devices/device_settings.php @@ -77,7 +77,7 @@ require_once "resources/paging.php"; } //prepare to page the results - $rows_per_page = 100; + $rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50; $param = ""; $page = $_GET['page']; if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; } diff --git a/app/devices/devices.php b/app/devices/devices.php index dddb75c1c2..1aab17908b 100644 --- a/app/devices/devices.php +++ b/app/devices/devices.php @@ -98,7 +98,7 @@ else { } //prepare to page the results - $rows_per_page = 150; + $rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50; if ($_GET['showall'] && permission_exists('device_all')) { $param = "&showall=true"; } else { diff --git a/app/dialplan/dialplans.php b/app/dialplan/dialplans.php index 531a38a1a5..56c6536073 100644 --- a/app/dialplan/dialplans.php +++ b/app/dialplan/dialplans.php @@ -186,7 +186,7 @@ else { } unset($prep_statement, $result); - $rows_per_page = 150; + $rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50; $param = ""; if (strlen($app_uuid) > 0) { $param = "&app_uuid=".$app_uuid; } $page = $_GET['page']; diff --git a/app/emails/emails.php b/app/emails/emails.php index f8c4ba29fe..01167495f5 100644 --- a/app/emails/emails.php +++ b/app/emails/emails.php @@ -58,7 +58,7 @@ else { if ($_REQUEST['a'] == 'resend' && permission_exists('email_resend')) { $email_uuid = check_str($_REQUEST["id"]); $resend = true; - + $msg_found = false; if ($email_uuid != '') { @@ -147,7 +147,7 @@ else { } //prepare to page the results - $rows_per_page = 50; + $rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50; if (permission_exists('emails_all') && $_REQUEST['showall'] == 'true') { $param .= "&showall=true"; } else { diff --git a/app/exec/sql_query_db.php b/app/exec/sql_query_db.php index cd7cf8bbbd..9f8bdc62cf 100644 --- a/app/exec/sql_query_db.php +++ b/app/exec/sql_query_db.php @@ -77,7 +77,7 @@ require_once "resources/paging.php"; } //prepare to page the results - $rows_per_page = 100; + $rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50; $param = ""; $page = $_GET['page']; if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; } diff --git a/app/extensions/extensions.php b/app/extensions/extensions.php index a3b3e9130d..a5daca0d81 100644 --- a/app/extensions/extensions.php +++ b/app/extensions/extensions.php @@ -86,7 +86,7 @@ require_once "resources/paging.php"; unset($prep_statement, $result); //prepare to page the results - $rows_per_page = 150; + $rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50; $param = "&search=".$search; if (!isset($_GET['page'])) { $_GET['page'] = 0; } $_GET['page'] = check_str($_GET['page']); diff --git a/app/fax/fax.php b/app/fax/fax.php index 5fb50ed436..8a937ef6cc 100644 --- a/app/fax/fax.php +++ b/app/fax/fax.php @@ -72,7 +72,7 @@ else { } unset($prep_statement, $result); - $rows_per_page = 150; + $rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50; $param = ""; $page = check_str($_GET['page']); if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; } diff --git a/app/fax/fax_files.php b/app/fax/fax_files.php index cd9a80b589..88fc0f81d8 100644 --- a/app/fax/fax_files.php +++ b/app/fax/fax_files.php @@ -193,7 +193,7 @@ else { } //prepare to page the results - $rows_per_page = 50; + $rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50; $param = "&id=".$_GET['id']."&box=".$_GET['box']."&order_by=".$_GET['order_by']."&order=".$_GET['order']; $page = $_GET['page']; if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; } diff --git a/app/fax/fax_logs.php b/app/fax/fax_logs.php index ee0e270112..989a44d614 100755 --- a/app/fax/fax_logs.php +++ b/app/fax/fax_logs.php @@ -61,7 +61,7 @@ else { } //prepare to page the results - $rows_per_page = 50; + $rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50; $param = "&id=".$fax_uuid."&order_by=".$order_by."&order=".$order; $page = $_GET['page']; if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; } diff --git a/app/gateways/gateways.php b/app/gateways/gateways.php index f517fd5354..a84dc4ed7e 100644 --- a/app/gateways/gateways.php +++ b/app/gateways/gateways.php @@ -139,7 +139,7 @@ else { $gateways = $prep_statement->fetchAll(PDO::FETCH_NAMED); unset ($prep_statement, $sql); - $rows_per_page = 150; + $rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50; $param = ""; $page = check_str($_GET['page']); if (strlen($page) == 0) { $page = 0; } diff --git a/app/ivr_menus/ivr_menu_options.php b/app/ivr_menus/ivr_menu_options.php index 962cd56593..8fdc3a1de9 100644 --- a/app/ivr_menus/ivr_menu_options.php +++ b/app/ivr_menus/ivr_menu_options.php @@ -73,7 +73,7 @@ else { unset($prep_statement, $result); //prepare to page the results - $rows_per_page = 150; + $rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50; $param = $_SERVER["QUERY_STRING"]; if (!isset($_GET['page'])) { $_GET['page'] = 0; } $_GET['page'] = check_str($_GET['page']); diff --git a/app/ivr_menus/ivr_menus.php b/app/ivr_menus/ivr_menus.php index c945ec683a..609ba1bab8 100644 --- a/app/ivr_menus/ivr_menus.php +++ b/app/ivr_menus/ivr_menus.php @@ -75,7 +75,7 @@ else { $total_ivr_menus = $num_rows; //prepare to page the results - $rows_per_page = 150; + $rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50; $param = ""; if (!isset($_GET['page'])) { $_GET['page'] = 0; } $_GET['page'] = check_str($_GET['page']); diff --git a/app/phrases/phrases.php b/app/phrases/phrases.php index 3f9f98048b..13da732c5a 100644 --- a/app/phrases/phrases.php +++ b/app/phrases/phrases.php @@ -69,7 +69,7 @@ require_once "resources/check_auth.php"; $num_rows = count($result); unset ($prep_statement, $result, $sql); - $rows_per_page = 50; + $rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50; $param = ""; $page = $_GET['page']; if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; } diff --git a/app/recordings/recordings.php b/app/recordings/recordings.php index bf4fe35917..e282a53c66 100644 --- a/app/recordings/recordings.php +++ b/app/recordings/recordings.php @@ -264,7 +264,7 @@ require_once "resources/check_auth.php"; $num_rows = count($result); unset ($prep_statement, $result, $sql); - $rows_per_page = 100; + $rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50; $param = "&order_by=".$order_by."&order=".$order; $page = $_GET['page']; if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; } diff --git a/app/ring_groups/ring_group_forward.php b/app/ring_groups/ring_group_forward.php index d68f397432..b4763157d0 100644 --- a/app/ring_groups/ring_group_forward.php +++ b/app/ring_groups/ring_group_forward.php @@ -96,7 +96,7 @@ require_once "resources/paging.php"; } } else { - $rows_per_page = 150; + $rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50; } $param = ""; $page = $_GET['page']; diff --git a/app/ring_groups/ring_groups.php b/app/ring_groups/ring_groups.php index a6f77cd75a..425685dca0 100644 --- a/app/ring_groups/ring_groups.php +++ b/app/ring_groups/ring_groups.php @@ -83,7 +83,7 @@ require_once "resources/paging.php"; } //prepare to page the results - $rows_per_page = 150; + $rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50; $param = ""; $page = $_GET['page']; if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; } diff --git a/app/services/services.php b/app/services/services.php index dc970bf43e..0ee0262f97 100644 --- a/app/services/services.php +++ b/app/services/services.php @@ -133,7 +133,7 @@ if (strlen($_GET["a"]) > 0) { $result = $prep_statement->fetchAll(PDO::FETCH_NAMED); $num_rows = count($result); unset ($prep_statement, $result, $sql); - $rows_per_page = 10; + $rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50; $param = ""; $page = $_GET['page']; if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; } diff --git a/app/sip_profiles/sip_profile_settings.php b/app/sip_profiles/sip_profile_settings.php index a77eeb1477..8f08d400fd 100644 --- a/app/sip_profiles/sip_profile_settings.php +++ b/app/sip_profiles/sip_profile_settings.php @@ -64,7 +64,7 @@ require_once "resources/paging.php"; } //prepare to page the results - $rows_per_page = 200; + $rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50; $param = ""; $page = $_GET['page']; if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; } diff --git a/app/sip_profiles/sip_profiles.php b/app/sip_profiles/sip_profiles.php index 193cb52f62..79e6c38c66 100644 --- a/app/sip_profiles/sip_profiles.php +++ b/app/sip_profiles/sip_profiles.php @@ -80,7 +80,7 @@ require_once "resources/paging.php"; } //prepare to page the results - $rows_per_page = 10; + $rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50; $param = ""; $page = $_GET['page']; if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; } diff --git a/app/time_conditions/time_conditions.php b/app/time_conditions/time_conditions.php index ad1c4d423a..38be51e712 100644 --- a/app/time_conditions/time_conditions.php +++ b/app/time_conditions/time_conditions.php @@ -124,7 +124,7 @@ else { } unset($prep_statement, $result); - $rows_per_page = 150; + $rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50; $param = ""; if (strlen($app_uuid) > 0) { $param = "&app_uuid=".$app_uuid; } $page = $_GET['page']; diff --git a/app/voicemails/voicemails.php b/app/voicemails/voicemails.php index a5b425a6f8..5fdc12a912 100644 --- a/app/voicemails/voicemails.php +++ b/app/voicemails/voicemails.php @@ -105,7 +105,7 @@ else { } //prepare to page the results - $rows_per_page = 150; + $rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50; $param = ""; if ($search != '') { $param .= "&search=".$search; } $page = $_GET['page']; diff --git a/app/xml_cdr/xml_cdr.php b/app/xml_cdr/xml_cdr.php index 8daf9fcb64..8c48c7c77f 100644 --- a/app/xml_cdr/xml_cdr.php +++ b/app/xml_cdr/xml_cdr.php @@ -44,7 +44,7 @@ else { require_once "resources/paging.php"; //xml cdr include - $rows_per_page = 100; + $rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50; require_once "xml_cdr_inc.php"; //javascript function: send_cmd diff --git a/app/xml_cdr/xml_cdr_export.php b/app/xml_cdr/xml_cdr_export.php index 9b403d8655..48a5909ff8 100644 --- a/app/xml_cdr/xml_cdr_export.php +++ b/app/xml_cdr/xml_cdr_export.php @@ -39,7 +39,7 @@ else { $text = $language->get(); //additional includes - $rows_per_page = 0; + $rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50; require_once "xml_cdr_inc.php"; //get the format diff --git a/app/xml_cdr/xml_cdr_inc.php b/app/xml_cdr/xml_cdr_inc.php index 9e08e837b6..24507e7349 100644 --- a/app/xml_cdr/xml_cdr_inc.php +++ b/app/xml_cdr/xml_cdr_inc.php @@ -292,12 +292,15 @@ else { if ($num_rows > $_SESSION['cdr']['limit']['numeric']) { $num_rows = $_SESSION['cdr']['limit']['numeric']; } - if ($rows_per_page > $_SESSION['cdr']['limit']['numeric']) { - $rows_per_page = $_SESSION['cdr']['limit']['numeric']; + if ($_SESSION['domain']['paging']['numeric'] != '' && $rows_per_page > $_SESSION['domain']['paging']['numeric']) { + $rows_per_page = $_SESSION['domain']['paging']['numeric']; + } + else { + $rows_per_page = 50; } //prepare to page the results - //$rows_per_page = 150; //set on the page that includes this page + //$rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50; //set on the page that includes this page $page = $_GET['page']; if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; } list($paging_controls_mini, $rows_per_page, $var_3) = paging($num_rows, $param, $rows_per_page, true); //top diff --git a/core/databases/databases.php b/core/databases/databases.php index 7b20efef17..71ee35c79f 100644 --- a/core/databases/databases.php +++ b/core/databases/databases.php @@ -76,7 +76,7 @@ else { } //prepare to page the results - $rows_per_page = 150; + $rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50; $param = ""; $page = $_GET['page']; if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; } diff --git a/core/default_settings/app_defaults.php b/core/default_settings/app_defaults.php index 73dffd1b4e..55b6f84ed4 100644 --- a/core/default_settings/app_defaults.php +++ b/core/default_settings/app_defaults.php @@ -50,6 +50,13 @@ if ($domains_processed == 1) { $array[$x]['default_setting_enabled'] = 'true'; $array[$x]['default_setting_description'] = 'outbound,loopback,lcr'; $x++; + $array[$x]['default_setting_category'] = 'domain'; + $array[$x]['default_setting_subcategory'] = 'paging'; + $array[$x]['default_setting_name'] = 'numeric'; + $array[$x]['default_setting_value'] = '100'; + $array[$x]['default_setting_enabled'] = 'false'; + $array[$x]['default_setting_description'] = 'Set the maximum number of records displayed per page.'; + $x++; $array[$x]['default_setting_category'] = 'security'; $array[$x]['default_setting_subcategory'] = 'password_length'; $array[$x]['default_setting_name'] = 'var'; diff --git a/core/domain_settings/domain_settings.php b/core/domain_settings/domain_settings.php index 3619689fa5..1a3cb87425 100644 --- a/core/domain_settings/domain_settings.php +++ b/core/domain_settings/domain_settings.php @@ -115,7 +115,7 @@ if (sizeof($_REQUEST) > 1) { } //prepare to page the results - $rows_per_page = 200; + $rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 200; $param = ""; $page = $_GET['page']; if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; } diff --git a/core/domain_settings/domains.php b/core/domain_settings/domains.php index 792cf4faa9..8af8a22185 100644 --- a/core/domain_settings/domains.php +++ b/core/domain_settings/domains.php @@ -132,7 +132,7 @@ require_once "resources/check_auth.php"; } //prepare to page the results - $rows_per_page = 100; + $rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50; $param = ""; $page = $_GET['page']; if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; } diff --git a/core/menu/menu.php b/core/menu/menu.php index fa3ccceaec..9d647732b8 100644 --- a/core/menu/menu.php +++ b/core/menu/menu.php @@ -75,7 +75,7 @@ else { } //prepare to page the results - $rows_per_page = 150; + $rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50; $param = ""; $page = $_GET['page']; if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; } diff --git a/core/users/user_settings.php b/core/users/user_settings.php index c29e22e09f..b7f1e46f5f 100644 --- a/core/users/user_settings.php +++ b/core/users/user_settings.php @@ -82,7 +82,7 @@ else { } //prepare to page the results - $rows_per_page = 200; + $rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 100; $param = ""; $page = $_GET['page']; if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; } diff --git a/core/users/users.php b/core/users/users.php index e3fe2d73c8..304508b86d 100644 --- a/core/users/users.php +++ b/core/users/users.php @@ -103,7 +103,7 @@ else { } } unset ($prep_statement, $result, $sql); - $rows_per_page = 200; + $rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50; $param = "search=".$search_value; if (permission_exists('user_all') && $_GET['showall'] == 'true') { $param .= "&showall=true"; diff --git a/resources/paging.php b/resources/paging.php index 8a747460c5..0c313c5189 100644 --- a/resources/paging.php +++ b/resources/paging.php @@ -27,7 +27,7 @@ function paging($num_rows, $param, $rows_per_page, $mini = false) { if (strlen($rows_per_page)==0) { - $rows_per_page = "5"; //default number of rows per page + $rows_per_page = 50; //default number of rows per page }