Ticket #1957: voicemail-functions.inc.php-patch-imap storage.diff

File voicemail-functions.inc.php-patch-imap storage.diff, 4.5 kB (added by drmessano, 3 years ago)
  • /var/www/html/admin/modules/voicemail/functions.inc.php

    old new  
    275275    document.getElementById('envelope1').disabled=dval; 
    276276    document.getElementById('delete0').disabled=dval; 
    277277    document.getElementById('delete1').disabled=dval; 
     278    document.getElementById('imapuser').disabled=dval; 
     279    document.getElementById('imappassword').disabled=dval; 
    278280    document.getElementById('options').disabled=dval; 
    279281    document.getElementById('vmcontext').disabled=dval; 
    280282    document.getElementById('vmx_state').disabled=dval; 
     
    434436      $alloptions = array_keys($vmoptions); 
    435437      if (isset($alloptions)) { 
    436438        foreach ($alloptions as $option) { 
    437           if ( ($option!="attach") && ($option!="envelope") && ($option!="saycid") && ($option!="delete") && ($option!='') ) 
     439          if ( ($option!="attach") && ($option!="envelope") && ($option!="saycid") && ($option!="delete") && ($option!="imapuser") && ($option!="imappassword") && ($option!='') ) 
    438440              $options .= $option.'='.$vmoptions[$option].'|'; 
    439441        } 
    440442        $options = rtrim($options,'|'); 
     
    448450      $vmops_saycid = 'no'; 
    449451      $vmops_envelope = 'no'; 
    450452      $vmops_delete = 'no'; 
     453      $vmops_imapuser = null; 
     454      $vmops_imappassword = null; 
    451455    } 
    452456 
    453457    if (empty($vmcontext))  
     
    478482    $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."), $disable)); 
    479483    $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 setting does not affect the operation of the envelope option in the advanced voicemail menu."), $disable)); 
    480484    $currentcomponent->addguielem($section, new gui_radio('delete', $currentcomponent->getoptlist('vmyn'), $vmops_delete, _('Delete Voicemail'), _("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."), $disable)); 
     485    $currentcomponent->addguielem($section, new gui_textbox('imapuser', $vmops_imapuser, _('IMAP Username'), sprintf(_("This is the IMAP username, if using IMAP storage"),"<br /><br />"),'','',true,0,$disable)); 
     486    $currentcomponent->addguielem($section, new gui_textbox('imappassword', $vmops_imappassword, _('IMAP Password'), sprintf(_("This is the IMAP password, if using IMAP storage"),"<br /><br />"),'','',true,0,$disable)); 
    481487    $currentcomponent->addguielem($section, new gui_textbox('options', $options, _('VM Options'), sprintf(_("Separate options with pipe ( | )%sie: review=yes|maxmessage=60"),"<br /><br />"),'','',true,0,$disable)); 
    482488    $currentcomponent->addguielem($section, new gui_textbox('vmcontext', $vmcontext, _('VM Context'), _("This is the Voicemail Context which is normally set to default. Do not change unless you understand the implications."), "frm_${display}_isVoiceMailEnabled() && isEmpty()", $msgInvalidVMContext, false,0,$disable)); 
    483489 
     
    730736   
    731737  if ($vm != 'disabled') 
    732738  {  
     739    if ($imapuser!='' && $imapuser!=''){ 
     740       $imapuser = 'imapuser='.$imapuser; 
     741       $imappassword = 'imappassword='.$imappassword; 
     742    } 
    733743    // need to check if there are any options entered in the text field 
    734744    if ($options!=''){ 
    735745      $options = explode("|",$options); 
     
    738748        $vmoptions[$vmoption[0]] = $vmoption[1]; 
    739749      } 
    740750    } 
     751    if ($imapuser!='' && $imapuser!=''){ 
     752      $vmoption = explode("=",$imapuser); 
     753        $vmoptions[$vmoption[0]] = $vmoption[1]; 
     754      $vmoption = explode("=",$imappassword); 
     755        $vmoptions[$vmoption[0]] = $vmoption[1]; 
     756    } 
    741757    $vmoption = explode("=",$attach); 
    742758      $vmoptions[$vmoption[0]] = $vmoption[1]; 
    743759    $vmoption = explode("=",$saycid);