function directory_configpageload() { global $currentcomponent, $display; if ($display == 'directory' && (isset($_REQUEST['action']) && $_REQUEST['action'] == 'add' || isset($_REQUEST['id']) && $_REQUEST['id'] != '')) { if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'add') { $currentcomponent->addguielem('_top', new gui_pageheading('title', _('Add Directory')), 0); $deet = array('dirname', 'description', 'repeat_loops', 'announcement', 'repeat_recording', 'invalid_recording', 'callid_prefix', 'alert_info', 'invalid_destination', 'retivr', 'say_extension', 'id'); foreach ($deet as $d) { switch ($d) { case 'repeat_loops': $dir[$d] = 2; break; case 'announcement': case 'repeat_recording': case 'invalid_recording': $dir[$d] = 0; break; default: $dir[$d] = ''; break; } } } else { $dir = directory_get_dir_details($_REQUEST['id']); $label = sprintf(_("Edit Directory: %s"), $dir['dirname'] ? $dir['dirname'] : 'ID ' . $dir['id']); $def_dir = directory_get_default_dir(); if ($dir['id'] == $def_dir) { $label .= ' ' . _("[SYSTEM DEFAULT]"); } $currentcomponent->addguielem('_top', new gui_pageheading('title', $label), 0); //display usage $usage_list = framework_display_destination_usage(directory_getdest($dir['id'])); $usage_list_text = isset($usage_list['text']) ? $usage_list['text'] : ''; $usage_list_tooltip = isset($usage_list['tooltip']) ? $usage_list['tooltip'] : ''; if (!empty($usage_list)) { $currentcomponent->addguielem('_top', new gui_link_label('usage', $usage_list_text, $usage_list_tooltip), 0); } //display delete link $label = sprintf(_("Delete Directory %s"), $dir['dirname'] ? $dir['dirname'] : $dir['id']); $label = '<span><img width="16" height="16" border="0" title="' . $label . '" alt="" src="images/core_delete.png"/> ' . $label . '</span>'; $currentcomponent->addguielem('_top', new gui_link('del', $label, '?' . $_SERVER['QUERY_STRING'] . '&action=delete', true, false), 0); } //delete link, dont show if we dont have an id (i.e. directory wasnt created yet) $gen_section = _('Directory General Options'); $category = "other"; $currentcomponent->addguielem($gen_section, new gui_textbox('dirname', stripslashes($dir['dirname']), _('Directory Name'), _('Name of this directory.')), $category); $currentcomponent->addguielem($gen_section, new gui_textbox('description', stripslashes($dir['description']), _('Directory Description'), _('Description of this directory.')), $category); $currentcomponent->addguielem($gen_section, new gui_textbox('callid_prefix', stripslashes($dir['callid_prefix']), _('CallerID Name Prefix'), _('Prefix to be appended to current CallerID Name.')), $category); $currentcomponent->addguielem($gen_section, new gui_textbox('alert_info', stripslashes($dir['alert_info']), _('Alert Info'), _('ALERT_INFO to be sent when called from this Directory. Can be used for distinctive ring for SIP devices.')), $category); $section = _('Directory Options (DTMF)'); //build recordings select list $currentcomponent->addoptlistitem('recordings', 0, _('Default')); foreach (recordings_list() as $r) { $currentcomponent->addoptlistitem('recordings', $r['id'], $r['displayname']); } $currentcomponent->setoptlistopts('recordings', 'sort', false); //build repeat_loops select list and defualt it to 3 for ($i = 0; $i < 11; $i++) { $currentcomponent->addoptlistitem('repeat_loops', $i, $i); } //generate page $currentcomponent->addguielem($section, new gui_selectbox('announcement', $currentcomponent->getoptlist('recordings'), $dir['announcement'], _('Announcement'), _('Greeting to be played on entry to the directory.'), false), $category); $currentcomponent->addguielem($section, new gui_selectbox('repeat_loops', $currentcomponent->getoptlist('repeat_loops'), $dir['repeat_loops'], _('Invalid Retries'), _('Number of times to retry when receiving an invalid/unmatched response from the caller'), false), $category); $currentcomponent->addguielem($section, new gui_selectbox('repeat_recording', $currentcomponent->getoptlist('recordings'), $dir['repeat_recording'], _('Invalid Retry Recording'), _('Prompt to be played when an invalid/unmatched response is received, before prompting the caller to try again'), false), $category); $currentcomponent->addguielem($section, new gui_selectbox('invalid_recording', $currentcomponent->getoptlist('recordings'), $dir['invalid_recording'], _('Invalid Recording'), _('Prompt to be played before sending the caller to an alternate destination due to the caller pressing 0 or receiving the maximum amount of invalid/unmatched responses (as determined by Invalid Retries)'), false), $category); $currentcomponent->addguielem($section, new gui_drawselects('invalid_destination', 0, $dir['invalid_destination'], _('Invalid Destination'), _('Destination to send the call to after Invalid Recording is played.'), false), $category); $currentcomponent->addguielem($section, new gui_checkbox('retivr', $dir['retivr'], _('Return to IVR'), _('When selected, if the call passed through an IVR that had "Return to IVR" selected, the call will be returned there instead of the Invalid destination.'), true), $category); $currentcomponent->addguielem($section, new gui_checkbox('say_extension', $dir['say_extension'], _('Announce Extension'), _('When checked, the extension number being transferred to will be announced prior to the transfer'), true), $category); $currentcomponent->addguielem($section, new gui_hidden('id', $dir['id']), $category); $currentcomponent->addguielem($section, new gui_hidden('action', 'edit'), $category); //TODO: the needs to be here instead of a space, guielements freaks for some reason with this specific section name $section = _('Directory Entries'); //draw the entries part of the table. A bit hacky perhaps, but hey - it works! $currentcomponent->addguielem($section, new guielement('rawhtml', directory_draw_entries($dir['id']), '')); } }
<label for="say_extensionno"><?php echo _("No"); ?> </label> </div> </div> </div> </div> </div> <div class="row"> <div class="col-md-12"> <span id="say_extension-help" class="help-block fpbx-help-block"><?php echo _("When checked, the extension number being transferred to will be announced prior to the transfer"); ?> </span> </div> </div> </div> <!--END Announce Extension--> <?php echo directory_draw_entries(isset($dir) ? $dir['id'] : ""); ?> <input type='hidden' name="action" value="edit"> <input type='hidden' name="id" value="<?php echo $id; ?> "> <input type='hidden' name="display" value="directory"> <input type='hidden' name="view" value="form"> </form>