当前位置: 首页>>代码示例>>PHP>>正文


PHP paloForm::setViewMode方法代码示例

本文整理汇总了PHP中paloForm::setViewMode方法的典型用法代码示例。如果您正苦于以下问题:PHP paloForm::setViewMode方法的具体用法?PHP paloForm::setViewMode怎么用?PHP paloForm::setViewMode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在paloForm的用法示例。


在下文中一共展示了paloForm::setViewMode方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: formNetwork

function formNetwork($smarty, $module_name, $local_templates_dir, $pNet, $arrEths)
{
    $arrNetwork = $pNet->obtener_configuracion_red();
    if (is_array($arrNetwork)) {
        $arrNetworkData['dns1'] = isset($arrNetwork['dns'][0]) ? $arrNetwork['dns'][0] : '';
        $arrNetworkData['dns2'] = isset($arrNetwork['dns'][1]) ? $arrNetwork['dns'][1] : '';
        $arrNetworkData['host'] = isset($arrNetwork['host']) ? $arrNetwork['host'] : '';
        $arrNetworkData['gateway'] = isset($arrNetwork['gateway']) ? $arrNetwork['gateway'] : '';
    }
    $arrFormNetwork = createFormNetwork();
    $oForm = new paloForm($smarty, $arrFormNetwork);
    $oForm->setViewMode();
    // SECCION ETHERNET LIST
    $arrData = array();
    $end = count($arrEths);
    foreach ($arrEths as $idEth => $arrEth) {
        $arrTmp = array();
        $arrTmp[0] = "&nbsp;<a href='?menu=network&action=editInterfase&id={$idEth}'>" . $arrEth['Name'] . "</a>";
        $arrTmp[1] = strtoupper($arrEth['Type']);
        $arrTmp[2] = $arrEth['Inet Addr'];
        $arrTmp[3] = $arrEth['Mask'];
        $arrTmp[4] = $arrEth['HWaddr'];
        $arrTmp[5] = isset($arrEth['HW_info']) ? $arrEth['HW_info'] : '';
        //- Deberia acotar este campo pues puede ser muy largo
        $arrTmp[6] = $arrEth['Running'] == "Yes" ? "<font color=green>" . _tr("Connected") . "</font>" : "<font color=red>" . _tr("Not Connected") . "</font>";
        $arrData[] = $arrTmp;
    }
    $oGrid = new paloSantoGrid($smarty);
    $oGrid->pagingShow(false);
    $arrGrid = array("title" => _tr("Ethernet Interfaces List"), "icon" => "web/apps/{$module_name}/images/system_hardware_detector.png", "width" => "99%", "start" => "1", "end" => $end, "total" => $end, "columns" => array(0 => array("name" => _tr("Device"), "property1" => ""), 1 => array("name" => _tr("Type"), "property1" => ""), 2 => array("name" => _tr("IP"), "property1" => ""), 3 => array("name" => _tr("Mask"), "property1" => ""), 4 => array("name" => _tr("MAC Address"), "property1" => ""), 5 => array("name" => _tr("HW Info"), "property1" => ""), 6 => array("name" => _tr("Status"), "property1" => "")));
    $htmlGrid = $oGrid->fetchGrid($arrGrid, $arrData);
    $smarty->assign("ETHERNET_INTERFASES_LIST", $htmlGrid);
    $smarty->assign("EDIT_PARAMETERS", _tr("Edit Network Parameters"));
    $smarty->assign("REQUIRED_FIELD", _tr("Required field"));
    $smarty->assign("icon", "web/apps/{$module_name}/images/system_network_network_parameters.png");
    $strReturn = $oForm->fetchForm("{$local_templates_dir}/network.tpl", _tr("Network Parameters"), $arrNetworkData);
    return $strReturn;
}
开发者ID:lordbasex,项目名称:elastix-gui,代码行数:38,代码来源:index.php

示例2: createFieldForm

function viewFormEliminacióndebases($smarty, $module_name, $local_templates_dir, &$pDB, $arrConf)
{
    $pEliminacióndebases = new paloSantoEliminacióndebases($pDB);
    $arrFormEliminacióndebases = createFieldForm($pEliminacióndebases);
    $oForm = new paloForm($smarty, $arrFormEliminacióndebases);
    //begin, Form data persistence to errors and other events.
    $_DATA = $_POST;
    $action = getParameter("action");
    $id = getParameter("id");
    $smarty->assign("ID", $id);
    //persistence id with input hidden in tpl
    if ($action == "view") {
        $oForm->setViewMode();
    } else {
        if ($action == "view_edit" || getParameter("save_edit")) {
            $oForm->setEditMode();
        }
    }
    //end, Form data persistence to errors and other events.
    if ($action == "view" || $action == "view_edit") {
        // the action is to view or view_edit.
        $dataEliminacióndebases = $pEliminacióndebases->getEliminacióndebasesById($id);
        if (is_array($dataEliminacióndebases) & count($dataEliminacióndebases) > 0) {
            $_DATA = $dataEliminacióndebases;
        } else {
            $smarty->assign("mb_title", _tr("Error get Data"));
            $smarty->assign("mb_message", $pEliminacióndebases->errMsg);
        }
    }
    $smarty->assign("DELETE", _tr("Delete"));
    $smarty->assign("EDIT", _tr("Edit"));
    $smarty->assign("CANCEL", _tr("Cancel"));
    $smarty->assign("REQUIRED_FIELD", _tr("Required field"));
    $smarty->assign("IMG", "images/list.png");
    $htmlForm = $oForm->fetchForm("{$local_templates_dir}/form.tpl", _tr("Eliminación de bases"), $_DATA);
    $content = "<form  method='POST' style='margin-bottom:0;' action='?menu={$module_name}'>" . $htmlForm . "</form>";
    return $content;
}
开发者ID:veraveramanolo,项目名称:cpc2c_uio,代码行数:38,代码来源:index.php

示例3: array

 function handleJSON_registerform($smarty, $module_name, $appletlist)
 {
     $respuesta = array('status' => 'success', 'message' => '(no message)');
     $smarty->assign(array("SAVE" => _tr("Save"), "CANCEL" => _tr("Cancel"), "Card_Register" => _tr("Card Register"), 'MSG_UNREGISTERED' => _tr('Card has not been Registered')));
     $oForm = new paloForm($smarty, $this->_getFormFields());
     if (isset($_REQUEST['hwd'])) {
         $db = $this->_getdb();
         $tupla = $db->getFirstRowQuery('SELECT * FROM car_system WHERE hwd = ?', TRUE, array($_REQUEST['hwd']));
         if (is_array($tupla) && count($tupla) > 0) {
             $_REQUEST['vendor'] = $tupla['vendor'];
             $_REQUEST['num_serie'] = $tupla['num_serie'];
             if (!empty($tupla['num_serie'])) {
                 // Tarjeta ya ha sido registrada
                 $oForm->setViewMode();
             }
         }
     }
     $local_templates_dir = dirname($_SERVER['SCRIPT_FILENAME']) . "/modules/{$module_name}/applets/TelephonyHardware/tpl";
     $respuesta['title'] = _tr('Card Register');
     $respuesta['html'] = $oForm->fetchForm("{$local_templates_dir}/_register.tpl", $respuesta['title'], $_REQUEST);
     $json = new Services_JSON();
     Header('Content-Type: application/json');
     return $json->encode($respuesta);
 }
开发者ID:hardikk,项目名称:HNH,代码行数:24,代码来源:index.php

示例4: viewFormInterfazdeAgente

function viewFormInterfazdeAgente($smarty, $module_name, $local_templates_dir, &$pDB, $arrConf)
{
    $pInterfazdeAgente = new paloSantoInterfazdeAgente($pDB);
    $oForm = new paloForm($smarty, $arrFormInterfazdeAgente);
    //begin, Form data persistence to errors and other events.
    $_DATA = $_POST;
    $action = getParameter("action");
    $id = getParameter("id");
    $smarty->assign("ID", $id);
    //persistence id with input hidden in tpl
    if ($action == "view") {
        $oForm->setViewMode();
    } else {
        if ($action == "view_edit" || getParameter("save_edit")) {
            $oForm->setEditMode();
        }
    }
    //end, Form data persistence to errors and other events.
    if ($action == "view" || $action == "view_edit") {
        // the action is to view or view_edit.
        $dataInterfazdeAgente = $pInterfazdeAgente->getInterfazdeAgenteById($id);
        if (is_array($dataInterfazdeAgente) & count($dataInterfazdeAgente) > 0) {
            $_DATA = $dataInterfazdeAgente;
        } else {
            $smarty->assign("mb_title", _tr("Error get Data"));
            $smarty->assign("mb_message", $pInterfazdeAgente->errMsg);
        }
    }
    $smarty->assign("SAVE", _tr("Save"));
    $smarty->assign("EDIT", _tr("Edit"));
    $smarty->assign("CANCEL", _tr("Cancel"));
    $smarty->assign("REQUIRED_FIELD", _tr("Required field"));
    $smarty->assign("IMG", "images/list.png");
    $htmlForm = $oForm->fetchForm("{$local_templates_dir}/form.tpl", _tr("Información del cliente"), $_DATA);
    $content = mostrarDatosClienteHTML($smarty, $pInterfazdeAgente);
    return $content;
}
开发者ID:veraveramanolo,项目名称:cpc2c_uio,代码行数:37,代码来源:index3.php

示例5: _moduleContent

function _moduleContent(&$smarty, $module_name)
{
    include_once "libs/paloSantoGrid.class.php";
    include_once "libs/paloSantoDB.class.php";
    include_once "libs/paloSantoForm.class.php";
    include_once "libs/paloSantoConfig.class.php";
    include_once "libs/paloSantoTrunk.class.php";
    require_once "libs/misc.lib.php";
    //include module files
    include_once "modules/{$module_name}/configs/default.conf.php";
    $lang = get_language();
    $base_dir = dirname($_SERVER['SCRIPT_FILENAME']);
    $lang_file = "modules/{$module_name}/lang/{$lang}.lang";
    if (file_exists("{$base_dir}/{$lang_file}")) {
        include_once "{$lang_file}";
    } else {
        include_once "modules/{$module_name}/lang/en.lang";
    }
    //global variables
    global $arrConf;
    global $arrConfModule;
    global $arrLang;
    global $arrLangModule;
    $arrConf = array_merge($arrConf, $arrConfModule);
    $arrLang = array_merge($arrLang, $arrLangModule);
    //folder path for custom templates
    $base_dir = dirname($_SERVER['SCRIPT_FILENAME']);
    $templates_dir = isset($arrConf['templates_dir']) ? $arrConf['templates_dir'] : 'themes';
    $local_templates_dir = "{$base_dir}/modules/{$module_name}/" . $templates_dir . '/' . $arrConf['theme'];
    $contenido = '';
    $msgError = '';
    $pConfig = new paloConfig("/etc", "amportal.conf", "=", "[[:space:]]*=[[:space:]]*");
    $arrConfig = $pConfig->leer_configuracion(false);
    $dsn = $arrConfig['AMPDBENGINE']['valor'] . "://" . $arrConfig['AMPDBUSER']['valor'] . ":" . $arrConfig['AMPDBPASS']['valor'] . "@" . $arrConfig['AMPDBHOST']['valor'] . "/asterisk";
    $pDB = new paloDB($dsn);
    $pDBSetting = new paloDB($arrConf['elastix_dsn']['settings']);
    $pDBTrunk = new paloDB($arrConfModule['dsn_conn_database_1']);
    $arrForm = array("default_rate" => array("LABEL" => $arrLang["Default Rate"], "REQUIRED" => "yes", "INPUT_TYPE" => "TEXT", "INPUT_EXTRA_PARAM" => "", "VALIDATION_TYPE" => "float", "VALIDATION_EXTRA_PARAM" => ""), "default_rate_offset" => array("LABEL" => $arrLang["Default Rate Offset"], "REQUIRED" => "yes", "INPUT_TYPE" => "TEXT", "INPUT_EXTRA_PARAM" => "", "VALIDATION_TYPE" => "float", "VALIDATION_EXTRA_PARAM" => ""));
    $oForm = new paloForm($smarty, $arrForm);
    $oForm->setViewMode();
    //obtener el valor de la tarifa por defecto
    $arrDefaultRate['default_rate'] = get_key_settings($pDBSetting, "default_rate");
    $arrDefaultRate['default_rate_offset'] = get_key_settings($pDBSetting, "default_rate_offset");
    $smarty->assign("EDIT", $arrLang["Edit"]);
    $smarty->assign("REQUIRED_FIELD", $arrLang["Required field"]);
    $strReturn = $oForm->fetchForm("{$local_templates_dir}/default_rate.tpl", $arrLang["Default Rate Configuration"], $arrDefaultRate);
    if (isset($_POST['edit_default'])) {
        $arrDefaultRate['default_rate'] = get_key_settings($pDBSetting, "default_rate");
        $arrDefaultRate['default_rate_offset'] = get_key_settings($pDBSetting, "default_rate_offset");
        $oForm = new paloForm($smarty, $arrForm);
        $smarty->assign("CANCEL", $arrLang["Cancel"]);
        $smarty->assign("SAVE", $arrLang["Save"]);
        $smarty->assign("REQUIRED_FIELD", $arrLang["Required field"]);
        $strReturn = $oForm->fetchForm("{$local_templates_dir}/default_rate.tpl", $arrLang["Default Rate Configuration"], $arrDefaultRate);
    } else {
        if (isset($_POST['save_default'])) {
            $oForm = new paloForm($smarty, $arrForm);
            $arrDefaultRate['default_rate'] = $_POST['default_rate'];
            $arrDefaultRate['default_rate_offset'] = $_POST['default_rate_offset'];
            if ($oForm->validateForm($_POST)) {
                $bValido = set_key_settings($pDBSetting, 'default_rate', $arrDefaultRate['default_rate']);
                $bValido = set_key_settings($pDBSetting, 'default_rate_offset', $arrDefaultRate['default_rate_offset']);
                if (!$bValido) {
                    echo $arrLang["Error when saving default rate"];
                } else {
                    header("Location: index.php?menu=billing_setup");
                }
            } else {
                // Error
                $smarty->assign("mb_title", $arrLang["Validation Error"]);
                $smarty->assign("mb_message", $arrLang["Value for rate is not valid"]);
                $smarty->assign("CANCEL", $arrLang["Cancel"]);
                $smarty->assign("SAVE", $arrLang["Save"]);
                $smarty->assign("REQUIRED_FIELD", $arrLang["Required field"]);
                $strReturn = $oForm->fetchForm("{$local_templates_dir}/default_rate.tpl", $arrLang["Default Rate Configuration"], $arrDefaultRate);
            }
        }
    }
    $arrTrunks = array();
    $arrData = array();
    $arrTrunksBill = array();
    //obtener todos los trunks
    $oTrunk = new paloTrunk($pDBTrunk);
    //obtener todos los trunks que son para billing
    //$arrTrunksBill=array("DAHDI/g0","DAHDI/g1");
    getTrunksBillFiltrado($pDB, $oTrunk, $arrConfig, $arrTrunks, $arrTrunksBill);
    if (isset($_POST['submit_bill_trunks'])) {
        //obtengo las que estan guardadas y las que ahora no estan
        $selectedTrunks = isset($_POST['trunksBills']) ? array_keys($_POST['trunksBills']) : array();
        if (count($selectedTrunks) > 0) {
            foreach ($selectedTrunks as $selectedTrunk) {
                $nuevaListaTrunks[] = base64_decode($selectedTrunk);
            }
        } else {
            $nuevaListaTrunks = array();
        }
        $listaTrunksNuevos = array_diff($nuevaListaTrunks, $arrTrunksBill);
        $listaTrunksAusentes = array_diff($arrTrunksBill, $nuevaListaTrunks);
        //tengo que borrar los trunks ausentes
        //tengo que agregar los trunks nuevos
//.........这里部分代码省略.........
开发者ID:hardikk,项目名称:HNH,代码行数:101,代码来源:index.php

示例6: viewFormOtherDestinations

function viewFormOtherDestinations($smarty, $module_name, $local_templates_dir, &$pDB, $arrConf, $credentials)
{
    global $arrPermission;
    $error = "";
    $arrOtherDestinations = array();
    $action = getParameter("action");
    $idOtherDestinations = getParameter("id");
    if ($action == "view" || $action == "view_edit" || getParameter("edit") || getParameter("save_edit")) {
        if (!isset($idOtherDestinations)) {
            $error = _tr("Invalid Other Destination ID");
        } else {
            $domain = getParameter('organization');
            if ($credentials['userlevel'] != 'superadmin') {
                $domain = $credentials['domain'];
            }
            $pOtherDestinations = new paloSantoOtherDestinations($pDB, $domain);
            $arrOtherDestinations = $pOtherDestinations->getOtherDestinationsById($idOtherDestinations);
            if ($arrOtherDestinations === false) {
                $error = _tr($pOtherDestinations->errMsg);
            } else {
                if (count($arrOtherDestinations) == 0) {
                    $error = _tr("Other Destination doesn't exist");
                } else {
                    if (getParameter("save_edit")) {
                        $arrOtherDestinations = $_POST;
                    }
                }
            }
        }
        if ($error != "") {
            $smarty->assign("mb_title", _tr("ERROR"));
            $smarty->assign("mb_message", $error);
            return reportOtherDestinations($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $credentials);
        }
    } else {
        // new, create
        if ($credentials['userlevel'] == 'superadmin') {
            if (getParameter("create_other_destination")) {
                $domain = getParameter('organization_add');
                //este parametro solo es selecionable cuando es el superadmin quien crea la ruta
            } else {
                $domain = getParameter('organization');
            }
        } else {
            $domain = $credentials['domain'];
        }
        $pOtherDestinations = new paloSantoOtherDestinations($pDB, $domain);
        if (getParameter("create_other_destination")) {
            $arrOtherDestinations["destdial"] = "";
            $arrOtherDestinations["description"] = "";
        } else {
            $arrOtherDestinations = $_POST;
        }
    }
    $arrFormOrgz = createFieldForm();
    $oForm = new paloForm($smarty, $arrFormOrgz);
    if ($action == "view") {
        $oForm->setViewMode();
    } else {
        if ($action == "view_edit" || getParameter("edit") || getParameter("save_edit")) {
            $oForm->setEditMode();
        }
    }
    //permission
    $arrAD = $pOtherDestinations->getAdditionalsDestinations();
    $smarty->assign("arrAditionalsDestinations", $arrAD);
    $smarty->assign("EDIT_OD", in_array('edit', $arrPermission));
    $smarty->assign("CREATE_OD", in_array('create', $arrPermission));
    $smarty->assign("DEL_OD", in_array('delete', $arrPermission));
    $smarty->assign("FeatureCodes", _tr("Feature Codes"));
    $smarty->assign("ShortcutApps", _tr("Shortcut Apps"));
    $smarty->assign("REQUIRED_FIELD", _tr("Required field"));
    $smarty->assign("CANCEL", _tr("Cancel"));
    $smarty->assign("OPTIONS", _tr("Options"));
    $smarty->assign("APPLY_CHANGES", _tr("Apply changes"));
    $smarty->assign("SAVE", _tr("Save"));
    $smarty->assign("EDIT", _tr("Edit"));
    $smarty->assign("DELETE", _tr("Delete"));
    $smarty->assign("CONFIRM_CONTINUE", _tr("Are you sure you wish to continue?"));
    $smarty->assign("MODULE_NAME", $module_name);
    $smarty->assign("id", $idOtherDestinations);
    $smarty->assign("USERLEVEL", $credentials['userlevel']);
    $smarty->assign("ORGANIZATION_LABEL", _tr("Organization Domain"));
    $smarty->assign("ORGANIZATION", $domain);
    $htmlForm = $oForm->fetchForm("{$local_templates_dir}/new.tpl", _tr("Other Destinations"), $arrOtherDestinations);
    $content = "<form  method='POST' style='margin-bottom:0;' action='?menu={$module_name}'>" . $htmlForm . "</form>";
    return $content;
}
开发者ID:Neo2SHYAlien,项目名称:elastix-mt-gui,代码行数:88,代码来源:index.php

示例7: viewFormMoH

function viewFormMoH($smarty, $module_name, $local_templates_dir, &$pDB, $arrConf, $credentials, $arrFiles = array())
{
    global $arrPermission;
    $error = "";
    $arrMoH = array();
    $action = getParameter("action");
    if ($credentials['userlevel'] == 'superadmin') {
        $pMoH = new paloSantoMoH($pDB, "");
    } else {
        $domain = $credentials['domain'];
        $pMoH = new paloSantoMoH($pDB, $domain);
    }
    $idMoH = getParameter("id_moh");
    if ($action == "view" || getParameter("edit") || getParameter("save_edit")) {
        if (!isset($idMoH)) {
            $error = _tr("Invalid Music on Hold Class");
        }
        $arrMoH = $pMoH->getMoHByClass($idMoH);
        $smarty->assign('NAME_MOH', $arrMoH["name"]);
        $smarty->assign('MODE_MOH', $arrMoH["mode_moh"]);
        if ($error == "") {
            if ($arrMoH === false) {
                $error = _tr($pMoH->errMsg);
            } else {
                if (count($arrMoH) == 0) {
                    $error = _tr("MoH doesn't exist");
                } else {
                    $smarty->assign('j', 0);
                    $smarty->assign('items', $arrMoH["listFiles"]);
                    if (getParameter("save_edit")) {
                        $arrMoH = $_POST;
                    }
                }
            }
        }
        if ($error != "") {
            $smarty->assign("mb_title", _tr("ERROR"));
            $smarty->assign("mb_message", $error);
            return reportMoH($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $credentials);
        }
    } else {
        if ($credentials['userlevel'] == 'superadmin') {
            $pMoH = new paloSantoMoH($pDB, "");
        } else {
            $pMoH = new paloSantoMoH($pDB, $domain);
        }
        $smarty->assign('j', 0);
        $smarty->assign('items', $arrFiles);
        $smarty->assign('arrFiles', "1");
        $arrMoH = $_POST;
    }
    $arrForm = createFieldForm($pMoH->getAudioFormatAsterisk(), $credentials['userlevel'] == 'superadmin');
    $oForm = new paloForm($smarty, $arrForm);
    if ($action == "view") {
        $oForm->setViewMode();
    } else {
        if ($action == "view_edit" || getParameter("edit") || getParameter("save_edit")) {
            $oForm->setEditMode();
        }
    }
    //permission
    $smarty->assign("EDIT_MOH", in_array("edit", $arrPermission));
    $smarty->assign("DEL_MOH", in_array("delete", $arrPermission));
    //$smarty->assign("ERROREXT",_tr($pTrunk->errMsg));
    $smarty->assign("REQUIRED_FIELD", _tr("Required field"));
    $smarty->assign("CANCEL", _tr("Cancel"));
    $smarty->assign("OPTIONS", _tr("Options"));
    $smarty->assign("APPLY_CHANGES", _tr("Apply changes"));
    $smarty->assign("SAVE", _tr("Save"));
    $smarty->assign("EDIT", _tr("Edit"));
    $smarty->assign("DELETE", _tr("Delete"));
    $smarty->assign("CONFIRM_CONTINUE", _tr("Are you sure you wish to continue?"));
    $smarty->assign("MODULE_NAME", $module_name);
    $smarty->assign("id_moh", $idMoH);
    $smarty->assign("USERLEVEL", $credentials['userlevel']);
    $smarty->assign("ADD_FILE", _tr("Add New file"));
    $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. "));
    $htmlForm = $oForm->fetchForm("{$local_templates_dir}/new.tpl", _tr("MoH Route"), $arrMoH);
    $content = "<form  method='POST' enctype='multipart/form-data' style='margin-bottom:0;' action='?menu={$module_name}'>" . $htmlForm . "</form>";
    return $content;
}
开发者ID:netconstructor,项目名称:elastix-mt-gui,代码行数:86,代码来源:index.php

示例8: viewQueue

function viewQueue($smarty, $module_name, $local_templates_dir, &$pDB, $arrConf, $credentials)
{
    global $arrPermission;
    $error = "";
    $arrQueue = array();
    $action = getParameter("action");
    $qname = getParameter("qname");
    if ($action == "view" || $action == "view_edit" || getParameter("edit") || getParameter("save_edit")) {
        if (!isset($qname)) {
            $error = _tr("Invalid Queue");
        } else {
            $domain = getParameter('organization');
            if ($credentials['userlevel'] != 'superadmin') {
                $domain = $credentials['domain'];
            }
            $pQueue = new paloQueuePBX($pDB, $domain);
            $arrTmp = $pQueue->getQueueByName($qname);
            if ($arrTmp === false) {
                $error = _tr("Error with database connection. ") . $pQueue->errMsg;
            } elseif (count($arrTmp) == false) {
                $error = _tr("Queue doesn't exist");
            } else {
                $smarty->assign("QUEUE", $arrTmp["queue_number"]);
                if (getParameter("save_edit")) {
                    $arrQueue = $_POST;
                } else {
                    $arrMember = $pQueue->getQueueMembers($qname);
                    if ($arrMember === false) {
                        $error = _tr("Problems getting queue members. ") . $pQueue->errMsg;
                        $arrMember = array();
                    }
                    $arrQueue = showQueueSetting($arrTmp, $arrMember);
                }
            }
        }
    } else {
        if ($credentials['userlevel'] == 'superadmin') {
            if (getParameter("create_queue")) {
                $domain = getParameter('organization_add');
                //este parametro solo es selecionable cuando es el superadmin quien crea la ruta
            } else {
                $domain = getParameter('organization');
            }
        } else {
            $domain = $credentials['domain'];
        }
        $pQueue = new paloQueuePBX($pDB, $domain);
        if (getParameter("create_queue")) {
            $arrQueue = $pQueue->defaultOptions();
        } else {
            $arrQueue = $_POST;
        }
    }
    if ($error != "") {
        $smarty->assign("mb_title", _tr("Error"));
        $smarty->assign("mb_message", $error);
        return reportQueue($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $credentials);
    }
    $category = $pQueue->getCategoryDefault($domain);
    if ($category === false) {
        $category = array();
    }
    $res = $pQueue->getDefaultDestination($domain, $arrQueue["category"]);
    $destiny = $res == false ? array() : $res;
    $arrForm = createFieldForm($pQueue->getRecordingsSystem($domain), getArrayExtens($pDB, $domain), $category, $destiny, $pQueue->getMoHClass($domain));
    $oForm = new paloForm($smarty, $arrForm);
    if ($action == "view") {
        $oForm->setViewMode();
    } else {
        if ($action == "view_edit" || getParameter("edit") || getParameter("save_edit")) {
            $oForm->setEditMode();
        }
    }
    //permission
    $smarty->assign("EDIT_QUEUE", in_array('edit', $arrPermission));
    $smarty->assign("CREATE_QUEUE", in_array('create', $arrPermission));
    $smarty->assign("DEL_QUEUE", in_array('delete', $arrPermission));
    $smarty->assign("REQUIRED_FIELD", _tr("Required field"));
    $smarty->assign("CANCEL", _tr("Cancel"));
    $smarty->assign("APPLY_CHANGES", _tr("Apply changes"));
    $smarty->assign("SAVE", _tr("Save"));
    $smarty->assign("EDIT", _tr("Edit"));
    $smarty->assign("DELETE", _tr("Delete"));
    $smarty->assign("CONFIRM_CONTINUE", _tr("Are you sure you wish to continue?"));
    $smarty->assign("MODULE_NAME", $module_name);
    $smarty->assign("qname", $qname);
    $smarty->assign("USERLEVEL", $credentials['userlevel']);
    $smarty->assign("ORGANIZATION_LABEL", _tr("Organization Domain"));
    $smarty->assign("ORGANIZATION", $domain);
    $smarty->assign("GENERAL", _tr("General"));
    $smarty->assign("MEMBERS", _tr("Queue Members"));
    $smarty->assign("ADVANCED", _tr("Advanced Options"));
    $smarty->assign("TIME_OPTIONS", _tr("Timing Options"));
    $smarty->assign("EMPTY_OPTIONS", _tr("Empty Options"));
    $smarty->assign("RECORDING", _tr("Recording Options"));
    $smarty->assign("ANN_OPTIONS", _tr("Announce Options"));
    $smarty->assign("PER_OPTIONS", _tr("Periodic Announce Options"));
    $smarty->assign("DEFAULT_DEST", _tr("Default Destination"));
    $htmlForm = $oForm->fetchForm("{$local_templates_dir}/new.tpl", _tr("Queues"), $arrQueue);
    $content = "<form  method='POST' style='margin-bottom:0;' action='?menu={$module_name}'>" . $htmlForm . "</form>";
//.........这里部分代码省略.........
开发者ID:netconstructor,项目名称:elastix-mt-gui,代码行数:101,代码来源:index.php

示例9: viewFormUser


//.........这里部分代码省略.........
                //ahora obtenemos las configuraciones de fax dle usuario
                $pFax = new paloFax($pACL->_DB);
                $listFaxs = $pFax->getFaxList(array("exten" => $extf, "organization_domain" => $arrDomains[$arrFill["organization"]]));
                if ($listFaxs != false) {
                    $faxUser = $listFaxs[0];
                    $arrFill["country_code"] = $faxUser["country_code"];
                    $arrFill["area_code"] = $faxUser["area_code"];
                    $arrFill["clid_number"] = $faxUser["clid_number"];
                    $arrFill["clid_name"] = $faxUser["clid_name"];
                }
                //ahora obtenemos la cuenta del email
                $arrFill["email_quota"] = $pACL->getUserProp($idUser, "email_quota");
                if ($idUser == "1") {
                    $arrFill["email_contact"] = $pACL->getUserProp($idUser, "email_contact");
                }
                $smarty->assign("EMAILQOUTA", $arrFill["email_quota"]);
                $smarty->assign("EXTENSION", $extu);
                $smarty->assign("FAX_EXTENSION", $extf);
                if (getParameter("save_edit")) {
                    $arrFill = $_POST;
                }
            }
        }
    }
    if ($credentials["userlevel"] != "superadmin") {
        $idOrgSel = $credentials["id_organization"];
    } else {
        $idOrgSel = getParameter("organization");
    }
    if (!isset($idOrgSel)) {
        $idOrgSel = 0;
    }
    if ($idOrgSel == 0) {
        $arrGrupos = array();
    } else {
        $temp = $pACL->getGroupsPaging(null, null, $idOrgSel);
        if ($temp === false) {
            $smarty->assign("mb_title", _tr("ERROR"));
            $smarty->assign("mb_message", _tr($pACL->errMsg));
            return reportUser($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrCredentiasls);
        }
        foreach ($temp as $value) {
            $arrGrupos[$value[0]] = $value[1];
        }
    }
    if (getParameter("create_user")) {
        $arrFill["country_code"] = $pORGZ->getOrganizationProp($idOrgSel, "country_code");
        $arrFill["area_code"] = $pORGZ->getOrganizationProp($idOrgSel, "area_code");
        $arrFill["email_quota"] = $pORGZ->getOrganizationProp($idOrgSel, "email_quota");
    }
    $arrFormOrgz = createFieldForm($arrGrupos, $arrOrgz);
    $oForm = new paloForm($smarty, $arrFormOrgz);
    $smarty->assign("HEIGHT", "310px");
    $smarty->assign("MARGIN_PIC", 'style="margin-top: 40px;"');
    $smarty->assign("MARGIN_TAB", "");
    if ($action == "view") {
        $smarty->assign("HEIGHT", "220px");
        $smarty->assign("MARGIN_PIC", "");
        $smarty->assign("MARGIN_TAB", "margin-top: 10px;");
        $oForm->setViewMode();
        $arrFill["password1"] = "*****";
        $arrFill["password2"] = "*****";
        $smarty->assign("HEIGHT", "220px");
    } else {
        if (getParameter("edit") || getParameter("save_edit")) {
            $oForm->setEditMode();
        }
    }
    global $arrPermission;
    if (in_array('create_user', $arrPermission)) {
        $smarty->assign("CREATE_USER", true);
    }
    if (in_array('edit_user', $arrPermission)) {
        $smarty->assign("EDIT_USER", true);
    }
    if (in_array('delete_user', $arrPermission)) {
        $smarty->assign("DEL_USER", true);
    }
    $smarty->assign("REQUIRED_FIELD", _tr("Required field"));
    $smarty->assign("CANCEL", _tr("Cancel"));
    $smarty->assign("APPLY_CHANGES", _tr("Apply changes"));
    $smarty->assign("SAVE", _tr("Save"));
    $smarty->assign("EDIT", _tr("Edit"));
    $smarty->assign("DELETE", _tr("Delete"));
    $smarty->assign("CONFIRM_CONTINUE", _tr("Are you sure you wish to continue?"));
    $smarty->assign("icon", "../web/_common/images/user_info.png");
    $smarty->assign("FAX_SETTINGS", _tr("Fax Settings"));
    $smarty->assign("EMAIL_SETTINGS", _tr("Email Settings"));
    $smarty->assign("MODULE_NAME", $module_name);
    $smarty->assign("userLevel", $credentials["userlevel"]);
    $smarty->assign("id_user", $idUser);
    if (isset($arrUsers[0][1])) {
        $smarty->assign("isSuperAdmin", $pACL->isUserSuperAdmin($arrUsers[0][1]));
    } else {
        $smarty->assign("isSuperAdmin", FALSE);
    }
    $htmlForm = $oForm->fetchForm("{$local_templates_dir}/new.tpl", _tr("User"), $arrFill);
    $content = "<form  method='POST' enctype='multipart/form-data' style='margin-bottom:0;' action='?menu={$module_name}'>" . $htmlForm . "</form>";
    return $content;
}
开发者ID:lordbasex,项目名称:elastix-gui,代码行数:101,代码来源:index.php

示例10: viewFormDatosbasicos

function viewFormDatosbasicos($smarty, $module_name, $local_templates_dir, &$pDB, $arrConf)
{
    $pDatosbasicos = new paloSantoDatosbasicos($pDB);
    $arrFormDatosbasicos = createFieldForm();
    $oForm = new paloForm($smarty, $arrFormDatosbasicos);
    $pDBSqlite = new paloDB("sqlite3:////var/www/db/acl.db");
    $pACL = new paloACL($pDBSqlite);
    if ($pACL->isUserAdministratorGroup($_SESSION['elastix_user'])) {
        $smarty->assign("esAdmin", true);
    } else {
        $smarty->assign("esAdmin", false);
    }
    //begin, Form data persistence to errors and other events.
    $_DATA = $_POST;
    $action = getParameter("action");
    if (isset($_SESSION['ci'])) {
        // si esta seteado la cedula en la session, procedo a editar
        $action = "view_edit";
    }
    $id = getParameter("id");
    $smarty->assign("ID", $id);
    //persistence id with input hidden in tpl
    if ($_GET["ci"]) {
        $smarty->assign("CI", getParameter("ci"));
        //persistence ci with input hidden in tpl
        $smarty->assign("action_edit", "yes");
        //persistence ci with input hidden in tpl
        $_SESSION["ci"] = getParameter("ci");
    } else {
        $smarty->assign("CI", $_SESSION['ci']);
        //persistence ci with input hidden in tpl
    }
    //Clientes Recargables
    if ($_GET["id_cliente"]) {
        $dataDatosbasicos = $pDatosbasicos->getDatosbasicosByIdCliente(getParameter("id_cliente"));
        $smarty->assign("CI", $dataDatosbasicos["ci"]);
        //persistence ci with input hidden in tpl
        $smarty->assign("action_edit", "yes");
        //persistence ci with input hidden in tpl
        $_SESSION["id_cliente"] = getParameter("id_cliente");
        $_SESSION["ci"] = $dataDatosbasicos["ci"];
    }
    if ($action == "view") {
        $oForm->setViewMode();
    } else {
        if ($action == "view_edit" || getParameter("save_edit")) {
            $oForm->setEditMode();
        }
    }
    //end, Form data persistence to errors and other events.
    if ($action == "view" || $action == "view_edit") {
        // the action is to view or view_edit.
        // $dataDatosbasicos = $pDatosbasicos->getDatosbasicosById($id); // Cambiado para editar al cliente de la Sesión
        //if(!empty($_SESSION["id_campania_cliente_recargable"])){
        //    $dataDatosbasicos = $pDatosbasicos->getDatosbasicosByIdCampaniaRecargable($_SESSION['id_campania_cliente_recargable']);
        //}else{
        $dataDatosbasicos = $pDatosbasicos->getDatosbasicosByCI($_SESSION['ci']);
        //}
        if ($_GET["id_cliente"]) {
            $dataDatosbasicos = $pDatosbasicos->getDatosbasicosByIdCliente($_SESSION['id_cliente']);
            $dataDatosbasicos["cedula"] = $dataDatosbasicos["ci"];
        }
        if (is_array($dataDatosbasicos) & count($dataDatosbasicos) > 0) {
            $_DATA = $dataDatosbasicos;
        } else {
            $smarty->assign("mb_title", _tr("Error get Data"));
            $smarty->assign("mb_message", $pDatosbasicos->errMsg);
        }
    }
    if (empty($_DATA["cedula"])) {
        $_DATA["cedula"] = getParameter("ci");
    }
    $smarty->assign("SAVE", _tr("Save"));
    $smarty->assign("EDIT", _tr("Edit"));
    $smarty->assign("CANCEL", _tr("Cancel"));
    $smarty->assign("REQUIRED_FIELD", _tr("Required field"));
    $smarty->assign("IMG", "images/list.png");
    $smarty->assign("IMG", "images/list.png");
    $htmlForm = $oForm->fetchForm("{$local_templates_dir}/form.tpl", _tr("Datos básicos"), $_DATA);
    $content = "<form  method='POST' style='margin-bottom:0;' action='?menu={$module_name}'>" . $htmlForm . "</form>";
    return $content;
}
开发者ID:veraveramanolo,项目名称:cpc2c_uio,代码行数:82,代码来源:index.php

示例11: listParameterFaxMail

function listParameterFaxMail($smarty, $module_name, $local_templates_dir, $pDB, $credentials)
{
    $arrData = array();
    $oFax = new paloFax($pDB);
    global $arrPermission;
    $smarty->assign("EDIT", in_array('edit', $arrPermission));
    if (getParameter("submit_apply_change")) {
        $arrParameterFaxMail = $_POST;
    } else {
        $arrParameterFaxMail = $oFax->getConfigurationSendingFaxMailOrg($credentials['id_organization']);
        if ($arrParameterFaxMail === false) {
            $smarty->assign("mb_title", "ERROR");
            $smarty->assign("mb_message", "An error has ocurred to retrieved email fax configutaion");
        }
    }
    // Definición del formulario
    $smarty->assign("REQUIRED_FIELD", _tr("Required field"));
    $smarty->assign("CANCEL", _tr("Cancel"));
    $smarty->assign("APPLY_CHANGES", _tr("Apply changes"));
    $smarty->assign("SAVE", _tr("Save"));
    $smarty->assign("EDIT", _tr("Edit"));
    $smarty->assign("EDIT_PARAMETERS", _tr("Edit Parameters"));
    $smarty->assign("icon", "web/apps/{$module_name}/images/fax_email_template.png");
    $arrFaxConfig = createForm();
    $oForm = new paloForm($smarty, $arrFaxConfig);
    if (getParameter("submit_apply_change") || getParameter("submit_edit")) {
        $oForm->setEditMode();
    } else {
        $oForm->setViewMode();
    }
    return $oForm->fetchForm("{$local_templates_dir}/parameterFaxMail.tpl", _tr("Configuration Sending Fax Mail"), $arrParameterFaxMail);
}
开发者ID:netconstructor,项目名称:elastix-mt-gui,代码行数:32,代码来源:index.php

示例12: viewFormIVR

function viewFormIVR($smarty, $module_name, $local_templates_dir, &$pDB, $arrConf, $credentials, $arrDestine = array())
{
    global $arrPermission;
    $error = "";
    $arrIvr = array();
    $action = getParameter("action");
    $idIVR = getParameter("id_ivr");
    if ($action == "view" || $action == "view_edit" || getParameter("edit") || getParameter("save_edit")) {
        if (!isset($idIVR)) {
            $error = _tr("Invalid IVR");
        } else {
            $domain = getParameter('organization');
            if ($credentials['userlevel'] != 'superadmin') {
                $domain = $credentials['domain'];
            }
            $pIVR = new paloIvrPBX($pDB, $domain);
            $arrIVR = $pIVR->getIvrById($idIVR);
            if ($arrIVR === false) {
                $error = _tr($pIVR->errMsg);
            } else {
                if (count($arrIVR) == 0) {
                    $error = _tr("IVR doesn't exist");
                } else {
                    //para que se muestren los destinos
                    $smarty->assign('j', 0);
                    $arrGoTo = $pIVR->getCategoryDefault($domain);
                    $smarty->assign('arrGoTo', $arrGoTo);
                    if ($action == "view" || getParameter("edit")) {
                        $arrDestine = $pIVR->getArrDestine($idIVR);
                    }
                    $smarty->assign('items', $arrDestine);
                    if (getParameter("save_edit")) {
                        $arrIVR = $_POST;
                    }
                    $arrIVR["mesg_invalid"] = is_null($arrIVR["mesg_invalid"]) ? "none" : $arrIVR["mesg_invalid"];
                    $arrIVR["mesg_timeout"] = is_null($arrIVR["mesg_timeout"]) ? "none" : $arrIVR["mesg_timeout"];
                    $arrIVR["announcement"] = is_null($arrIVR["announcement"]) ? "none" : $arrIVR["announcement"];
                    if (isset($arrIVR["retvm"])) {
                        if ($arrIVR["retvm"] == "yes") {
                            $smarty->assign("CHECKED", "checked");
                        }
                    }
                    if (getParameter("retvm")) {
                        $smarty->assign("CHECKED", "checked");
                    }
                }
            }
        }
    } else {
        if ($credentials['userlevel'] == 'superadmin') {
            if (getParameter("create_ivr")) {
                $domain = getParameter('organization_add');
                //este parametro solo es selecionable cuando es el superadmin quien crea la ruta
            } else {
                $domain = getParameter('organization');
            }
        } else {
            $domain = $credentials['domain'];
        }
        $pIVR = new paloIvrPBX($pDB, $domain);
        //para que se muestren los destinos
        $smarty->assign('j', 0);
        $arrGoTo = $pIVR->getCategoryDefault($domain);
        $smarty->assign('arrGoTo', $arrGoTo);
        $smarty->assign('items', $arrDestine);
        if (getParameter("create_ivr")) {
            $arrIVR["timeout"] = "10";
            $arrIVR["loops"] = "2";
            $arrIVR["directdial"] = "no";
        } else {
            $arrIVR = $_POST;
        }
    }
    $arrFormOrgz = createFieldForm($pIVR->getRecordingsSystem($domain), $arrGoTo);
    $oForm = new paloForm($smarty, $arrFormOrgz);
    if ($action == "view") {
        $oForm->setViewMode();
    } else {
        if ($action == "view_edit" || getParameter("edit") || getParameter("save_edit")) {
            $oForm->setEditMode();
        }
    }
    $smarty->assign("EDIT_IVR", in_array('edit', $arrPermission));
    $smarty->assign("CREATE_IVR", in_array('create', $arrPermission));
    $smarty->assign("DEL_IVR", in_array('delete', $arrPermission));
    $smarty->assign("ERROREXT", _tr($pIVR->errMsg));
    $smarty->assign("REQUIRED_FIELD", _tr("Required field"));
    $smarty->assign("CANCEL", _tr("Cancel"));
    $smarty->assign("APPLY_CHANGES", _tr("Apply changes"));
    $smarty->assign("SAVE", _tr("Save"));
    $smarty->assign("EDIT", _tr("Edit"));
    $smarty->assign("DELETE", _tr("Delete"));
    $smarty->assign("CONFIRM_CONTINUE", _tr("Are you sure you wish to continue?"));
    $smarty->assign("MODULE_NAME", $module_name);
    $smarty->assign("id_ivr", $idIVR);
    $smarty->assign("USERLEVEL", $credentials['userlevel']);
    $smarty->assign("ORGANIZATION_LABEL", _tr("Organization Domain"));
    $smarty->assign("ORGANIZATION", $domain);
    $smarty->assign("RETIVR", _tr("Return to IVR"));
    $smarty->assign("DIGIT", _tr("Exten"));
//.........这里部分代码省略.........
开发者ID:netconstructor,项目名称:elastix-mt-gui,代码行数:101,代码来源:index.php

示例13: viewFormOrganization


//.........这里部分代码省略.........
                $check_e = empty($num_exten) ? _tr("unlimited") : $num_exten;
                $check_q = empty($num_queues) ? _tr("unlimited") : $num_queues;
                $check_u = empty($num_users) ? _tr("unlimited") : $num_users;
            }
            if (!getParameter("save_edit")) {
                $arrFill['name'] = $dataOrgz['name'];
                $arrFill['country'] = $dataOrgz['country'];
                $arrFill['city'] = $dataOrgz['city'];
                $arrFill['address'] = $dataOrgz['address'];
                $arrFill['email_contact'] = $dataOrgz['email_contact'];
                $arrFill['country_code'] = $pOrganization->getOrganizationProp($id, "country_code");
                $arrFill['area_code'] = $pOrganization->getOrganizationProp($id, "area_code");
                $arrFill['quota'] = $pOrganization->getOrganizationProp($id, "email_quota");
                $arrFill['domain'] = $dataOrgz['domain'];
                if ($credentials['userlevel'] == "superadmin") {
                    if (empty($num_exten)) {
                        $check_e = "checked";
                    } else {
                        $check_e = "";
                        $arrFill["max_num_exten"] = $num_exten;
                    }
                    if (empty($num_queues)) {
                        $check_q = "checked";
                    } else {
                        $check_q = "";
                        $arrFill["max_num_queues"] = $num_queues;
                    }
                    if (empty($num_users)) {
                        $check_u = "checked";
                    } else {
                        $check_u = "";
                        $arrFill["max_num_user"] = $num_users;
                    }
                }
            }
            $smarty->assign("domain_name", $dataOrgz['domain']);
        } else {
            $smarty->assign("mb_title", _tr("Error"));
            $smarty->assign("mb_message", _tr("An error has ocurred to try retrieve organization data"));
            return reportOrganization($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $credentials);
        }
    } else {
        //solo el superadmin tiene permitido crear organizaciones
        if ($credentials['userlevel'] != "superadmin") {
            $smarty->assign("mb_title", _tr("ERROR"));
            $smarty->assign("mb_message", _tr("You are not authorized to perform this action"));
            return reportOrganization($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $credentials);
        }
        if (getParameter("new_organization")) {
            $arrFill['quota'] = 30;
            $check_e = "checked";
            $check_u = "checked";
            $check_q = "checked";
        }
    }
    $smarty->assign("ID", $id);
    //persistence id with input hidden in tpl
    $smarty->assign("ORG_RESTRINCTION", _tr("Organization Limits"));
    $smarty->assign("UNLIMITED", _tr("unlimited"));
    $smarty->assign("CHECK_U", $check_u);
    $smarty->assign("CHECK_E", $check_e);
    $smarty->assign("CHECK_Q", $check_q);
    $smarty->assign("USERLEVEL", $credentials['userlevel']);
    $smarty->assign("APLICAR_CAMBIOS", _tr("Apply Changes"));
    $smarty->assign("SAVE", _tr("Save"));
    $smarty->assign("DELETE", _tr("Delete"));
    $smarty->assign("EDIT", _tr("Edit"));
    $smarty->assign("CANCEL", _tr("Cancel"));
    $smarty->assign("REQUIRED_FIELD", _tr("Required field"));
    $smarty->assign("CONFIRM_CONTINUE", _tr("Are you sure you wish to continue?"));
    // $smarty->assign("icon", "web/apps/organizaciones/images/organization.png");
    //variable usadas en el tpl
    //estas acciones solosp pueden ser realizadas por el susperadmin
    global $arrPermission;
    if ($credentials['userlevel'] == "superadmin") {
        if (in_array('create_org', $arrPermission)) {
            $smarty->assign('CREATE_ORG', TRUE);
        }
        if (in_array('delete_org', $arrPermission)) {
            $smarty->assign('DELETE_ORG', TRUE);
        }
    }
    if (in_array('edit_org', $arrPermission)) {
        $smarty->assign('EDIT_ORG', TRUE);
    }
    $arrFormOrgz = createFieldForm();
    $oForm = new paloForm($smarty, $arrFormOrgz);
    if ($action == "view") {
        $oForm->setViewMode();
        $smarty->assign("edit_entity", 1);
    } else {
        if (getParameter("edit") || getParameter("save_edit")) {
            $oForm->setEditMode();
            $smarty->assign("edit_entity", 1);
        }
    }
    $htmlForm = $oForm->fetchForm("{$local_templates_dir}/form.tpl", _tr("Organization"), $arrFill);
    $content = "<form  method='POST' style='margin-bottom:0;' action='?menu={$module_name}'>" . $htmlForm . "</form>";
    return $content;
}
开发者ID:lordbasex,项目名称:elastix-gui,代码行数:101,代码来源:index.php

示例14: viewFormTC

function viewFormTC($smarty, $module_name, $local_templates_dir, &$pDB, $arrConf, $credentials)
{
    global $arrPermission;
    $error = "";
    $arrRG = array();
    $action = getParameter("action");
    $idTC = getParameter("id_tc");
    if ($action == "view" || getParameter("edit") || getParameter("save_edit")) {
        if (!isset($idTC)) {
            $error = _tr("Invalid Time Conditions");
        } else {
            $domain = getParameter('organization');
            if ($credentials['userlevel'] != 'superadmin') {
                $domain = $credentials['domain'];
            }
            $pTC = new paloSantoTC($pDB, $domain);
            $arrTC = $pTC->getTCById($idTC);
            if ($arrTC === false) {
                $error = _tr($pTC->errMsg);
            } else {
                if (count($arrTC) == 0) {
                    $error = _tr("TC doesn't exist");
                } else {
                    if (getParameter("save_edit")) {
                        $arrTC = $_POST;
                    }
                }
            }
        }
        if ($error != "") {
            $smarty->assign("mb_title", _tr("ERROR"));
            $smarty->assign("mb_message", $error);
            return reportTC($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $credentials);
        }
    } else {
        if ($credentials['userlevel'] == 'superadmin') {
            if (getParameter("create_tc")) {
                $domain = getParameter('organization_add');
                //este parametro solo es selecionable cuando es el superadmin quien crea la ruta
            } else {
                $domain = getParameter('organization');
            }
        } else {
            $domain = $credentials['domain'];
        }
        $pTC = new paloSantoTC($pDB, $domain);
        if (getParameter("create_tc")) {
            $arrTC["goto_m"] = "";
            $arrTC["goto_f"] = "";
        } else {
            $arrTC = $_POST;
        }
    }
    $goto = $pTC->getCategoryDefault($domain);
    if ($goto === false) {
        $goto = array();
    }
    $res1 = $pTC->getDefaultDestination($domain, $arrTC["goto_m"]);
    $destiny1 = $res1 == false ? array() : $res1;
    $res2 = $pTC->getDefaultDestination($domain, $arrTC["goto_f"]);
    $destiny2 = $res2 == false ? array() : $res2;
    $arrForm = createFieldForm($goto, $destiny1, $destiny2, $pTC->getTimeGroup());
    $oForm = new paloForm($smarty, $arrForm);
    if ($action == "view") {
        $oForm->setViewMode();
    } else {
        if (getParameter("edit") || getParameter("save_edit")) {
            $oForm->setEditMode();
        }
    }
    //permission
    $smarty->assign("EDIT_TC", in_array('edit', $arrPermission));
    $smarty->assign("CREATE_TC", in_array('create', $arrPermission));
    $smarty->assign("DEL_TC", in_array('delete', $arrPermission));
    $smarty->assign("REQUIRED_FIELD", _tr("Required field"));
    $smarty->assign("CANCEL", _tr("Cancel"));
    $smarty->assign("OPTIONS", _tr("Options"));
    $smarty->assign("APPLY_CHANGES", _tr("Apply changes"));
    $smarty->assign("SAVE", _tr("Save"));
    $smarty->assign("EDIT", _tr("Edit"));
    $smarty->assign("DELETE", _tr("Delete"));
    $smarty->assign("CONFIRM_CONTINUE", _tr("Are you sure you wish to continue?"));
    $smarty->assign("MODULE_NAME", $module_name);
    $smarty->assign("id_tc", $idTC);
    $smarty->assign("USERLEVEL", $credentials['userlevel']);
    $smarty->assign("ORGANIZATION_LABEL", _tr("Organization Domain"));
    $smarty->assign("ORGANIZATION", $domain);
    $smarty->assign("SETDESTINATION_M", _tr("Destination If Match"));
    $smarty->assign("SETDESTINATION_F", _tr("Destination If Fail"));
    $htmlForm = $oForm->fetchForm("{$local_templates_dir}/new.tpl", _tr("TC Route"), $arrTC);
    $content = "<form  method='POST' style='margin-bottom:0;' action='?menu={$module_name}'>" . $htmlForm . "</form>";
    return $content;
}
开发者ID:netconstructor,项目名称:elastix-mt-gui,代码行数:93,代码来源:index.php

示例15: viewFormDHCP_Configuration

function viewFormDHCP_Configuration($smarty, $module_name, $local_templates_dir, &$pDB, $arrConf, $edit = "true")
{
    $pDHCP_Configuration = new paloSantoDHCP_Configuration($pDB);
    $arrFormDHCP_Configuration = createFieldForm();
    $oForm = new paloForm($smarty, $arrFormDHCP_Configuration);
    //begin, Form data persistence to errors and other events.
    $_DATA = $_POST;
    $action = getParameter("action");
    $id = getParameter("id");
    $smarty->assign("ID", $id);
    //persistence id with input hidden in tpl
    if ($action == "view_dhcpconf") {
        $oForm->setViewMode();
    } else {
        if ($edit == "true") {
            $oForm->setEditMode();
        }
    }
    //end, Form data persistence to errors and other events.
    if ($action == "view_dhcpconf" || $edit == "true") {
        // the action is to view or view_edit.
        $dataDhcpConfig = $pDHCP_Configuration->leerInfoIPFija($id);
        if (is_array($dataDhcpConfig) & count($dataDhcpConfig) > 0) {
            $_DATA = $dataDhcpConfig;
        } else {
            $smarty->assign("mb_title", _tr('Error get Data'));
            $smarty->assign("mb_message", $pDHCP_Configuration->errMsg);
        }
    }
    $smarty->assign("SAVE", _tr('Save'));
    $smarty->assign("EDIT", _tr('Edit'));
    $smarty->assign("CANCEL", _tr('Cancel'));
    $smarty->assign("REQUIRED_FIELD", _tr('Required field'));
    $smarty->assign("icon", "modules/{$module_name}/images/system_network_assign_ip_address.png");
    $smarty->assign("HOST_NAME", _tr('ex_hostname'));
    $smarty->assign("IP_ADDRESS", _tr('ex_ipaddress'));
    $smarty->assign("MAC_ADDRESS", _tr('ex_mac_address'));
    $htmlForm = $oForm->fetchForm("{$local_templates_dir}/form.tpl", _tr('Assign IP Address to Host'), $_DATA);
    $content = "<form  method='POST' style='margin-bottom:0;' action='?menu={$module_name}'>" . $htmlForm . "</form>";
    return $content;
}
开发者ID:hardikk,项目名称:HNH,代码行数:41,代码来源:index.php


注:本文中的paloForm::setViewMode方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。