Changeset 6366
- Timestamp:
- 08/13/08 09:08:23 (4 years ago)
- Files:
-
- modules/branches/2.5/core/functions.inc.php (modified) (5 diffs)
- modules/branches/2.5/core/page.did.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
modules/branches/2.5/core/functions.inc.php
r6363 r6366 2515 2515 $newdid = isset($newdid) ? $newdid : ''; 2516 2516 $newdid = preg_replace("/[^0-9._XxNnZz\[\]\-\+]/" ,"", trim($newdid)); 2517 2517 2518 $newdidcid = isset($newdidcid) ? $newdidcid : ''; 2518 $newdidcid = preg_replace("/[^0-9._XxNnZz\[\]\-\+]/" ,"", trim($newdidcid)); 2519 $newdidcid = trim($newdidcid); 2520 switch ($newdidcid) { 2521 case 'Unknown': 2522 case 'Private': 2523 case 'Blocked': 2524 case 'Restricted': 2525 case 'Unavailable': 2526 break; 2527 default: 2528 $newdidcid = preg_replace("/[^0-9._XxNnZz\[\]\-\+]/" ,"", $newdidcid); 2529 break; 2530 } 2519 2531 2520 2532 // Well more ugliness since the javascripts are already in here … … 2751 2763 $newdid = isset($vars['newdid']) ? $vars['newdid'] : ''; 2752 2764 $newdid = preg_replace("/[^0-9._XxNnZz\[\]\-\+]/" ,"", trim($newdid)); 2765 2753 2766 $newdidcid = isset($vars['newdidcid']) ? $vars['newdidcid'] : ''; 2754 $newdidcid = preg_replace("/[^0-9._XxNnZz\[\]\-\+]/" ,"", trim($newdidcid)); 2767 $newdidcid = trim($newdidcid); 2768 switch ($newdidcid) { 2769 case 'Unknown': 2770 case 'Private': 2771 case 'Blocked': 2772 case 'Restricted': 2773 case 'Unavailable': 2774 break; 2775 default: 2776 $newdidcid = preg_replace("/[^0-9._XxNnZz\[\]\-\+]/" ,"", $newdidcid); 2777 break; 2778 } 2755 2779 2756 2780 // Well more ugliness since the javascripts are already in here … … 4042 4066 $currentcomponent->setoptlistopts('ringtime', 'sort', false); 4043 4067 4068 // Special CID handling to deal with Private, etc. 4069 // 4070 $js = 'if (isDialpattern(mycid) || mycid == "Private" || mycid == "Blocked" || mycid == "Unknown" || mycid == "Restricted" || mycid == "Unavailable") { return true } else { return false };'; 4071 $currentcomponent->addjsfunc('isValidCID(mycid)', $js); 4072 4044 4073 // Add the 'proces' functions 4045 4074 $currentcomponent->addguifunc('core_users_configpageload'); … … 4135 4164 $msgInvalidOutboundCID = _("Please enter a valid Outbound CID"); 4136 4165 $msgInvalidPause = _("Please enter a valid pause time in seconds, using digits only"); 4137 $msgInvalidDIDNum = _("You have entered a non-standard dialpattern for your DID. You can only enter standard dialpatterns. You must use the inbound routing form to enter non-standard patterns");4166 $msgInvalidDIDNum = _("You have entered a non-standard dialpattern for your DID. You can only enter standard dialpatterns. You must use the inbound routing form to enter non-standard patterns"); 4138 4167 $msgInvalidCIDNum = _("Please enter a valid Caller ID Number or leave it blank for your Assigned DID/CID pair"); 4139 4168 … … 4205 4234 $currentcomponent->addguielem($section, new gui_textbox('newdid_name', $newdid_name, _("DID Description"), _("A description for this DID, such as \"Fax\"")), 4); 4206 4235 $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); 4207 $currentcomponent->addguielem($section, new gui_textbox('newdidcid', $newdidcid, _("Add Inbound CID"), _("Add a CID for more specific DID + CID routing. A CID must be specified in the above Add DID box"),'!isDialpattern()',$msgInvalidCIDNum,true), 4); 4236 //$currentcomponent->addguielem($section, new gui_textbox('newdidcid', $newdidcid, _("Add Inbound CID"), _("Add a CID for more specific DID + CID routing. A CID must be specified in the above Add DID box"),'!isDialpattern()',$msgInvalidCIDNum,true), 4); 4237 $currentcomponent->addguielem($section, new gui_textbox('newdidcid', $newdidcid, _("Add Inbound CID"), _("Add a CID for more specific DID + CID routing. A CID must be specified in the above Add DID box"),"!frm_${display}_isValidCID()",$msgInvalidCIDNum,true), 4); 4208 4238 4209 4239 $dids = core_did_list('extension'); modules/branches/2.5/core/page.did.php
r6345 r6366 334 334 return false; 335 335 } 336 if (!isDialpattern(theForm.cidnum.value) )336 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") 337 337 return warnInvalid(theForm.cidnum, msgInvalidCIDNum); 338 338
