function form_Recordings($smarty, $module_name, $local_templates_dir, &$pDB, $arrConf, $credentials)
{
    $pRecording = new paloSantoRecordings($pDB);
    $user = isset($_SESSION['elastix_user']) ? $_SESSION['elastix_user'] : "";
    $domain = '';
    if ($credentials['userlevel'] != 'superadmin') {
        $arrOrgz = array();
        $domain = $credentials["domain"];
        $extension = $pRecording->Obtain_Extension_Current_User();
    } else {
        $domain = getParameter('organization');
        $arrOrgz = array("" => _tr("-- Any (To the system) --"));
        $pORGZ = new paloSantoOrganization($pDB);
        foreach ($pORGZ->getOrganization(array()) as $value) {
            $arrOrgz[$value["domain"]] = $value["name"];
        }
        $extension = '';
    }
    if (isset($_POST['option_record']) && $_POST['option_record'] == 'by_file') {
        $smarty->assign("check_file", "checked");
    } else {
        $smarty->assign("check_record", "checked");
    }
    $arrForm = createFieldForm($arrOrgz);
    $oForm = new paloForm($smarty, $arrForm);
    $smarty->assign("recording_name_Label", _tr("Record Name"));
    $smarty->assign("overwrite_record", _tr("This record Name already exists. Do you want to Overwrite it?"));
    $smarty->assign("record_Label", _tr("File Upload"));
    $smarty->assign("record_on_extension", _tr("Record On Extension"));
    $smarty->assign("Record", _tr("Record"));
    $smarty->assign("SAVE", _tr("Save"));
    $smarty->assign("INFO", _tr("Press REC and start your recording. Once you have finished recording you must press ·STOP or hangup the phone") . ".");
    $smarty->assign("NAME", _tr("You do not need to add an extension to the record name") . ".");
    $smarty->assign("icon", "web/apps/{$module_name}/images/recording.png");
    $smarty->assign("module_name", $module_name);
    $smarty->assign("file_upload", _tr("File Upload"));
    $smarty->assign("record", _tr("Record"));
    $smarty->assign("ext", _tr("Extension"));
    $smarty->assign("system", _tr("System"));
    $smarty->assign("exten", _tr("Extension"));
    $smarty->assign("EXTENSION", $extension);
    $smarty->assign("checking", _tr("Checking Name..."));
    $smarty->assign("dialing", _tr("Dialing..."));
    $smarty->assign("domain", $domain);
    $smarty->assign("confirm_dialog", _tr("This Record Name already exists."));
    $smarty->assign("success_record", _tr("Record was saved succesfully."));
    $smarty->assign("cancel_record", _tr("Record was canceled."));
    $smarty->assign("hangup", _tr("Hang up."));
    $max_upload = (int) ini_get('upload_max_filesize');
    $max_post = (int) ini_get('post_max_size');
    $memory_limit = (int) ini_get('memory_limit');
    $upload_mb = min($max_upload, $max_post, $memory_limit) * 1048576;
    $smarty->assign("max_size", $upload_mb);
    $smarty->assign("alert_max_size", _tr("File size exceeds the limit. "));
    $smarty->assign("USERLEVEL", $credentials['userlevel']);
    $htmlForm = $oForm->fetchForm("{$local_templates_dir}/form.tpl", _tr("Recordings"), $_POST);
    $contenidoModulo = "<form enctype='multipart/form-data' method='POST' style='margin-bottom:0;' action='?menu={$module_name}'>" . $htmlForm . "</form>";
    return $contenidoModulo;
}
Exemple #2
0
function new_recording($smarty, $module_name, $local_templates_dir, $arrLang, $dsn_agi_manager, $arrConf, $pDBACL)
{
    $recording_name = isset($_POST['recording_name']) ? $_POST['recording_name'] : '';
    if ($recording_name != '') {
        $pRecording = new paloSantoRecordings();
        $result = $pRecording->Obtain_Protocol_Current_User($arrConf);
        $number2call = '*77';
        if ($result != FALSE) {
            $result = $pRecording->Call2Phone($dsn_agi_manager, $result['id'], $number2call, $result['dial'], $result['description']);
            if ($result) {
                $smarty->assign("filename", $recording_name);
                $smarty->assign("mb_message", $arrLang["To continue: record a message then click on save"]);
            } else {
                $smarty->assign("mb_title", $arrLang['ERROR'] . ":");
                $smarty->assign("mb_message", $arrLang["The call couldn't be realized"]);
            }
        }
    } else {
        $smarty->assign("mb_title", $arrLang["Validation Error"]);
        $smarty->assign("mb_message", $arrLang['Insert the Recording Name']);
    }
    return form_Recordings($smarty, $module_name, $local_templates_dir, $arrLang, $pDBACL);
}