function ivr_get_details($id = '') { return FreePBX::Ivr()->getDetails($id); }
public function ivrHook($request) { if (isset($request['id'])) { $ivr = \FreePBX::Ivr()->getDetails($request['id']); } $directdial = isset($ivr['directdial']) ? $ivr['directdial'] : ''; $dirs = directory_list(); $options = '$("<option />", {text: \'' . _("Disabled") . '\'}).appendTo(sel);'; $options .= '$("<option />", {val: \'ext-local\', text: \'' . _("Enabled") . '\'}).appendTo(sel);'; foreach ($dirs as $dir) { $name = $dir['dirname'] ? $dir['dirname'] : 'Directory ' . $dir['id']; $options .= '$("<option />", {val: \'' . $dir['id'] . '\', text: \'' . $name . '\'}).appendTo(sel);'; } $html = ' <script type="text/javascript"> var sel = $("<select id=\\"directdial\\" name=\\"directdial\\" class=\\"form-control\\" />"); var target = $("#directdialyes").parent(); '; $html .= $options; $html .= ' $(target).html(sel); $("#directdial").find("option").each( function() { var $this = $(this); if ($this.val() == "' . $directdial . '") { $this.attr("selected","selected"); return false; } }); </script> '; return $html; }
$checked = $r['id'] == $ivr['invalid_recording'] ? ' SELECTED' : ''; $invalidopts .= '<option value="' . $r['id'] . '" ' . $checked . '>' . $r['displayname'] . '</option>'; } $timeoutretryopts = '<option value="default">' . _('Default') . '</option>'; $timeoutretryopts .= '<option value="" ' . ($ivr['timeout_retry_recording'] == '' ? 'SELECTED' : '') . '>' . _('None') . '</option>'; foreach ($recordingList as $r) { $checked = $r['id'] == $ivr['timeout_retry_recording'] ? ' SELECTED' : ''; $timeoutretryopts .= '<option value="' . $r['id'] . '" ' . $checked . '>' . $r['displayname'] . '</option>'; } $timeoutopts = '<option value="default">' . _('Default') . '</option>'; $timeoutopts .= '<option value="" ' . ($ivr['timeout_recording'] == '' ? 'SELECTED' : '') . '>' . _('None') . '</option>'; foreach ($recordingList as $r) { $checked = $r['id'] == $ivr['timeout_recording'] ? ' SELECTED' : ''; $timeoutopts .= '<option value="' . $r['id'] . '" ' . $checked . '>' . $r['displayname'] . '</option>'; } $hooks = \FreePBX::Ivr()->pageHook($_REQUEST); $hookhtml = ''; foreach ($hooks as $key => $value) { $hookhtml .= $value; } $display_mode = "advanced"; $mode = \FreePBX::Config()->get("FPBXOPMODE"); if (!empty($mode)) { $display_mode = $mode; } ?> <div class="container-fluid"> <h1><?php echo $heading; ?> </h1>