Disable limit and offset when exporting CDR to CSV.

This commit is contained in:
markjcrane
2016-05-04 22:35:05 -06:00
parent 097a5d8ade
commit f3ef1154e2
+12 -5
View File
@@ -299,6 +299,11 @@ else {
$rows_per_page = 50; $rows_per_page = 50;
} }
//disable the paging
if ($_REQUEST['export_format'] != "csv") {
$rows_per_page = 0;
}
//prepare to page the results //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 //$rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50; //set on the page that includes this page
$page = $_GET['page']; $page = $_GET['page'];
@@ -348,11 +353,13 @@ else {
} }
$sql .= $sql_where; $sql .= $sql_where;
if (strlen($order_by)> 0) { $sql .= " order by ".$order_by." ".$order." "; } if (strlen($order_by)> 0) { $sql .= " order by ".$order_by." ".$order." "; }
if ($rows_per_page == 0) { if ($_REQUEST['export_format'] != "csv") {
$sql .= " limit ".$_SESSION['cdr']['limit']['numeric']." offset 0 "; if ($rows_per_page == 0) {
} $sql .= " limit ".$_SESSION['cdr']['limit']['numeric']." offset 0 ";
else { }
$sql .= " limit ".$rows_per_page." offset ".$offset." "; else {
$sql .= " limit ".$rows_per_page." offset ".$offset." ";
}
} }
$sql= str_replace(" ", " ", $sql); $sql= str_replace(" ", " ", $sql);
$sql= str_replace("where and", "where", $sql); $sql= str_replace("where and", "where", $sql);