X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=reporting%2Fincludes%2Fprinter_class.inc;h=ecc0542fc4e8e731b5118d2a141ea9bf53eff646;hb=534d4b6a6b5e771f3b61e0fc65afd856760a6408;hp=1b5a14e31d5757ecb6cb888cdb4bb12f6e747218;hpb=cf67cec296e611c30be010686a5ea96d730418b0;p=fa-stable.git diff --git a/reporting/includes/printer_class.inc b/reporting/includes/printer_class.inc index 1b5a14e3..ecc0542f 100644 --- a/reporting/includes/printer_class.inc +++ b/reporting/includes/printer_class.inc @@ -14,7 +14,7 @@ class remote_printer { // // Setting connection parameters // - function remote_printer($queue, $host='', $port=515, $timeout=20){ + function __construct($queue, $host='', $port=515, $timeout=20){ if ($host == '') $host = $_SERVER['REMOTE_ADDR']; // default is user's host $this->host = $host; @@ -34,9 +34,9 @@ class remote_printer { // if($ret) return $ret; //Open a new connection to send the control file and data. - $stream = fsockopen("tcp://".$this->host, $this->port, $errNo, $errStr, $this->timeout); + $stream = @fsockopen("tcp://".$this->host, $this->port, $errNo, $errStr, $this->timeout); if(!$stream){ - return _('Cannot open connection to printer'); + return _('Cannot open connection to printer').":
$errStr"; } if (!isset($_SESSION['_print_job'])) { $_SESSION['print_job'] = 0; @@ -95,9 +95,9 @@ class remote_printer { // Print all waiting jobs on remote printer queue. // function flush_queue($queue){ - $stream = fsockopen("tcp://".$this->host, $this->port,$errNo, $errStr, $this->timeout); + $stream = @fsockopen("tcp://".$this->host, $this->port,$errNo, $errStr, $this->timeout); if (!$stream){ - return _('Cannot flush printing queue'); + return _('Cannot flush printing queue').":
$errStr"; // .':
' . $errNo." (".$errStr.")"; return 0 (success) even on failure } else { //Print any waiting jobs @@ -111,4 +111,3 @@ class remote_printer { } -?>