Changeset 12275

Show
Ignore:
Timestamp:
06/27/11 09:49:42 (2 years ago)
Author:
mbrevda
Message:

closes #5251 - add ivr deletion detection ot queues

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/branches/2.10/directory/functions.inc.php

    r12271 r12275  
    33function directory_configpageload_ivr() { 
    44  global $currentcomponent, $display; 
    5   if (isset($_REQUEST['action']) && $_REQUEST['action']  == 'add' || $_REQUEST['action']  == 'edit') { 
     5  if (isset($_REQUEST['action']) && ($_REQUEST['action']  == 'add' || $_REQUEST['action']  == 'edit')) { 
    66     
    77    //add help text 
  • modules/branches/2.10/queues/functions.inc.php

    r12263 r12275  
    12281228  $extension = isset($_REQUEST['extension'])?$_REQUEST['extension']:null; 
    12291229  $tech_hardware = isset($_REQUEST['tech_hardware'])?$_REQUEST['tech_hardware']:null; 
    1230  
    1231   // We only want to hook 'users' or 'extensions' pages. 
    1232   if ($pagename != 'users' && $pagename != 'extensions')  
     1230  $display = isset($_REQUEST['display'])?$_REQUEST['display']:null; 
     1231   
     1232  //hook in to ivr's 
     1233  if ($display == 'ivr') { 
     1234    $currentcomponent->addprocessfunc('queues_configprocess_ivr'); 
     1235    // We only want to hook 'users' or 'extensions' pages. 
     1236  } elseif ($pagename != 'users' && $pagename != 'extensions') { 
    12331237    return true; 
     1238  } 
    12341239  // On a 'new' user, 'tech_hardware' is set, and there's no extension. Hook into the page. 
    12351240  if ($tech_hardware != null || $pagename == 'users') { 
     
    12671272  //create vars from the request 
    12681273  $action = isset($_REQUEST['action'])?$_REQUEST['action']:null; 
     1274  $id = isset($_REQUEST['id'])?$_REQUEST['id']:null; 
    12691275  $ext = isset($_REQUEST['extdisplay'])?$_REQUEST['extdisplay']:null; 
    12701276  $extn = isset($_REQUEST['extension'])?$_REQUEST['extension']:null; 
    12711277  $qnostate = isset($_REQUEST['qnostate'])?$_REQUEST['qnostate']:null; 
     1278   
    12721279 
    12731280  if ($ext==='') {  
     
    12821289  } // if 'del' then core will remove the entire tree 
    12831290} 
     1291 
     1292function queues_configprocess_ivr() { 
     1293  $action = isset($_REQUEST['action'])?$_REQUEST['action']:null; 
     1294  $display = isset($_REQUEST['display'])?$_REQUEST['display']:null; 
     1295  $id = isset($_REQUEST['id'])?$_REQUEST['id']:null; 
     1296 
     1297   
     1298  if($display == 'ivr' && $action == 'delete') { 
     1299    queues_ivr_delete_event($id); 
     1300  } 
     1301   
     1302} 
     1303function queues_ivr_delete_event($id = '') { 
     1304  global $db; 
     1305   
     1306  if (!$id) { 
     1307      sql('UPDATE queues_config SET ivr_id = ""'); 
     1308  } else { 
     1309    $sql = 'UPDATE queues_config SET ivr_id = "" WHERE ivr_id = ?'; 
     1310    $ret = $db->query($sql, array($id)); 
     1311  } 
     1312} 
    12841313?> 
  • modules/branches/2.10/queues/page.queues.php

    r12263 r12275  
    130130 
    131131// do if we are submitting a form 
    132 if(isset($_POST['action'])){ 
     132if(isset($_REQUEST['action'])){ 
    133133  //check if the extension is within range for this user 
    134134  if (isset($account) && !checkRange($account)){