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


PHP paloForm::setEditMode方法代码示例

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


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

示例1: showConfigs

function showConfigs($smarty, $module_name, $local_templates_dir, $pDB, $arrCredentials)
{
    global $arrPermission;
    $fMaster = new paloFaxMaster($pDB);
    $arrForm = fieldFrorm();
    $oForm = new paloForm($smarty, $arrForm);
    $oForm->setEditMode();
    $smarty->assign("EDIT", in_array('edit', $arrPermission));
    if (getParameter("save_default")) {
        $arrDefault['fax_master'] = $_POST['fax_master'];
    } else {
        //obtener el valor de la tarifa por defecto
        $arrDefault['fax_master'] = $fMaster->getFaxMaster();
        if ($arrDefault['fax_master'] === false) {
            $smarty->assign("mb_title", "ERROR");
            $smarty->assign("mb_message", _tr("An error has ocurred to retrieved configuration.") . " " . $fMaster->getErrorMsg());
            $arrDefault['fax_master'] = '';
        }
    }
    $smarty->assign("FAXMASTER_MSG", _tr("Write the email address which will receive the notifications of received messages, errors and activity summary of the Fax Server"));
    $smarty->assign("icon", "web/apps/{$module_name}/images/fax_fax_master.png");
    $smarty->assign("APPLY_CHANGES", _tr("Save"));
    $smarty->assign("REQUIRED_FIELD", _tr("Required field"));
    $strReturn = $oForm->fetchForm("{$local_templates_dir}/fax_master.tpl", _tr("Fax Master Configuration"), $arrDefault);
    return $strReturn;
}
开发者ID:netconstructor,项目名称:elastix-mt-gui,代码行数:26,代码来源:index.php

示例2: 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

示例3: view_adress_book

function view_adress_book($smarty, $module_name, $local_templates_dir, $pDB, $pDB_2, $arrLang, $arrConf, $dsn_agi_manager, $dsnAsterisk, $update = FALSE)
{
    $arrFormadress_book = createFieldForm($pDB);
    $padress_book = new paloAdressBook($pDB);
    $oForm = new paloForm($smarty, $arrFormadress_book);
    $id = getParameter('id');
    if (isset($_POST["edit"]) || $update == TRUE) {
        $oForm->setEditMode();
        $smarty->assign("Commit", 1);
        $smarty->assign("SAVE", "Sửa");
    } else {
        $oForm->setViewMode();
        $smarty->assign("Edit", 1);
    }
    $smarty->assign("icon", "modules/{$module_name}/images/address_book.png");
    $smarty->assign("EDIT", "Sửa");
    $smarty->assign("title", "Thông tin khách hàng");
    $smarty->assign("SAVE", "Lưu");
    $smarty->assign("CANCEL", "Đóng");
    $smarty->assign("REQUIRED_FIELD", "Bắt buộc");
    $contactData = $padress_book->contactData($id);
    if ($contactData) {
        $smarty->assign("ID", $id);
    } else {
        $smarty->assign("mb_title", "Lỗi");
        $smarty->assign("mb_message", 'Không cho phép xem');
        return report_adress_book($smarty, $module_name, $local_templates_dir, $pDB, $pDB_2, $arrLang, $arrConf, $dsn_agi_manager, $dsnAsterisk);
    }
    if ($contactData['type'] == '0') {
        $smarty->assign("check_0", "checked");
    } elseif ($contactData['type'] == '1') {
        $smarty->assign("check_1", "checked");
    } elseif ($contactData['type'] == '2') {
        $smarty->assign("check_2", "checked");
    } else {
        $smarty->assign("check_3", "checked");
    }
    // get contact list to show in smarty
    $smarty->assign("CONTACT", $contactData['contact']);
    // get phone list
    foreach ($contactData['number'] as $v) {
        $arr_phone .= $v . "\n";
    }
    $arrData['firstname'] = $contactData['firstname'];
    $arrData['lastname'] = $contactData['lastname'];
    $arrData['company'] = $contactData['company'];
    $arrData['email'] = $contactData['email'];
    $arrData['cmnd'] = $contactData['cmnd'];
    $arrData['passport'] = $contactData['passport'];
    $arrData['birthday'] = date("d-m-Y", strtotime($contactData['birthday']));
    $arrData['birthplace'] = $contactData['birthplace'];
    $arrData['address'] = $contactData['address'];
    $arrData['membership'] = $contactData['membership'];
    $arrData['sale'] = $contactData['sale'];
    $arrData['booker'] = $contactData['agent_id'];
    $arrData['accountant'] = $contactData['accountant'];
    $arrData['payment_type'] = $contactData['payment_type'];
    $arrData['customer_code'] = $contactData['customer_code'];
    // for company customer
    $arrData['company_name'] = $contactData['firstname'];
    $arrData['company_booker'] = $contactData['agent_id'];
    $arrData['company_code'] = $contactData['customer_code'];
    $arrData['company_pay_type'] = $contactData['payment_type'];
    $arrData['company_sale'] = $contactData['sale'];
    $arrData['company_accountant'] = $contactData['accountant'];
    $arrData['company_address'] = $contactData['address'];
    $arrData['company_membership'] = $contactData['membership'];
    $arrData['phone'] = $arr_phone;
    $htmlForm = $oForm->fetchForm("{$local_templates_dir}/new_adress_book.tpl", "Thông tin khách hàng", $arrData);
    $contenidoModulo = "<form  method='POST' enctype='multipart/form-data' style='margin-bottom:0;' action='?menu={$module_name}'>" . $htmlForm . "</form>";
    return $contenidoModulo;
}
开发者ID:hardikk,项目名称:HNH,代码行数:72,代码来源:index.php

示例4: 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

示例5: 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

示例6: viewFormGroup

function viewFormGroup($smarty, $module_name, $local_templates_dir, &$pDB, $arrConf, $userLevel1, $userAccount, $idOrganization)
{
    $pACL = new paloACL($pDB);
    $pORGZ = new paloSantoOrganization($pDB);
    $arrFill = array();
    $action = getParameter("action");
    $arrOrgz = array(0 => _tr("Select one Organization"));
    if ($userLevel1 == "superadmin") {
        $orgTmp = $pORGZ->getOrganization(array());
    } else {
        $orgTmp = $pORGZ->getOrganization(array("id" => $idOrganization));
    }
    if ($orgTmp === false) {
        $smarty->assign("mb_title", _tr("ERROR"));
        $smarty->assign("mb_message", _tr($pORGZ->errMsg));
        return reportGroup($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $userLevel1, $userAccount, $idOrganization);
    } else {
        if (count($orgTmp) == 0) {
            $smarty->assign("mb_title", _tr("ERROR"));
            $smarty->assign("mb_message", _tr("You haven't created any organization"));
            return reportGroup($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $userLevel1, $userAccount, $idOrganization);
        }
        foreach ($orgTmp as $value) {
            $arrOrgz[$value["id"]] = $value["name"];
        }
    }
    $idGroup = getParameter("id");
    $arrFill = $_POST;
    if ($action == "view" || getParameter("edit") || getParameter("save_edit")) {
        if (!isset($idGroup)) {
            $smarty->assign("mb_title", _tr("ERROR"));
            $smarty->assign("mb_message", _tr("Invalid Group"));
            return reportGroup($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $userLevel1, $userAccount, $idOrganization);
        } else {
            if ($userLevel1 == "superadmin") {
                $arrGroup = $pACL->getGroups($idGroup);
            } else {
                $arrGroup = $pACL->getGroups($idGroup, $idOrganization);
            }
        }
        if ($arrGroup === false) {
            $smarty->assign("mb_title", _tr("ERROR"));
            $smarty->assign("mb_message", _tr($pACL->errMsg));
            return reportGroup($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $userLevel1, $userAccount, $idOrganization);
        } elseif (count($arrGroup) == 0) {
            $smarty->assign("mb_title", _tr("ERROR"));
            $smarty->assign("mb_message", _tr("Group doesn't exist"));
            return reportGroup($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $userLevel1, $userAccount, $idOrganization);
        } else {
            if ($arrGroup[0][3] == 1) {
                $smarty->assign("mb_title", _tr("ERROR"));
                $smarty->assign("mb_message", _tr("Group doesn't exist"));
                return reportGroup($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $userLevel1, $userAccount, $idOrganization);
            }
            $arrFill["group"] = _tr($arrGroup[0][1]);
            $arrFill["description"] = _tr($arrGroup[0][2]);
            $arrFill["organization"] = $arrGroup[0][3];
            $smarty->assign("GROUP", $arrFill["group"]);
            $smarty->assign("ORGANIZATION", $arrOrgz[$arrFill["organization"]]);
        }
        if (getParameter("save_edit")) {
            $arrFill["description"] = $_POST["description"];
        }
    }
    $arrFormGroup = createFieldForm($arrOrgz);
    $oForm = new paloForm($smarty, $arrFormGroup);
    if ($action == "view") {
        $oForm->setViewMode();
    } else {
        if ($action == "view_edit" || getParameter("edit") || getParameter("save_edit")) {
            $oForm->setEditMode();
        }
    }
    global $arrPermission;
    if (in_array('create_group', $arrPermission)) {
        $smarty->assign("CREATE_GROUP", true);
    }
    if (in_array('edit_group', $arrPermission)) {
        $smarty->assign("EDIT_GROUP", true);
    }
    if (in_array('delete_group', $arrPermission)) {
        $smarty->assign("DELETE_GROUP", 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("icon", "web/apps/{$module_name}/images/system_groups.png");
    $smarty->assign("CONFIRM_CONTINUE", _tr("Are you sure you wish to continue?"));
    $smarty->assign("USERLEVEL", $userLevel1);
    $smarty->assign("id_group", $idGroup);
    $htmlForm = $oForm->fetchForm("{$local_templates_dir}/grouplist.tpl", _tr("Group"), $arrFill);
    $content = "<form  method='POST' style='margin-bottom:0;' action='?menu={$module_name}'>" . $htmlForm . "</form>";
    return $content;
}
开发者ID:lordbasex,项目名称:elastix-gui,代码行数:97,代码来源:index.php

示例7: viewFormAnnouncement

function viewFormAnnouncement($smarty, $module_name, $local_templates_dir, &$pDB, $arrConf, $credentials)
{
    global $arrPermission;
    $error = "";
    $arrAnnouncement = array();
    $action = getParameter("action");
    $idAnnouncement = getParameter("id_ann");
    if ($action == "view" || $action == "view_edit" || getParameter("edit") || getParameter("save_edit")) {
        if (!isset($idAnnouncement)) {
            $error = _tr("Invalid Announcement ID");
        } else {
            $domain = getParameter('organization');
            if ($credentials['userlevel'] != 'superadmin') {
                $domain = $credentials['domain'];
            }
            $pAnnouncement = new paloSantoAnnouncement($pDB, $domain);
            $arrAnnouncement = $pAnnouncement->getAnnouncementById($idAnnouncement);
            if ($arrAnnouncement === false) {
                $error = _tr($pAnnouncement->errMsg);
            } else {
                if (count($arrAnnouncement) == 0) {
                    $error = _tr("Announcement doesn't exist");
                } else {
                    if (getParameter("save_edit")) {
                        $arrAnnouncement = $_POST;
                    }
                }
            }
        }
        if ($error != "") {
            $smarty->assign("mb_title", _tr("ERROR"));
            $smarty->assign("mb_message", $error);
            return reportAnnouncement($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $credentials);
        }
    } else {
        // new, create
        if ($credentials['userlevel'] == 'superadmin') {
            if (getParameter("create_announcement")) {
                $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'];
        }
        $pAnnouncement = new paloSantoAnnouncement($pDB, $domain);
        if (getParameter("create_announcement")) {
            $arrAnnouncement["description"] = "";
            $arrAnnouncement["recording_id"] = "none";
            $arrAnnouncement["allow_skip"] = "no";
            $arrAnnouncement["return_ivr"] = "no";
            $arrAnnouncement["noanswer"] = "no";
            $arrAnnouncement["repeat_msg"] = "disable";
            $arrAnnouncement["destination"] = "";
            $arrAnnouncement["goto"] = "";
        } else {
            $arrAnnouncement = $_POST;
        }
    }
    $goto = $pAnnouncement->getCategoryDefault($domain);
    if ($goto === false) {
        $goto = array();
    }
    $res = $pAnnouncement->getDefaultDestination($domain, $arrAnnouncement["goto"]);
    $destiny = $res == false ? array() : $res;
    $arrFormOrgz = createFieldForm($goto, $destiny, $pDB, $domain);
    $oForm = new paloForm($smarty, $arrFormOrgz);
    if ($action == "view") {
        $oForm->setViewMode();
    } else {
        if ($action == "view_edit" || getParameter("edit") || getParameter("save_edit")) {
            $oForm->setEditMode();
        }
    }
    //permission
    $smarty->assign("EDIT_ANN", in_array('edit', $arrPermission));
    $smarty->assign("CREATE_ANN", in_array('create', $arrPermission));
    $smarty->assign("DEL_ANN", 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_ann", $idAnnouncement);
    $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("Announcement"), $arrAnnouncement);
    $content = "<form  method='POST' style='margin-bottom:0;' action='?menu={$module_name}'>" . $htmlForm . "</form>";
    return $content;
}
开发者ID:netconstructor,项目名称:elastix-mt-gui,代码行数:96,代码来源:index.php

示例8: viewFormIngresodeBasedeClientes

function viewFormIngresodeBasedeClientes($smarty, $module_name, $local_templates_dir, &$pDB, $arrConf)
{
    $pIngresodeBasedeClientes = new paloSantoIngresodeBasedeClientes($pDB);
    $arrFormIngresodeBasedeClientes = createFieldForm($pDB);
    if (!is_array($arrFormIngresodeBasedeClientes)) {
        return $arrFormIngresodeBasedeClientes;
    }
    $oForm = new paloForm($smarty, $arrFormIngresodeBasedeClientes);
    //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.
        $dataIngresodeBasedeClientes = $pIngresodeBasedeClientes->getIngresodeBasedeClientesById($id);
        if (is_array($dataIngresodeBasedeClientes) & count($dataIngresodeBasedeClientes) > 0) {
            $_DATA = $dataIngresodeBasedeClientes;
        } else {
            $smarty->assign("mb_title", _tr("Error get Data"));
            $smarty->assign("mb_message", $pIngresodeBasedeClientes->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");
    //Editar base
    $edit_base = getParameter("edit_base");
    $id_base = getParameter("id_base");
    $id_campania = getParameter("id_campania");
    if ($edit_base == "si") {
        $base = $pIngresodeBasedeClientes->getDatosBase($id_base, $id_campania);
        $_DATA = $base;
        $smarty->assign("view_edit", "si");
        $smarty->assign("id_campania", $id_campania);
        $smarty->assign("id_base", $id_base);
    }
    $htmlForm = $oForm->fetchForm("{$local_templates_dir}/form.tpl", _tr("Ingreso de Base de Clientes"), $_DATA);
    $content = "<form method='POST' enctype='multipart/form-data' style='margin-bottom:0;' action='?menu={$module_name}'>" . $htmlForm . "</form>";
    return $content;
}
开发者ID:veraveramanolo,项目名称:cpc2c_uio,代码行数:52,代码来源:index.php

示例9: _moduleContent

function _moduleContent(&$smarty, $module_name)
{
    include_once "libs/paloSantoDB.class.php";
    include_once "libs/paloSantoGrid.class.php";
    include_once "libs/paloSantoACL.class.php";
    include_once "modules/{$module_name}/configs/default.conf.php";
    load_language_module($module_name);
    //global variables
    global $arrConf;
    global $arrConfModule;
    $arrConf = array_merge($arrConf, $arrConfModule);
    /////conexion a php
    $pDB = new paloDB($arrConf['elastix_dsn']['acl']);
    //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'];
    if (!empty($pDB->errMsg)) {
        echo "ERROR DE DB: {$pDB->errMsg} <br>";
    }
    $arrData = array();
    $pACL = new paloACL($pDB);
    if (!empty($pACL->errMsg)) {
        echo "ERROR DE ACL: {$pACL->errMsg} <br>";
    }
    $arrFormElements = array("description" => array("LABEL" => _tr("Description"), "REQUIRED" => "yes", "INPUT_TYPE" => "TEXT", "INPUT_EXTRA_PARAM" => "", "VALIDATION_TYPE" => "text", "VALIDATION_EXTRA_PARAM" => ""), "group" => array("LABEL" => _tr("Group"), "REQUIRED" => "yes", "INPUT_TYPE" => "TEXT", "INPUT_EXTRA_PARAM" => "", "VALIDATION_TYPE" => "text", "VALIDATION_EXTRA_PARAM" => ""));
    //description  id  name
    $contenidoModulo = "";
    $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("icon", "modules/{$module_name}/images/system_groups.png");
    $smarty->assign("CONFIRM_CONTINUE", _tr("Are you sure you wish to continue?"));
    if (isset($_POST['submit_create_group'])) {
        // Implementar
        include_once "libs/paloSantoForm.class.php";
        $arrFillGroup['group'] = '';
        $arrFillGroup['description'] = '';
        $oForm = new paloForm($smarty, $arrFormElements);
        $contenidoModulo = $oForm->fetchForm("{$local_templates_dir}/grouplist.tpl", _tr("New Group"), $arrFillGroup);
    } else {
        if (isset($_POST['edit'])) {
            // Tengo que recuperar la data del usuario
            $pACL = new paloACL($pDB);
            $arrGroup = $pACL->getGroups($_POST['id_group']);
            if (!is_array($arrGroup)) {
                $contenidoModulo = '';
                Header("Location: ?menu={$module_name}");
            } else {
                if ($arrGroup[0][1] == 'administrator') {
                    $arrGroup[0][1] = _tr('administrator');
                } else {
                    if ($arrGroup[0][1] == 'operator') {
                        $arrGroup[0][1] = _tr('operator');
                    } else {
                        if ($arrGroup[0][1] == 'extension') {
                            $arrGroup[0][1] = _tr('extension');
                        }
                    }
                }
                if ($arrGroup[0][2] == 'total access') {
                    $arrGroup[0][2] = _tr('total access');
                } else {
                    if ($arrGroup[0][2] == 'operator') {
                        $arrGroup[0][2] = _tr('operator');
                    } else {
                        if ($arrGroup[0][2] == 'extension user') {
                            $arrGroup[0][2] = _tr('extension user');
                        }
                    }
                }
                $arrFillGroup['group'] = $arrGroup[0][1];
                $arrFillGroup['description'] = $arrGroup[0][2];
                // Implementar
                include_once "libs/paloSantoForm.class.php";
                $oForm = new paloForm($smarty, $arrFormElements);
                $oForm->setEditMode();
                $smarty->assign("id_group", htmlspecialchars($_POST['id_group'], ENT_COMPAT, 'UTF-8'));
                $contenidoModulo = $oForm->fetchForm("{$local_templates_dir}/grouplist.tpl", _tr('Edit Group') . " \"" . $arrFillGroup['group'] . "\"", $arrFillGroup);
            }
        } else {
            if (isset($_POST['submit_save_group'])) {
                include_once "libs/paloSantoForm.class.php";
                $oForm = new paloForm($smarty, $arrFormElements);
                if ($oForm->validateForm($_POST)) {
                    // Exito, puedo procesar los datos ahora.
                    $pACL = new paloACL($pDB);
                    // Creo el Grupo
                    $pACL->createGroup($_POST['group'], $_POST['description']);
                    if (!empty($pACL->errMsg)) {
                        // Ocurrio algun error aqui
                        $smarty->assign("mb_message", "ERROR: {$pACL->errMsg}");
                        $contenidoModulo = $oForm->fetchForm("{$local_templates_dir}/grouplist.tpl", _tr("New Group"), $_POST);
                    } else {
                        header("Location: ?menu=grouplist");
                    }
                } else {
//.........这里部分代码省略.........
开发者ID:hardikk,项目名称:HNH,代码行数:101,代码来源:index.php

示例10: viewFormOutbound


//.........这里部分代码省略.........
                    $arrTrunkPriority = array();
                    foreach ($arrTrunks as $trunk) {
                        $val = $pOutbound->getTrunkById($trunk);
                        $arrTrunkPriority[$val["trunkid"]] = $val["name"] . "/" . strtoupper($val["tech"]);
                    }
                    $smarty->assign('trunks', $arrTrunkPriority);
                    $arrDif = array_diff_assoc($arrAllTrunks, $arrTrunkPriority);
                    $smarty->assign('arrDif', $arrDif);
                }
                if ($action == "view" || getParameter("edit")) {
                    $arrDialPattern = $pOutbound->getArrDestine($idOutbound);
                }
                $smarty->assign('items', $arrDialPattern);
                if (getParameter("save_edit")) {
                    $arrOutbound = $_POST;
                }
            }
        }
    } else {
        $arrOutbound = $_POST;
        $domain = getParameter('organization_add');
        //este parametro solo es selecionable cuando es el superadmin quien crea la ruta
        if ($credentials['userlevel'] != 'superadmin') {
            $domain = $credentials['domain'];
        }
        $pOutbound = new paloSantoOutbound($pDB, $domain);
        $domain = $pOutbound->getDomain();
        if (empty($domain)) {
            $smarty->assign("mb_title", _tr("ERROR"));
            $smarty->assign("mb_message", _tr("Invalid Organization"));
            return reportOutbound($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $credentials);
        }
        $smarty->assign('j', 0);
        $smarty->assign('items', $arrDialPattern);
        $arrTrunks = array();
        //todas las truncales que han sido asignadas a la organizacion
        $arrAllTrunks = $pOutbound->getTrunks();
        //conjunto de id de las truncales que han sido seleccionadas para la ruta
        $arrTrunk = getParameter("arrTrunks");
        $tmp = explode(",", $arrTrunk);
        $arrTrunk = array_values(array_diff($tmp, array('')));
        //verifico que los indices de las truncales dadas existan y que hayan sido asiganados a la organizacion
        if (is_array($arrTrunk) && is_array($arrAllTrunks)) {
            $arrTrunks = array_intersect($arrTrunk, array_keys($arrAllTrunks));
        }
        $arrTrunkPriority = array();
        foreach ($arrTrunks as $trunk) {
            $val = $pOutbound->getTrunkById($trunk);
            $arrTrunkPriority[$val["trunkid"]] = $val["name"] . "/" . strtoupper($val["tech"]);
        }
        $smarty->assign('trunks', $arrTrunkPriority);
        $arrDif = array_diff_assoc($arrAllTrunks, $arrTrunkPriority);
        $smarty->assign('arrDif', $arrDif);
    }
    $arrForm = createFieldForm($pDB, $domain);
    $oForm = new paloForm($smarty, $arrForm);
    if ($action == "view") {
        $oForm->setViewMode();
    } else {
        if ($action == "view_edit" || getParameter("edit") || getParameter("save_edit")) {
            $oForm->setEditMode();
        }
    }
    $smarty->assign("EDIT_ROUTE", in_array('edit', $arrPermission));
    $smarty->assign("CREATE_ROUTE", in_array('create', $arrPermission));
    $smarty->assign("DELETE_ROUTE", in_array('delete', $arrPermission));
    //$smarty->assign("ERROREXT",_tr($pTrunk->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_outbound", $idOutbound);
    $smarty->assign("USERLEVEL", $credentials['userlevel']);
    $smarty->assign("ORGANIZATION_LABEL", _tr("Organization Domain"));
    $smarty->assign("ORGANIZATION", $domain);
    $smarty->assign("CALLERID", _tr("Caller Id"));
    $smarty->assign("PREPEND", _tr("Prepend"));
    $smarty->assign("PREFIX", _tr("Prefix"));
    $smarty->assign("MATCH_PATTERN", _tr("Match Pattern"));
    $smarty->assign("RULES", _tr("Dial Patterns"));
    $smarty->assign("GENERAL", _tr("General"));
    $smarty->assign("TRUNK_SEQUENCE", _tr("Trunk Sequence for Matched Routes"));
    $smarty->assign("DRAGANDDROP", _tr("Drag and Drop Trunk into Sequence Trunk Area"));
    $smarty->assign("TRUNKS", _tr("TRUNKS"));
    $smarty->assign("SEQUENCE", _tr("TRUNKS SEQUENCE"));
    $smarty->assign("SETTINGS", _tr("Settings"));
    $smarty->assign("PEERDETAIL", _tr("PEER Details"));
    $smarty->assign("USERDETAIL", _tr("USER Details"));
    $smarty->assign("REGISTRATION", _tr("Registration"));
    $smarty->assign("OUTGOING_SETTINGS", _tr("Outgoing Settings"));
    $smarty->assign("INCOMING_SETTINGS", _tr("Incoming Settings"));
    $smarty->assign("OVEREXTEN", _tr("Override Extension"));
    $htmlForm = $oForm->fetchForm("{$local_templates_dir}/new.tpl", _tr("Outbound Route"), $arrOutbound);
    $content = "<form  method='POST' style='margin-bottom:0;' action='?menu={$module_name}'>" . $htmlForm . "</form>";
    return $content;
}
开发者ID:Neo2SHYAlien,项目名称:elastix-mt-gui,代码行数:101,代码来源:index.php

示例11: viewFormExten


//.........这里部分代码省略.........
                        $smarty->assign("CHECKED", "checked");
                        $smarty->assign("DISPLAY_VM", "style='visibility: visible;'");
                    } else {
                        if ($action == "view") {
                            $smarty->assign("DIV_VM", "no");
                        } else {
                            $arrVM = $pExten->getVMdefault($domain);
                            $arrExten["vmcontext"] = $arrVM["vmcontext"];
                            $arrExten["vmattach"] = $arrVM["vmattach"];
                            $arrExten["vmdelete"] = $arrVM["vmdelete"];
                            $arrExten["vmsaycid"] = $arrVM["vmsaycid"];
                            $arrExten["vmenvelope"] = $arrVM["vmenvelope"];
                            $arrExten["vmemailsubject"] = $arrVM["vmemailsubject"];
                            $arrExten["vmemailbody"] = $arrVM["vmemailbody"];
                            $arrExten["vmx_locator"] = "enabled";
                            $arrExten["vmx_use"] = "both";
                            $arrExten["vmx_operator"] = "on";
                        }
                    }
                }
            }
        }
    } else {
        $tech = null;
        $smarty->assign("USER_EXTEN", true);
        if ($credentials['userlevel'] == 'superadmin') {
            if (getParameter("create_exten")) {
                $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'];
        }
        if (getParameter("create_exten")) {
            $arrExten["technology"] = "sip";
            $arrExten = $pExten->getDefaultSettings($domain, "sip");
        } else {
            $arrExten = $_POST;
        }
        if (isset($_POST["create_vm"])) {
            $smarty->assign("VALVM", "value='yes'");
            $smarty->assign("CHECKED", "checked");
        }
    }
    $arrFormOrgz = createFieldForm($tech);
    $oForm = new paloForm($smarty, $arrFormOrgz);
    if ($action == "view") {
        $oForm->setViewMode();
    } else {
        if ($action == "view_edit" || getParameter("edit") || getParameter("save_edit")) {
            $oForm->setEditMode();
            $mostrar = getParameter("mostra_adv");
            if (isset($mostrar)) {
                if ($mostrar == "yes") {
                    $smarty->assign("SHOW_MORE", "style='visibility: visible;'");
                    $smarty->assign("mostra_adv", "yes");
                } else {
                    $smarty->assign("SHOW_MORE", "style='display: none;'");
                    $smarty->assign("mostra_adv", "no");
                }
            } else {
                $smarty->assign("SHOW_MORE", "style='display: none;'");
                $smarty->assign("mostra_adv", "yes");
            }
        }
    }
    //permission
    $smarty->assign("EDIT_EXTEN", in_array('edit', $arrPermission));
    $smarty->assign("CREATE_EXTEN", in_array('create', $arrPermission));
    $smarty->assign("DEL_EXTEN", in_array('delete', $arrPermission));
    $smarty->assign("ERROREXT", _tr($pExten->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("VOICEMAIL_SETTINGS", _tr("Voicemail Settings"));
    $smarty->assign("MODULE_NAME", $module_name);
    $smarty->assign("id_exten", $idExten);
    $smarty->assign("USERLEVEL", $credentials['userlevel']);
    $smarty->assign("ORGANIZATION_LABEL", _tr("Organization Domain"));
    $smarty->assign("ORGANIZATION", $domain);
    $smarty->assign("CREATE_VM", _tr("Enabled Voicemail"));
    $smarty->assign("DEV_OPTIONS", _tr("Device Settings"));
    $smarty->assign("ADV_OPTIONS", _tr("Advanced Settings"));
    $smarty->assign("DICT_OPTIONS", _tr("Dictation Settings"));
    $smarty->assign("REC_OPTIONS", _tr("Recording Settings"));
    $smarty->assign("VM_OPTIONS", _tr("Voicemail Settings"));
    $smarty->assign("EXTENSION", _tr("GENERAL"));
    $smarty->assign("DEVICE", _tr("DEVICE"));
    $smarty->assign("VOICEMAIL", _tr("VOICEMAIL"));
    $smarty->assign("LOCATOR", _tr("Vmx Locator"));
    $htmlForm = $oForm->fetchForm("{$local_templates_dir}/new.tpl", _tr("Extensions"), $arrExten);
    $content = "<form  method='POST' style='margin-bottom:0;' action='?menu={$module_name}'>" . $htmlForm . "</form>";
    return $content;
}
开发者ID:netconstructor,项目名称:elastix-mt-gui,代码行数:101,代码来源:index.php

示例12: 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

示例13: 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

示例14: 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

示例15: viewFormInbound

function viewFormInbound($smarty, $module_name, $local_templates_dir, &$pDB, $arrConf, $credentials)
{
    global $arrPermission;
    $error = "";
    $arrInbound = array();
    $action = getParameter("action");
    $idInbound = getParameter("id_inbound");
    if ($action == "view" || getParameter("edit") || getParameter("save_edit")) {
        if (!isset($idInbound)) {
            $error = _tr("Invalid Inbound Route");
        }
        $domain = getParameter('organization');
        if ($credentials['userlevel'] != 'superadmin') {
            $domain = $credentials['domain'];
        }
        $pInbound = new paloSantoInbound($pDB, $domain);
        $arrInbound = $pInbound->getInboundById($idInbound);
        if ($error == "") {
            if ($arrInbound === false) {
                $error = $pInbound->errMsg;
            } else {
                if (count($arrInbound) == 0) {
                    $error = _tr("Inbound doesn't exist");
                } else {
                    if (getParameter("save_edit")) {
                        $arrInbound = $_POST;
                    }
                    $smarty->assign("fax_detect_act", $arrInbound["fax_detect"]);
                    $smarty->assign("privacy_act", $arrInbound["primanager"]);
                }
            }
        }
        if ($error != "") {
            $smarty->assign("mb_title", _tr("ERROR"));
            $smarty->assign("mb_message", $error);
            return reportInbound($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $credentials);
        }
    } else {
        if ($credentials['userlevel'] == 'superadmin') {
            if (getParameter("create_inbound")) {
                $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'];
        }
        $pInbound = new paloSantoInbound($pDB, $domain);
        $domain = $pInbound->getDomain();
        if (empty($domain)) {
            $smarty->assign("mb_title", _tr("ERROR"));
            $smarty->assign("mb_message", _tr("Invalid Organization"));
            return reportInbound($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $credentials);
        }
        if (getParameter("create_inbound")) {
            $arrInbound["primanager"] = "no";
            $arrInbound["fax_detect"] = "no";
            $arrInbound["fax_time"] = "4";
            $arrInbound["fax_type"] = "fax";
            $arrInbound["min_length"] = "3";
            $arrInbound["max_attempt"] = "5";
            $arrInbound["goto"] = "";
        } else {
            $arrInbound = $_POST;
        }
    }
    $goto = $pInbound->getCategoryDefault($domain);
    if ($goto === false) {
        $goto = array();
    }
    $res = $pInbound->getDefaultDestination($domain, $arrInbound["goto"]);
    $destiny = $res == false ? array() : $res;
    $arrForm = createFieldForm($goto, $destiny, $pInbound->getFaxExtesion(), $pInbound->getDetectFax(), $pInbound->getMoHClass($domain));
    $oForm = new paloForm($smarty, $arrForm);
    if ($action == "view") {
        $oForm->setViewMode();
    } else {
        if ($action == "view_edit" || getParameter("edit") || getParameter("save_edit")) {
            $oForm->setEditMode();
        }
    }
    $smarty->assign("EDIT_ROUTE", in_array('edit', $arrPermission));
    $smarty->assign("CREATE_ROUTE", in_array('create', $arrPermission));
    $smarty->assign("DELETE_ROUTE", 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_inbound", $idInbound);
    $smarty->assign("USERLEVEL", $credentials['userlevel']);
    $smarty->assign("ORGANIZATION_LABEL", _tr("Organization Domain"));
    $smarty->assign("ORGANIZATION", $domain);
    $smarty->assign("CALLERID", _tr("Caller Id"));
//.........这里部分代码省略.........
开发者ID:netconstructor,项目名称:elastix-mt-gui,代码行数:101,代码来源:index.php


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