Changeset 8680 for modules/branches
- Timestamp:
- 01/25/10 11:20:59 (3 years ago)
- Files:
-
- modules/branches/2.7/fax/functions.inc.php (modified) (3 diffs)
- modules/branches/2.7/fax/page.fax.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
modules/branches/2.7/fax/functions.inc.php
r8679 r8680 116 116 global $amp_conf; 117 117 $dests=fax_get_destinations(); 118 $sender_address=sql('SELECT value FROM fax_details WHERE `key` = \'sender_address\'','getRow'); 118 119 if($dests){ 119 $sender_address=sql('SELECT value FROM fax_details WHERE `key` = \'sender_address\'','getRow');120 120 $context='ext-fax'; 121 121 foreach ($dests as $row) { … … 132 132 fax_write_conf(); 133 133 } 134 // Now check if any legacy destinations. If so, then generate proper receive fax context 135 $routes = sql('SELECT extension, cidnum FROM fax_incoming WHERE legacy_email IS NOT NULL ','getAll', DB_FETCHMODE_ASSOC); 136 if(count($routes)){ 137 $context='ext-fax-legacy'; 138 $exten = 's'; 139 $ext->add($context, $exten, '', new ext_noop('Reciving Fax for Fax Recipient: ${FAX_RX_EMAIL} , From: ${CALLERID(all)}')); 140 $ext->add($context, $exten, 'receivefax', new ext_receivefax('${ASTSPOOLDIR}/fax/${UNIQUEID}.tif')); //recive fax, then email it on 141 $ext->add($context, 'h', '', new ext_execif('$["${FAX_RX_EMAIL}" != ""]','system','\'${ASTVARLIBDIR}/bin/fax-process.pl --to ${FAX_RX_EMAIL} --from "'.$sender_address['0'].'" --dest "${FROM_DID}" --subject "New fax from ${URIENCODE(${CALLERID(all)})}" --attachment fax_${URIENCODE(${CALLERID(number)})}.pdf --type application/pdf --file ${ASTSPOOLDIR}/fax/${UNIQUEID}.tif\'')); 142 } 134 // generate ext-fax-legacy used for both legacy mode and app-fax feature code 135 // 136 $context='ext-fax-legacy'; 137 $exten = 's'; 138 $ext->add($context, $exten, '', new ext_noop('Reciving Fax for Fax Recipient: ${FAX_RX_EMAIL} , From: ${CALLERID(all)}')); 139 $ext->add($context, $exten, 'receivefax', new ext_receivefax('${ASTSPOOLDIR}/fax/${UNIQUEID}.tif')); //recive fax, then email it on 140 $ext->add($context, 'h', '', new ext_execif('$["${FAX_RX_EMAIL}" != ""]','system','\'${ASTVARLIBDIR}/bin/fax-process.pl --to ${FAX_RX_EMAIL} --from "'.$sender_address['0'].'" --dest "${FROM_DID}" --subject "New fax from ${URIENCODE(${CALLERID(all)})}" --attachment fax_${URIENCODE(${CALLERID(number)})}.pdf --type application/pdf --file ${ASTSPOOLDIR}/fax/${UNIQUEID}.tif\'')); 141 143 142 $modulename = 'fax'; 144 143 $fcc = new featurecode($modulename, 'simu_fax'); … … 147 146 148 147 if ($fc_simu_fax != '') { 149 $default_address = sql('SELECT value FROM fax_details WHERE `key` = \' defemail\'','getRow');148 $default_address = sql('SELECT value FROM fax_details WHERE `key` = \'FAX_RX_EMAIL\'','getRow'); 150 149 $ext->addInclude('from-internal-additional', 'app-fax'); // Add the include from from-internal 151 150 $ext->add('app-fax', $fc_simu_fax, '', new ext_setvar('FAX_RX_EMAIL', $default_address[0])); modules/branches/2.7/fax/page.fax.php
r8679 r8680 18 18 if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'edit'){ 19 19 needreload(); 20 $options=array("headerinfo", "localstationid", "ecm", "maxrate", "minrate", "modem", "sender_address", " defemail");20 $options=array("headerinfo", "localstationid", "ecm", "maxrate", "minrate", "modem", "sender_address", "FAX_RX_EMAIL"); 21 21 foreach($options as $option){ 22 22 isset($_REQUEST[$option])?$fax[$option]=$_REQUEST[$option]:$fax[$option]=''; … … 47 47 <tr> 48 48 <td><a class="info" href="#"><?php echo _("Default Email address:")?><span><?php echo _("Email address that faxes are sent to if no other email address. This used for Simulate Incoming Fax and in some rare legacy migration cases")?></span></a></td> 49 <td><input type="text" size="30" name=" defemail" value="<?php echo htmlspecialchars($fax['defemail'])?>" tabindex="<?php echo ++$tabindex;?>"/></td>49 <td><input type="text" size="30" name="FAX_RX_EMAIL" value="<?php echo htmlspecialchars($fax['FAX_RX_EMAIL'])?>" tabindex="<?php echo ++$tabindex;?>"/></td> 50 50 </tr> 51 51
