Beispiel #1
0
    unlink($aed . '/vm_email.inc');
}
if (file_exists($aed . '/vm_general.inc')) {
    $contents = FreePBX::LoadConfig()->getConfig('vm_general.inc');
    $final = array();
    if (!empty($contents['HEADER']) && is_array($contents['HEADER'])) {
        foreach ($contents['HEADER'] as $key => $val) {
            $final["gen__" . $key] = $val;
            $gen_settings[$key] = "";
        }
    }
    if (!empty($final)) {
        if (!function_exists('voicemail_update_settings')) {
            include __DIR__ . '/functions.inc.php';
        }
        voicemail_update_settings("settings", "", "", $final);
    }
    unlink($aed . '/vm_general.inc');
}
$vmconf = \FreePBX::Voicemail()->getVoicemail(false);
if (!empty($vmconf)) {
    $dsettings = $settings = \FreePBX::Voicemail()->constructSettings("general");
    foreach ($dsettings as $data) {
        foreach ($data['settings'] as $key => $items) {
            if ($items['default'] !== '' && !isset($vmconf['general'][$key])) {
                $vmconf['general'][$key] = $items['default'];
            }
        }
    }
    \FreePBX::Voicemail()->saveVoicemail($vmconf);
}
Beispiel #2
0
    $extension = "";
    $need_update = false;
    $action = "usage";
}
/* Need to generate rnav div menu */
/* system-wide rnav menu (lists all accounts) */
$rnav_list = implode("\n", $rnav_entries);
show_view(dirname(__FILE__) . '/views/nav.php', array('rnav_list' => $rnav_list));
$title = voicemail_get_title($action, $context, $extension);
$sys_view_flag = empty($extension) ? true : false;
show_view(dirname(__FILE__) . '/views/header.php', array('type' => $type, 'display' => $display, 'extension' => $extension, 'action' => $action, 'sys_view_flag' => $sys_view_flag, 'title' => $title));
//Do we really need to say "UPDATE COMPLETED??"
if ($need_update && $action != 'usage') {
    /* set args */
    $args = array();
    if (voicemail_update_settings($action, $context, $extension, $_REQUEST)) {
        $url = "config.php?type={$type}&display={$display}&action={$action}&ext={$extension}&updated=true";
        needreload();
        redirect($url);
    } else {
        $url = "config.php?type={$type}&display={$display}&action={$action}&ext={$extension}&updated=false";
        redirect($url);
    }
}
switch ($action) {
    case "tz":
        /* get tz settings */
        $settings = voicemail_get_settings($uservm, $action, $extension);
        $settings = is_array($settings) && !empty($settings) ? $settings : array();
        show_view(dirname(__FILE__) . '/views/tz.php', array('settings' => $settings, 'tooltips' => $tooltips));
        break;