Changeset 5287

Show
Ignore:
Timestamp:
11/25/07 03:11:07 (5 years ago)
Author:
p_lindheimer
Message:

added callback_getdest() and callback_getdestinfo() and feedback on destination usage

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/branches/2.4/callback/functions.inc.php

    r1675 r5287  
    1414  } else { 
    1515    return null; 
     16  } 
     17} 
     18 
     19function callback_getdest($exten) { 
     20  return array('callback,'.$exten.',1'); 
     21} 
     22 
     23function callback_getdestinfo($dest) { 
     24  global $active_modules; 
     25 
     26  if (substr(trim($dest),0,9) == 'callback,') { 
     27    $exten = explode(',',$dest); 
     28    $exten = $exten[1]; 
     29    $thisexten = callback_get($exten); 
     30    if (empty($thisexten)) { 
     31      return array(); 
     32    } else { 
     33      //$type = isset($active_modules['announcement']['type'])?$active_modules['announcement']['type']:'setup'; 
     34      return array('description' => 'Callback : '.$thisexten['description'], 
     35                   'edit_url' => 'config.php?display=callback&itemid='.urlencode($exten), 
     36                  ); 
     37    } 
     38  } else { 
     39    return false; 
    1640  } 
    1741} 
  • modules/branches/2.4/callback/page.callback.php

    r3204 r5287  
    8383  <p><?php echo ($itemid ? '' : _("A callback will hang up on the caller and then call them back, directing them to the selected destination. This is useful for reducing mobile phone charges as well as other applications. Outbound calls will proceed according to the dial patterns in Outbound Routes.")); ?></p> 
    8484 
    85 <?php   if ($itemid){  echo $delButton;   } ?> 
     85<?php   if ($itemid) { 
     86          echo $delButton;   
     87          $usage_list = framework_display_destination_usage(callback_getdest($itemid)); 
     88          if (!empty($usage_list)) { 
     89?> 
     90            <a href="#" class="info"><?php echo $usage_list['text']?>:<span><?php echo $usage_list['tooltip']?></span></a> 
     91<?php 
     92          } 
     93        } 
     94?> 
     95 
    8696 
    8797<form autocomplete="off" name="edit" action="<?php $_SERVER['PHP_SELF'] ?>" method="post" onsubmit="return edit_onsubmit();">