From 06849f491f55a8d045f06872770492ef6f743b93 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Tue, 26 Jul 2016 20:49:23 -0600 Subject: [PATCH] Update xml_cdr_inc.php Disable paging for the XML PDF export and modified slightly for the CSV export. --- app/xml_cdr/xml_cdr_inc.php | 43 ++++++++++++++++++++----------------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/app/xml_cdr/xml_cdr_inc.php b/app/xml_cdr/xml_cdr_inc.php index 9063912669..a7084ce23c 100644 --- a/app/xml_cdr/xml_cdr_inc.php +++ b/app/xml_cdr/xml_cdr_inc.php @@ -23,16 +23,20 @@ Contributor(s): Mark J Crane */ -require_once "root.php"; -require_once "resources/require.php"; -require_once "resources/check_auth.php"; -if (permission_exists('xml_cdr_view')) { - //access granted -} -else { - echo "access denied"; - exit; -} + +//includes + require_once "root.php"; + require_once "resources/require.php"; + require_once "resources/check_auth.php"; + +//check permissions + if (permission_exists('xml_cdr_view')) { + //access granted + } + else { + echo "access denied"; + exit; + } //additional includes require_once "resources/paging.php"; @@ -80,9 +84,9 @@ else { case 'equal': $mos_comparison = "<"; break; case 'notequal': $mos_comparison = "<>"; break; } - } else { - $mos_comparison = ''; - } + } else { + $mos_comparison = ''; + } //$mos_comparison = check_str($_REQUEST["mos_comparison"]); $mos_score = check_str($_REQUEST["mos_score"]); } @@ -268,9 +272,13 @@ else { //set a default CDR limit if (!isset($_SESSION['cdr']['limit']['numeric'])) { - $_SESSION['cdr']['limit']['numeric'] = 800; + $_SESSION['cdr']['limit']['numeric'] = 1000; } +//disable the paging + if ($_REQUEST['export_format'] == "csv") { $rows_per_page = 0; } + if ($_REQUEST['export_format'] == "pdf") { $rows_per_page = 0; } + //page results if rows_per_page is greater than zero if ($rows_per_page > 0) { if ($_SESSION['cdr']['count']['boolean'] == "true") { @@ -306,11 +314,6 @@ else { $rows_per_page = 50; } - //disable the paging - if ($_REQUEST['export_format'] == "csv") { - $rows_per_page = 0; - } - //prepare to page the results //$rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50; //set on the page that includes this page $page = $_GET['page']; @@ -363,7 +366,7 @@ else { } $sql .= $sql_where; if (strlen($order_by)> 0) { $sql .= " order by ".$order_by." ".$order." "; } - if ($_REQUEST['export_format'] != "csv") { + if ($_REQUEST['export_format'] != "csv" && $_REQUEST['export_format'] != "pdf") { if ($rows_per_page == 0) { $sql .= " limit ".$_SESSION['cdr']['limit']['numeric']." offset 0 "; }