Copyright 2003-2016 Horde LLC (http://www.horde.org/) See the enclosed file COPYING for license information (GPL). If you did not receive this file, see http://www.horde.org/licenses/gpl.
Author: Marko Djukic (marko@oblo.com)
Esempio n. 1
0
 public function __construct($params)
 {
     parent::__construct($params);
     $this->_states = Hylax::getStates();
     $this->_stat_cols = Hylax::getStatCols();
     $this->_cmd = array('sendfax' => '/usr/bin/sendfax');
 }
Esempio n. 2
0
<?php

/**
 * The Hylax script to show a fax view.
 *
 * See the enclosed file COPYING for license information (GPL). If you
 * did not receive this file, see http://www.horde.org/licenses/gpl.
 */
require_once __DIR__ . '/lib/Application.php';
$hylax = Horde_Registry::appInit('hylax');
$fax_id = Horde_Util::getFormData('fax_id');
$url = Horde_Util::getFormData('url', 'folder.php');
$print = Hylax::printFax($fax_id);
if (is_a($print, 'PEAR_Error')) {
    $notification->push(sprintf(_("Could not print fax ID \"%s\". %s"), $fax_id, $print->getMessage()), 'horde.error');
} else {
    $notification->push(sprintf(_("Printed fax ID \"%s\"."), $fax_id), 'horde.success');
}
/* Redirect back. */
Horde::url($url, true)->redirect();
Esempio n. 3
0
$tpl = Horde_Util::getFormData('template', 'default');
if (empty($_covers[$tpl])) {
    throw new Horde_Exception(_("The requested Cover Page does not exist."));
}
/* Load Form Actions */
$action = Horde_Form_Action::factory('submit');
/* Create Form */
$vars = Horde_Variables::getDefaultVariables();
$form = new Horde_Form($vars, _("Compose a new Fax"), 'compose');
$form->setButtons(_("Send"));
$form->appendButtons(_("Preview"));
/* Cover Page section */
$form->addVariable(_("Cover Page"), 'fromhdr', 'header', false);
$form->addVariable(_("Template"), 'template', 'enum', true, false, null, array($covers));
$form->addVariable(_("Fax Number"), 'faxnum', 'text', true);
$form->addVariable(_("Name"), 'name', 'text', false);
$form->addVariable(_("Company"), 'company', 'text', false);
$form->addVariable(_("Subject"), 'subject', 'text', false, false, null, array(false, 60));
$form->addVariable(_("Comment"), 'comment', 'longtext', false, false, null, array(4, 80));
/* Set up template. */
$template = $injector->createInstance('Horde_Template');
$template->set('form', '');
$template->set('menu', Hylax::getMenu('string'));
Horde::startBuffer();
$notification->notify(array('listeners' => 'status'));
$template->set('notify', Horde::endBuffer());
$page_output->header();
echo $template->fetch(HYLAX_TEMPLATES . '/compose/compose.html');
$renderer = new Horde_Form_Renderer();
$form->renderActive($renderer, $vars, Horde::selfURL(), 'post');
$page_output->footer();
Esempio n. 4
0
$form->setButtons(_("Send"), true);
$form->addHidden('', 'url', 'text', false);
$form->addHidden('', 'fax_id', 'int', false);
$form->addVariable(_("Fax destination"), 'fax_number', 'text', true, false, null, array('/^\\d+$/'));
if ($form->validate($vars)) {
    $form->getInfo($vars, $info);
    $send = $hylax->storage->send($info['fax_id'], $info['fax_number']);
    if (is_a($send, 'PEAR_Error')) {
        $notification->push(sprintf(_("Could not send fax ID \"%s\". %s"), $info['fax_id'], $send->getMessage()), 'horde.error');
    } else {
        $notification->push(sprintf(_("Fax ID \"%s\" submitted successfully."), $info['fax_id']), 'horde.success');
    }
    Horde::url($url, true)->redirect();
}
/* Get the preview pages. */
$pages = Hylax::getPages($fax_id, $fax['fax_pages']);
/* Render the form. */
require_once 'Horde/Form/Renderer.php';
$renderer = new Horde_Form_Renderer();
Horde::startBuffer();
$form->renderActive($renderer, $vars, Horde::url('send.php'), 'post');
$send_form = Horde::endBuffer();
/* Set up template. */
$template = $injector->createInstance('Horde_Template');
$template->set('form', $send_form);
$template->set('pages', $pages);
$template->set('menu', $menu->getMenu());
Horde::startBuffer();
$notification->notify(array('listeners' => 'status'));
$template->set('notify', Horde::endBuffer());
$page_output->header(array('title' => $title));
Esempio n. 5
0
 function getFaxData($fax_id)
 {
     $path = Hylax::getVFSPath($fax_id);
     $file = $fax_id . '.ps';
     try {
         return $this->_vfs->read($path, $file);
     } catch (Horde_Vfs_Exception $e) {
         Horde::log(sprintf("%s '%s/%s'.", $e->getMessage(), $path, $file), 'ERR');
         throw $e;
     }
 }
Esempio n. 6
0
 public function __construct($params)
 {
     parent::__construct($params);
     $this->_states = Hylax::getStates();
     $this->_stat_cols = Hylax::getStatCols();
 }