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


PHP Vtiger_Viewer::fetch方法代码示例

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


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

示例1: ShowModuleIdField

function ShowModuleIdField($selected_module, $tab_only = false)
{
    $db = PearDatabase::getInstance();
    $names = array('Emails', 'PBXManager', 'ModComments', 'SMSNotifier', 'OSSPdf');
    foreach ($names as $id) {
        $in .= "'" . $id . "',";
    }
    $in = trim($in, ',');
    $query = "select tabid, name, customized from vtiger_tab where isentitytype = '1' and presence <> '2' and name not in ( {$in} )";
    $wynik = $db->query($query, true);
    $tablist = array();
    for ($i = 0; $i < $db->num_rows($wynik); $i++) {
        $tablist[$i]['id'] = $db->query_result($wynik, $i, "tabid");
        $label = $db->query_result($wynik, $i, "name");
        if ($db->query_result($wynik, $i, "customized") == 0) {
            $tablist[$i]['label'] = getTranslatedString($label);
        } else {
            $tablist[$i]['label'] = getTranslatedString($label, $label);
        }
    }
    if ($selected_module == '') {
        $SMODULE = $tablist[0]['id'];
    } else {
        $SMODULE = $selected_module;
    }
    if ($tab_only == false) {
        $viewer = new Vtiger_Viewer();
        $viewer->assign("TABLIST", $tablist);
        $viewer->assign("SMODULE", $SMODULE);
        $viewer->assign("SELECTED_MODULE", $selected_module);
        return $viewer->fetch('modules/OSSPdf/FieldModuleid.tpl');
    } else {
        return $tablist;
    }
}
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:35,代码来源:ShowModuleIdField.php

示例2: mStep3

 public function mStep3(Vtiger_Request $request)
 {
     $system = $request->get('system');
     $source_directory = $request->get('source_directory');
     $username = $request->get('username');
     $password = $request->get('password');
     $errorText = '';
     $loginStatus = false;
     $migrationURL = 'Install.php?mode=execute&ajax=true&system=' . $system . '&user=' . $username;
     $viewer = new Vtiger_Viewer();
     $createConfig = Install_InitSchema_Model::createConfig($source_directory, $username, $password, $system);
     if ($createConfig['result']) {
         include 'config/config.inc.php';
         $adb = new PearDatabase($dbconfig['db_type'], $dbconfig['db_hostname'], $dbconfig['db_name'], $dbconfig['db_username'], $dbconfig['db_password']);
         vglobal('adb', $adb);
         $query = "SELECT crypt_type, user_name FROM vtiger_users WHERE user_name=?";
         $result = $adb->requirePsSingleResult($query, array($username), true);
         if ($adb->num_rows($result) > 0) {
             $crypt_type = $adb->query_result($result, 0, 'crypt_type');
             $salt = substr($username, 0, 2);
             if ($crypt_type == 'MD5') {
                 $salt = '$1$' . $salt . '$';
             } elseif ($crypt_type == 'BLOWFISH') {
                 $salt = '$2$' . $salt . '$';
             } elseif ($crypt_type == 'PHP5.3MD5') {
                 $salt = '$1$' . str_pad($salt, 9, '0');
             }
             $encrypted_password = crypt($password, $salt);
             $query = "SELECT 1 from vtiger_users where user_name=? AND user_password=? AND status = ?";
             $result = $adb->requirePsSingleResult($query, array($username, $encrypted_password, 'Active'), true);
             if ($adb->num_rows($result) > 0) {
                 $loginStatus = true;
             }
         }
         if (!$loginStatus) {
             $errorText = 'LBL_WRONG_USERNAME_OR_PASSWORD';
             file_put_contents('config/config.inc.php', '');
         }
     } else {
         $errorText = $createConfig['text'];
     }
     $viewer->setTemplateDir('install/tpl/');
     $viewer->assign('LANG', $request->get('lang'));
     $viewer->assign('MIGRATIONURL', $migrationURL);
     $viewer->assign('ERRORTEXT', $errorText);
     $viewer->assign('MIGRATIONRESULT', $migrationResult);
     echo $viewer->fetch('mStep3.tpl');
     if ($loginStatus) {
         echo $viewer->fetch('mStep3Pre.tpl');
         $migrationResult = Install_InitSchema_Model::executeMigrationSchema($system, $username, $source_directory);
         echo $viewer->fetch('mStep3Post.tpl');
     }
 }
开发者ID:artisan4710,项目名称:YetiForceCRM,代码行数:53,代码来源:Index.php

示例3: Popup


//.........这里部分代码省略.........
                    $modulename = $name;
                    break;
                }
            }
        }
        //echo $modulename;
        if ($modulename != '') {
            $pobierz = $db->query("select tabid from vtiger_tab where name = '{$modulename}'", true);
            $moduleid = $db->query_result($pobierz, 0, "tabid");
            $pobierz_bloki = $db->query("select blockid, blocklabel from vtiger_blocks where tabid = '{$moduleid}'", true);
            $relatedfield_list = array();
            for ($k = 0; $k < $db->num_rows($pobierz_bloki); $k++) {
                $blockid = $db->query_result($pobierz_bloki, $k, "blockid");
                $label = $db->query_result($pobierz_bloki, $k, "blocklabel");
                $pobierz_pola = $db->query("select fieldname,fieldlabel from vtiger_field where block='{$blockid}' and tabid = '{$moduleid}'", true);
                for ($i = 0; $i < $db->num_rows($pobierz_pola); $i++) {
                    if ($modulename == 'Users' && ($db->query_result($pobierz_pola, $i, "fieldname") == 'accesskey' || $db->query_result($pobierz_pola, $i, "fieldname") == 'user_password' || $db->query_result($pobierz_pola, $i, "fieldname") == 'confirm_password')) {
                    } else {
                        $relatedfield_list[vtranslate($label, $modulename)][$i]['name'] = $db->query_result($pobierz_pola, $i, "fieldname");
                        $relatedfield_list[vtranslate($label, $modulename)][$i]['label'] = vtranslate($db->query_result($pobierz_pola, $i, "fieldlabel"), $modulename);
                    }
                }
            }
        }
        if (count($list) == 0) {
            $list[0] = vtranslate('LBL_empty', 'OSSPdf');
        }
        $templates = array();
        if (is_dir($templates_dir)) {
            if ($handle = opendir($templates_dir)) {
                while ($file = readdir($handle)) {
                    if (strstr($file, ".html")) {
                        $templates[] = $file;
                    }
                }
                closedir($handle);
            }
        }
        $pobierz = $db->query("select logoname from vtiger_organizationdetails", true);
        $logo = $db->query_result($pobierz, 0, "logoname");
        $company = array('company_organizationname' => vtranslate('LBL_ORGANIZATION_NAME', 'OSSPdf'), 'storage/Logo/' . $logo => vtranslate('LBL_ORGANIZATION_LOGO', 'OSSPdf'), 'company_address' => vtranslate('LBL_ORGANIZATION_ADDRESS', 'OSSPdf'), 'company_city' => vtranslate('LBL_ORGANIZATION_CITY', 'OSSPdf'), 'company_state' => vtranslate('LBL_ORGANIZATION_STATE', 'OSSPdf'), 'company_code' => vtranslate('LBL_ORGANIZATION_CODE', 'OSSPdf'), 'company_country' => vtranslate('LBL_ORGANIZATION_COUNTRY', 'OSSPdf'), 'company_phone' => vtranslate('LBL_ORGANIZATION_PHONE', 'OSSPdf'), 'company_fax' => vtranslate('LBL_ORGANIZATION_FAX', 'OSSPdf'), 'company_vatid' => vtranslate('LBL_ORGANIZATION_VAT', 'OSSPdf'), 'company_website' => vtranslate('LBL_ORGANIZATION_WEBSITE', 'OSSPdf'));
        $modtab = array(20, 21, 22, 23);
        // lista funkcji specjalnych które mają pojawić się tylko w nietórych modułach
        $funtab = array('amount_in_words', 'replaceProductList', 'replaceProductTable', 'replaceProductTableNP');
        $PRODMODULE = array();
        $dir = dir("modules/OSSPdf/special_functions");
        while ($file = $dir->read()) {
            if ($file != '.' && $file != '..' && $file != 'example.php') {
                include "modules/OSSPdf/special_functions/" . $file;
                $functionname = str_replace(".php", "", $file);
                if (in_array('all', $permitted_modules)) {
                    $PRODMODULE["#special_function#{$functionname}#end_special_function#"] = vtranslate($functionname, "OSSPdf");
                } else {
                    if (in_array(getTabModuleName($chosenid), $permitted_modules)) {
                        $PRODMODULE["#special_function#{$functionname}#end_special_function#"] = vtranslate($functionname, "OSSPdf");
                    }
                }
            }
        }
        $pobierz = "select vtiger_reportmodules.reportmodulesid as id, vtiger_report.reportname as name from vtiger_reportmodules\n        INNER JOIN vtiger_report on (vtiger_report.reportid = vtiger_reportmodules.reportmodulesid ) where vtiger_reportmodules.primarymodule like '%{$chosen_module}'\tOR vtiger_reportmodules.secondarymodules like '%{$chosen_module}%'";
        $zapytanie = $db->query($pobierz, true);
        $reports = array();
        for ($i = 0; $i < $db->num_rows($zapytanie); $i++) {
            $reports[$db->query_result($zapytanie, $i, "id")] = vtranslate($db->query_result($zapytanie, $i, "name"), "Reports");
        }
        $viewer = new Vtiger_Viewer();
        $viewer->assign("MODULE", $modulename);
        $viewer->assign("TABLIST", ShowModuleIdField($request->get('selected_module'), true));
        $viewer->assign("SELECTED_MODULE", $request->get('selected_module'));
        $viewer->assign("PRODMODULE", $PRODMODULE);
        $viewer->assign('ProductModule', $productmodule);
        $viewer->assign("ChosenModule", $request->get('selected_module'));
        $viewer->assign("RELMODULE", $list);
        $viewer->assign("DEFAULT_FIELDS", $field_list);
        $viewer->assign("RELATEDFIELDS", $relatedfield_list);
        $viewer->assign("TEMPLATES", $templates);
        $viewer->assign("COMPANY", $company);
        $viewer->assign("REPORTS", $reports);
        $viewer->assign("LBL_Label", vtranslate("LBL_Label", 'OSSPdf'));
        $viewer->assign("LBL_Field", vtranslate("LBL_Field", 'OSSPdf'));
        $viewer->assign("LBL_CHOSENMODULE", vtranslate("LBL_CHOSENMODULE", 'OSSPdf'));
        $viewer->assign("LBL_INSERTREPORT", vtranslate("LBL_INSERTREPORT", 'OSSPdf'));
        $viewer->assign("LBL_COMPANY_DETAILS", vtranslate("LBL_COMPANY_DETAILS", "Settings"));
        $viewer->assign("LBL_PRODUCT_MODULE", vtranslate("LBL_PRODUCT_MODULE", 'OSSPdf'));
        $viewer->assign("LBL_DEFAULT_FIELDS", vtranslate("LBL_DEFAULT_FIELDS", 'OSSPdf'));
        $viewer->assign("LBL_RELATED_MODULE", vtranslate("LBL_RELATED_MODULE", 'OSSPdf'));
        $viewer->assign("LBL_RELATED_FIELDS", vtranslate("LBL_RELATED_FIELDS", 'OSSPdf'));
        $viewer->assign("LBL_GET_VARIABLE", vtranslate("LBL_GET_VARIABLE", 'OSSPdf'));
        $viewer->assign("LBL_SET_DEFAULT_TEMPLATE", vtranslate("LBL_SET_DEFAULT_TEMPLATE", 'OSSPdf'));
        $viewer->assign("LBL_SELECT_TEMPLATE", vtranslate("LBL_SELECT_TEMPLATE", 'OSSPdf'));
        $viewer->assign("LBL_SELECT_FIELD", vtranslate("LBL_SELECT_FIELD", 'OSSPdf'));
        if ($request->get('changedindex') == 'true') {
            return $viewer->fetch('modules/OSSPdf/selectlist.tpl');
        } elseif ($request->get('changerelatedmodule') == 'true') {
            return $viewer->fetch('modules/OSSPdf/newvalues.tpl');
        } else {
            return $viewer->fetch('modules/OSSPdf/popup.tpl');
        }
    }
}
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:101,代码来源:Popup.php


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