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


PHP VTCacheUtils::lookupReport_ListofModuleInfos方法代码示例

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


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

示例1: initListOfModules

 function initListOfModules()
 {
     global $adb, $current_user, $old_related_modules;
     $restricted_modules = array('Events');
     $restricted_blocks = array('LBL_COMMENTS', 'LBL_COMMENT_INFORMATION');
     $this->module_id = array();
     $this->module_list = array();
     // Prefetch module info to check active or not and also get list of tabs
     $modulerows = vtlib_prefetchModuleActiveInfo(false);
     $cachedInfo = VTCacheUtils::lookupReport_ListofModuleInfos();
     if ($cachedInfo !== false) {
         $this->module_list = $cachedInfo['module_list'];
         $this->related_modules = $cachedInfo['related_modules'];
     } else {
         if ($modulerows) {
             foreach ($modulerows as $resultrow) {
                 if ($resultrow['presence'] == '1') {
                     continue;
                 }
                 // skip disabled modules
                 if ($resultrow['isentitytype'] != '1') {
                     continue;
                 }
                 // skip extension modules
                 if (in_array($resultrow['name'], $restricted_modules)) {
                     // skip restricted modules
                     continue;
                 }
                 if ($resultrow['name'] != 'Calendar') {
                     $this->module_id[$resultrow['tabid']] = $resultrow['name'];
                 } else {
                     $this->module_id[9] = $resultrow['name'];
                     $this->module_id[16] = $resultrow['name'];
                 }
                 $this->module_list[$resultrow['name']] = array();
             }
             $moduleids = array_keys($this->module_id);
             $reportblocks = $adb->pquery("SELECT blockid, blocklabel, tabid FROM vtiger_blocks WHERE tabid IN (" . generateQuestionMarks($moduleids) . ")", array($moduleids));
             $prev_block_label = '';
             if ($adb->num_rows($reportblocks)) {
                 while ($resultrow = $adb->fetch_array($reportblocks)) {
                     $blockid = $resultrow['blockid'];
                     $blocklabel = $resultrow['blocklabel'];
                     $module = $this->module_id[$resultrow['tabid']];
                     if (in_array($blocklabel, $restricted_blocks) || in_array($blockid, $this->module_list[$module]) || isset($this->module_list[$module][getTranslatedString($blocklabel, $module)])) {
                         continue;
                     }
                     if (!empty($blocklabel)) {
                         if ($module == 'Calendar' && $blocklabel == 'LBL_CUSTOM_INFORMATION') {
                             $this->module_list[$module][$blockid] = getTranslatedString($blocklabel, $module);
                         } else {
                             $this->module_list[$module][$blockid] = getTranslatedString($blocklabel, $module);
                         }
                         $prev_block_label = $blocklabel;
                     } else {
                         $this->module_list[$module][$blockid] = getTranslatedString($prev_block_label, $module);
                     }
                 }
             }
             $relatedmodules = $adb->pquery("SELECT vtiger_tab.name, vtiger_relatedlists.tabid FROM vtiger_tab\n\t\t\t\t\tINNER JOIN vtiger_relatedlists on vtiger_tab.tabid=vtiger_relatedlists.related_tabid\n\t\t\t\t\tWHERE vtiger_tab.isentitytype=1\n\t\t\t\t\tAND vtiger_tab.name NOT IN(" . generateQuestionMarks($restricted_modules) . ")\n\t\t\t\t\tAND vtiger_tab.presence = 0 AND vtiger_relatedlists.label!='Activity History'\n\t\t\t\t\tUNION\n\t\t\t\t\tSELECT module, vtiger_tab.tabid FROM vtiger_fieldmodulerel\n\t\t\t\t\tINNER JOIN vtiger_tab on vtiger_tab.name = vtiger_fieldmodulerel.relmodule\n\t\t\t\t\tWHERE vtiger_tab.isentitytype = 1\n\t\t\t\t\tAND vtiger_tab.name NOT IN(" . generateQuestionMarks($restricted_modules) . ")\n\t\t\t\t\tAND vtiger_tab.presence = 0", array($restricted_modules, $restricted_modules));
             if ($adb->num_rows($relatedmodules)) {
                 while ($resultrow = $adb->fetch_array($relatedmodules)) {
                     $module = $this->module_id[$resultrow['tabid']];
                     if (!isset($this->related_modules[$module])) {
                         $this->related_modules[$module] = array();
                     }
                     if ($module != $resultrow['name']) {
                         $this->related_modules[$module][] = $resultrow['name'];
                     }
                     // To achieve Backward Compatability with Report relations
                     if (isset($old_related_modules[$module])) {
                         $rel_mod = array();
                         foreach ($old_related_modules[$module] as $key => $name) {
                             if (vtlib_isModuleActive($name) && isPermitted($name, 'index', '')) {
                                 $rel_mod[] = $name;
                             }
                         }
                         if (!empty($rel_mod)) {
                             $this->related_modules[$module] = array_merge($this->related_modules[$module], $rel_mod);
                             $this->related_modules[$module] = array_unique($this->related_modules[$module]);
                         }
                     }
                 }
             }
             foreach ($this->related_modules as $module => $related_modules) {
                 if ($module == 'Emails') {
                     $this->related_modules[$module] = getEmailRelatedModules();
                 }
             }
             // Put the information in cache for re-use
             VTCacheUtils::updateReport_ListofModuleInfos($this->module_list, $this->related_modules);
         }
     }
 }
开发者ID:rcrrich,项目名称:UpdatePackages,代码行数:94,代码来源:Reports.php

示例2: initListOfModules

 public function initListOfModules()
 {
     global $old_related_modules;
     $adb = PearDatabase::getInstance();
     $this->inventory_modules = self::$inventory_modules;
     // $restricted_modules = array('Emails', 'Events', 'Webmails');
     $restricted_modules = array('Emails', 'Events', 'Webmails');
     global $current_user;
     if ($current_user->is_admin != "on") {
         $restricted_modules[] = "Users";
     }
     $restricted_blocks = array('LBL_IMAGE_INFORMATION', 'LBL_COMMENTS', 'LBL_COMMENT_INFORMATION');
     $this->module_id = array();
     $this->module_list = array();
     // Prefetch module info to check active or not and also get list of tabs
     $modulerows = vtlib_prefetchModuleActiveInfo(false);
     $cachedInfo = VTCacheUtils::lookupReport_ListofModuleInfos();
     if ($cachedInfo !== false) {
         $this->module_list = $cachedInfo['module_list'];
         $this->related_modules = $cachedInfo['related_modules'];
     } else {
         if ($modulerows) {
             foreach ($modulerows as $resultrow) {
                 if ($resultrow['presence'] == '1') {
                     continue;
                 }
                 // skip disabled modules
                 // ITS4YOU-UP SlOl 21. 2. 2014 11:38:13 add Assigned to Users module
                 if ($resultrow['isentitytype'] != '1' && $resultrow['name'] != "Users") {
                     continue;
                 }
                 // skip extension modules
                 if (in_array($resultrow['name'], $restricted_modules)) {
                     // skip restricted modules
                     continue;
                 }
                 if ($resultrow['name'] != 'Calendar') {
                     $this->module_id[$resultrow['tabid']] = $resultrow['name'];
                 } else {
                     $this->module_id[9] = $resultrow['name'];
                     $this->module_id[16] = $resultrow['name'];
                 }
                 // ITS4YOU-CR SlOl  2. 12. 2013 8:42:40
                 $this->init_list_for_module($resultrow['name']);
                 // ITS4YOU-END 2. 12. 2013 8:42:43
                 $this->module_list[$resultrow['name']] = array();
             }
             $moduleids = array_keys($this->module_id);
             //$adb->setDebug(true);
             $reportblocks = $adb->pquery("SELECT blockid, blocklabel, tabid FROM vtiger_blocks WHERE tabid IN (" . generateQuestionMarks($moduleids) . ")", array($moduleids));
             // $reportblocks = $adb->pquery("SELECT blockid, blocklabel, tabid FROM vtiger_blocks WHERE tabid IN (9,16)", array());
             //$adb->setDebug(false);
             $prev_block_label = '';
             if ($adb->num_rows($reportblocks) > 0) {
                 while ($resultrow = $adb->fetch_array($reportblocks)) {
                     $blockid = $resultrow['blockid'];
                     $blocklabel = $resultrow['blocklabel'];
                     $module = $this->module_id[$resultrow['tabid']];
                     if (in_array($blocklabel, $restricted_blocks) || in_array($blockid, $this->module_list[$module]) || isset($this->module_list[$module][vtranslate($blocklabel, $module)])) {
                         continue;
                     }
                     if ($blocklabel != "") {
                         if ($module == 'Calendar' && $blocklabel == 'LBL_CUSTOM_INFORMATION') {
                             $this->module_list[$module][$blockid] = vtranslate($blocklabel, $module);
                         } elseif ($module == 'Calendar' && in_array($blocklabel, array("LBL_RECURRENCE_INFORMATION", "LBL_RELATED_TO"))) {
                             $this->module_list[$module][$blockid] = vtranslate($blocklabel, "Events");
                         } else {
                             $this->module_list[$module][$blockid] = vtranslate($blocklabel, $module);
                         }
                         $prev_block_label = $blocklabel;
                         // ak je blocklabel prazdny spustat toto ??? zistit !!!
                     } else {
                         $this->module_list[$module][$blockid] = vtranslate($prev_block_label, $module);
                     }
                 }
             }
             // tvorba vazby cez ui10 a pridanie stlpcov k danemu modulu
             //    $adb->setDebug(true);
             $relatedmodules_pf = $adb->pquery("\n                                    SELECT uitype,fieldid, CONCAT(fieldlabel,' (',relmodule,') ') AS name, vtiger_tab.tabid, relmodule FROM vtiger_fieldmodulerel\n                                    INNER JOIN vtiger_tab on vtiger_tab.name = vtiger_fieldmodulerel.module \n                                    INNER JOIN vtiger_field USING (fieldid) \n                                    WHERE vtiger_tab.isentitytype = 1\n                                    AND vtiger_tab.name NOT IN(" . generateQuestionMarks($restricted_modules) . ")\n                                    AND vtiger_tab.presence = 0 AND vtiger_field.uitype='10' ", array($restricted_modules));
             //AND vtiger_tab.presence = 0 AND vtiger_field.uitype='10'  GROUP BY relmodule ", array($restricted_modules));
             //    $adb->setDebug(false);
             if ($adb->num_rows($relatedmodules_pf) > 0) {
                 $related_fields_array = array();
                 while ($resultrow = $adb->fetch_array($relatedmodules_pf)) {
                     $tabid = $resultrow['tabid'];
                     $module = $this->module_id[$tabid];
                     if (!isset($this->related_modules[$module])) {
                         $this->related_modules[$module] = array();
                     }
                     $this->init_list_for_module($module);
                     $field_rel = $st_rel_row["fieldlabel"];
                     if (is_numeric(strpos($resultrow["name"], $resultrow['relmodule']))) {
                         $reltabid = getTabid($resultrow["relmodule"]);
                         $relmodule_lbl = vtranslate($resultrow['name']);
                         $this->related_modules[$module][] = array("name" => $relmodule_lbl, "id" => $reltabid . "x" . $resultrow['fieldid']);
                     }
                 }
             }
             // pridanie modulu Users pre assigned user id ui type 53 na vyber poloziek
             // ITS4YOU-CR SlOl 21. 2. 2014 11:02:16
//.........这里部分代码省略.........
开发者ID:cin-system,项目名称:cinrepo,代码行数:101,代码来源:ITS4YouReports.php


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