Example #1
0
    _ob_send();
}
//////////////////// SELECT FEATURETYPE }
//////////////////// SELECT CID {
if ($type == "cidint" || $type == "cidext") {
    if (!$show_clip) {
        _err("Forbidden");
    }
    if ($type == "cidext") {
        $target = "external";
    } else {
        $target = "internal";
    }
    $mac = preg_replace("/[^\\dA-Z]/", "", strtoupper(trim(@$_REQUEST["m"])));
    $user_name = $db->executeGetOne("SELECT `user` FROM `users` WHERE `id`='" . $db->escape($user_id) . "'");
    $enumbers = gs_user_callerids_get($user_name);
    if (isGsError($enumbers)) {
        _err("Fehler beim Abfragen.");
    }
    $selected = true;
    foreach ($enumbers as $number) {
        if ($number["selected"] === 1) {
            $selected = false;
        }
    }
    ob_start();
    echo "<html>\n";
    echo "<head><title>" . __("Dienstmerkmale") . " - " . $typeToTitle[$type] . "</title></head>\n";
    echo "<body><br />\n";
    echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"1\" width=\"100%\">\n";
    echo "<tr>";
echo __('aus');
?>
</label>
	</td>
	<td>
		<small><?php 
echo __('Das Verhalten ist ggf. von Ihrem Endger&auml;t abh&auml;ngig.');
?>
</small>
	</td>
	</tr>

<?php 
if (gs_get_conf('GS_USER_SELECT_CALLERID')) {
    echo "<tr>\n";
    $numbers = gs_user_callerids_get($_SESSION['sudo_user']['name']);
    if (isGsError($numbers)) {
        echo $numbers->getMsg();
    }
    $sel = " selected";
    foreach ($numbers as $number) {
        if ($number['dest'] != 'external') {
            continue;
        }
        if ($number['selected'] == 1) {
            $sel = "";
        }
    }
    echo "<td>", __('Angezeigte Rufnummer extern'), "</td>\n";
    echo "<td>\n";
    echo '<select name="callerid_ext" size="1"', $disabled['clip'], '>', "\n";
Example #3
0
function gs_clip_changed_ui($username)
{
    //get the username
    include_once GS_DIR . 'inc/gs-fns/gs_user_name_by_ext.php';
    $user_name = gs_user_name_by_ext($username);
    if (isGsError($user_name)) {
        gs_log(GS_LOG_WARNING, $user_name->getMsg());
        return;
    }
    //get the clip
    include_once GS_DIR . 'inc/gs-fns/gs_user_callerids_get.php';
    $clip = gs_user_callerids_get($user_name);
    if (isGsError($clip)) {
        gs_log(GS_LOG_WARNING, $clip->getMsg());
        return;
    }
    $clip_act = array('internal' => $username, 'external' => $username);
    foreach ($clip as $setting) {
        if ($setting['selected'] === 1) {
            $clip_act[$setting['dest']] = $setting['number'];
        }
    }
    $data = _get_ui_head('UserClipUI');
    $data[] = array('parm' => 'user', 'value' => $username);
    $data[] = array('parm' => 'internal', 'value' => $clip_act['internal']);
    $data[] = array('parm' => 'external', 'value' => $clip_act['external']);
    _gs_send_event($data);
}