Skip to content

Commit

Permalink
improved cover sheet and a couple of other fax-sending tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
sunsetsystems committed Sep 24, 2006
1 parent 77b79bd commit 5c18cde
Show file tree
Hide file tree
Showing 4 changed files with 194 additions and 14 deletions.
11 changes: 8 additions & 3 deletions custom/faxcover.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
FACSIMILE TRANSMISSION
{CURRENT_DATE}
^epsf[c]{faxtitle.eps}
^font{Courier-Bold@12}
{CURRENT_DATE}


From: {SENDER_NAME}
Expand All @@ -9,5 +10,9 @@ From: {SENDER_NAME}

To: {RECIPIENT_NAME}
Fax: {RECIPIENT_FAX}

^font{Helvetica-Bold@12}
{MESSAGE}

Best regards,

{SENDER_NAME}
169 changes: 169 additions & 0 deletions custom/faxtitle.eps

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 16 additions & 10 deletions interface/fax/fax_dispatch.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,13 @@ function mergeTiffs() {
$form_to = trim($_POST['form_to']);
$form_fax = trim($_POST['form_fax']);
$form_message = trim($_POST['form_message']);
$form_finemode = $_POST['form_finemode'] ? ' -m' : '';
$form_finemode = $_POST['form_finemode'] ? '-m' : '-l';

if (get_magic_quotes_gpc()) {
$form_from = stripslashes($form_from);
$form_to = stripslashes($form_to);
$form_message = stripslashes($form_message);
}

// Generate a cover page using enscript. This can be a cool thing
// to do, as enscript is very powerful.
Expand All @@ -150,16 +156,16 @@ function mergeTiffs() {
$cpstring = str_replace('{MESSAGE}' , $form_message , $cpstring);
fwrite($tmph, $cpstring);
fclose($tmph);
$tmp0 = exec($GLOBALS['hylafax_enscript'] . " -o $tmpfn2 $tmpfn1",
$tmp1, $tmp2);
$tmp0 = exec("cd $webserver_root/custom; " . $GLOBALS['hylafax_enscript'] .
" -o $tmpfn2 $tmpfn1", $tmp1, $tmp2);
if ($tmp2) {
$info_msg .= "enscript returned $tmp2: $tmp0 ";
}
unlink($tmpfn1);

// Send the fax as the cover page followed by the selected pages.
$info_msg .= mergeTiffs();
$tmp0 = exec("sendfax -n$form_finemode -d " .
$tmp0 = exec("sendfax -n $form_finemode -d " .
escapeshellarg($form_fax) . " $tmpfn2 '$faxcache/temp.tif'",
$tmp1, $tmp2);
if ($tmp2) {
Expand Down Expand Up @@ -472,17 +478,17 @@ function validate() {
</td>
</tr>
<tr>
<td class='itemtitle' nowrap>Resolution</td>
<td class='itemtitle' nowrap>Message</td>
<td>
<input type='radio' name='form_finemode' value='' checked />Standard &nbsp;
<input type='radio' name='form_finemode' value='1' />Fine &nbsp;
<textarea name='form_message' rows='3' cols='30' style='width:100%'
title='Your comments to include with this message' /></textarea>
</td>
</tr>
<tr>
<td class='itemtitle' nowrap>Message</td>
<td class='itemtitle' nowrap>Quality</td>
<td>
<textarea name='form_message' rows='3' cols='30' style='width:100%'
title='Your comments to include with this message' /></textarea>
<input type='radio' name='form_finemode' value='' />Normal &nbsp;
<input type='radio' name='form_finemode' value='1' checked />Fine &nbsp;
</td>
</tr>
</table>
Expand Down
2 changes: 1 addition & 1 deletion interface/globals.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@
// statements, and also customize custom/faxcover.txt:
// $GLOBALS['hylafax_server'] = 'localhost';
// $GLOBALS['hylafax_basedir'] = '/var/spool/fax';
// $GLOBALS['hylafax_enscript'] = 'enscript -M Letter -f Courier@12 -B --margins=36:36:36:36';
// $GLOBALS['hylafax_enscript'] = 'enscript -M Letter -B -e^ --margins=36:36:36:36';

// Customize these if you are using SQL-Ledger with OpenEMR.
$sl_cash_acc = '1060'; // sql-ledger account number for checking account
Expand Down

0 comments on commit 5c18cde

Please sign in to comment.