From fb06a0a45f0766a0ad432121b5954a240b4fb3d1 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Wed, 20 Apr 2022 20:44:01 -0600 Subject: [PATCH] Update fax_files.php Minor changes to the select statement. --- app/fax/fax_files.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/app/fax/fax_files.php b/app/fax/fax_files.php index fee8a386c7..fc675e3a0a 100644 --- a/app/fax/fax_files.php +++ b/app/fax/fax_files.php @@ -201,6 +201,7 @@ $parameters['domain_uuid'] = $domain_uuid; $database = new database; $num_rows = $database->select($sql, $parameters, 'column'); + unset($sql, $parameters); //prepare to page the results $rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50; @@ -211,7 +212,17 @@ $offset = $rows_per_page * $page; //get the list - $sql = str_replace('count(fax_file_uuid)', '*', $sql); + $sql = "select * from v_fax_files "; + $sql .= "where fax_uuid = :fax_uuid "; + $sql .= "and domain_uuid = :domain_uuid "; + if ($_REQUEST['box'] == 'inbox') { + $sql .= "and fax_mode = 'rx' "; + } + if ($_REQUEST['box'] == 'sent') { + $sql .= "and fax_mode = 'tx' "; + } + $parameters['fax_uuid'] = $fax_uuid; + $parameters['domain_uuid'] = $domain_uuid; $sql .= order_by($order_by, $order, 'fax_date', 'desc'); $sql .= limit_offset($rows_per_page, $offset); $database = new database; @@ -351,6 +362,7 @@ //generate pdf from tif $cmd_tif2pdf = "tiff2pdf -u i -p ".$page_size." -w ".$page_width." -l ".$page_height." -f -o ".$dir_fax.'/'.$file_name.".pdf ".$dir_fax.'/'.$file_name.".tif"; exec($cmd_tif2pdf); + //echo $cmd_tif2pdf."
\n"; //clean up temporary files, if any if (file_exists($dir_fax_temp.'/'.$file_name.'.pdf')) { @unlink($dir_fax_temp.'/'.$file_name.'.pdf'); } if (file_exists($dir_fax_temp.'/'.$file_name.'.tif')) { @unlink($dir_fax_temp.'/'.$file_name.'.tif'); }