Changeset 6536
- Timestamp:
- 09/02/08 08:34:45 (3 months ago)
- Files:
-
- modules/branches/2.5/core/functions.inc.php (modified) (4 diffs)
- modules/branches/2.5/core/page.did.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
modules/branches/2.5/core/functions.inc.php
r6534 r6536 2604 2604 $newdid = preg_replace("/[^0-9._XxNnZz\[\]\-\+]/" ,"", trim($newdid)); 2605 2605 2606 $newdidcid = isset($newdidcid) ? $newdidcid : ''; 2607 $newdidcid = trim($newdidcid); 2608 switch ($newdidcid) { 2609 case 'Unknown': 2610 case 'Private': 2611 case 'Blocked': 2612 case 'Restricted': 2613 case 'Unavailable': 2614 break; 2615 default: 2616 $newdidcid = preg_replace("/[^0-9._XxNnZz\[\]\-\+]/" ,"", $newdidcid); 2617 break; 2606 $newdidcid = isset($newdidcid) ? trim($newdidcid) : ''; 2607 if (!preg_match('/^priv|^block|^unknown|^restrict|^unavail|^anonym/',strtolower($newdidcid))) { 2608 $newdidcid = preg_replace("/[^0-9._XxNnZz\[\]\-\+]/" ,"", $newdidcid); 2618 2609 } 2619 2610 … … 2853 2844 $newdid = preg_replace("/[^0-9._XxNnZz\[\]\-\+]/" ,"", trim($newdid)); 2854 2845 2855 $newdidcid = isset($vars['newdidcid']) ? $vars['newdidcid'] : ''; 2856 $newdidcid = trim($newdidcid); 2857 switch ($newdidcid) { 2858 case 'Unknown': 2859 case 'Private': 2860 case 'Blocked': 2861 case 'Restricted': 2862 case 'Unavailable': 2863 break; 2864 default: 2865 $newdidcid = preg_replace("/[^0-9._XxNnZz\[\]\-\+]/" ,"", $newdidcid); 2866 break; 2846 $newdidcid = isset($vars['newdidcid']) ? trim($vars['newdidcid']) : ''; 2847 if (!preg_match('/^priv|^block|^unknown|^restrict|^unavail|^anonym/',strtolower($newdidcid))) { 2848 $newdidcid = preg_replace("/[^0-9._XxNnZz\[\]\-\+]/" ,"", $newdidcid); 2867 2849 } 2868 2850 … … 4127 4109 // Special CID handling to deal with Private, etc. 4128 4110 // 4129 $js = 'if (isDialpattern(mycid) || mycid == "Private" || mycid == "Blocked" || mycid == "Unknown" || mycid == "Restricted" || mycid == "Unavailable") { return true } else { return false };'; 4130 $currentcomponent->addjsfunc('isValidCID(mycid)', $js); 4111 $js = 4112 'var mycid = thiscid.toLowerCase(); 4113 if (isDialpattern(thiscid) || mycid.substring(0,4) == "priv" || mycid.substring(0,5) == "block" || mycid == "unknown" || mycid.substring(0,8) == "restrict" || mycid.substring(0,7) == "unavail" || mycid.substring(0,6) == "anonym") { return true } else { return false }; 4114 '; 4115 $currentcomponent->addjsfunc('isValidCID(thiscid)', $js); 4131 4116 4132 4117 // Add the 'proces' functions … … 4293 4278 $currentcomponent->addguielem($section, new gui_textbox('newdid_name', $newdid_name, _("DID Description"), _("A description for this DID, such as \"Fax\"")), 4); 4294 4279 $currentcomponent->addguielem($section, new gui_textbox('newdid', $newdid, _("Add Inbound DID"), _("A direct DID that is associated with this extension. The DID should be in the same format as provided by the provider (e.g. full number, 4 digits for 10x4, etc).<br><br>Format should be: <b>XXXXXXXXXX</b><br><br>.An optional CID can also be associated with this DID by setting the next box"),'!isDialpattern()',$msgInvalidDIDNum,true), 4); 4295 $currentcomponent->addguielem($section, new gui_textbox('newdidcid', $newdidcid, _("Add Inbound CID"), _("Add a CID for more specific DID + CID routing. A DID must be specified in the above Add DID box. In addition to standard dial sequences, you can also put Private, Blocked, Unknown, Restricted and Unavailable in order to catch these special cases if the Telco transmits them."),"!frm_${display}_isValidCID()",$msgInvalidCIDNum,true), 4);4280 $currentcomponent->addguielem($section, new gui_textbox('newdidcid', $newdidcid, _("Add Inbound CID"), _("Add a CID for more specific DID + CID routing. A DID must be specified in the above Add DID box. In addition to standard dial sequences, you can also put Private, Blocked, Unknown, Restricted, Anonymous and Unavailable in order to catch these special cases if the Telco transmits them."),"!frm_${display}_isValidCID()",$msgInvalidCIDNum,true), 4); 4296 4281 4297 4282 $dids = core_did_list('extension'); modules/branches/2.5/core/page.did.php
r6450 r6536 182 182 </tr> 183 183 <tr> 184 <td><a href="#" class="info"><?php echo _("Caller ID Number")?><span><?php echo _('Define the Caller ID Number to be matched on incoming calls.<br><br>Leave this field blank to match any or no CID info. In addition to standard dial sequences, you can also put Private, Blocked, Unknown, Restricted and Unavailable in order to catch these special cases if the Telco transmits them.')?></span></a>:</td>184 <td><a href="#" class="info"><?php echo _("Caller ID Number")?><span><?php echo _('Define the Caller ID Number to be matched on incoming calls.<br><br>Leave this field blank to match any or no CID info. In addition to standard dial sequences, you can also put Private, Blocked, Unknown, Restricted, Anonymous and Unavailable in order to catch these special cases if the Telco transmits them.')?></span></a>:</td> 185 185 <td><input type="text" name="cidnum" value="<?php echo htmlspecialchars(isset($cidnum)?$cidnum:'') ?>" tabindex="<?php echo ++$tabindex;?>"></td> 186 186 </tr> … … 340 340 return false; 341 341 } 342 if (!isDialpattern(theForm.cidnum.value) && theForm.cidnum.value != "Private" && theForm.cidnum.value != "Blocked" && theForm.cidnum.value != "Unknown" && theForm.cidnum.value != "Restricted" && theForm.cidnum.value != "Unavailable") 342 343 var mycid = theForm.cidnum.value.toLowerCase(); 344 if (!isDialpattern(mycid) && mycid.substring(0,4) != "priv" && mycid.substring(0,5) != "block" && mycid != "unknown" && mycid.substring(0,8) != "restrict" && mycid.substring(0,7) != "unavail" && mycid.substring(0,6) != "anonym") 343 345 return warnInvalid(theForm.cidnum, msgInvalidCIDNum); 344 346
