Changeset 6366

Show
Ignore:
Timestamp:
08/13/08 09:08:23 (4 years ago)
Author:
p_lindheimer
Message:

closes #3053 allow CIDs like Restricted, Blocked, Unknown, Private, Unavailable to handle such special cases sent by the telco

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/branches/2.5/core/functions.inc.php

    r6363 r6366  
    25152515  $newdid = isset($newdid) ? $newdid : ''; 
    25162516  $newdid = preg_replace("/[^0-9._XxNnZz\[\]\-\+]/" ,"", trim($newdid)); 
     2517 
    25172518  $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  } 
    25192531 
    25202532  // Well more ugliness since the javascripts are already in here 
     
    27512763  $newdid = isset($vars['newdid']) ? $vars['newdid'] : ''; 
    27522764  $newdid = preg_replace("/[^0-9._XxNnZz\[\]\-\+]/" ,"", trim($newdid)); 
     2765 
    27532766  $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  } 
    27552779 
    27562780  // Well more ugliness since the javascripts are already in here 
     
    40424066    $currentcomponent->setoptlistopts('ringtime', 'sort', false); 
    40434067 
     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 
    40444073    // Add the 'proces' functions 
    40454074    $currentcomponent->addguifunc('core_users_configpageload'); 
     
    41354164    $msgInvalidOutboundCID = _("Please enter a valid Outbound CID"); 
    41364165    $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"); 
    41384167    $msgInvalidCIDNum = _("Please enter a valid Caller ID Number or leave it blank for your Assigned DID/CID pair"); 
    41394168 
     
    42054234    $currentcomponent->addguielem($section, new gui_textbox('newdid_name', $newdid_name, _("DID Description"), _("A description for this DID, such as \"Fax\"")), 4); 
    42064235    $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); 
    42084238 
    42094239    $dids = core_did_list('extension'); 
  • modules/branches/2.5/core/page.did.php

    r6345 r6366  
    334334    return false; 
    335335  } 
    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"
    337337    return warnInvalid(theForm.cidnum, msgInvalidCIDNum); 
    338338