Show
Ignore:
Timestamp:
09/09/06 17:37:56 (7 years ago)
Author:
mheydon1973
Message:

Voicemail (gui) code moved from core

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/branches/2.2/voicemail/functions.inc.php

    r2177 r2390  
    6868} 
    6969 
     70function voicemail_configpageinit($dispnum) { 
     71  global $currentcomponent; 
     72 
     73  //if ( $dispnum == 'users' || $dispnum == 'extensions' ) { 
     74  if ( $dispnum == 'users' ) { 
     75    // Setup two option lists we need 
     76    // Enable / Disable list 
     77    $currentcomponent->addoptlistitem('vmena', 'enabled', 'Enabled'); 
     78    $currentcomponent->addoptlistitem('vmena', 'disabled', 'Disabled'); 
     79    $currentcomponent->setoptlistopts('vmena', 'sort', false); 
     80    // Yes / No Radio button list 
     81    $currentcomponent->addoptlistitem('vmyn', 'yes', 'yes'); 
     82    $currentcomponent->addoptlistitem('vmyn', 'no', 'no'); 
     83    $currentcomponent->setoptlistopts('vmyn', 'sort', false); 
     84 
     85    // Add the 'proces' function 
     86    $currentcomponent->addguifunc('voicemail_configpageload'); 
     87  } 
     88} 
     89 
     90function voicemail_configpageload() { 
     91  global $currentcomponent; 
     92 
     93  // Init vars from $_REQUEST[] 
     94  $action = $_REQUEST['action']; 
     95  $extdisplay = $_REQUEST['extdisplay']; 
     96   
     97  if ($action != 'del') {    
     98    //read in the voicemail.conf and set appropriate variables for display 
     99    $uservm = getVoicemail(); 
     100    $vmcontexts = array_keys($uservm); 
     101    $vm=false; 
     102    foreach ($vmcontexts as $vmcontext) { 
     103      if(isset($uservm[$vmcontext][$extdisplay])){ 
     104        //echo $extdisplay.' found in context '.$vmcontext.'<hr>'; 
     105        $incontext = $vmcontext;  //the context for the current extension 
     106        $vmpwd = $uservm[$vmcontext][$extdisplay]['pwd']; 
     107        $name = $uservm[$vmcontext][$extdisplay]['name']; 
     108        $email = $uservm[$vmcontext][$extdisplay]['email']; 
     109        $pager = $uservm[$vmcontext][$extdisplay]['pager']; 
     110        //loop through all options 
     111        $options=""; 
     112        if (is_array($uservm[$vmcontext][$extdisplay]['options'])) { 
     113          $alloptions = array_keys($uservm[$vmcontext][$extdisplay]['options']); 
     114          if (isset($alloptions)) { 
     115            foreach ($alloptions as $option) { 
     116              if ( ($option!="attach") && ($option!="envelope") && ($option!="saycid") && ($option!="delete") && ($option!='') ) 
     117                $options .= $option.'='.$uservm[$vmcontext][$extdisplay]['options'][$option].'|'; 
     118            } 
     119            $options = rtrim($options,'|'); 
     120            // remove the = sign if there are no options set 
     121            $options = rtrim($options,'='); 
     122             
     123          } 
     124          extract($uservm[$vmcontext][$extdisplay]['options'], EXTR_PREFIX_ALL, "vmops"); 
     125        } 
     126        $vm=true; 
     127      } 
     128    } 
     129     
     130    $vmcontext = $_SESSION["AMP_user"]->_deptname; //AMP Users can only add to their department's context 
     131    if (empty($vmcontext))  
     132      $vmcontext = ($_REQUEST['vmcontext'] ? $_REQUEST['vmcontext'] : $incontext); 
     133    if (empty($vmcontext)) 
     134      $vmcontext = 'default'; 
     135     
     136    if ( $vm==true ) { 
     137      $vmselect = "enabled"; 
     138    } else { 
     139      $vmselect = "disabled"; 
     140    } 
     141     
     142    $fc_vm = featurecodes_getFeatureCode('voicemail', 'dialvoicemail'); 
     143 
     144    $msgInvalidVmPwd = 'Please enter a valid Voicemail Password, using digits only'; 
     145    $msgInvalidEmail = 'Please enter a valid Email Address'; 
     146    $msgInvalidPager = 'Please enter a valid Pager Email Address'; 
     147    $msgInvalidVMContext = 'VM Context cannot be blank'; 
     148 
     149    $section = 'Voicemail & Directory'; 
     150    $currentcomponent->addguielem($section, new gui_selectbox('vm', $currentcomponent->getoptlist('vmena'), $vmselect, 'Status', '', false)); 
     151    $currentcomponent->addguielem($section, new gui_textbox('vmpwd', $vmpwd, 'voicemail password', "This is the password used to access the voicemail system.<br><br>This password can only contain numbers.<br><br>A user can change the password you enter here after logging into the voicemail system ($fc_vm) with a phone.", "isVoiceMailEnabled() && !isInteger()", $msgInvalidVmPwd, false)); 
     152    $currentcomponent->addguielem($section, new gui_textbox('email', $email, 'email address', "The email address that voicemails are sent to.", "isVoiceMailEnabled() && !isEmail()", $msgInvalidEmail, true)); 
     153    $currentcomponent->addguielem($section, new gui_textbox('pager', $pager, 'pager email address', "Pager/mobile email address that short voicemail notifcations are sent to.", "isVoiceMailEnabled() && !isEmail()", $msgInvalidEmail, true)); 
     154    $currentcomponent->addguielem($section, new gui_radio('attach', $currentcomponent->getoptlist('vmyn'), $vmops_attach, 'email attachment', "Option to attach voicemails to email.")); 
     155    $currentcomponent->addguielem($section, new gui_radio('saycid', $currentcomponent->getoptlist('vmyn'), $vmops_saycid, 'Play CID', "Read back caller's telephone number prior to playing the incoming message, and just after announcing the date and time the message was left.")); 
     156    $currentcomponent->addguielem($section, new gui_radio('envelope', $currentcomponent->getoptlist('vmyn'), $vmops_envelope, 'Play Envelope', "Envelope controls whether or not the voicemail system will play the message envelope (date/time) before playing the voicemail message. This settng does not affect the operation of the envelope option in the advanced voicemail menu.")); 
     157    $currentcomponent->addguielem($section, new gui_radio('delete', $currentcomponent->getoptlist('vmyn'), $vmops_delete, 'Delete Vmail', "If set to \"yes\" the message will be deleted from the voicemailbox (after having been emailed). Provides functionality that allows a user to receive their voicemail via email alone, rather than having the voicemail able to be retrieved from the Webinterface or the Extension handset.  CAUTION: MUST HAVE attach voicemail to email SET TO YES OTHERWISE YOUR MESSAGES WILL BE LOST FOREVER.")); 
     158    $currentcomponent->addguielem($section, new gui_textbox('options', $options, 'vm options', 'Separate options with pipe ( | )<br><br>ie: review=yes|maxmessage=60')); 
     159    $currentcomponent->addguielem($section, new gui_textbox('vmcontext', $vmcontext, 'vm context', '', 'isVoiceMailEnabled() && isEmpty()', $msgInvalidVMContext, false)); 
     160  } 
     161} 
     162 
    70163?> 
  • modules/branches/2.2/voicemail/module.xml

    r2366 r2390  
    22  <rawname>voicemail</rawname> 
    33  <name>Voicemail</name> 
    4   <version>1.1.2</version> 
     4  <version>1.2.0</version> 
    55  <type>setup</type> 
    66  <category>Messaging</category>