Пример #1
0
 public function finalizeInstall()
 {
     FaxDisposition::register('donothing', 'fax', 'Leave in spool directory');
     FaxDisposition::register('movetodir', 'fax', 'Move to specified directory');
     FaxDisposition::register('emailtoadd', 'fax', 'Email to a specified email');
     FaxDisposition::register('emailtouser', 'fax', 'Email to user');
     $tmpdisp = FaxDisposition::getDispositionByName('donothing');
     $infax = new FaxProfile();
     $infax->fxp_name = 'Default';
     $infax->fxp_default = true;
     $infax->fxp_fxd_id = $tmpdisp->fxd_id;
     $infax->fxp_t38_mode = 2;
     $infax->save();
 }
Пример #2
0
 public static function register($name, $package, $displayname, $desc = null, $mode = 'SAFE')
 {
     // see if the package is already registered
     $dispobj = null;
     try {
         $dispobj =& self::getDispositionByName($name);
     } catch (Exception $e) {
         if (!$e->getCode() == 0) {
             throw $e;
         }
     }
     if ($dispobj && $mode == 'SAFE') {
         throw new faxException('This fax disposition is already registered and registration was attempted in safe mode.', 0);
     }
     // find the package attempting registration
     try {
         if (!($packageobj = Package_Catalog::getInstalledPackage($package))) {
             throw new faxException('The package "' . $package . '" that attempted to register fax disposition "' . $name . '" was not found.', -1);
         }
     } catch (Package_Catalog_Exception $e) {
         throw new faxException('The package "' . $package . '" that attempted to register fax disposition "' . $name . '" was not found.', -1);
     }
     $package = $packageobj['datastore_id'];
     // if we are reregging (e.g. to handle a package upgrade) then make sure that package matches what is on file
     if ($mode == 'REREG' && $dispobj && $dispobj->fxd_package_id !== $package) {
         // Make sure the package that is on file still exists, otherwise allow the rereg
         $fxd_package_obj = Doctrine::getTable('package')->findOne($dispobj->fxd_package_id);
         if ($fxd_package_obj && $fxd_package_obj->name !== $packageobj->name) {
             throw new faxException('Rereg was attempted on the fax disposition named "' . $dispobj->fxd_name . '" but the package that tried to reregister named "' . $packageobj->name . '" does not match the currently registerd fax disposition named "' . $fxd_package_obj->name . '".', -2);
         }
     }
     if (!$dispobj) {
         $dispobj = new FaxDisposition();
     }
     $dispobj->fxd_name = $name;
     $dispobj->fxd_display_name = $displayname;
     $dispobj->fxd_package_id = $package;
     $dispobj->fxd_desc = $desc;
     $dispobj->save();
 }
Пример #3
0
        <div class="field">
        <?php 
echo form::label(array('for' => 'faxprofile[fxp_desc]', 'hint' => 'Description of fax profile', 'help' => 'Detailed description of what this fax profile is used for.'), 'Description:');
echo form::textarea(array('name' => 'faxprofile[fxp_desc]', 'rows' => 4, 'cols' => 50));
?>
        </div>
        <div class="field">
        <?php 
echo form::label(array('for' => 'faxprofile[fxp_default]', 'hint' => 'Use this profile as the fax defaults', 'help' => 'If checked, the settings from this profile will be used as the default settings. One profile must, and only one profile can have this checked; checking and saving will disable other profiles.'), 'Default Settings:');
echo form::checkbox('faxprofile[fxp_default]');
?>
        </div>
        <div class="field">
        <?php 
echo form::label(array('for' => 'faxprofile[fxp_fxd_id]', 'hint' => 'How to handle inboung faxes', 'help' => 'What do you want to do with an inbound fax once it is received?'), 'Disposition:');
echo form::dropdown('faxprofile[fxp_fxd_id]', FaxDisposition::dictionary(), null, 'onChange="getDispositionForm();"');
?>
<div id="dispformstatus"></div>
        </div>
        <div class="subform" id="dispform" name="dispform">
        </div>
		<div class="field">
        <?php 
echo form::label(array('for' => 'faxprofile[fxp_ident]', 'hint' => 'Normally, your fax number.', 'help' => 'Often the fax number, a numeric only string displayed on the remote fax machine while the fax is being received.'), 'Ident:');
echo form::input('faxprofile[fxp_ident]');
?>
        </div>
		<div class="field">
        <?php 
echo form::label(array('for' => 'faxprofile[fxp_header]', 'hint' => 'Your name, company name, or fax number.', 'help' => 'A string printed at the top of every page on the received fax, it can contain both letters and numbers.  Most often it is set to your name, your company\'s name, or your fax number.'), 'Header:');
echo form::input('faxprofile[fxp_header]');