Ejemplo n.º 1
0
function fax_configpageload()
{
    global $currentcomponent;
    global $display;
    $extdisplay = isset($_REQUEST['extdisplay']) ? $_REQUEST['extdisplay'] : '';
    $extensions = isset($_REQUEST['extensions']) ? $_REQUEST['extensions'] : '';
    $users = isset($_REQUEST['users']) ? $_REQUEST['users'] : '';
    if ($display == 'extensions' || $display == 'users') {
        if ($extdisplay != '') {
            $fax = fax_get_user($extdisplay);
            $faxenabled = $fax['faxenabled'];
            $faxemail = $fax['faxemail'];
        }
        //get settings in to variables
        $section = _('Fax');
        $toggleemail = 'if($(this).attr(\'checked\')){$(\'[id^=fax]\').removeAttr(\'disabled\');}else{$(\'[id^=fax]\').attr(\'disabled\',\'true\');$(this).removeAttr(\'disabled\');}';
        //check for fax prequsits, and alert the user if something is amiss
        $fax = fax_detect();
        if (!$fax['module']) {
            //missing modules
            $currentcomponent->addguielem($section, new gui_label('error', '<font color="red">' . _('ERROR: No FAX modules detected! Fax-related dialplan will <b>NOT</b> be generated. This module requires Fax for Asterisk or spandsp based app_fax or app_rxfax to function.') . '</font>'));
        } elseif ($fax['module'] == 'res_fax' && $fax['license'] < 1) {
            //missing licese
            $currentcomponent->addguielem($section, new gui_label('error', '<font color="gray">' . _('NOTICE: No Fax license detected. Fax-related dialplan will not be generated! This module has detected that Fax for Asterisk is installed without a license. At least one license is required (it is available for free) and must be installed.') . '</font>'));
        }
        $usage_list = framework_display_destination_usage(fax_getdest($extdisplay));
        if (!empty($usage_list)) {
            $currentcomponent->addguielem('_top', new gui_link_label('faxdests', "&nbsp;Fax" . $usage_list['text'], $usage_list['tooltip'], true), 5);
        }
        $currentcomponent->addguielem($section, new gui_checkbox('faxenabled', $faxenabled, _('Enabled'), _('Enable this user to receive faxes'), 'true', '', $toggleemail));
        $currentcomponent->addguielem($section, new gui_textbox('faxemail', $faxemail, _('Fax Email'), _('Enter an email address where faxes sent to this extension will be delivered.'), '!isEmail()', _('Please Enter a valid email address for fax delivery.'), TRUE, '', $faxenabled == 'true' ? '' : 'true'));
    }
}
Ejemplo n.º 2
0
function daynight_show_edit($post, $add = "")
{
    global $db;
    global $itemid;
    $fcc = new featurecode('daynight', 'toggle-mode-' . $itemid);
    $code = $fcc->getCodeActive();
    unset($fcc);
    $dests = daynight_get_obj($itemid);
    $password = isset($dests['password']) ? $dests['password'] : '';
    $fc_description = isset($dests['fc_description']) ? $dests['fc_description'] : '';
    $state = isset($dests['state']) ? $dests['state'] : 'DAY';
    $day_recording_id = isset($dests['day_recording_id']) ? $dests['day_recording_id'] : '';
    $night_recording_id = isset($dests['night_recording_id']) ? $dests['night_recording_id'] : '';
    ?>
	<div class="content">
	<h2><?php 
    echo _("Day / Night Mode Control");
    ?>
</h2>
<?php 
    if ($itemid != "") {
        $delURL = $_SERVER['PHP_SELF'] . '?' . $_SERVER['QUERY_STRING'] . '&action=delete';
        $tlabel = sprintf(_("Delete Day/Night Feature Code %s"), $code);
        $label = '<span><img width="16" height="16" border="0" title="' . $tlabel . '" alt="" src="images/core_delete.png"/>&nbsp;' . $tlabel . '</span>';
        ?>
		<a href="<?php 
        echo $delURL;
        ?>
"><?php 
        echo $label;
        ?>
</a><br />
<?php 
        $usage_list = framework_display_destination_usage(daynight_getdest($itemid));
        if (!empty($usage_list)) {
            ?>
			<a href="#" class="info"><?php 
            echo $usage_list['text'] . '<br />';
            ?>
<span><?php 
            echo $usage_list['tooltip'];
            ?>
</span></a>
<?php 
        }
        $timeconditions_refs = daynight_list_timecondition($itemid);
        if (!empty($timeconditions_refs)) {
            echo "<br />";
            foreach ($timeconditions_refs as $ref) {
                $dmode = $ref['dmode'] == 'timeday' ? _("Forces to Day  Mode") : _("Forces to Night Mode");
                $timecondition_id = $ref['dest'];
                $tcURL = $_SERVER['PHP_SELF'] . '?' . "display=timeconditions&itemid={$timecondition_id}";
                $label = '<span><img width="16" height="16" border="0" title="' . sprintf(_("Linked to Time Condition %s - %s"), $timecondition_id, $dmode) . '" alt="" src="images/clock_link.png"/>&nbsp;' . sprintf(_("Linked to Time Condition %s - %s"), $timecondition_id, $dmode) . '</span>';
                ?>
				<a href="<?php 
                echo $tcURL;
                ?>
"><?php 
                echo $label;
                ?>
</a><br />
<?php 
            }
        }
    }
    ?>
	<form name="prompt" action="<?php 
    $_SERVER['PHP_SELF'];
    ?>
" method="post" onsubmit="return prompt_onsubmit();">
	<input type="hidden" name="action" value="edited" />
	<input type="hidden" name="display" value="daynight" />
	<input name="Submit" type="submit" style="display:none;" value="save" />
	<table>
	<tr>
		<td colspan=2><hr />
		</td>
	</tr>
	<tr>
		<td colspan="2">	
		<input name="Submit" type="submit" value="<?php 
    echo _("Save");
    ?>
">
		<?php 
    if ($itemid != '') {
        echo "&nbsp " . sprintf(_("Use feature code: %s to toggle DAY/NIGHT mode"), "<strong>" . $code . "</strong>");
    }
    ?>
		</td>
	</tr>
	<tr>
		<td colspan=2>
		<hr />
		</td>
	</tr>
	<tr>
		<td><a href="#" class="info"><?php 
    echo _("Day/Night Feature Code Index:");
    ?>
		<span><?php 
    echo _("There are a total of 10 Feature code objects, 0-9, each can control a call flow and be toggled using the day/night feature code plus the index.");
    ?>
		</span></a>
		</td>
		<td>
<?php 
    if ($add == "add" && $itemid == "") {
        ?>
			<select name="itemid" tabindex="<?php 
        echo ++$tabindex;
        ?>
">
			<?php 
        $ids = daynight_get_avail();
        foreach ($ids as $id) {
            echo '<option value="' . $id . '" >' . $id . '</option>';
        }
        ?>
			</select>
<?php 
    } else {
        ?>
		<input readonly="yes" size="1" type="text" name="itemid" value="<?php 
        echo $itemid;
        ?>
">
<?php 
    }
    ?>
		</td>
	</tr>
	<tr>
		<td><a href="#" class="info"><?php 
    echo _("Description");
    ?>
:<span><?php 
    echo _("Description for this Day/Night Control");
    ?>
</span></a></td>
		<td><input size="40" type="text" name="fc_description" value="<?php 
    echo $fc_description;
    ?>
" tabindex="<?php 
    echo ++$tabindex;
    ?>
">
		</td>
	</tr>
	<tr>
		<td><a href="#" class="info"><?php 
    echo _("Current Mode:");
    ?>
		<span><?php 
    echo _("This will change the current state for this Day/Night Mode Control, or set the initial state when creating a new one.");
    ?>
		</span></a>
		</td>
		<td>
			<select name="state" tabindex="<?php 
    echo ++$tabindex;
    ?>
">
				<option value="DAY" <?php 
    echo $state == 'DAY' ? 'SELECTED' : '';
    ?>
 ><?php 
    echo _("Day");
    ?>
</option> 
				<option value="NIGHT" <?php 
    echo $state == 'NIGHT' ? 'SELECTED' : '';
    ?>
 ><?php 
    echo _("Night");
    ?>
</option> 
			</select>
		</td>
	</tr>

<?php 
    if (function_exists('recordings_list')) {
        //only include if recordings are enabled
        ?>
	<tr>
		<td><a href="#" class="info"><?php 
        echo _("Recording for Day Mode");
        ?>
<span><?php 
        echo _("Message to be played.<br>To add additional recordings use the \"System Recordings\" MENU to the left");
        ?>
</span></a></td>
		<td>
			<select name="day_recording_id"  tabindex="<?php 
        echo ++$tabindex;
        ?>
">
			<?php 
        $tresults = recordings_list();
        $default = isset($day_recording_id) ? $day_recording_id : '';
        echo '<option value="0">' . _("Default") . "</option>\n";
        if (isset($tresults[0])) {
            foreach ($tresults as $tresult) {
                echo '<option value="' . $tresult['id'] . '"' . ($tresult['id'] == $default ? ' SELECTED' : '') . '>' . $tresult['displayname'] . "</option>\n";
            }
        }
        ?>
			</select>
		</td>
	</tr>
	<tr>
		<td><a href="#" class="info"><?php 
        echo _("Recording for Night Mode");
        ?>
<span><?php 
        echo _("Message to be played.<br>To add additional recordings use the \"System Recordings\" MENU to the left");
        ?>
</span></a></td>
		<td>
			<select name="night_recording_id"  tabindex="<?php 
        echo ++$tabindex;
        ?>
">
			<?php 
        $default = isset($night_recording_id) ? $night_recording_id : '';
        echo '<option value="0">' . _("Default") . "</option>\n";
        if (isset($tresults[0])) {
            foreach ($tresults as $tresult) {
                echo '<option value="' . $tresult['id'] . '"' . ($tresult['id'] == $default ? ' SELECTED' : '') . '>' . $tresult['displayname'] . "</option>\n";
            }
        }
        ?>
			</select>
		</td>
	</tr>

<?php 
    }
    ?>

	<tr>
		<td><a href="#" class="info"><?php 
    echo _("Optional Password");
    ?>
:<span><?php 
    echo _('You can optionally include a password to authenticate before toggling the day/night mode. If left blank anyone can use the feature code and it will be un-protected');
    ?>
</span></a></td>
		<td><input size="12" type="text" name="password" value="<?php 
    echo $password;
    ?>
" tabindex="<?php 
    echo ++$tabindex;
    ?>
">
		</td>
	</tr>
	<tr>
		<td colspan=2>
		<hr />
		</td>
	</tr>
<?php 
    // Draw the destinations
    // returns an array, $dest['day'], $dest['night']
    // and puts null if nothing set
    drawdestinations(0, _("DAY"), isset($dests['day']) ? $dests['day'] : '');
    drawdestinations(1, _("NIGHT"), isset($dests['night']) ? $dests['night'] : '');
    //TODO: Check to make sure a destination radio button was checked, and if custom, that it was not blank
    //
    ?>
	<tr>
		<td colspan=2>	
		<input name="Submit" type="submit" value="<?php 
    echo _("Save");
    ?>
">
		<?php 
    if ($itemid != '') {
        echo "&nbsp " . sprintf(_("Use feature code: %s to toggle DAY/NIGHT mode"), "<strong>" . $code . "</strong>");
    }
    ?>
		</td>
	</tr>
	<tr>
		<td colspan=2>
		<hr />
		</td>
	</tr>
	</table>

	<script language="javascript">
	<!--
	var theForm = document.prompt;

	function prompt_onsubmit() {
		var msgInvalidPassword = "******";

		defaultEmptyOK = true;
		if (!isInteger(theForm.password.value))
			return warnInvalid(theForm.password, msgInvalidPassword);
		return true;
	}
	//-->
	</script>

	</form>
<?php 
}
Ejemplo n.º 3
0
            case 'timeout_recording':
                $ivr[$d] = 'default';
                break;
            case 'timeout_time':
                $ivr[$d] = 10;
                break;
            default:
                $ivr[$d] = '';
                break;
        }
    }
} else {
    $ivr = ivr_get_details($id);
    $heading = _('Edit IVR: ');
    $heading .= $ivr['name'] ? $ivr['name'] : 'ID ' . $ivr['id'];
    $usage_list = framework_display_destination_usage(ivr_getdest($ivr['id']));
    if (!empty($usage_list)) {
        $infohtml = '
		<div class="panel panel-default">
			<div class="panel-heading">
				' . $usage_list['text'] . '
			</div>
			<div class="panel-body">
    			' . $usage_list['tooltip'] . '
			</div>
		</div>
		';
    }
    $delURL = '?display=ivr&action=delete&id=' . $id;
}
$recordingList = recordings_list();
Ejemplo n.º 4
0
<?php

extract($request);
if (empty($action) && empty($id)) {
    $subhead = _("Add Directory");
    $inusehtml = $action = $id = "";
} else {
    $subhead = _("Edit Directory");
    $dir = directory_get_dir_details($request['id']);
    extract($dir);
    $usage_list = framework_display_destination_usage(directory_getdest($id));
    if (!empty($usage_list)) {
        $inusehtml = '
			<div class="panel panel-default">
				<div class="panel-heading">
					<h3 class="panel-title">' . $usage_list['text'] . '</h3>
				</div>
				<div class="panel-body">
					' . $usage_list['tooltip'] . '
				</div>
			</div>
		';
    } else {
        $inusehtml = "";
    }
}
$recoptions = '<option value="0">' . _("Default") . '</option>';
if (function_exists('recordings_list')) {
    foreach (recordings_list() as $r) {
        $selected = !empty($announcement) && $r['id'] == $announcement ? ' SELECTED' : '';
        $recoptions .= "<option value='{$r['id']}'{$selected}>{$r['displayname']}</option>";
Ejemplo n.º 5
0
        ?>
</h2>
<?php 
        $delURL = $_SERVER['PHP_SELF'] . '?' . $_SERVER['QUERY_STRING'] . '&action=delete';
        $tlabel = sprintf(_("Delete Conference %s"), $extdisplay);
        $label = '<span><img width="16" height="16" border="0" title="' . $tlabel . '" alt="" src="images/core_delete.png"/>&nbsp;' . $tlabel . '</span>';
        ?>
					<a href="<?php 
        echo $delURL;
        ?>
"><?php 
        echo $label;
        ?>
</a><br />
<?php 
        $usage_list = framework_display_destination_usage(conferences_getdest($extdisplay));
        if (!empty($usage_list)) {
            ?>
						<a href="#" class="info"><?php 
            echo $usage_list['text'];
            ?>
:<span><?php 
            echo $usage_list['tooltip'];
            ?>
</span></a>
<?php 
        }
        ?>

<?php 
    } else {
Ejemplo n.º 6
0
<?php

//	License for all code of this FreePBX module can be found in the license file inside the module directory
//	Copyright 2015 Sangoma Technologies.
//
extract($request, EXTR_SKIP);
if ($extdisplay != '') {
    // We need to populate grplist with the existing extension list.
    $thisgrp = vmblast_get($extdisplay);
    $grplist = $thisgrp['grplist'];
    $description = $thisgrp['description'];
    $audio_label = $thisgrp['audio_label'];
    $password = $thisgrp['password'];
    $default_group = $thisgrp['default_group'];
    unset($thisgrp);
    $usage_list = framework_display_destination_usage(vmblast_getdest($extdisplay));
    if (!empty($usage_list)) {
        $usagehtml = '<div class="well">';
        $usagehtml .= '<h3>' . $usage_list['text'] . '</h3>';
        $usagehtml .= '<p>' . $usage_list['tooltip'] . '</p>';
        $usagehtml .= '</div>';
    }
    $delURL = '?display=vmblast&action=delGRP&account=' . $extdisplay;
} else {
    $grplist = array();
    $strategy = '';
    $ringing = '';
    $delURL = '';
}
if (function_exists('recordings_list')) {
    $tresults = recordings_list();
Ejemplo n.º 7
0
</h2>
<?php 
    if ($itemid) {
        $delURL = $_SERVER['PHP_SELF'] . '?' . $_SERVER['QUERY_STRING'] . '&action=delete';
        $tlabel = sprintf(_("Delete DISA %s"), $thisItem["displayname"]);
        $label = '<span><img width="16" height="16" border="0" title="' . $tlabel . '" alt="" src="images/core_delete.png"/>&nbsp;' . $tlabel . '</span>';
        ?>
					<a href="<?php 
        echo $delURL;
        ?>
"><?php 
        echo $label;
        ?>
</a>
<?php 
        $usage_list = framework_display_destination_usage(disa_getdest($itemid));
        if (!empty($usage_list)) {
            ?>
						<br /><a href="#" class="info"><?php 
            echo $usage_list['text'];
            ?>
:<span><?php 
            echo $usage_list['tooltip'];
            ?>
</span></a>
<?php 
        }
        ?>

<?php 
    }
Ejemplo n.º 8
0
?>
" tabindex="<?php 
echo ++$tabindex;
?>
">
			<?php 
if ($extdisplay) {
    echo '&nbsp;<input name="delete" type="submit" value="' . _("Delete") . '">';
}
?>
			</td>		
			
			</tr>
			<?php 
if ($extdisplay) {
    $usage_list = framework_display_destination_usage(announcement_getdest($extdisplay));
    if (!empty($usage_list)) {
        ?>
					<tr><td colspan="2">
					<a href="#" class="info"><?php 
        echo $usage_list['text'];
        ?>
:<span><?php 
        echo $usage_list['tooltip'];
        ?>
</span></a>
					</td></tr>
				<?php 
    }
}
?>
Ejemplo n.º 9
0
<?php 
    if ($itemid) {
        $thisItem = timeconditions_get($itemid);
        $delURL = $_SERVER['PHP_SELF'] . '?' . $_SERVER['QUERY_STRING'] . '&action=delete';
        $tlabel = sprintf(_("Delete Time Condition: %s"), trim($thisItem['displayname']) == '' ? $itemid : $thisItem['displayname'] . " ({$itemid}) ");
        $label = '<span><img width="16" height="16" border="0" title="' . $tlabel . '" alt="" src="images/core_delete.png"/>&nbsp;' . $tlabel . '</span>';
        ?>
		<a href="<?php 
        echo $delURL;
        ?>
"><?php 
        echo $label;
        ?>
</a><br />
<?php 
        $usage_list = framework_display_destination_usage(timeconditions_getdest($itemid));
        if (!empty($usage_list)) {
            ?>
			<a href="#" class="info"><?php 
            echo $usage_list['text'];
            ?>
:<span><?php 
            echo $usage_list['tooltip'];
            ?>
</span></a>
<?php 
        }
    }
    ?>
	<form autocomplete="off" name="edit" action="<?php 
    $_SERVER['PHP_SELF'];
Ejemplo n.º 10
0
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"/>&nbsp;' . $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 &nbsp; needs to be here instead of a space, guielements freaks for some reason with this specific section name
        $section = _('Directory&nbsp;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']), ''));
    }
}
Ejemplo n.º 11
0
function core_users_configpageload()
{
    global $currentcomponent;
    global $amp_conf;
    // Ensure variables possibly extracted later exist
    $name = $outboundcid = $record_in = $record_out = $sipname = $cid_masquerade = $newdid_name = $newdid = $newdidcid = $call_screen = $pinless = null;
    // Init vars from $_REQUEST[]
    $display = isset($_REQUEST['display']) ? $_REQUEST['display'] : null;
    $action = isset($_REQUEST['action']) ? $_REQUEST['action'] : null;
    $extdisplay = isset($_REQUEST['extdisplay']) ? $_REQUEST['extdisplay'] : null;
    $tech_hardware = isset($_REQUEST['tech_hardware']) ? $_REQUEST['tech_hardware'] : null;
    if ($action == 'del') {
        // Deleted
        $currentcomponent->addguielem('_top', new gui_subheading('del', $extdisplay . ' ' . _("deleted"), false));
    } elseif ($display == 'extensions' && ($extdisplay == '' && $tech_hardware == '')) {
        // Adding
        // do nothing as you want the Devices to handle this bit
    } else {
        $delURL = $_SERVER['PHP_SELF'] . '?' . $_SERVER['QUERY_STRING'] . '&action=del';
        if (is_string($extdisplay)) {
            if (!isset($GLOBALS['abort']) || $GLOBALS['abort'] !== true) {
                $extenInfo = core_users_get($extdisplay);
                extract($extenInfo);
            }
            if (isset($deviceInfo) && is_array($deviceInfo)) {
                extract($deviceInfo);
            }
            if ($display == 'extensions') {
                $currentcomponent->addguielem('_top', new gui_pageheading('title', _("Extension") . ": {$extdisplay}", false), 0);
                if (!isset($GLOBALS['abort']) || $GLOBALS['abort'] !== true) {
                    $tlabel = sprintf(_("Delete Extension %s"), $extdisplay);
                    $label = '<span><img width="16" height="16" border="0" title="' . $tlabel . '" alt="" src="images/user_delete.png"/>&nbsp;' . $tlabel . '</span>';
                    $currentcomponent->addguielem('_top', new gui_link('del', $label, $delURL, true, false), 0);
                    $usage_list = framework_display_destination_usage(core_getdest($extdisplay));
                    if (!empty($usage_list)) {
                        $currentcomponent->addguielem('_top', new gui_link_label('dests', $usage_list['text'], $usage_list['tooltip'], true), 0);
                    }
                }
            } else {
                $currentcomponent->addguielem('_top', new gui_pageheading('title', _("User") . ": {$extdisplay}", false), 0);
                if (!isset($GLOBALS['abort']) || $GLOBALS['abort'] !== true) {
                    $tlabel = sprintf(_("Delete User %s"), $extdisplay);
                    $label = '<span><img width="16" height="16" border="0" title="' . $tlabel . '" alt="" src="images/user_delete.png"/>&nbsp;' . $tlabel . '</span>';
                    $currentcomponent->addguielem('_top', new gui_link('del', $label, $delURL, true, false), 0);
                    $usage_list = framework_display_destination_usage(core_getdest($extdisplay));
                    if (!empty($usage_list)) {
                        $currentcomponent->addguielem('_top', new gui_link_label('dests', $usage_list['text'], $usage_list['tooltip'], true), 0);
                    }
                }
            }
        } elseif ($display != 'extensions') {
            $currentcomponent->addguielem('_top', new gui_pageheading('title', _("Add User/Extension")), 0);
        }
        // Setup vars for use in the gui later on
        $fc_logon = featurecodes_getFeatureCode('core', 'userlogon');
        $fc_logoff = featurecodes_getFeatureCode('core', 'userlogoff');
        $msgInvalidExtNum = _("Please enter a valid extension number.");
        $msgInvalidCidNum = _("Please enter a valid CID Num Alias (must be a valid number).");
        $msgInvalidExtPwd = _("Please enter valid User Password using numbers only");
        $msgInvalidDispName = _("Please enter a valid Display Name");
        $msgInvalidOutboundCID = _("Please enter a valid Outbound CID");
        $msgInvalidPause = _("Please enter a valid pause time in seconds, using digits only");
        $msgInvalidDIDNum = _("You have entered a non-standard dialpattern for your DID. You can only enter standard dialpatterns. You must use the inbound routing form to enter non-standard patterns");
        $msgInvalidCIDNum = _("Please enter a valid Caller ID Number or leave it blank for your Assigned DID/CID pair");
        // This is the actual gui stuff
        $currentcomponent->addguielem('_top', new gui_hidden('action', $extdisplay ? 'edit' : 'add'));
        $currentcomponent->addguielem('_top', new gui_hidden('extdisplay', $extdisplay));
        if ($display == 'extensions') {
            $section = $extdisplay ? _("Edit Extension") : _("Add Extension");
        } else {
            $section = $extdisplay ? _("Edit User") : _("Add User");
        }
        if (trim($extdisplay) != '') {
            $currentcomponent->addguielem($section, new gui_hidden('extension', $extdisplay), 2);
        } else {
            $currentcomponent->addguielem($section, new gui_textbox('extension', $extdisplay, _("User Extension"), _("The extension number to dial to reach this user."), '!isInteger()', $msgInvalidExtNum, false), 3);
        }
        if ($display != 'extensions') {
            $currentcomponent->addguielem($section, new gui_password('password', $password, _("User Password"), _("A user will enter this password when logging onto a device.") . ' ' . $fc_logon . ' ' . _("logs into a device.") . ' ' . $fc_logoff . ' ' . _("logs out of a device."), '!isInteger() && !isWhitespace()', $msgInvalidExtPwd, true));
            // extra JS function check required for blank password warning -- call last in the onsubmit() function
            $currentcomponent->addjsfunc('onsubmit()', "\treturn checkBlankUserPwd();\n", 9);
        }
        $currentcomponent->addguielem($section, new gui_textbox('name', $name, _("Display Name"), _("The caller id name for calls from this user will be set to this name. Only enter the name, NOT the number."), '!isAlphanumeric() || isWhitespace()', $msgInvalidDispName, false));
        $cid_masquerade = trim($cid_masquerade) == $extdisplay ? "" : $cid_masquerade;
        $currentcomponent->addguielem($section, new gui_textbox('cid_masquerade', $cid_masquerade, _("CID Num Alias"), _("The CID Number to use for internal calls, if different from the extension number. This is used to masquerade as a different user. A common example is a team of support people who would like their internal callerid to display the general support number (a ringgroup or queue). There will be no effect on external calls."), '!isWhitespace() && !isInteger()', $msgInvalidCidNum, false));
        $currentcomponent->addguielem($section, new gui_textbox('sipname', $sipname, _("SIP Alias"), _("If you want to support direct sip dialing of users internally or through anonymous sip calls, you can supply a friendly name that can be used in addition to the users extension to call them.")));
        // If user mode, list devices associated with this user
        //
        if ($display == 'users' && trim($extdisplay != '')) {
            $section = _("User Devices");
            $device_list = core_devices_list('all', 'full');
            usort($device_list, 'dev_grp');
            $link_count = 0;
            foreach ($device_list as $device_item) {
                if ($device_item['user'] == $extdisplay) {
                    $editURL = $_SERVER['PHP_SELF'] . '?type=setup&display=devices&skip=0&extdisplay=' . $device_item['id'];
                    $device_icon = $device_item['devicetype'] == 'fixed' ? 'images/telephone_key.png' : 'images/telephone_edit.png';
                    $device_label = '&nbsp;';
                    $device_label .= _("Edit:");
                    $device_label .= '&nbsp;' . $device_item['id'] . '&nbsp;' . $device_item['description'];
                    $device_label = '<span>
						<img width="16" height="16" border="0" title="Edit Device" alt="Edit Device" src="' . $device_icon . '"/>' . $device_label . '</span> ';
                    $currentcomponent->addguielem($section, new gui_link('dev' . $link_count++, $device_label, $editURL, true, false), 2);
                }
            }
        }
        $section = _("Extension Options");
        $currentcomponent->addguielem($section, new gui_textbox('outboundcid', $outboundcid, _("Outbound CID"), _("Overrides the caller id when dialing out a trunk. Any setting here will override the common outbound caller id set in the Trunks admin.<br><br>Format: <b>\"caller name\" &lt;#######&gt;</b><br><br>Leave this field blank to disable the outbound callerid feature for this user."), '!isCallerID()', $msgInvalidOutboundCID, true), 3);
        $ringtimer = isset($ringtimer) ? $ringtimer : '0';
        $currentcomponent->addguielem($section, new gui_selectbox('ringtimer', $currentcomponent->getoptlist('ringtime'), $ringtimer, _("Ring Time"), _("Number of seconds to ring prior to going to voicemail. Default will use the value set in the General Tab. If no voicemail is configured this will be ignored."), false));
        if (!isset($callwaiting)) {
            if ($amp_conf['ENABLECW']) {
                $callwaiting = 'enabled';
            } else {
                $callwaiting = 'disabled';
            }
        }
        $currentcomponent->addguielem($section, new gui_selectbox('callwaiting', $currentcomponent->getoptlist('callwaiting'), $callwaiting, _("Call Waiting"), _("Set the initial/current Call Waiting state for this user's extension"), false));
        $currentcomponent->addguielem($section, new gui_selectbox('call_screen', $currentcomponent->getoptlist('call_screen'), $call_screen, _("Call Screening"), _("Call Screening requires external callers to say their name, which will be played back to the user and allow the user to accept or reject the call.  Screening with memory only verifies a caller for their caller-id once. Screening without memory always requires a caller to say their name. Either mode will always announce the caller based on the last introduction saved with that callerid. If any user on the system uses the memory option, when that user is called, the caller will be required to re-introduce themselves and all users on the system will have that new introduction associated with the caller's CallerId."), false));
        $currentcomponent->addguielem($section, new gui_selectbox('pinless', $currentcomponent->getoptlist('pinless'), $pinless, _("Pinless Dialing"), _("Enabling Pinless Dialing will allow this extension to bypass any pin codes normally required on outbound calls"), false));
        $section = _("Assigned DID/CID");
        $currentcomponent->addguielem($section, new gui_textbox('newdid_name', $newdid_name, _("DID Description"), _("A description for this DID, such as \"Fax\"")), 4);
        $currentcomponent->addguielem($section, new gui_textbox('newdid', $newdid, _("Add Inbound DID"), _("A direct DID that is associated with this extension. The DID should be in the same format as provided by the provider (e.g. full number, 4 digits for 10x4, etc).<br><br>Format should be: <b>XXXXXXXXXX</b><br><br>.An optional CID can also be associated with this DID by setting the next box"), '!isDialpattern()', $msgInvalidDIDNum, true), 4);
        $currentcomponent->addguielem($section, new gui_textbox('newdidcid', $newdidcid, _("Add Inbound CID"), _("Add a CID for more specific DID + CID routing. A DID must be specified in the above Add DID box. In addition to standard dial sequences, you can also put Private, Blocked, Unknown, Restricted, Anonymous and Unavailable in order to catch these special cases if the Telco transmits them."), "!frm_{$display}_isValidCID()", $msgInvalidCIDNum, true), 4);
        $dids = core_did_list('extension');
        $did_count = 0;
        foreach ($dids as $did) {
            $did_dest = split(',', $did['destination']);
            if (isset($did_dest[1]) && $did_dest[1] == $extdisplay) {
                $did_title = $did['description'] != '' ? $did['description'] : _("DID / CID");
                $addURL = $_SERVER['PHP_SELF'] . '?type=setup&display=did&&extdisplay=' . $did['extension'] . '/' . $did['cidnum'];
                $did_icon = 'images/email_edit.png';
                $did_label = trim($did['extension']) == '' ? ' ' . _("Any DID") : ' ' . $did['extension'];
                if (trim($did['cidnum']) != '') {
                    $did_label .= ' / ' . $did['cidnum'];
                }
                if (trim($did['description']) != '') {
                    $did_label .= ' (' . $did['description'] . ')';
                }
                $did_label = '&nbsp;<span>
					<img width="16" height="16" border="0" title="' . $did_title . '" alt="" src="' . $did_icon . '"/>' . $did_label . '</span> ';
                $currentcomponent->addguielem($section, new gui_link('did_' . $did_count++, $did_label, $addURL, true, false), 4);
            }
        }
        $section = _("Recording Options");
        $currentcomponent->addguielem($section, new gui_selectbox('record_in', $currentcomponent->getoptlist('recordoptions'), $record_in, _("Record Incoming"), _("Record all inbound calls received at this extension."), false));
        $currentcomponent->addguielem($section, new gui_selectbox('record_out', $currentcomponent->getoptlist('recordoptions'), $record_out, _("Record Outgoing"), _("Record all outbound calls received at this extension."), false));
    }
}
Ejemplo n.º 12
0
function core_users_configpageload()
{
    global $currentcomponent;
    global $amp_conf;
    // Ensure variables possibly extracted later exist
    $name = $outboundcid = $sipname = $cid_masquerade = $newdid_name = $newdid = $newdidcid = $call_screen = $pinless = null;
    // Init vars from $_REQUEST[]
    $display = isset($_REQUEST['display']) ? $_REQUEST['display'] : null;
    $action = isset($_REQUEST['action']) ? $_REQUEST['action'] : null;
    $extdisplay = isset($_REQUEST['extdisplay']) ? $_REQUEST['extdisplay'] : null;
    $tech_hardware = isset($_REQUEST['tech_hardware']) ? $_REQUEST['tech_hardware'] : null;
    if ($action == 'del') {
        // Deleted
        $currentcomponent->addguielem('_top', new gui_subheading('del', $extdisplay . ' ' . _("deleted"), false));
    } elseif ($display == 'extensions' && ($extdisplay == '' && $tech_hardware == '')) {
        // Adding
        // do nothing as you want the Devices to handle this bit
    } else {
        $delURL = '?' . $_SERVER['QUERY_STRING'] . '&action=del';
        if (is_string($extdisplay)) {
            if (!isset($GLOBALS['abort']) || $GLOBALS['abort'] !== true) {
                $extenInfo = core_users_get($extdisplay);
                extract($extenInfo);
            }
            if (isset($deviceInfo) && is_array($deviceInfo)) {
                extract($deviceInfo);
            }
            if ($display == 'extensions') {
                $currentcomponent->addguielem('_top', new gui_pageheading('title', _("Extension") . ": {$extdisplay}", false), 0);
                if (!isset($GLOBALS['abort']) || $GLOBALS['abort'] !== true) {
                    $tlabel = sprintf(_("Delete Extension %s"), $extdisplay);
                    $label = '<span><img width="16" height="16" border="0" title="' . $tlabel . '" alt="" src="images/user_delete.png"/>&nbsp;' . $tlabel . '</span>';
                    $currentcomponent->addguielem('_top', new gui_link('del', $label, $delURL, true, false), 0);
                    $usage_list = framework_display_destination_usage(core_getdest($extdisplay));
                    if (!empty($usage_list)) {
                        $currentcomponent->addguielem('_top', new gui_link_label('dests', $usage_list['text'], $usage_list['tooltip'], true), 0);
                    }
                }
            } else {
                $currentcomponent->addguielem('_top', new gui_pageheading('title', _("User") . ": {$extdisplay}", false), 0);
                if (!isset($GLOBALS['abort']) || $GLOBALS['abort'] !== true) {
                    $tlabel = sprintf(_("Delete User %s"), $extdisplay);
                    $label = '<span><img width="16" height="16" border="0" title="' . $tlabel . '" alt="" src="images/user_delete.png"/>&nbsp;' . $tlabel . '</span>';
                    $currentcomponent->addguielem('_top', new gui_link('del', $label, $delURL, true, false), 0);
                    $usage_list = framework_display_destination_usage(core_getdest($extdisplay));
                    if (!empty($usage_list)) {
                        $currentcomponent->addguielem('_top', new gui_link_label('dests', $usage_list['text'], $usage_list['tooltip'], true), 0);
                    }
                }
            }
        } elseif ($display != 'extensions') {
            $currentcomponent->addguielem('_top', new gui_pageheading('title', _("Add User/Extension")), 0);
        }
        // Setup vars for use in the gui later on
        $fc_logon = featurecodes_getFeatureCode('core', 'userlogon');
        $fc_logoff = featurecodes_getFeatureCode('core', 'userlogoff');
        $msgInvalidExtNum = _("Please enter a valid extension number.");
        $msgInvalidCidNum = _("Please enter a valid CID Num Alias (must be a valid number).");
        $msgInvalidExtPwd = _("Please enter valid User Password using numbers only");
        $msgInvalidDispName = _("Please enter a valid Display Name");
        $msgInvalidOutboundCID = _("Please enter a valid Outbound CID");
        $msgInvalidPause = _("Please enter a valid pause time in seconds, using digits only");
        $msgInvalidDIDNum = _("You have entered a non-standard dialpattern for your DID. You can only enter standard dialpatterns. You must use the inbound routing form to enter non-standard patterns");
        $msgInvalidCIDNum = _("Please enter a valid CallerID Number or leave it blank for your Assigned DID/CID pair");
        // This is the actual gui stuff
        $currentcomponent->addguielem('_top', new gui_hidden('action', $extdisplay ? 'edit' : 'add'));
        $currentcomponent->addguielem('_top', new gui_hidden('extdisplay', $extdisplay));
        if ($display == 'extensions') {
            $section = $extdisplay ? _("Edit Extension") : _("Add Extension");
        } else {
            $section = $extdisplay ? _("Edit User") : _("Add User");
        }
        if (trim($extdisplay) != '') {
            $currentcomponent->addguielem($section, new gui_hidden('extension', $extdisplay), 2);
        } else {
            $currentcomponent->addguielem($section, new gui_textbox('extension', $extdisplay, _("User Extension"), _("The extension number to dial to reach this user."), '!isInteger()', $msgInvalidExtNum, false), 3);
        }
        if ($display != 'extensions') {
            $currentcomponent->addguielem($section, new gui_password('password', $password, _("User Password"), _("A user will enter this password when logging onto a device.") . ' ' . $fc_logon . ' ' . _("logs into a device.") . ' ' . $fc_logoff . ' ' . _("logs out of a device."), '!isInteger() && !isWhitespace()', $msgInvalidExtPwd, true));
            // extra JS function check required for blank password warning -- call last in the onsubmit() function
            $currentcomponent->addjsfunc('onsubmit()', "\treturn checkBlankUserPwd();\n", 9);
        }
        if ($action == 'add') {
            $currentcomponent->addjsfunc('onsubmit()', "\n\t\t\tvar exten = \$('#extension').val();\n\t\t\tvar ajax_result = true;\n\t\t\t\$('#error').remove();\n\t\t\t\$.ajax({\n\t\t\t\ttype: 'POST',\n\t\t\t\turl: 'config.php',\n\t\t\t\tdata: 'handler=api&function=framework_get_conflict_url_helper&args=' + exten,\n\t\t\t\tdataType: 'json',\n\t\t\t\tcache: false,\n\t\t\t\tasync: false,\n\t\t\t\tsuccess: function(data, textStatus, XMLHttpRequest) {\n\t\t\t\t\tif (data.length !== 0) {\n\t\t\t\t\t\t\$('#title').after('<div id=\"error\"><h5>" . _("Conflicting Extensions") . "</h5>' + data + '</div>');\n\t\t\t\t\t\tajax_result = false;\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\terror: function(data) {\n\t\t\t\t\tconsole.log('an error was recevied: ' + data);\n\t\t\t\t\t// TODO: Should we stop the submital and do something here?\n\t\t\t\t}\n\t\t\t});\n\t\t\tif (!ajax_result) {\n\t\t\t\talert('" . _("Extension number conflict, please choose another.") . "');\n\t\t\t\t\$('#extension').focus();\n\t\t\t\treturn false;\n\t\t\t}", 9);
        }
        $currentcomponent->addguielem($section, new gui_textbox('name', $name, _("Display Name"), _("The CallerID name for calls from this user will be set to this name. Only enter the name, NOT the number."), '(typeof isCorrectLengthExtensions != "undefined") ? !isCorrectLengthExtensions() || !isAlphanumeric() || isWhitespace() : !isAlphanumeric() || isWhitespace()', $msgInvalidDispName, false));
        $cid_masquerade = trim($cid_masquerade) == $extdisplay ? "" : $cid_masquerade;
        $currentcomponent->addguielem($section, new gui_textbox('cid_masquerade', $cid_masquerade, _("CID Num Alias"), _("The CID Number to use for internal calls, if different from the extension number. This is used to masquerade as a different user. A common example is a team of support people who would like their internal CallerID to display the general support number (a ringgroup or queue). There will be no effect on external calls."), '!isWhitespace() && !isInteger()', $msgInvalidCidNum, false));
        $currentcomponent->addguielem($section, new gui_textbox('sipname', $sipname, _("SIP Alias"), _("If you want to support direct sip dialing of users internally or through anonymous sip calls, you can supply a friendly name that can be used in addition to the users extension to call them.")));
        // If user mode, list devices associated with this user
        //
        if ($display == 'users' && trim($extdisplay != '')) {
            $section = _("User Devices");
            $device_list = core_devices_list('all', 'full');
            usort($device_list, 'dev_grp');
            $link_count = 0;
            foreach ($device_list as $device_item) {
                if ($device_item['user'] == $extdisplay) {
                    $editURL = '?display=devices&skip=0&extdisplay=' . $device_item['id'];
                    $device_icon = $device_item['devicetype'] == 'fixed' ? 'images/telephone_key.png' : 'images/telephone_edit.png';
                    $device_label = '&nbsp;';
                    $device_label .= _("Edit:");
                    $device_label .= '&nbsp;' . $device_item['id'] . '&nbsp;' . $device_item['description'];
                    $device_label = '<span>
					<img width="16" height="16" border="0" title="Edit Device" alt="Edit Device" src="' . $device_icon . '"/>' . $device_label . '</span> ';
                    $currentcomponent->addguielem($section, new gui_link('dev' . $link_count++, $device_label, $editURL, true, false), 2);
                }
            }
        }
        $section = _("Extension Options");
        $currentcomponent->addguielem($section, new gui_textbox('outboundcid', $outboundcid, _("Outbound CID"), _("Overrides the CallerID when dialing out a trunk. Any setting here will override the common outbound CallerID set in the Trunks admin.<br><br>Format: <b>\"caller name\" &lt;#######&gt;</b><br><br>Leave this field blank to disable the outbound CallerID feature for this user."), '!isCallerID()', $msgInvalidOutboundCID, true), 3);
        $ringtimer = isset($ringtimer) ? $ringtimer : '0';
        $dialopts = isset($dialopts) ? $dialopts : false;
        $disable_dialopts = $dialopts === false;
        $currentcomponent->addguielem($section, new gui_textbox_check('dialopts', $dialopts, _("Asterisk Dial Options"), _("Cryptic Asterisk Dial Options, check to customize for this extension or un-check to use system defaults set in Advanced Options. These will not apply to trunk options which are configured with the trunk."), '', '', true, 0, $disable_dialopts, '<small>' . _("Override") . '</small>', $amp_conf['DIAL_OPTIONS'], true));
        $currentcomponent->addguielem($section, new gui_selectbox('ringtimer', $currentcomponent->getoptlist('ringtime'), $ringtimer, _("Ring Time"), _("Number of seconds to ring prior to going to voicemail. Default will use the value set in Advanced Settings. If no voicemail is configured this will be ignored."), false));
        if (!isset($cfringtimer)) {
            if ($amp_conf['CFRINGTIMERDEFAULT'] < 0 || ctype_digit($amp_conf['CFRINGTIMERDEFAULT'])) {
                $cfringtimer = $amp_conf['CFRINGTIMERDEFAULT'] < 0 ? -1 : ($amp_conf['CFRINGTIMERDEFAULT'] > 120 ? 120 : $amp_conf['CFRINGTIMERDEFAULT']);
            } else {
                $cfringtimer = 0;
            }
        }
        $currentcomponent->addguielem($section, new gui_selectbox('cfringtimer', $currentcomponent->getoptlist('cfringtime'), $cfringtimer, _("Call Forward Ring Time"), _("Number of seconds to ring during a Call Forward, Call Forward Busy or Call Forward Unavailable call prior to continuing to voicemail or specified destination. Setting to Always will not return, it will just continue to ring. Default will use the current Ring Time. If voicemail is disabled and their is not destination specified, it will be forced into Always mode"), false));
        if (!isset($callwaiting)) {
            if ($amp_conf['ENABLECW']) {
                $callwaiting = 'enabled';
            } else {
                $callwaiting = 'disabled';
            }
        }
        $concurrency_limit = isset($concurrency_limit) ? $concurrency_limit : $amp_conf['CONCURRENCYLIMITDEFAULT'];
        $currentcomponent->addguielem($section, new gui_selectbox('concurrency_limit', $currentcomponent->getoptlist('concurrency_limit'), $concurrency_limit, _("Outbound Concurrency Limit"), _("Maximum number of outbound simultaneous calls that an extension can make. This is also very useful as a Security Protection against a system that has been compromised. It will limit the number of simultaneous calls that can be made on the compromised extension."), false));
        $currentcomponent->addguielem($section, new gui_selectbox('callwaiting', $currentcomponent->getoptlist('callwaiting'), $callwaiting, _("Call Waiting"), _("Set the initial/current Call Waiting state for this user's extension"), false));
        if (function_exists('paging_get_config')) {
            $answermode = isset($answermode) ? $answermode : $amp_conf['DEFAULT_INTERNAL_AUTO_ANSWER'];
            $currentcomponent->addguielem($section, new gui_selectbox('answermode', $currentcomponent->getoptlist('answermode'), $answermode, _("Internal Auto Answer"), _("When set to Intercom, calls to this extension/user from other internal users act as if they were intercom calls meaning they will be auto-answered if the endpoint supports this feature and the system is configured to operate in this mode. All the normal white list and black list settings will be honored if they are set. External calls will still ring as normal, as will certain other circumstances such as blind transfers and when a Follow Me is configured and enabled. If Disabled, the phone rings as a normal phone."), false));
        }
        $currentcomponent->addguielem($section, new gui_selectbox('call_screen', $currentcomponent->getoptlist('call_screen'), $call_screen, _("Call Screening"), _("Call Screening requires external callers to say their name, which will be played back to the user and allow the user to accept or reject the call.  Screening with memory only verifies a caller for their CallerID once. Screening without memory always requires a caller to say their name. Either mode will always announce the caller based on the last introduction saved with that CallerID. If any user on the system uses the memory option, when that user is called, the caller will be required to re-introduce themselves and all users on the system will have that new introduction associated with the caller's CallerID."), false));
        $currentcomponent->addguielem($section, new gui_selectbox('pinless', $currentcomponent->getoptlist('pinless'), $pinless, _("Pinless Dialing"), _("Enabling Pinless Dialing will allow this extension to bypass any pin codes normally required on outbound calls"), false));
        $section = _("Assigned DID/CID");
        $currentcomponent->addguielem($section, new gui_textbox('newdid_name', $newdid_name, _("DID Description"), _("A description for this DID, such as \"Fax\"")), 4);
        $currentcomponent->addguielem($section, new gui_textbox('newdid', $newdid, _("Add Inbound DID"), _("A direct DID that is associated with this extension. The DID should be in the same format as provided by the provider (e.g. full number, 4 digits for 10x4, etc).<br><br>Format should be: <b>XXXXXXXXXX</b><br><br>.An optional CID can also be associated with this DID by setting the next box"), '!isDialpattern()', $msgInvalidDIDNum, true), 4);
        $currentcomponent->addguielem($section, new gui_textbox('newdidcid', $newdidcid, _("Add Inbound CID"), _("Add a CID for more specific DID + CID routing. A DID must be specified in the above Add DID box. In addition to standard dial sequences, you can also put Private, Blocked, Unknown, Restricted, Anonymous, Withheld and Unavailable in order to catch these special cases if the Telco transmits them."), "!frm_{$display}_isValidCID()", $msgInvalidCIDNum, true), 4);
        $dids = core_did_list('extension');
        $did_count = 0;
        foreach ($dids as $did) {
            $did_dest = preg_split('/,/', $did['destination']);
            if (isset($did_dest[1]) && $did_dest[1] === $extdisplay) {
                $did_title = $did['description'] != '' ? $did['description'] : _("DID / CID");
                $addURL = '?display=did&&extdisplay=' . $did['extension'] . '/' . $did['cidnum'];
                $did_icon = 'images/email_edit.png';
                $did_label = trim($did['extension']) == '' ? ' ' . _("Any DID") : ' ' . $did['extension'];
                if (trim($did['cidnum']) != '') {
                    $did_label .= ' / ' . $did['cidnum'];
                }
                if (trim($did['description']) != '') {
                    $did_label .= ' (' . $did['description'] . ')';
                }
                $did_label = '&nbsp;<span>
				<img width="16" height="16" border="0" title="' . $did_title . '" alt="" src="' . $did_icon . '"/>' . $did_label . '</span> ';
                $currentcomponent->addguielem($section, new gui_link('did_' . $did_count++, $did_label, $addURL, true, false), 4);
            }
        }
        $section = _("Recording Options");
        $recording_in_external = isset($recording_in_external) ? $recording_in_external : 'dontcare';
        $recording_out_external = isset($recording_out_external) ? $recording_out_external : 'dontcare';
        $recording_in_internal = isset($recording_in_internal) ? $recording_in_internal : 'dontcare';
        $recording_out_internal = isset($recording_out_internal) ? $recording_out_internal : 'dontcare';
        $recording_ondemand = isset($recording_ondemand) ? $recording_ondemand : 'disabled';
        $recording_priority = isset($recording_priority) ? $recording_priority : '10';
        $currentcomponent->addguielem($section, new gui_radio('recording_in_external', $currentcomponent->getoptlist('recording_options'), $recording_in_external, _('Inbound External Calls'), _("Recording of inbound calls from external sources.")));
        $currentcomponent->addguielem($section, new gui_radio('recording_out_external', $currentcomponent->getoptlist('recording_options'), $recording_out_external, _('Outbound External Calls'), _("Recording of outbound calls to external sources.")));
        $currentcomponent->addguielem($section, new gui_radio('recording_in_internal', $currentcomponent->getoptlist('recording_options'), $recording_in_internal, _('Inbound Internal Calls'), _("Recording of calls received from other extensions on the system.")));
        $currentcomponent->addguielem($section, new gui_radio('recording_out_internal', $currentcomponent->getoptlist('recording_options'), $recording_out_internal, _('Outbound Internal Calls'), _("Recording of calls made to other extensions on the system.")));
        $currentcomponent->addguielem($section, new gui_radio('recording_ondemand', $currentcomponent->getoptlist('recording_ondemand_options'), $recording_ondemand, _('On Demand Recording'), _("Enable or disable the ability to do on demand (one-touch) recording. The overall calling policy rules still apply and if calls are already being recorded by 'Force' or 'Never', the can not be paused unless 'Override' is selected..")));
        $currentcomponent->addguielem($section, new gui_selectbox('recording_priority', $currentcomponent->getoptlist('recording_priority_options'), $recording_priority, _("Record Priority Policy"), _("Call recording policy priority relative to other extensions when there is a conflict between an extension wanting recording and the other not wanting it. The higher of the two determines the policy, on a tie the global policy (caller or callee) determines the policy."), false));
        $section = _("Optional Destinations");
        $noanswer_dest = isset($noanswer_dest) ? $noanswer_dest : '';
        $busy_dest = isset($busy_dest) ? $busy_dest : '';
        $chanunavail_dest = isset($chanunavail_dest) ? $chanunavail_dest : '';
        $noanswer_cid = isset($noanswer_cid) ? $noanswer_cid : '';
        $busy_cid = isset($busy_cid) ? $busy_cid : '';
        $chanunavail_cid = isset($chanunavail_cid) ? $chanunavail_cid : '';
        if ($amp_conf['CWINUSEBUSY']) {
            $helptext = _('Optional destination call is routed to when the call is not answered on an otherwise idle phone. If the phone is in use and the call is simply ignored, then the busy destination will be used.');
        } else {
            $helptext = _('Optional destination call is routed to when the call is not answered.');
        }
        $nodest_msg = _('Unavail Voicemail if Enabled');
        $currentcomponent->addguielem($section, new gui_drawselects('noanswer_dest', '0', $noanswer_dest, _('No Answer'), $helptext, false, '', $nodest_msg), 5, 9);
        $currentcomponent->addguielem($section, new gui_textbox('noanswer_cid', $noanswer_cid, '&nbsp;&nbsp;' . _("CID Prefix"), _("Optional CID Prefix to add before sending to this no answer destination.")), 5, 9);
        if ($amp_conf['CWINUSEBUSY']) {
            $helptext = _('Optional destination the call is routed to when the phone is busy or the call is rejected by the user. This destination is also used on an unanswered call if the phone is in use and the user chooses not to pickup the second call.');
        } else {
            $helptext = _('Optional destination the call is routed to when the phone is busy or the call is rejected by the user.');
        }
        $nodest_msg = _('Busy Voicemail if Enabled');
        $currentcomponent->addguielem($section, new gui_drawselects('busy_dest', '1', $busy_dest, _('Busy'), $helptext, false, '', $nodest_msg), 5, 9);
        $currentcomponent->addguielem($section, new gui_textbox('busy_cid', $busy_cid, '&nbsp;&nbsp;' . _("CID Prefix"), _("Optional CID Prefix to add before sending to this busy destination.")), 5, 9);
        $helptext = _('Optional destination the call is routed to when the phone is offline, such as a softphone currently off or a phone unplugged.');
        $nodest_msg = _('Unavail Voicemail if Enabled');
        $currentcomponent->addguielem($section, new gui_drawselects('chanunavail_dest', '2', $chanunavail_dest, _('Not Reachable'), $helptext, false, '', $nodest_msg), 5, 9);
        $currentcomponent->addguielem($section, new gui_textbox('chanunavail_cid', $chanunavail_cid, '&nbsp;&nbsp;' . _("CID Prefix"), _("Optional CID Prefix to add before sending to this not reachable destination.")), 5, 9);
    }
}
Ejemplo n.º 13
0
if ($action == 'delGRP') {
    echo '<br><h3>' . _("VMBlast Group") . ' ' . $account . ' ' . _("deleted") . '!</h3><br><br><br><br><br><br><br><br>';
} else {
    if ($extdisplay) {
        // We need to populate grplist with the existing extension list.
        $thisgrp = vmblast_get(ltrim($extdisplay, 'GRP-'));
        $grplist = $thisgrp['grplist'];
        $description = $thisgrp['description'];
        $audio_label = $thisgrp['audio_label'];
        $password = $thisgrp['password'];
        $default_group = $thisgrp['default_group'];
        unset($thisgrp);
        $delButton = "\n\t\t\t<form name=delete action=\"{$_SERVER['PHP_SELF']}\" method=POST>\n\t\t\t\t<input type=\"hidden\" name=\"display\" value=\"{$dispnum}\">\n\t\t\t\t<input type=\"hidden\" name=\"account\" value=\"" . ltrim($extdisplay, 'GRP-') . "\">\n\t\t\t\t<input type=\"hidden\" name=\"action\" value=\"delGRP\">\n\t\t\t\t<input type=submit value=\"" . _("Delete Group") . "\">\n\t\t\t</form>";
        echo "<h2>" . _("VMBlast Group") . ": " . ltrim($extdisplay, 'GRP-') . "</h2>";
        echo "<p>" . $delButton . "</p>";
        $usage_list = framework_display_destination_usage(vmblast_getdest(ltrim($extdisplay, 'GRP-')));
        if (!empty($usage_list)) {
            ?>
			<a href="#" class="info"><?php 
            echo $usage_list['text'];
            ?>
:<span><?php 
            echo $usage_list['tooltip'];
            ?>
</span></a>
		<?php 
        }
    } else {
        $grplist = array();
        $strategy = '';
        $ringing = '';
Ejemplo n.º 14
0
<div class="rnav"><ul>
<?php 
echo '<li><a href="config.php?display=' . $display . '&amp;type=' . $type . '">' . _('Add Custom Destination') . '</a></li>';
foreach (customappsreg_customdests_list() as $row) {
    $descr = $row['description'] != '' ? $row['description'] : '(' . $row['custom_dest'] . ')';
    echo '<li><a href="config.php?display=' . $display . '&amp;type=' . $type . '&amp;extdisplay=' . $row['custom_dest'] . '" class="">' . $descr . '</a></li>';
}
?>
</ul></div>

<div class="content">

<?php 
if ($custom_dest != '') {
    // load
    $usage_list = framework_display_destination_usage(customappsreg_customdests_getdest($custom_dest));
    $row = customappsreg_customdests_get($custom_dest);
    $description = $row['description'];
    $notes = $row['notes'];
    $disp_description = $row['description'] != '' ? $row['description'] : '(' . $row['custom_dest'] . ')';
    echo "<h2>" . _("Edit: ") . "{$disp_description}" . "</h2>";
} else {
    echo "<h2>" . _("Add Custom Destination") . "</h2>";
}
$helptext = _("Custom Destinations allows you to register your custom destinations that point to custom dialplans and will also 'publish' these destinations as available destinations to other modules. This is an advanced feature and should only be used by knowledgeable users. If you are getting warnings or errors in the notification panel about CUSTOM destinations that are correct, you should include them here. The 'Unknown Destinations' chooser will allow you to choose and insert any such destinations that the registry is not aware of into the Custom Destination field.");
echo $helptext;
?>

<form name="editCustomDest" action="<?php 
$_SERVER['PHP_SELF'];
?>
Ejemplo n.º 15
0
?>
</a></li>

<?php 
foreach ($allDests as $destid => $row) {
    $descr = $row['description'] . ' (' . $row['target'] . ')';
    echo "<li><a href='config.php?display=customdests&destid={$destid}'>{$descr}</a></li>";
}
?>
</ul></div>

<?php 
if (isset($_REQUEST['destid']) && isset($allDests[$_REQUEST['destid']])) {
    $destid = $_REQUEST['destid'];
    $current = $allDests[$destid];
    $usage_list = framework_display_destination_usage(\FreePBX::Customappsreg()->getDestTarget($destid));
} else {
    $current = array("target" => "", "description" => "", "notes" => "", "destret" => false);
    $usage_list = false;
    $destid = false;
}
$target = $current['target'];
$desc = $current['description'];
$notes = $current['notes'];
$destret = $current['destret'];
if ($destid) {
    echo "<h2>" . _("Edit: ") . "{$desc}</h2>\n";
} else {
    echo "<h2>" . _("Add Custom Destination") . "</h2>\n";
}
$helptext = _("Custom Destinations allows you to register your custom destinations that point to custom dialplans and will also 'publish' these destinations as available destinations to other modules. This is an advanced feature and should only be used by knowledgeable users. If you are getting warnings or errors in the notification panel about CUSTOM destinations that are correct, you should include them here. The 'Unknown Destinations' chooser will allow you to choose and insert any such destinations that the registry is not aware of into the Custom Destination field.");
Ejemplo n.º 16
0
<?php

$extdisplay = isset($_REQUEST['extdisplay']) ? $_REQUEST['extdisplay'] : '';
$usagehtml = '';
if ($extdisplay != '') {
    // load
    $row = queueprio_get($extdisplay);
    $usage_list = framework_display_destination_usage(queueprio_getdest($extdisplay));
    if (!empty($usage_list)) {
        $usagehtml = '<div class="well well-info>"';
        $usagehtml .= '<h3>' . $usage_list['text'] . '</h3>';
        $usagehtml .= $usage_list['tooltip'];
        $usagehtml .= '</div>';
    }
    $description = $row['description'];
    $queue_priority = $row['queue_priority'];
    $dest = $row['dest'];
    $delURL = '?display=queueprio&action=delete&queueprio_id=' . $extdisplay;
    $subhead = "<h2>" . _("Edit: ") . "{$description} ({$queue_priority})" . "</h2>";
} else {
    $description = '';
    $queue_priority = '0';
    $dest = '';
    $delURL = '';
    $subhead = "<h2>" . _("Add Queue Priority") . "</h2>";
}
echo $subhead;
echo $usagehtml;
?>
<form name="editQueuePriority" id="editQueuePriority" class="fpbx-submit" action="" method="post" onsubmit="return checkQueuePriority(editQueuePriority);" data-fpbx-delete="<?php 
echo $delURL;
Ejemplo n.º 17
0
function gabcast_show($xtn, $type, $iam)
{
    //get settings if editing
    if (!empty($xtn)) {
        $thisxtn = gabcast_get($xtn);
        if (!is_array($thisxtn)) {
            echo _("Error: cannot retreive Gabcast info for this extension");
            return;
        }
        $player = gabcast_player($thisxtn[1]);
        $action = 'edit';
        ?>
		
		<form method="POST" action="{$_SERVER['PHP_SELF']}?type={$type}&display={$iam}">
		<input type="hidden" name="action" value="delete">
		<input type="hidden" name="ext" value="{$thisxtn[0]}">
		<input type="submit" value="<?php 
        echo _('Delete settings');
        ?>
"></form>
<?php 
    }
    $usage_list = framework_display_destination_usage(gabcast_getdest($xtn));
    if (!empty($usage_list)) {
        ?>
			<a href="#" class="info"><?php 
        echo $usage_list['text'];
        ?>
:<span><?php 
        echo $usage_list['tooltip'];
        ?>
</span></a>
		<?php 
    }
    echo "<hr>";
    if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'add') {
        $thisxtn['ext'] = $_REQUEST['ext'];
        $thisxtn[0] = $_REQUEST['ext'];
        $player = "";
        $action = 'add';
        echo "<div style=margin-bottom:10px;>";
        echo _("You <u>must</u> have a Gabcast account & channel to use this feature. Visit");
        echo "&nbsp;<a href=\"http://www.gabcast.com\" target=\"_blank\">www.gabcast.com</a>&nbsp;";
        echo _("to sign up. <u>It's a free service</u>!");
        echo "</div>";
    }
    echo "<form method=\"POST\" action=\"{$_SERVER['PHP_SELF']}?type={$type}&display={$iam}&action={$action}\">";
    echo "<input type=\"hidden\" name=\"action\" value=\"{$action}\"><div>";
    echo _("Gabcast Channel Number:");
    echo "<input size=\"10\" type=\"text\" name=\"channbr\" value=\"{$thisxtn[1]}\"></div><dic>";
    echo _("Gabcast Channel Password:"******"<input size=\"10\" type=\"text\" name=\"pin\" value=\"{$thisxtn[2]}\"></div><div>";
    echo _("Link to Extension/User Number:");
    echo "<input size=\"10\" type=\"text\" name=\"ext\" value=\"{$thisxtn[0]}\"></div><div>";
    echo "<input type=\"submit\"></div><div style=\"margin-top:20px;\">";
    echo "{$player}";
    echo "</div></form>";
}
Ejemplo n.º 18
0
    $callrecording_mode = "yes";
}
if ($callrecording_mode == "") {
    $callrecording_mode = "dontcare";
}
$options = array(_("Force") => "force", _("Yes") => "yes", _("Don't Care") => "dontcare", _("No") => "no", _("Never") => "never");
foreach ($options as $disp => $name) {
    if ($callrecording_mode == $name) {
        $checked = "checked";
    } else {
        $checked = "";
    }
    $ropts .= "<input type='radio' id='record_{$name}' name='callrecording_mode' value='{$name}' {$checked}><label for='record_{$name}'>{$disp}</label>";
}
if ($extdisplay) {
    $usage_list = framework_display_destination_usage(callrecording_getdest($extdisplay));
    if (!empty($usage_list)) {
        $usagehtml = '<div class="well">';
        $usagehtml .= '<h4>' . $usage_list['text'] . '</h4>';
        $usagehtml .= '<p>' . $usage_list['tooltip'] . '</p>';
        $usagehtml .= '</div>';
    }
}
echo $usagehtml;
?>
<form name="editCallRecording" class="fpbx-submit" action="" method="post" onsubmit="return checkCallRecording(editCallRecording);" data-fpbx-delete="?display=callrecording&amp;callrecording_id=<?php 
echo $extdisplay;
?>
&amp;action=delete">
<input type="hidden" name="extdisplay" value="<?php 
echo $extdisplay;
Ejemplo n.º 19
0
        //get details for this meetme
        $thisMiscDest = miscdests_get($extdisplay);
        //create variables
        $description = "";
        $destdial = "";
        extract($thisMiscDest);
    }
    $helptext = _("Misc Destinations are for adding destinations that can be used by other FreePBX modules, generally used to route incoming calls. If you want to create feature codes that can be dialed by internal users and go to various destinations, please see the <strong>Misc Applications</strong> module.");
    if ($extdisplay) {
        ?>
	<h2><?php 
        echo _("Misc Destination:") . " " . $description;
        ?>
</h2>
<?php 
        $usage_list = framework_display_destination_usage(miscdests_getdest($extdisplay));
        $delURL = $_SERVER['PHP_SELF'] . '?' . $_SERVER['QUERY_STRING'] . '&action=delete';
        $tlabel = sprintf(_("Delete Misc Destination %s"), $description);
        $label = '<span><img width="16" height="16" border="0" title="' . $tlabel . '" alt="" src="images/core_delete.png"/>&nbsp;' . $tlabel . '</span>';
        ?>
			<a href="<?php 
        echo $delURL;
        ?>
"><?php 
        echo $label;
        ?>
</a>
<?php 
        if (!empty($usage_list)) {
            ?>
				<br /><a href="#" class="info"><?php 
Ejemplo n.º 20
0
}
?>
</ul></div>

<div class="content">

<?php 
if ($extdisplay) {
    // load
    $row = setcid_get($extdisplay);
    $description = $row['description'];
    $cid_name = $row['cid_name'];
    $cid_num = $row['cid_num'];
    $dest = $row['dest'];
    echo "<h2>" . _("Edit: ") . "{$description} ({$cid_name})" . "</h2>";
    $usage_list = framework_display_destination_usage(setcid_getdest($extdisplay));
    if (!empty($usage_list)) {
        ?>
			<tr><td colspan="2">
			<a href="#" class="info"><?php 
        echo $usage_list['text'];
        ?>
:<span><?php 
        echo $usage_list['tooltip'];
        ?>
</span></a>
			</td></tr><br /><br />
		<?php 
    }
} else {
    echo "<h2>" . _("Add CallerID") . "</h2>";
Ejemplo n.º 21
0
function ivr_show_edit($id, $nbroptions, $post)
{
    global $db;
    global $tabindex;
    $ivr_details = ivr_get_details($id);
    $ivr_dests = ivr_get_dests($id);
    ?>
	<div class="content">
	<h2><?php 
    echo _("Digital Receptionist");
    ?>
</h2>
	<h3><?php 
    echo _("Edit Menu") . " " . $ivr_details['displayname'];
    ?>
</h3>
<?php 
    ?>
	<form name="prompt" action="<?php 
    $_SERVER['PHP_SELF'];
    ?>
" method="post" onsubmit="return prompt_onsubmit();">
	<input type="hidden" name="action" value="edited" />
	<input type="hidden" name="display" value="ivr" />
	<input type="hidden" name="id" value="<?php 
    echo $id;
    ?>
" />
	<input name="Submit" type="submit" value="<?php 
    echo _("Save");
    ?>
" tabindex="<?php 
    echo ++$tabindex;
    ?>
" disabled>
<?php 
    $usage_list = array();
    if (function_exists('queues_ivr_usage')) {
        $usage_list = queues_ivr_usage($id);
    }
    if (count($usage_list)) {
        ?>
		<a href="#" class="info"><?php 
        echo _("Queue Breakout Menu Usage List");
        ?>
<span><?php 
        echo _("This IVR is being used by the following Queues, providing an ability for callers to hear this Queue's announcement periodically and giving callers an option to break out of the queue into this IVR's menu options. This queue can not be deleted when being used in this mode");
        ?>
</span></a>
<?php 
        $count = 0;
        foreach ($usage_list as $link) {
            $label = '<span><img width="16" height="16" border="0" title="' . $link['description'] . '" alt="" src="images/queue_link.png"/>&nbsp;' . $link['description'] . '</span>';
            echo "<br /><a href=" . $link['url_query'] . ">" . $label . "</a>";
        }
        echo "<br />";
    } else {
        ?>
	<input name="delete" type="submit" value="<?php 
        echo _("Delete") . " " . _("Digital Receptionist") . " {$ivr_details['displayname']}";
        ?>
" disabled/>
<?php 
    }
    if ($id) {
        $usage_list = framework_display_destination_usage(ivr_getdest($id));
        if (!empty($usage_list)) {
            ?>
			<br /><a href="#" class="info"><?php 
            echo $usage_list['text'];
            ?>
:<span><?php 
            echo $usage_list['tooltip'];
            ?>
</span></a>
		<?php 
        }
    }
    ?>
	<table>
		<tr><td colspan=2><hr /></td></tr>
		<tr>
			<td><a href="#" class="info"><?php 
    echo _("Change Name");
    ?>
<span><?php 
    echo _("This changes the short name, visible on the right, of this IVR");
    ?>
</span></a></td>
			<td><input type="text" name="displayname" value="<?php 
    echo $ivr_details['displayname'];
    ?>
" tabindex="<?php 
    echo ++$tabindex;
    ?>
"></td>
		</tr>

<?php 
    $annmsg_id = isset($ivr_details['announcement_id']) ? $ivr_details['announcement_id'] : '';
    if (function_exists('recordings_list')) {
        //only include if recordings is enabled
        ?>
		<tr>
			<td><a href="#" class="info"><?php 
        echo _("Announcement");
        ?>
<span><?php 
        echo _("Message to be played to the caller. To add additional recordings please use the \"System Recordings\" MENU to the left");
        ?>
</span></a></td>
			<td>
				<select name="annmsg_id" tabindex="<?php 
        echo ++$tabindex;
        ?>
">
				<?php 
        $tresults = recordings_list();
        echo '<option value="">' . _("None") . "</option>";
        if (isset($tresults[0])) {
            foreach ($tresults as $tresult) {
                echo '<option value="' . $tresult['id'] . '"' . ($tresult['id'] == $annmsg_id ? ' SELECTED' : '') . '>' . $tresult['displayname'] . "</option>\n";
            }
        }
        ?>
				</select>
			</td>
		</tr>
	
<?php 
    } else {
        ?>
		<tr>
			<td><a href="#" class="info"><?php 
        echo _("Announcement");
        ?>
<span><?php 
        echo _("Message to be played to the caller.<br><br>You must install and enable the \"Systems Recordings\" Module to edit this option");
        ?>
</span></a></td>
			<td>
			<?php 
        $default = isset($annmsg_id) ? $annmsg_id : '';
        ?>
				<input type="hidden" name="annmsg_id" value="<?php 
        echo $default;
        ?>
"><?php 
        echo $default != '' ? $default : 'None';
        ?>
			</td>
		</tr>
<?php 
    }
    ?>
		<tr>
			<td><a href="#" class="info"><?php 
    echo _("Timeout");
    ?>
<span><?php 
    echo _("The amount of time (in seconds) before the 't' option, if specified, is used");
    ?>
</span></a></td>
			<td><input type="text" name="timeout" value="<?php 
    echo $ivr_details['timeout'];
    ?>
" tabindex="<?php 
    echo ++$tabindex;
    ?>
"></td>
		</tr>
		<?php 
    if ($ivr_details['enable_directory'] && function_exists('voicemail_getVoicemail')) {
        ?>
		<tr>
			<td><a href="#" class="info"><?php 
        echo _("Enable Directory");
        ?>
<span><?php 
        echo _("Let callers into the IVR dial '#' to access the directory. WARNING: this feature is deprecated and will be removed from future versions. You should install the Directory module and assign an IVR destination to use Directory functionality.");
        ?>
</span></a></td>
			<td><input type="checkbox" name="ena_directory" <?php 
        echo $ivr_details['enable_directory'];
        ?>
 tabindex="<?php 
        echo ++$tabindex;
        ?>
"></td>
		</tr>
		<tr>
			<td><a href="#" class="info"><?php 
        echo _("Directory Context");
        ?>
<span><?php 
        echo _("When # is selected, this is the voicemail directory context that is used");
        ?>
</span></a></td>
			<td>
				<select name="dircontext" tabindex="<?php 
        echo ++$tabindex;
        ?>
">
					<?php 
        $vm_results = voicemail_getVoicemail();
        $vmcontexts = array_keys($vm_results);
        foreach ($vmcontexts as $vmc) {
            if ($vmc != 'general' && $vmc != 'zonemessages') {
                echo '<option value="' . $vmc . '"' . ($vmc == $ivr_details['dircontext'] ? ' SELECTED' : '') . '>' . $vmc . "</option>\n";
            }
        }
        ?>
				</select>
			</td>
		</tr>
		<?php 
    }
    ?>
		<tr>
			<td><a href="#" class="info"><?php 
    echo _("VM Return to IVR");
    ?>
<span><?php 
    echo _("If checked, upon exiting voicemail a caller will be returned to this IVR if they got a users voicemail");
    ?>
</span></a></td>
			<td><input type="checkbox" name="retvm" <?php 
    echo $ivr_details['retvm'];
    ?>
 tabindex="<?php 
    echo ++$tabindex;
    ?>
"></td>
		</tr>
<?php 
    if (!function_exists('directory_list')) {
        ?>
		<tr>
			<td><a href="#" class="info"><?php 
        echo _("Enable Direct Dial");
        ?>
<span><?php 
        echo _("Let callers into the IVR dial an extension directly");
        ?>
</span></a></td>
			<td><input type="checkbox" name="ena_directdial" <?php 
        echo $ivr_details['enable_directdial'];
        ?>
 tabindex="<?php 
        echo ++$tabindex;
        ?>
"></td>
		</tr>
<?php 
    } else {
        ?>
		<tr>
			<td><a href="#" class="info"><?php 
        echo _("Direct Dial Options");
        ?>
<span><?php 
        echo _("Provides options for callers to direct dial an extension. Direct dialing can be completely disabled, it can be enabled for all extensions on a system, or it can be tied to a Company Directory allowing any member listed in that directory to be dialed directly if their extension is known. If an extension in the chosen directory is overridden, only that overridden number is dialable");
        ?>
</span></a></td>
			<td>
				<select name="ena_directdial" tabindex="<?php 
        echo ++$tabindex;
        ?>
">
					<?php 
        $dlist = directory_list();
        echo '<option value=""' . ($ivr_details['enable_directdial'] == '' ? ' SELECTED' : '') . '>' . _('Disabled') . "</option>\n";
        echo '<option value="CHECKED"' . (strtoupper($ivr_details['enable_directdial']) == 'CHECKED' ? ' SELECTED' : '') . '>' . _('All Extensions') . "</option>\n";
        foreach ($dlist as $dir) {
            echo '<option value="' . $dir['id'] . '"' . ($ivr_details['enable_directdial'] == $dir['id'] ? ' SELECTED' : '') . '>' . $dir['dirname'] . "</option>\n";
        }
        ?>
				</select>
			</td>
		</tr>

<?php 
    }
    ?>
		<tr>
			<td><a href="#" class="info"><?php 
    echo _("Loop Before t-dest");
    ?>
<span><?php 
    echo _("If checked, and there is a 't' (timeout) destination defined below, the IVR will loop back to the beginning if no input is provided for the designated loop counts prior to going to the timeout (t) destination.");
    ?>
</span></a></td>
			<td><input type="checkbox" name="alt_timeout" <?php 
    echo $ivr_details['alt_timeout'];
    ?>
 tabindex="<?php 
    echo ++$tabindex;
    ?>
"></td>
		</tr>
<?php 
    $timeout_id = isset($ivr_details['timeout_id']) ? $ivr_details['timeout_id'] : '';
    if (function_exists('recordings_list')) {
        //only include if recordings is enabled
        ?>
		<tr>
			<td><a href="#" class="info"><?php 
        echo _("Timeout Message");
        ?>
<span><?php 
        echo _("If a timeout occurs and a message is selected, it will be played in place of the announcement message when looping back to the top of the IVR. It will not be played if the t destination is the next target.");
        ?>
</span></a></td>
			<td>
				<select name="timeout_id" tabindex="<?php 
        echo ++$tabindex;
        ?>
">
				<?php 
        //$tresults obtained above
        echo '<option value="">' . _("None") . "</option>";
        if (isset($tresults[0])) {
            foreach ($tresults as $tresult) {
                echo '<option value="' . $tresult['id'] . '"' . ($tresult['id'] == $timeout_id ? ' SELECTED' : '') . '>' . $tresult['displayname'] . "</option>\n";
            }
        }
        ?>
				</select>
			</td>
		</tr>
<?php 
    }
    ?>
		<tr>
			<td><a href="#" class="info"><?php 
    echo _("Loop Before i-dest");
    ?>
<span><?php 
    echo _("If checked, and there is an 'i' (invalid extension) destination defined below, the IVR will play invalid option and then loop back to the beginning for the designated loop counts prior to going to the invalid (i) destination.");
    ?>
</span></a></td>
			<td><input type="checkbox" name="alt_invalid" <?php 
    echo $ivr_details['alt_invalid'];
    ?>
 tabindex="<?php 
    echo ++$tabindex;
    ?>
"></td>
		</tr>
<?php 
    $invalid_id = isset($ivr_details['invalid_id']) ? $ivr_details['invalid_id'] : '';
    if (function_exists('recordings_list')) {
        //only include if recordings is enabled
        ?>
		<tr>
			<td><a href="#" class="info"><?php 
        echo _("Invalid Message");
        ?>
<span><?php 
        echo _("If an invalid extension is pressed and a message is selected, it will be played in place of the announcement message when looping back to the top of the IVR. It will not be played if the t destination is the next target. If nothing is selected, the system will play a default invalid extension message before going back to the main announcement");
        ?>
</span></a></td>
			<td>
				<select name="invalid_id" tabindex="<?php 
        echo ++$tabindex;
        ?>
">
				<?php 
        //$tresults obtained above
        echo '<option value="">' . _("None") . "</option>";
        if (isset($tresults[0])) {
            foreach ($tresults as $tresult) {
                echo '<option value="' . $tresult['id'] . '"' . ($tresult['id'] == $invalid_id ? ' SELECTED' : '') . '>' . $tresult['displayname'] . "</option>\n";
            }
        }
        ?>
				</select>
			</td>
		</tr>
<?php 
    }
    ?>
		<tr>
			<td><a href="#" class="info"><?php 
    echo _("Repeat Loops:");
    ?>
<span><?php 
    echo _("The number of times we should loop when invalid input or no input has been entered before going to the defined or default generated 'i' or 't' options. If the 'i' or 't' options are defined, the above check boxes must be checked in order to loop.");
    ?>
</span></a></td>
			<td>
				<select name="loops" tabindex="<?php 
    echo ++$tabindex;
    ?>
">
				<?php 
    $default = isset($ivr_details['loops']) ? $ivr_details['loops'] : 2;
    for ($i = 0; $i <= 9; $i++) {
        echo '<option value="' . $i . '" ' . ($i == $default ? 'SELECTED' : '') . '>' . $i . '</option>';
    }
    ?>
		
				</select>		
			</td>
		</tr>

		<tr><td colspan=2><hr /></td></tr>
		<tr><td colspan=2>

			<input name="increase" type="submit" value="<?php 
    echo _("Increase Options");
    ?>
" disabled>
			&nbsp;
			<input name="Submit" type="submit" value="<?php 
    echo _("Save");
    ?>
" tabindex="<?php 
    echo ++$tabindex;
    ?>
" disabled>
			&nbsp;
			<?php 
    if ($nbroptions > 1) {
        ?>
			<input name="decrease" type="submit" value="<?php 
        echo _("Decrease Options");
        ?>
" disabled>
			<?php 
    }
    ?>
		</td>
	</tr>
	<tr><td colspan=2><hr /></td></tr></table>
	<style type="text/css">
	#ivr-dests tr:nth-child(odd){
	background-color: #FCE7CE;
	}
	</style>
	<table id="ivr-dests">
<?php 
    // Draw the destinations
    $dests = ivr_get_dests($id);
    $count = 0;
    if (!empty($dests)) {
        foreach ($dests as $dest) {
            drawdestinations($count, $dest['selection'], $dest['dest'], $dest['ivr_ret']);
            $count++;
        }
    }
    while ($count < $nbroptions) {
        drawdestinations($count, null, null, 0);
        $count++;
    }
    ?>
	
</table>
<?php 
    if ($nbroptions < $count) {
        echo "<input type='hidden' name='nbroptions' value={$count} />\n";
    } else {
        echo "<input type='hidden' name='nbroptions' value={$nbroptions} />\n";
    }
    global $module_hook;
    echo $module_hook->hookHtml;
    ?>
	<input name="increase" type="submit" value="<?php 
    echo _("Increase Options");
    ?>
" disabled>
	&nbsp;
	<input name="Submit" type="submit" value="<?php 
    echo _("Save");
    ?>
" disabled>
	&nbsp;
	<?php 
    if ($nbroptions > 1) {
        ?>
	<input name="decrease" type="submit" value="<?php 
        echo _("Decrease Options");
        ?>
" disabled>
	<?php 
    }
    ?>
	
	<script language="javascript">
	<!--
$(document).ready(function() {  
	$(':submit:disabled').removeAttr('disabled'); 
});

function delEntry(e){
	$('[name=option'+e+'],[name=goto'+e+']').val('').parent().parent().fadeOut(500,function(){$(this).remove();});
}
 
var theForm = document.prompt;
theForm.displayname.focus();

	function prompt_onsubmit() {
		var msgInvalidOption = "<?php 
    echo _("Invalid option");
    ?>
";
		
		defaultEmptyOK = true;

		// go thru the form looking for options
		// where the option isn't blank (as that will be removed) do the validation
	    var allelems = theForm.elements;
        if (allelems != null)
        {
        	var i, elem;
            for (i = 0; elem = allelems[i]; i++)
            {
            	if (elem.type == 'text' && elem.name.indexOf('option') == 0)
                {
                	if (elem.value != '') {
                    	if (!isIVROption(elem.value))
                        	return warnInvalid(elem, msgInvalidOption);
                        
                        var gotoNum = elem.name.charAt(6);
                        var isok = validateSingleDestination(theForm,gotoNum,true);
                        if (!isok)
                        	return false;
                    }
                 }
          	}
        }
                              	
		return true;
	}
	
	//-->

	</script>
        </form>
        </div>
<?php 
}
Ejemplo n.º 22
0
<?php

//	License for all code of this FreePBX module can be found in the license file inside the module directory
//	Copyright 2015 Sangoma Technologies.
//
extract($request);
if ($extdisplay) {
    // load
    $row = languages_get($extdisplay);
    $description = $row['description'];
    $lang_code = $row['lang_code'];
    $dest = $row['dest'];
    $deleteurl = '?display=languages&action=delete&language_id=' . $row['language_id'];
    $subhead = "<h2>" . _("Edit: ") . "{$description} ({$lang_code})" . "</h2>";
    $usage_list = framework_display_destination_usage(languages_getdest($extdisplay));
    if (!empty($usage_list)) {
        $inusehtml = '<div class="well">';
        $inusehtml .= '<h3>' . $usage_list['text'] . '</h3>';
        $inusehtml .= '<p>' . $usage_list['tooltip'] . '</p>';
        $inusehtml .= '</div>';
    }
} else {
    if (FreePBX::Modules()->moduleHasMethod('Soundlang', 'getLanguage')) {
        $lang_code = FreePBX::Soundlang()->getLanguage();
    }
}
?>

<?php 
echo $subhead;
echo $inusehtml;
Ejemplo n.º 23
0
    ?>

	<h2><?php 
    echo $itemid ? _("Callback:") . " " . $itemid : _("Add Callback");
    ?>
</h2>
	
	<p><?php 
    echo $itemid ? '' : _("A callback will hang up on the caller and then call them back, directing them to the selected destination. This is useful for reducing mobile phone charges as well as other applications. Outbound calls will proceed according to the dial patterns in Outbound Routes.");
    ?>
</p>

<?php 
    if ($itemid) {
        echo $delButton;
        $usage_list = framework_display_destination_usage(callback_getdest($itemid));
        if (!empty($usage_list)) {
            ?>
						<a href="#" class="info"><?php 
            echo $usage_list['text'];
            ?>
:<span><?php 
            echo $usage_list['tooltip'];
            ?>
</span></a>
<?php 
        }
    }
    ?>

Ejemplo n.º 24
0
<?php

//	License for all code of this FreePBX module can be found in the license file inside the module directory
//	Copyright 2015 Sangoma Technologies.
extract($request, EXTR_SKIP);
$helptext = '';
if ($extdisplay) {
    $thisMiscDest = $md->get($extdisplay);
    $thisMiscDest = $thisMiscDest[0];
    $description = $thisMiscDest['description'] ? $thisMiscDest['description'] : '';
    $destdial = $thisMiscDest['destdial'] ? $thisMiscDest['destdial'] : '';
    $usage_list = framework_display_destination_usage($extdisplay);
    if (!empty($usage_list)) {
        $objects = explode("\n", $usage_list['tooltip']);
        $helptext = '<div class="alert alert-info" role="alert">';
        $helptext .= '<i class="glyphicon glyphicon-info-sign fpbx-help-icon" data-for="inuse"></i>&nbsp;' . $usage_list['text'] . '<br/>';
        $helptext .= '<ul class="list-group">';
        $objects = is_array($objects) ? $objects : array();
        foreach ($objects as $o) {
            $helptext .= '<li class="list-group-item" id="iteminuse">' . $o . '</li>';
        }
        $helptext .= '</ul>';
        $helptext .= '</div>';
    }
}
echo $helptext;
?>
<form autocomplete="off" class="fpbx-submit" name="editMD" action="config.php?display=miscdests" method="post" data-fpbx-delete="config.php?display=miscdests&amp;extdisplay=<?php 
echo $extdisplay;
?>
&amp;action=delete" role="form">
Ejemplo n.º 25
0
                 $register = core_trunks_getTrunkRegister($trunknum);
             }
         }
     }
     if (count($dialpattern_array) == 0) {
         $dialpattern_array = core_trunks_get_dialrules($trunknum);
     }
     $upper_tech = strtoupper($tech);
     if (trim($trunk_name) == '') {
         $trunk_name = $upper_tech == 'ZAP' | $upper_tech == 'DAHDI' ? sprintf(_('%s Channel %s'), $upper_tech, $channelid) : $channelid;
     }
     // find which routes use this trunk
     $routes = core_trunks_gettrunkroutes($trunknum);
     $num_routes = count($routes);
     if ($num_routes > 0) {
         $usage_list = framework_display_destination_usage(core_getdest(ltrim($extdisplay, 'OUT_')));
     }
 } else {
     // 'Add New Trunk' selected.
     // Generic defaults
     $outcid = "";
     $maxchans = "";
     $dialoutprefix = "";
     if ($tech == 'zap' || $tech == 'dahdi') {
         $channelid = 'g0';
     } else {
         $channelid = '';
     }
     // only for iax2/sip
     $peerdetails = "host=***provider ip address***\nusername=***userid***\nsecret=***password***\ntype=peer";
     $usercontext = "";
Ejemplo n.º 26
0
        $description = $thisgrp['description'];
        $alertinfo = $thisgrp['alertinfo'];
        $remotealert_id = $thisgrp['remotealert_id'];
        $needsconf = $thisgrp['needsconf'];
        $cwignore = $thisgrp['cwignore'];
        $cfignore = $thisgrp['cfignore'];
        $toolate_id = $thisgrp['toolate_id'];
        $ringing = $thisgrp['ringing'];
        $changecid = isset($thisgrp['changecid']) ? $thisgrp['changecid'] : 'default';
        $fixedcid = isset($thisgrp['fixedcid']) ? $thisgrp['fixedcid'] : '';
        unset($grpliststr);
        unset($thisgrp);
        $delButton = "\n\t\t\t<form name=delete action=\"{$_SERVER['PHP_SELF']}\" method=POST>\n\t\t\t\t<input type=\"hidden\" name=\"display\" value=\"{$dispnum}\">\n\t\t\t\t<input type=\"hidden\" name=\"account\" value=\"" . ltrim($extdisplay, 'GRP-') . "\">\n\t\t\t\t<input type=\"hidden\" name=\"action\" value=\"delGRP\">\n\t\t\t\t<input type=submit value=\"" . _("Delete Group") . "\">\n\t\t\t</form>";
        echo "<h2>" . _("Ring Group") . ": " . ltrim($extdisplay, 'GRP-') . "</h2>";
        echo "<p>" . $delButton . "</p>";
        $usage_list = framework_display_destination_usage(ringgroups_getdest(ltrim($extdisplay, 'GRP-')));
        if (!empty($usage_list)) {
            ?>
			<a href="#" class="info"><?php 
            echo $usage_list['text'];
            ?>
:<span><?php 
            echo $usage_list['tooltip'];
            ?>
</span></a>
		<?php 
        }
    } else {
        $grplist = explode("-", '');
        $strategy = '';
        $grppre = '';