Use which command to find the path to the commands.
This fixes the FAX send notification PDF attachment.
This commit is contained in:
parent
a84095ef30
commit
5fd2ca9105
|
|
@ -317,12 +317,14 @@ if (!function_exists('fax_split_dtmf')) {
|
||||||
chdir($dir_fax_temp);
|
chdir($dir_fax_temp);
|
||||||
|
|
||||||
//convert pdf to tif
|
//convert pdf to tif
|
||||||
$cmd = gs_cmd("-q -r".$gs_r." -g".$gs_g." -dBATCH -dPDFFitPage -dNOSAFER -dNOPAUSE -dBATCH -sOutputFile=".correct_path($fax_name).".tif -sDEVICE=tiffg4 -Ilib stocht.ps -c \"{ .75 gt { 1 } { 0 } ifelse} settransfer\" -- ".correct_path($fax_name).".pdf -c quit");
|
$gs = exec('which gs');
|
||||||
|
$cmd = $gs . "-q -r".$gs_r." -g".$gs_g." -dBATCH -dPDFFitPage -dNOSAFER -dNOPAUSE -dBATCH -sOutputFile=".correct_path($fax_name).".tif -sDEVICE=tiffg4 -Ilib stocht.ps -c \"{ .75 gt { 1 } { 0 } ifelse} settransfer\" -- ".correct_path($fax_name).".pdf -c quit";
|
||||||
// echo($cmd . "<br/>\n");
|
// echo($cmd . "<br/>\n");
|
||||||
exec($cmd);
|
exec($cmd);
|
||||||
@unlink($dir_fax_temp.'/'.$fax_name.'.pdf');
|
@unlink($dir_fax_temp.'/'.$fax_name.'.pdf');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$tiffinfo = exec('which tiffinfo');
|
||||||
$cmd = "tiffinfo ".correct_path($dir_fax_temp.'/'.$fax_name).".tif | grep \"Page Number\" | grep -c \"P\"";
|
$cmd = "tiffinfo ".correct_path($dir_fax_temp.'/'.$fax_name).".tif | grep \"Page Number\" | grep -c \"P\"";
|
||||||
// echo($cmd . "<br/>\n");
|
// echo($cmd . "<br/>\n");
|
||||||
$tif_page_count = exec($cmd);
|
$tif_page_count = exec($cmd);
|
||||||
|
|
@ -567,7 +569,8 @@ if (!function_exists('fax_split_dtmf')) {
|
||||||
|
|
||||||
//combine tif files into single multi-page tif
|
//combine tif files into single multi-page tif
|
||||||
if (is_array($tif_files) && sizeof($tif_files) > 0) {
|
if (is_array($tif_files) && sizeof($tif_files) > 0) {
|
||||||
$cmd = "tiffcp -c none ";
|
$tiffcp = exec('which tiffcp');
|
||||||
|
$cmd = $tiffcp. " -c none ";
|
||||||
foreach ($tif_files as $tif_file) {
|
foreach ($tif_files as $tif_file) {
|
||||||
$cmd .= correct_path($tif_file) . ' ';
|
$cmd .= correct_path($tif_file) . ' ';
|
||||||
}
|
}
|
||||||
|
|
@ -580,21 +583,22 @@ if (!function_exists('fax_split_dtmf')) {
|
||||||
}
|
}
|
||||||
|
|
||||||
//generate pdf from tif
|
//generate pdf from tif
|
||||||
$cmd = 'tiff2pdf -u i -p '.$fax_page_size.
|
$tiff2pdf = exec('which tiff2pdf');
|
||||||
|
$cmd = $tiff2pdf . ' -u i -p '.$fax_page_size.
|
||||||
' -w '.$page_width.
|
' -w '.$page_width.
|
||||||
' -l '.$page_height.
|
' -l '.$page_height.
|
||||||
' -f -o '.
|
' -f -o '.
|
||||||
correct_path($dir_fax_temp.'/'.$fax_instance_uuid.'.pdf').' '.
|
correct_path($dir_fax_temp.'/'.$fax_instance_uuid.'.pdf').' '.
|
||||||
correct_path($dir_fax_temp.'/'.$fax_instance_uuid.'.tif');
|
correct_path($dir_fax_temp.'/'.$fax_instance_uuid.'.tif');
|
||||||
|
|
||||||
exec($cmd);
|
exec($cmd);
|
||||||
|
//echo $cmd."<br />\n";
|
||||||
}
|
}
|
||||||
else {
|
elseif (!$included) {
|
||||||
if (!$included) {
|
//nothing to send, redirect the browser
|
||||||
//nothing to send, redirect the browser
|
message::add($text['message-invalid-fax'], 'negative', 4000);
|
||||||
message::add($text['message-invalid-fax'], 'negative', 4000);
|
header("Location: fax_send.php?id=".$fax_uuid);
|
||||||
header("Location: fax_send.php?id=".$fax_uuid);
|
exit;
|
||||||
exit;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//preview, if requested
|
//preview, if requested
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue