<input type="hidden" name="display" value="2"> <p><?php echo _("Callers to this Menu can press the pound key (#) to access the user directory."); ?> <br><br> <?php echo _("Directory context to be used:"); ?> <select name="dir-context" <?php if ($DIRECTORY == 'disabled') { echo "disabled"; } ?> > <?php $uservm = getVoicemail(); $vmcontexts = array_keys($uservm); echo 'ctx:' . $dircontext; foreach ($vmcontexts as $vmcontext) { echo '<option value="' . $vmcontext . '" ' . (strpos($dircontext, $vmcontext) === false ? '' : 'SELECTED') . '>' . ($vmcontext == 'general' ? 'Entire Directory' : $vmcontext); } ?> </select> </p> <p> <?php echo _("Aside from local extensions and the pound key (#), how many other options should callers be able to dial during the playback of this menu prompt?"); ?> <br><br><?php echo _("Number of options for Menu:"); ?>
function ivrdrawselects($formName, $goto, $i) { $unique_aas = getaas(); $extens = getextens(); $gresults = getgroups(); $queues = getqueues(); $miscdest = getmiscdest(); if (isset($extens)) { //get voicemail $uservm = getVoicemail(); $vmcontexts = array_keys($uservm); foreach ($extens as $thisext) { $extnum = $thisext[0]; // search vm contexts for this extensions mailbox foreach ($vmcontexts as $vmcontext) { if (isset($uservm[$vmcontext][$extnum])) { $vmname = $uservm[$vmcontext][$extnum]['name']; $vmboxes[] = array($extnum, '"' . $vmname . '" <' . $extnum . '>'); } } } } $selectHtml = '<table border="0" cellpadding="1" cellspacing="2" id="loopdestination"'; if ($goto == "") { $selectHtml .= 'style="display:none;"'; } $selectHtml .= '>'; $selectHtml .= '<tr><td><h5>Set Destination:</h5></td></tr>'; $selectHtml .= '<tr><td></td></tr>'; $selectHtml .= '<tr><td><input type="hidden" name="goto' . $i . '" value="">'; $selectHtml .= '<input type="radio" onFocus="this.blur()" name="goto_indicate' . $i . '" value="ivr" onclick="javascript:document.' . $formName . '.goto' . $i . '.value=\'ivr\';" onkeypress="javascript:if (event.keyCode == 0 || (document.all && event.keyCode == 13)) document.' . $formName . '.goto' . $i . '.value=\'ivr\';" ' . (strpos($goto, 'aa_') === false ? '' : 'CHECKED=CHECKED') . ' /> ' . _("Digital Receptionist") . ': '; $selectHtml .= '<select name="ivr' . $i . '">'; if (isset($unique_aas)) { foreach ($unique_aas as $unique_aa) { $menu_id = $unique_aa[0]; $menu_name = $unique_aa[1]; $selectHtml .= '<option value="' . $menu_id . '" ' . (strpos($goto, $menu_id) === false ? '' : 'SELECTED') . '>' . ($menu_name ? $menu_name : 'Menu ID' . $menu_id) . '</option>'; } } $selectHtml .= '</select></td></tr>'; $selectHtml .= '<tr><td><input type="radio" onFocus="this.blur()" name="goto_indicate' . $i . '" value="extension" onclick="javascript:document.' . $formName . '.goto' . $i . '.value=\'extension\';" onkeypress="javascript:if (event.keyCode == 0 || (document.all && event.keyCode == 13)) document.' . $formName . '.goto' . $i . '.value=\'extension\';" ' . (strpos($goto, 'ext-local') === false ? '' : 'CHECKED=CHECKED') . '/> ' . _("Extension") . ': '; $selectHtml .= '<select name="extension' . $i . '">'; if (isset($extens)) { foreach ($extens as $exten) { $selectHtml .= '<option value="' . $exten[0] . '" ' . (strpos($goto, $exten[0]) === false ? '' : 'SELECTED') . '>' . $exten[1] . '</option>'; } } $selectHtml .= '</select></td></tr>'; $selectHtml .= '<tr><td><input type="radio" onFocus="this.blur()" name="goto_indicate' . $i . '" value="voicemail" onclick="javascript:document.' . $formName . '.goto' . $i . '.value=\'voicemail\';" onkeypress="javascript:if (event.keyCode == 0 || (document.all && event.keyCode == 13)) document.' . $formName . '.goto' . $i . '.value=\'voicemail\';" ' . (strpos($goto, 'vm') === false ? '' : 'CHECKED=CHECKED') . (strpos($goto, 'ext-local,${VM_PREFIX}') === false ? '' : 'CHECKED=CHECKED') . ' /> ' . _("Voicemail") . ': '; $selectHtml .= '<select name="voicemail' . $i . '">'; if (isset($vmboxes)) { foreach ($vmboxes as $exten) { $selectHtml .= '<option value="' . $exten[0] . '" ' . (strpos($goto, $exten[0]) === false ? '' : 'SELECTED') . '>' . $exten[1] . '</option>'; } } $selectHtml .= '</select></td></tr>'; $selectHtml .= '<tr><td><input type="radio" onFocus="this.blur()" name="goto_indicate' . $i . '" value="group" onclick="javascript:document.' . $formName . '.goto' . $i . '.value=\'group\';" onkeypress="javascript:if (event.keyCode == 0 || (document.all && event.keyCode == 13)) document.' . $formName . '.goto' . $i . '.value=\'group\';" ' . (strpos($goto, 'ext-group') === false ? '' : 'CHECKED=CHECKED') . ' /> ' . _("Ring Group") . ': '; $selectHtml .= '<select name="group' . $i . '">'; if (isset($gresults)) { foreach ($gresults as $gresult) { $selectHtml .= '<option value="' . $gresult[0] . '" ' . (strpos(',' . $goto . ',', ',' . $gresult[0] . ',') === false ? '' : 'SELECTED') . '>' . $gresult[0] . ':' . $gresult[1] . '</option>'; } } $selectHtml .= '</select></td></tr>'; $selectHtml .= '<tr><td><input type="radio" onFocus="this.blur()" name="goto_indicate' . $i . '" value="queue" onclick="javascript:document.' . $formName . '.goto' . $i . '.value=\'queue\';" onkeypress="javascript:if (event.keyCode == 0 || (document.all && event.keyCode == 13)) document.' . $formName . '.goto' . $i . '.value=\'queue\';" ' . (strpos($goto, 'ext-queues') === false ? '' : 'CHECKED=CHECKED') . ' /> ' . _("Queue") . ': '; $selectHtml .= '<select name="queue' . $i . '">'; if (isset($queues)) { foreach ($queues as $queue) { $selectHtml .= '<option value="' . $queue[0] . '" ' . (strpos($goto, $queue[0]) === false ? '' : 'SELECTED') . '>' . $queue[0] . ':' . $queue[1] . '</option>'; } } $selectHtml .= '</select></td></tr>'; $selectHtml .= '<tr><td><input type="radio" onFocus="this.blur()" name="goto_indicate' . $i . '" value="miscdest" onclick="javascript:document.' . $formName . '.goto' . $i . '.value=\'miscdest\';" onkeypress="javascript:if (event.keyCode == 0 || (document.all && event.keyCode == 13)) document.' . $formName . '.goto' . $i . '.value=\'miscdest\';" ' . (strpos($goto, 'ext-miscdests') === false ? '' : 'CHECKED=CHECKED') . '/> ' . _("Misc Destinations") . ': '; $selectHtml .= '<select name="miscdest' . $i . '">'; if (isset($miscdest)) { foreach ($miscdest as $miscdests) { $selectHtml .= '<option value="' . $miscdests[0] . '" ' . (strpos($goto, $miscdests[0]) === false ? '' : 'SELECTED') . '>' . $miscdests[0] . ':' . $miscdests[1] . '</option>'; } } $selectHtml .= '</select></td></tr>'; $selectHtml .= '<tr><td><input type="radio" onFocus="this.blur()" name="goto_indicate' . $i . '" value="dial" ' . (strpos($goto, 'outbound-allroutes') === false ? '' : 'CHECKED=CHECKED') . ' />'; $selectHtml .= ' <a href="#" class="info">' . _("Custom Dial<span>You can include an extension on a remote system, or an external number (Outbound Routing must contain a valid route for external numbers)</span>") . '</a>:'; $hackstart = strpos($goto, ',') + 1; $selectHtml .= '<input type="text" size="20" name="dial_args' . $i . '" value="' . (strpos($goto, 'outbound-allroutes') === false ? '' : substr($goto, $hackstart, -2)) . '" />'; $selectHtml .= '</td></tr>'; $selectHtml .= '</table>'; return $selectHtml; }