function getPDF($fax_id) { $data = $GLOBALS['hylax_storage']->getFaxData($fax_id); /* Get the pdf. */ require_once HYLAX_BASE . '/lib/Image.php'; $image = new Hylax_Image(); $image->loadData($data); $image->getPDF(); }
function createFax($info, $fix_owner = false) { /* In case this is just a fax creation without yet a number assigned * create an empty number. */ if (!isset($info['fax_number'])) { $info['fax_number'] = ''; } /* Set the folder. */ $info['fax_folder'] = $info['fax_type'] ? 'outbox' : 'inbox'; /* Set timestamp. */ if (empty($info['fax_created'])) { $info['fax_created'] = time(); } $data = $this->getFaxData($info['fax_id']); if (is_a($data, 'PEAR_Error')) { Horde::log('Could not get fax data: ' . $data->getMessage(), 'ERR'); return $data; } /* Create a fax image object. */ require_once HYLAX_BASE . '/lib/Image.php'; $image = new Hylax_Image(); $image->loadData($data); if (empty($info['fax_pages'])) { $info['fax_pages'] = $image->getNumPages(); } /* Save to backend. */ $result = $this->_createFax($info); if (is_a($result, 'PEAR_Error')) { return $result; } global $conf; foreach ($conf['fax']['notify'] as $rec) { mail($rec, _("New fax from: ") . $info['fax_number'], '', 'From: ' . $conf['fax']['notifyfrom']); } return true; }