本文整理汇总了PHP中VTCacheUtils::updateReport_ListofModuleInfos方法的典型用法代码示例。如果您正苦于以下问题:PHP VTCacheUtils::updateReport_ListofModuleInfos方法的具体用法?PHP VTCacheUtils::updateReport_ListofModuleInfos怎么用?PHP VTCacheUtils::updateReport_ListofModuleInfos使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VTCacheUtils
的用法示例。
在下文中一共展示了VTCacheUtils::updateReport_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);
}
}
}
示例2: initListOfModules
//.........这里部分代码省略.........
// 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
foreach ($this->related_modules as $modulename => $related_array) {
$module_id = getTabid($modulename);
//$adb->setDebug(true);
$relatedmodules_at = $adb->pquery("SELECT fieldlabel, fieldid FROM vtiger_field WHERE uitype = ? AND tabid = ? AND presence IN (0,2)", array(53, $module_id));
//$adb->setDebug(false);
while ($row = $adb->fetchByAssoc($relatedmodules_at)) {
$user_module = "Users";
$user_module_lbl = vtranslate($user_module);
$this->related_modules[$modulename][] = array("name" => vtranslate($row['fieldlabel']) . " (" . $user_module_lbl . ")", "id" => getTabid($user_module) . "x" . $row['fieldid']);
}
}
// ITS4YOU-END 21. 2. 2014 11:02:18
// related modules with MIF signature (more_info relation)
$relatedmodules_mi = $adb->pquery("SELECT vtiger_tab.name AS name, vtiger_relatedlists.tabid FROM vtiger_tab\n INNER JOIN vtiger_relatedlists on vtiger_tab.tabid=vtiger_relatedlists.related_tabid\n WHERE vtiger_tab.isentitytype=1\n AND vtiger_tab.name NOT IN(" . generateQuestionMarks($restricted_modules) . ") \n AND vtiger_tab.presence = 0 AND vtiger_relatedlists.label!='Activity History'\n UNION \n SELECT module, vtiger_tab.tabid \n FROM vtiger_fieldmodulerel \n INNER JOIN vtiger_tab on vtiger_tab.name = vtiger_fieldmodulerel.relmodule \n INNER JOIN vtiger_field ON vtiger_field.fieldid = vtiger_fieldmodulerel.fieldid AND vtiger_field.uitype != '10' \n WHERE vtiger_tab.isentitytype = 1 AND vtiger_tab.name NOT IN('Emails','Events','Webmails') AND vtiger_tab.presence = 0 \n ", array($restricted_modules));
//$adb->setDebug(true);
while ($resultrow = $adb->fetch_array($relatedmodules_mi)) {
$tabid = $resultrow['tabid'];
$module = $this->module_id[$tabid];
$relmodule_lbl = vtranslate($resultrow['name']);
$this->related_modules[$module][] = array("name" => $relmodule_lbl, "id" => getTabid($resultrow['name']) . "xMIF");
}
//$adb->setDebug(false);
// inventory modules related modules Services Products with INV signature (inventory relation)
foreach ($this->related_modules as $module => $rel_array) {
foreach ($rel_array as $r_key => $r_d_array) {
if (in_array($module, $this->inventory_modules)) {
if (!in_array("Products", $r_d_array) && !$this->in_multiarray(vtranslate("Products"), $this->related_modules[$module])) {
$related_modules[$module][] = "Products";
$this->related_modules[$module][] = array("name" => vtranslate("Products"), "id" => getTabid("Products") . "xINV");
$r_d_array[] = "Products";
}
if (!in_array("Services", $r_d_array) && !$this->in_multiarray(vtranslate("Services"), $this->related_modules[$module])) {
$related_modules[$module][] = "Services";
$this->related_modules[$module][] = array("name" => vtranslate("Services"), "id" => getTabid("Services") . "xINV");
$r_d_array[] = "Services";
}
}
}
}
// Put the information in cache for re-use
VTCacheUtils::updateReport_ListofModuleInfos($this->module_list, $this->related_modules);
}
}
}