From: Ruben Rodriguez Date: Tue, 29 May 2018 19:03:00 +0000 (-0400) Subject: Corrections X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=refs%2Fheads%2Fmaster;p=civicrm-lp.git Corrections --- diff --git a/CRM/Lp/Page/Greeter.php b/CRM/Lp/Page/Greeter.php index e7d5c3c..2d82b52 100644 --- a/CRM/Lp/Page/Greeter.php +++ b/CRM/Lp/Page/Greeter.php @@ -7,6 +7,8 @@ define('DIR_STORE', '/var/www/html/sites/default/files/civicrm/lp/store'); define('DIR_TEMP', '/var/www/html/sites/default/files/civicrm/lp/tmp'); define('BIN_LPSTAT', '/usr/bin/lpstat'); +exec ("/bin/bash /var/www/civicrm_custom/extensions/org.fsf.lp/update.sh"); + class CRM_Lp_Page_Greeter extends CRM_Core_Page { @@ -97,12 +99,12 @@ class CRM_Lp_Page_Greeter extends CRM_Core_Page { function getTable($data) { $output = ''; - $output .= ''; + $output .= '
'; $output .= ''; foreach($data as $item) { $status = $this->checkStatus($item); - $output .= ''; + $output .= ''; $output .= '
FileStatusActions
'.$item.''.$status['status']; if(array_key_exists('printer', $status)) $output .= ' ('.$status['printer'].' #'.$status['jid'].')'; $output .= 'Print'; @@ -122,7 +124,9 @@ class CRM_Lp_Page_Greeter extends CRM_Core_Page { function printFile($file) { $dir = $_SESSION['mode'] == 'history' ? DIR_STORE : DIR_SPOOL; - $lph = popen('lp -d '.$_SESSION['printer'].' '.$dir.'/'.$file, 'r'); + #quidam this fixes issues with unusual fonts + popen("/usr/bin/pdftops $dir/$file $dir/$file.ps", 'r'); + $lph = popen('/usr/bin/lp -d '.$_SESSION['printer'].' '.$dir.'/'.$file.'.ps', 'r'); $data = fgets($lph); $words = str_word_count($data, 1, '0123456789-_'); @@ -133,6 +137,7 @@ class CRM_Lp_Page_Greeter extends CRM_Core_Page { $tfh = fopen(DIR_TEMP.'/'.$file.'.dat', 'w'); fwrite($tfh, $jid."\n"); fclose($tfh); + popen("/bin/rm $dir/$file.ps", 'r'); } /* FIXME: Use civicrm session functions */