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


PHP ModTracker::updateCache方法代码示例

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


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

示例1: array

 /**
  * Invoked when special actions are performed on the module.
  * @param String Module name
  * @param String Event Type
  */
 function vtlib_handler($moduleName, $eventType)
 {
     global $adb;
     if ($eventType == 'module.postinstall') {
         include_once 'vtlib/Vtiger/Module.php';
         $moduleInstance = CRMEntity::getInstance('RequirementCards');
         $moduleInstance->setModuleSeqNumber("configure", 'RequirementCards', 'RC', '1');
         $adb->pquery('UPDATE vtiger_tab SET customized=0 WHERE name=?', array('RequirementCards'));
         $moduleInstance = Vtiger_Module::getInstance('RequirementCards');
         $targetModule = Vtiger_Module::getInstance('Accounts');
         $targetModule->setRelatedList($moduleInstance, 'RequirementCards', array('ADD'), 'get_dependents_list');
         $modcommentsModuleInstance = Vtiger_Module::getInstance('ModComments');
         if ($modcommentsModuleInstance && file_exists('modules/ModComments/ModComments.php')) {
             include_once 'modules/ModComments/ModComments.php';
             if (class_exists('ModComments')) {
                 ModComments::addWidgetTo(array('RequirementCards'));
             }
         }
         $modcommentsModuleInstance = Vtiger_Module::getInstance('ModTracker');
         if ($modcommentsModuleInstance && file_exists('modules/ModTracker/ModTracker.php')) {
             include_once 'vtlib/Vtiger/Module.php';
             include_once 'modules/ModTracker/ModTracker.php';
             $tabid = Vtiger_Functions::getModuleId('RequirementCards');
             $moduleModTrackerInstance = new ModTracker();
             if (!$moduleModTrackerInstance->isModulePresent($tabid)) {
                 $res = $adb->pquery("INSERT INTO vtiger_modtracker_tabs VALUES(?,?)", array($tabid, 1));
                 $moduleModTrackerInstance->updateCache($tabid, 1);
             } else {
                 $updatevisibility = $adb->pquery("UPDATE vtiger_modtracker_tabs SET visible = 1 WHERE tabid = ?", array($tabid));
                 $moduleModTrackerInstance->updateCache($tabid, 1);
             }
             if (!$moduleModTrackerInstance->isModTrackerLinkPresent($tabid)) {
                 $moduleInstance = Vtiger_Module::getInstance($tabid);
                 $moduleInstance->addLink('DETAILVIEWBASIC', 'View History', "javascript:ModTrackerCommon.showhistory('\$RECORD\$')", '', '', array('path' => 'modules/ModTracker/ModTracker.php', 'class' => 'ModTracker', 'method' => 'isViewPermitted'));
             }
         }
     } else {
         if ($eventType == 'module.disabled') {
             // TODO Handle actions before this module is being uninstalled.
         } else {
             if ($eventType == 'module.preuninstall') {
                 // TODO Handle actions when this module is about to be deleted.
             } else {
                 if ($eventType == 'module.preupdate') {
                     // TODO Handle actions before this module is updated.
                 } else {
                     if ($eventType == 'module.postupdate') {
                         // TODO Handle actions after this module is updated.
                     }
                 }
             }
         }
     }
 }
开发者ID:rcrrich,项目名称:UpdatePackages,代码行数:59,代码来源:RequirementCards.php

示例2: array

 /**
  * Invoked when special actions are performed on the module.
  * @param String Module name
  * @param String Event Type (module.postinstall, module.disabled, module.enabled, module.preuninstall)
  */
 function vtlib_handler($modulename, $event_type)
 {
     $adb = PearDatabase::getInstance();
     if ($event_type == 'module.postinstall') {
         $ModuleInstance = CRMEntity::getInstance($modulename);
         $ModuleInstance->setModuleSeqNumber("configure", $modulename, '', '1');
         $modcommentsModuleInstance = Vtiger_Module::getInstance('ModComments');
         if ($modcommentsModuleInstance && file_exists('modules/ModComments/ModComments.php')) {
             include_once 'modules/ModComments/ModComments.php';
             if (class_exists('ModComments')) {
                 ModComments::addWidgetTo(array('Payments'));
             }
         }
         $adb->pquery('UPDATE vtiger_tab SET customized=0 WHERE name=?', array($modulename));
         $tabid = Vtiger_Functions::getModuleId($modulename);
         include_once 'modules/ModTracker/ModTracker.php';
         $moduleModTrackerInstance = new ModTracker();
         if (!$moduleModTrackerInstance->isModulePresent($tabid)) {
             $res = $adb->pquery("INSERT INTO vtiger_modtracker_tabs VALUES(?,?)", array($tabid, 1));
             $moduleModTrackerInstance->updateCache($tabid, 1);
         } else {
             $updatevisibility = $adb->pquery("UPDATE vtiger_modtracker_tabs SET visible = 1 WHERE tabid = ?", array($tabid));
             $moduleModTrackerInstance->updateCache($tabid, 1);
         }
         if (!$moduleModTrackerInstance->isModTrackerLinkPresent($tabid)) {
             $moduleInstance = Vtiger_Module::getInstance($tabid);
             $moduleInstance->addLink('DETAILVIEWBASIC', 'View History', "javascript:ModTrackerCommon.showhistory('\$RECORD\$')", '', '', array('path' => 'modules/ModTracker/ModTracker.php', 'class' => 'ModTracker', 'method' => 'isViewPermitted'));
         }
         $this->addWorkflow($modulename);
     } else {
         if ($event_type == 'module.disabled') {
             // TODO Handle actions when this module is disabled.
         } else {
             if ($event_type == 'module.enabled') {
                 // TODO Handle actions when this module is enabled.
             } else {
                 if ($event_type == 'module.preuninstall') {
                     // TODO Handle actions when this module is about to be deleted.
                 } else {
                     if ($event_type == 'module.preupdate') {
                         // TODO Handle actions before this module is updated.
                     } else {
                         if ($event_type == 'module.postupdate') {
                         }
                     }
                 }
             }
         }
     }
 }
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:55,代码来源:PaymentsOut.php

示例3: VALUES

 /**
  * Invoked when special actions are performed on the module.
  * @param String Module name
  * @param String Event Type
  */
 function vtlib_handler($moduleName, $eventType)
 {
     require_once 'include/utils/utils.php';
     global $adb;
     if ($eventType == 'module.postinstall') {
         include_once 'vtlib/Vtiger/Module.php';
         $myCustomEntity = CRMEntity::getInstance($moduleName);
         $myCustomPrefix = "M_";
         $sequenceStart = '1';
         $myCustomEntity->setModuleSeqNumber("configure", $moduleName, $myCustomPrefix, $sequenceStart);
         $displayLabel = 'OSSMailView';
         $adb->query("UPDATE vtiger_tab SET customized=0 WHERE name='{$displayLabel}'");
         $adb->pquery("INSERT INTO vtiger_ossmailscanner_config (conf_type,parameter,value) VALUES (?,?,?)", array('email_list', 'widget_limit', '10'));
         $adb->pquery("INSERT INTO vtiger_ossmailscanner_config (conf_type,parameter,value) VALUES (?,?,?)", array('email_list', 'target', '_blank'));
         $adb->pquery("INSERT INTO vtiger_ossmailscanner_config (conf_type,parameter,value) VALUES (?,?,?)", array('email_list', 'permissions', 'vtiger'));
         include_once 'modules/ModTracker/ModTracker.php';
         $tabid = Vtiger_Functions::getModuleId($moduleName);
         $moduleModTrackerInstance = new ModTracker();
         if (!$moduleModTrackerInstance->isModulePresent($tabid)) {
             $res = $adb->pquery("INSERT INTO vtiger_modtracker_tabs VALUES(?,?)", array($tabid, 1));
             $moduleModTrackerInstance->updateCache($tabid, 1);
         } else {
             $updatevisibility = $adb->pquery("UPDATE vtiger_modtracker_tabs SET visible = 1 WHERE tabid = ?", array($tabid));
             $moduleModTrackerInstance->updateCache($tabid, 1);
         }
         if (!$moduleModTrackerInstance->isModTrackerLinkPresent($tabid)) {
             $moduleInstance = Vtiger_Module::getInstance($tabid);
             $moduleInstance->addLink('DETAILVIEWBASIC', 'View History', "javascript:ModTrackerCommon.showhistory('\$RECORD\$')", '', '', array('path' => 'modules/ModTracker/ModTracker.php', 'class' => 'ModTracker', 'method' => 'isViewPermitted'));
         }
         $this->add_relation();
         $registerLink = true;
         $Module = Vtiger_Module::getInstance($moduleName);
         $user_id = Users_Record_Model::getCurrentUserModel()->get('user_name');
         $adb->pquery("INSERT INTO vtiger_ossmails_logs (`action`, `info`, `user`) VALUES (?, ?, ?);", array('Action_InstallModule', $moduleName . ' ' . $Module->version, $user_id), false);
         $this->turn_on($moduleName);
     } else {
         if ($eventType == 'module.disabled') {
             $this->turn_off($moduleName);
             $registerLink = false;
             // TODO Handle actions when this module is disabled.
         } else {
             if ($eventType == 'module.enabled') {
                 $this->turn_on($moduleName);
                 $registerLink = true;
                 $this->add_relation();
                 // TODO Handle actions when this module is enabled.
             } else {
                 if ($eventType == 'module.preuninstall') {
                     // TODO Handle actions when this module is about to be deleted.
                 } else {
                     if ($eventType == 'module.preupdate') {
                         // TODO Handle actions before this module is updated.
                     } else {
                         if ($eventType == 'module.postupdate') {
                             $Module = Vtiger_Module::getInstance($moduleName);
                             $user_id = Users_Record_Model::getCurrentUserModel()->get('user_name');
                             $adb->pquery("INSERT INTO vtiger_ossmails_logs (`action`, `info`, `user`) VALUES (?, ?, ?);", array('Action_UpdateModule', $moduleName . ' ' . $Module->version, $user_id), false);
                         }
                     }
                 }
             }
         }
     }
     $displayLabel = 'Mail View';
     if ($registerLink) {
         $blockid = $adb->query_result($adb->pquery("SELECT blockid FROM vtiger_settings_blocks WHERE label='LBL_MAIL'", array()), 0, 'blockid');
         $sequence = (int) $adb->query_result($adb->pquery("SELECT max(sequence) as sequence FROM vtiger_settings_field WHERE blockid=?", array($blockid)), 0, 'sequence') + 1;
         $fieldid = $adb->getUniqueId('vtiger_settings_field');
         $adb->pquery("INSERT INTO vtiger_settings_field (fieldid,blockid,sequence,name,iconpath,description,linkto)\n\t\t\t\tVALUES (?,?,?,?,?,?,?)", array($fieldid, $blockid, $sequence, $displayLabel, '', 'LBL_MAIL_VIEW_DESCRIPTION', 'index.php?module=OSSMailView&parent=Settings&view=index'));
     } else {
         $adb->pquery("DELETE FROM vtiger_settings_field WHERE name=?", array($displayLabel));
     }
 }
开发者ID:rcrrich,项目名称:UpdatePackages,代码行数:78,代码来源:OSSMailView.php

示例4: array

 /**
  * Invoked when special actions are performed on the module.
  * @param String Module name
  * @param String Event Type (module.postinstall, module.disabled, module.enabled, module.preuninstall)
  */
 function vtlib_handler($modulename, $event_type)
 {
     $adb = PearDatabase::getInstance();
     if ($event_type == 'module.postinstall') {
         $ModuleInstance = CRMEntity::getInstance($modulename);
         $ModuleInstance->setModuleSeqNumber("configure", $modulename, '', '1');
         $modcommentsModuleInstance = Vtiger_Module::getInstance('ModComments');
         if ($modcommentsModuleInstance && file_exists('modules/ModComments/ModComments.php')) {
             include_once 'modules/ModComments/ModComments.php';
             if (class_exists('ModComments')) {
                 ModComments::addWidgetTo(array('Payments'));
             }
         }
         $adb->pquery('UPDATE vtiger_tab SET customized=0 WHERE name=?', array($modulename));
         $tabid = Vtiger_Functions::getModuleId($modulename);
         include_once 'modules/ModTracker/ModTracker.php';
         $moduleModTrackerInstance = new ModTracker();
         if (!$moduleModTrackerInstance->isModulePresent($tabid)) {
             $res = $adb->pquery("INSERT INTO vtiger_modtracker_tabs VALUES(?,?)", array($tabid, 1));
             $moduleModTrackerInstance->updateCache($tabid, 1);
         } else {
             $updatevisibility = $adb->pquery("UPDATE vtiger_modtracker_tabs SET visible = 1 WHERE tabid = ?", array($tabid));
             $moduleModTrackerInstance->updateCache($tabid, 1);
         }
         if (!$moduleModTrackerInstance->isModTrackerLinkPresent($tabid)) {
             $moduleInstance = Vtiger_Module::getInstance($tabid);
             $moduleInstance->addLink('DETAILVIEWBASIC', 'View History', "javascript:ModTrackerCommon.showhistory('\$RECORD\$')", '', '', array('path' => 'modules/ModTracker/ModTracker.php', 'class' => 'ModTracker', 'method' => 'isViewPermitted'));
         }
         vimport('~~vtlib/Vtiger/Module.php');
         $moduleInstance = Vtiger_Module::getInstance('Invoice');
         $blockInstance = Vtiger_Block::getInstance('LBL_INVOICE_INFORMATION', $moduleInstance);
         $fieldInstance = new Vtiger_Field();
         $fieldInstance->name = 'payment_balance';
         $fieldInstance->table = 'vtiger_invoice';
         $fieldInstance->label = 'Payment balance';
         $fieldInstance->column = 'payment_balance';
         $fieldInstance->columntype = 'decimal(25,8)';
         $fieldInstance->uitype = 7;
         $fieldInstance->typeofdata = 'NN~O';
         $fieldInstance->displaytype = 2;
         $blockInstance->addField($fieldInstance);
         $moduleInstance = Vtiger_Module::getInstance('Accounts');
         $blockInstance = Vtiger_Block::getInstance('LBL_ACCOUNT_INFORMATION', $moduleInstance);
         $fieldInstance = new Vtiger_Field();
         $fieldInstance->name = 'payment_balance';
         $fieldInstance->table = 'vtiger_account';
         $fieldInstance->label = 'Payment balance';
         $fieldInstance->column = 'payment_balance';
         $fieldInstance->columntype = 'decimal(25,8)';
         $fieldInstance->uitype = 7;
         $fieldInstance->typeofdata = 'NN~O';
         $fieldInstance->displaytype = 2;
         $blockInstance->addField($fieldInstance);
         $moduleInstance = Vtiger_Module::getInstance('Potentials');
         $blockInstance = Vtiger_Block::getInstance('LBL_OPPORTUNITY_INFORMATION', $moduleInstance);
         $fieldInstance = new Vtiger_Field();
         $fieldInstance->name = 'payment_balance';
         $fieldInstance->table = 'vtiger_potential';
         $fieldInstance->label = 'Payment balance';
         $fieldInstance->column = 'payment_balance';
         $fieldInstance->columntype = 'decimal(25,8)';
         $fieldInstance->uitype = 7;
         $fieldInstance->typeofdata = 'NN~O';
         $fieldInstance->displaytype = 2;
         $blockInstance->addField($fieldInstance);
         $this->addWorkflow($modulename);
         $this->addWorkflow('Invoice');
     } else {
         if ($event_type == 'module.disabled') {
             // TODO Handle actions when this module is disabled.
         } else {
             if ($event_type == 'module.enabled') {
                 // TODO Handle actions when this module is enabled.
             } else {
                 if ($event_type == 'module.preuninstall') {
                     // TODO Handle actions when this module is about to be deleted.
                 } else {
                     if ($event_type == 'module.preupdate') {
                         // TODO Handle actions before this module is updated.
                     } else {
                         if ($event_type == 'module.postupdate') {
                         }
                     }
                 }
             }
         }
     }
 }
开发者ID:rcrrich,项目名称:UpdatePackages,代码行数:93,代码来源:PaymentsIn.php

示例5: ModTracker

 /**
  * Invoked when special actions are performed on the module.
  * @param String Module name
  * @param String Event Type
  */
 function vtlib_handler($moduleName, $eventType)
 {
     require_once 'include/utils/utils.php';
     $adb = PearDatabase::getInstance();
     if ($eventType == 'module.postinstall') {
         include_once 'vtlib/Vtiger/Module.php';
         $myCustomEntity = CRMEntity::getInstance($moduleName);
         $myCustomEntity->setModuleSeqNumber("configure", $moduleName, '', '1');
         $adb->query("UPDATE vtiger_tab SET customized=0 WHERE name='{$moduleName}'");
         $modcommentsModuleInstance = Vtiger_Module::getInstance('ModTracker');
         if ($modcommentsModuleInstance && file_exists('modules/ModTracker/ModTracker.php')) {
             include_once 'vtlib/Vtiger/Module.php';
             include_once 'modules/ModTracker/ModTracker.php';
             $tabid = Vtiger_Functions::getModuleId($moduleName);
             $moduleModTrackerInstance = new ModTracker();
             if (!$moduleModTrackerInstance->isModulePresent($tabid)) {
                 $res = $adb->pquery("INSERT INTO vtiger_modtracker_tabs VALUES(?,?)", array($tabid, 1));
                 $moduleModTrackerInstance->updateCache($tabid, 1);
             } else {
                 $updatevisibility = $adb->pquery("UPDATE vtiger_modtracker_tabs SET visible = 1 WHERE tabid = ?", array($tabid));
                 $moduleModTrackerInstance->updateCache($tabid, 1);
             }
         }
     } else {
         if ($eventType == 'module.readonly="readonly"') {
             // TODO Handle actions when this module is readonly="readonly".
         } else {
             if ($eventType == 'module.enabled') {
                 // TODO Handle actions when this module is enabled.
             } else {
                 if ($eventType == 'module.preuninstall') {
                     // TODO Handle actions when this module is about to be deleted.
                 } else {
                     if ($eventType == 'module.preupdate') {
                         // TODO Handle actions before this module is updated.
                     } else {
                         if ($eventType == 'module.postupdate') {
                         }
                     }
                 }
             }
         }
     }
 }
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:49,代码来源:Calculations.php

示例6: array

 /**
  * Invoked when special actions are performed on the module.
  * @param String Module name
  * @param String Event Type (module.postinstall, module.disabled, module.enabled, module.preuninstall)
  */
 function vtlib_handler($modulename, $event_type)
 {
     global $adb;
     if ($event_type == 'module.postinstall') {
         $ModuleInstance = CRMEntity::getInstance($modulename);
         $ModuleInstance->setModuleSeqNumber("configure", $modulename, 'LI', '1');
         $modcommentsModuleInstance = Vtiger_Module::getInstance('ModComments');
         if ($modcommentsModuleInstance && file_exists('modules/ModComments/ModComments.php')) {
             include_once 'modules/ModComments/ModComments.php';
             if (class_exists('ModComments')) {
                 ModComments::addWidgetTo(array('LettersOut'));
             }
         }
         $Instance = Vtiger_Module::getInstance($modulename);
         $nModule = Vtiger_Module::getInstance('Accounts');
         if ($nModule) {
             $nModule->setRelatedList($Instance, $modulename, array('add'), 'get_dependents_list');
         }
         $nModule = Vtiger_Module::getInstance('Leads');
         if ($nModule) {
             $nModule->setRelatedList($Instance, $modulename, array('add'), 'get_dependents_list');
         }
         $nModule = Vtiger_Module::getInstance('OSSEmployees');
         if ($nModule) {
             $nModule->setRelatedList($Instance, $modulename, array('add'), 'get_dependents_list');
         }
         $nModule = Vtiger_Module::getInstance('Vendors');
         if ($nModule) {
             $nModule->setRelatedList($Instance, $modulename, array('add'), 'get_dependents_list');
         }
         $modcommentsModuleInstance = Vtiger_Module::getInstance('ModTracker');
         if ($modcommentsModuleInstance && file_exists('modules/ModTracker/ModTracker.php')) {
             include_once 'vtlib/Vtiger/Module.php';
             include_once 'modules/ModTracker/ModTracker.php';
             $tabid = Vtiger_Functions::getModuleId($modulename);
             $moduleModTrackerInstance = new ModTracker();
             if (!$moduleModTrackerInstance->isModulePresent($tabid)) {
                 $res = $adb->pquery("INSERT INTO vtiger_modtracker_tabs VALUES(?,?)", array($tabid, 1));
                 $moduleModTrackerInstance->updateCache($tabid, 1);
             } else {
                 $updatevisibility = $adb->pquery("UPDATE vtiger_modtracker_tabs SET visible = 1 WHERE tabid = ?", array($tabid));
                 $moduleModTrackerInstance->updateCache($tabid, 1);
             }
             if (!$moduleModTrackerInstance->isModTrackerLinkPresent($tabid)) {
                 $moduleInstance = Vtiger_Module::getInstance($tabid);
                 $moduleInstance->addLink('DETAILVIEWBASIC', 'View History', "javascript:ModTrackerCommon.showhistory('\$RECORD\$')", '', '', array('path' => 'modules/ModTracker/ModTracker.php', 'class' => 'ModTracker', 'method' => 'isViewPermitted'));
             }
         }
         $adb->pquery('UPDATE vtiger_tab SET customized=0 WHERE name=?', array($modulename));
         $adb->pquery('UPDATE vtiger_field SET summaryfield=1 WHERE tablename=? AND columnname=?', array('vtiger_lettersout', 'title'));
         $adb->pquery('UPDATE vtiger_field SET summaryfield=1 WHERE tablename=? AND columnname=?', array('vtiger_lettersout', 'smownerid'));
         $adb->pquery('UPDATE vtiger_field SET summaryfield=1 WHERE tablename=? AND columnname=?', array('vtiger_lettersout', 'lout_type_ship'));
         $adb->pquery('UPDATE vtiger_field SET summaryfield=1 WHERE tablename=? AND columnname=?', array('vtiger_lettersout', 'lout_type_doc'));
         $adb->pquery('UPDATE vtiger_field SET summaryfield=1 WHERE tablename=? AND columnname=?', array('vtiger_lettersout', 'date_adoption'));
         $adb->pquery('UPDATE vtiger_field SET summaryfield=1 WHERE tablename=? AND columnname=?', array('vtiger_lettersout', 'relatedid'));
     } else {
         if ($event_type == 'module.disabled') {
             // TODO Handle actions when this module is disabled.
         } else {
             if ($event_type == 'module.enabled') {
                 // TODO Handle actions when this module is enabled.
             } else {
                 if ($event_type == 'module.preuninstall') {
                     // TODO Handle actions when this module is about to be deleted.
                 } else {
                     if ($event_type == 'module.preupdate') {
                         // TODO Handle actions before this module is updated.
                     } else {
                         if ($event_type == 'module.postupdate') {
                         }
                     }
                 }
             }
         }
     }
 }
开发者ID:rcrrich,项目名称:UpdatePackages,代码行数:81,代码来源:LettersOut.php

示例7: VTEventsManager

 /**
  * Invoked when special actions are performed on the module.
  * @param String Module name
  * @param String Event Type
  */
 function vtlib_handler($moduleName, $eventType)
 {
     require_once 'include/utils/utils.php';
     require_once 'include/events/include.inc';
     $adb = PearDatabase::getInstance();
     $registerLink = false;
     $addModTracker = false;
     $handlerClass = 'SECURE';
     if ($eventType == 'module.postinstall') {
     } else {
         if ($eventType == 'module.disabled') {
             // TODO Handle actions when this module is disabled.
             $registerLink = false;
             $em = new VTEventsManager($adb);
             $em->setHandlerInActive($handlerClass);
         } else {
             if ($eventType == 'module.enabled') {
                 // TODO Handle actions when this module is enabled.
                 $registerLink = true;
                 $em = new VTEventsManager($adb);
                 $em->setHandlerActive($handlerClass);
             } else {
                 if ($eventType == 'module.preuninstall') {
                     // TODO Handle actions when this module is about to be deleted.
                     $this->log->debug('Before starting uninstall script...');
                     require_once 'modules/Settings/' . $moduleName . '/views/uninstall.php';
                     $this->log->debug('After uninstall script.');
                     header('Location: index.php?module=Vtiger&parent=Settings&view=Index');
                 } else {
                     if ($eventType == 'module.preupdate') {
                         // TODO Handle actions before this module is updated.
                     } else {
                         if ($eventType == 'module.postupdate') {
                         }
                     }
                 }
             }
         }
     }
     $displayLabel = 'OSSPassword Configuration';
     if ($registerLink) {
         $blockid = $adb->query_result($adb->pquery("SELECT blockid FROM vtiger_settings_blocks WHERE label='LBL_OTHER_SETTINGS'", array()), 0, 'blockid');
         $sequence = (int) $adb->query_result($adb->pquery("SELECT max(sequence) as sequence FROM vtiger_settings_field WHERE blockid=?", array($blockid)), 0, 'sequence') + 1;
         $fieldid = $adb->getUniqueId('vtiger_settings_field');
         $adb->pquery("INSERT INTO vtiger_settings_field (fieldid,blockid,sequence,name,iconpath,description,linkto)\n\t\t\t\tVALUES (?,?,?,?,?,?,?)", array($fieldid, $blockid, $sequence, $displayLabel, 'migrate.gif', 'LBL_OSSPASSWORD_CONFIGURATION_DESCRIPTION', 'index.php?module=OSSPasswords&view=ConfigurePass&parent=Settings'));
     } else {
         $adb->pquery("DELETE FROM vtiger_settings_field WHERE name=?", array($displayLabel));
     }
     // register modtracker history updates
     if ($addModTracker) {
         $tabId = getTabid($moduleName);
         include_once 'modules/ModTracker/ModTracker.php';
         $moduleModTrackerInstance = new ModTracker();
         if (!$moduleModTrackerInstance->isModulePresent($tabId)) {
             $res = $adb->pquery("INSERT INTO vtiger_modtracker_tabs VALUES(?,?)", array($tabId, 1));
             $moduleModTrackerInstance->updateCache($tabId, 1);
         } else {
             $updatevisibility = $adb->pquery("UPDATE vtiger_modtracker_tabs SET visible = 1 WHERE tabid = ?", array($tabId));
             $moduleModTrackerInstance->updateCache($tabId, 1);
         }
         if (!$moduleModTrackerInstance->isModTrackerLinkPresent($tabId)) {
             $moduleInstance = Vtiger_Module::getInstance($tabId);
             $moduleInstance->addLink('DETAILVIEWBASIC', 'View History', "javascript:ModTrackerCommon.showhistory('\$RECORD\$')", '', '', array('path' => 'modules/ModTracker/ModTracker.php', 'class' => 'ModTracker', 'method' => 'isViewPermitted'));
         }
     }
 }
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:71,代码来源:OSSPasswords.php

示例8: values

 /**
  * Invoked when special actions are performed on the module.
  * @param String Module name
  * @param String Event Type
  */
 function vtlib_handler($moduleName, $eventType)
 {
     require_once 'include/utils/utils.php';
     require_once 'include/events/include.inc';
     $adb = PearDatabase::getInstance();
     $registerLink = false;
     $addModTracker = false;
     $handlerClass = 'SECURE';
     if ($eventType == 'module.postinstall') {
         //Add OSSPasswords Module to Customer Portal
         require_once 'vtlib/Vtiger/Module.php';
         // add default oss_passwords configuration
         $adb->pquery("INSERT INTO vtiger_passwords_config values(?,?,?,?)", array('10', '15', 'a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,W,X,Y,Z,0,1,2,3,4,5,6,7,8,9', '0'));
         // adds record prefix
         $myCustomEntity = new CRMEntity();
         $myCustomPrefix = "PASS";
         // Your custom prefix string for the custom module
         $sequenceStart = 1;
         // The starting sequence number
         $myCustomEntity->setModuleSeqNumber("configure", $moduleName, $myCustomPrefix, $sequenceStart);
         $registerLink = true;
         $addModTracker = true;
         // handler for obscuring password data in "update history"
         $em = new VTEventsManager($adb);
         $em->registerHandler('vtiger.entity.aftersave.final', 'modules/OSSPasswords/handlers/secure.php', $handlerClass);
         // Module icon
         copy('modules/OSSPasswords/OSSPasswords.png', 'layouts/vlayout/skins/images/OSSPasswords.png');
         // block export of module
         $sql = "UPDATE vtiger_tab SET customized=0 WHERE name='{$moduleName}' LIMIT 1;";
         $adb->query($sql, true);
     } else {
         if ($eventType == 'module.disabled') {
             // TODO Handle actions when this module is disabled.
             $registerLink = false;
             $em = new VTEventsManager($adb);
             $em->setHandlerInActive($handlerClass);
         } else {
             if ($eventType == 'module.enabled') {
                 // TODO Handle actions when this module is enabled.
                 $registerLink = true;
                 $em = new VTEventsManager($adb);
                 $em->setHandlerActive($handlerClass);
             } else {
                 if ($eventType == 'module.preuninstall') {
                     // TODO Handle actions when this module is about to be deleted.
                     $this->log->debug('Before starting uninstall script...');
                     require_once 'modules/Settings/' . $moduleName . '/views/uninstall.php';
                     $this->log->debug('After uninstall script.');
                     header('Location: index.php?module=Vtiger&parent=Settings&view=Index');
                 } else {
                     if ($eventType == 'module.preupdate') {
                         // TODO Handle actions before this module is updated.
                     } else {
                         if ($eventType == 'module.postupdate') {
                         }
                     }
                 }
             }
         }
     }
     $displayLabel = 'OSSPassword Configuration';
     if ($registerLink) {
         $blockid = $adb->query_result($adb->pquery("SELECT blockid FROM vtiger_settings_blocks WHERE label='LBL_OTHER_SETTINGS'", array()), 0, 'blockid');
         $sequence = (int) $adb->query_result($adb->pquery("SELECT max(sequence) as sequence FROM vtiger_settings_field WHERE blockid=?", array($blockid)), 0, 'sequence') + 1;
         $fieldid = $adb->getUniqueId('vtiger_settings_field');
         $adb->pquery("INSERT INTO vtiger_settings_field (fieldid,blockid,sequence,name,iconpath,description,linkto)\n\t\t\t\tVALUES (?,?,?,?,?,?,?)", array($fieldid, $blockid, $sequence, $displayLabel, 'migrate.gif', 'LBL_OSSPASSWORD_CONFIGURATION_DESCRIPTION', 'index.php?module=OSSPasswords&view=ConfigurePass&parent=Settings'));
     } else {
         $adb->pquery("DELETE FROM vtiger_settings_field WHERE name=?", array($displayLabel));
     }
     // register modtracker history updates
     if ($addModTracker) {
         $tabId = getTabid($moduleName);
         include_once 'modules/ModTracker/ModTracker.php';
         $moduleModTrackerInstance = new ModTracker();
         if (!$moduleModTrackerInstance->isModulePresent($tabId)) {
             $res = $adb->pquery("INSERT INTO vtiger_modtracker_tabs VALUES(?,?)", array($tabId, 1));
             $moduleModTrackerInstance->updateCache($tabId, 1);
         } else {
             $updatevisibility = $adb->pquery("UPDATE vtiger_modtracker_tabs SET visible = 1 WHERE tabid = ?", array($tabId));
             $moduleModTrackerInstance->updateCache($tabId, 1);
         }
         if (!$moduleModTrackerInstance->isModTrackerLinkPresent($tabId)) {
             $moduleInstance = Vtiger_Module::getInstance($tabId);
             $moduleInstance->addLink('DETAILVIEWBASIC', 'View History', "javascript:ModTrackerCommon.showhistory('\$RECORD\$')", '', '', array('path' => 'modules/ModTracker/ModTracker.php', 'class' => 'ModTracker', 'method' => 'isViewPermitted'));
         }
     }
 }
开发者ID:rcrrich,项目名称:YetiForceCRM,代码行数:92,代码来源:OSSPasswords.php

示例9: databaseData


//.........这里部分代码省略.........
            $adb->pquery("UPDATE `vtiger_relatedlists` SET `name` = ? WHERE `tabid` = ? AND `related_tabid` = ? AND `name` = ?;", array('get_related_list', getTabid('Quotes'), getTabid('Calculations'), 'get_dependents_list'));
        }
        /*$result = $adb->pquery("SELECT * FROM `vtiger_relatedlists` WHERE tabid = ? AND related_tabid = ? AND name = ? AND label = ?;", array(getTabid('OSSEmployees'),getTabid('HolidaysEntitlement'),'get_dependents_list','HolidaysEntitlement'));
        		if($adb->num_rows($result) == 0){
        			$targetModule = Vtiger_Module::getInstance('OSSEmployees');
        			$moduleInstance = Vtiger_Module::getInstance('HolidaysEntitlement');
        			$targetModule->setRelatedList($moduleInstance, 'HolidaysEntitlement', array('ADD'),'get_dependents_list');
        		}*/
        /*$result = $adb->pquery("SELECT * FROM `vtiger_relatedlists` WHERE tabid = ? AND related_tabid = ? AND name = ? AND label = ?;", array(getTabid('Accounts'),getTabid('RequirementCards'),'get_dependents_list','RequirementCards'));
        		if($adb->num_rows($result) == 0){
        			$targetModule = Vtiger_Module::getInstance('Accounts');
        			$moduleInstance = Vtiger_Module::getInstance('RequirementCards');
        			$targetModule->setRelatedList($moduleInstance, 'RequirementCards', array('ADD'),'get_dependents_list');
        		}*/
        $result = $adb->pquery("SELECT * FROM `vtiger_links` WHERE tabid = ? AND linktype = ? AND linklabel = ?;", array(getTabid('Calculations'), 'DETAILVIEWWIDGET', 'DetailViewBlockCommentWidget'));
        if ($adb->num_rows($result) == 0) {
            $modcommentsModuleInstance = Vtiger_Module::getInstance('ModComments');
            if ($modcommentsModuleInstance && file_exists('modules/ModComments/ModComments.php')) {
                include_once 'modules/ModComments/ModComments.php';
                if (class_exists('ModComments')) {
                    ModComments::addWidgetTo(array('Calculations'));
                }
            }
        }
        $modulename = 'Calculations';
        $modcommentsModuleInstance = Vtiger_Module::getInstance('ModTracker');
        if ($modcommentsModuleInstance && file_exists('modules/ModTracker/ModTracker.php')) {
            include_once 'vtlib/Vtiger/Module.php';
            include_once 'modules/ModTracker/ModTracker.php';
            $tabid = Vtiger_Functions::getModuleId($modulename);
            $moduleModTrackerInstance = new ModTracker();
            if (!$moduleModTrackerInstance->isModulePresent($tabid)) {
                $res = $adb->pquery("INSERT INTO vtiger_modtracker_tabs VALUES(?,?)", array($tabid, 1));
                $moduleModTrackerInstance->updateCache($tabid, 1);
            } else {
                $updatevisibility = $adb->pquery("UPDATE vtiger_modtracker_tabs SET visible = 1 WHERE tabid = ?", array($tabid));
                $moduleModTrackerInstance->updateCache($tabid, 1);
            }
            if (!$moduleModTrackerInstance->isModTrackerLinkPresent($tabid)) {
                $moduleInstance = Vtiger_Module::getInstance($tabid);
                $moduleInstance->addLink('DETAILVIEWBASIC', 'View History', "javascript:ModTrackerCommon.showhistory('\$RECORD\$')", '', '', array('path' => 'modules/ModTracker/ModTracker.php', 'class' => 'ModTracker', 'method' => 'isViewPermitted'));
            }
        }
        $result = $adb->pquery("SELECT * FROM `vtiger_links` WHERE tabid = ? AND linktype = ? AND linklabel = ?;", array(getTabid('Quotes'), 'DETAILVIEWWIDGET', 'DetailViewBlockCommentWidget'));
        if ($adb->num_rows($result) == 0) {
            $modcommentsModuleInstance = Vtiger_Module::getInstance('ModComments');
            if ($modcommentsModuleInstance && file_exists('modules/ModComments/ModComments.php')) {
                include_once 'modules/ModComments/ModComments.php';
                if (class_exists('ModComments')) {
                    ModComments::addWidgetTo(array('Quotes'));
                }
            }
        }
        $modulename = 'Quotes';
        $modcommentsModuleInstance = Vtiger_Module::getInstance('ModTracker');
        if ($modcommentsModuleInstance && file_exists('modules/ModTracker/ModTracker.php')) {
            include_once 'vtlib/Vtiger/Module.php';
            include_once 'modules/ModTracker/ModTracker.php';
            $tabid = Vtiger_Functions::getModuleId($modulename);
            $moduleModTrackerInstance = new ModTracker();
            if (!$moduleModTrackerInstance->isModulePresent($tabid)) {
                $res = $adb->pquery("INSERT INTO vtiger_modtracker_tabs VALUES(?,?)", array($tabid, 1));
                $moduleModTrackerInstance->updateCache($tabid, 1);
            } else {
                $updatevisibility = $adb->pquery("UPDATE vtiger_modtracker_tabs SET visible = 1 WHERE tabid = ?", array($tabid));
                $moduleModTrackerInstance->updateCache($tabid, 1);
开发者ID:rcrrich,项目名称:UpdatePackages,代码行数:67,代码来源:init.php

示例10: updateRecords


//.........这里部分代码省略.........
     $adb->pquery("UPDATE vtiger_calendar_default_activitytypes SET `active` = ? ;", array(1));
     // links
     $instanceModule = Vtiger_Module::getInstance('Potentials');
     $instanceModule->addLink('DASHBOARDWIDGET', 'KPI', 'index.php?module=Potentials&view=ShowWidget&name=Kpi');
     $instanceModule = Vtiger_Module::getInstance('Home');
     $instanceModule->addLink('DASHBOARDWIDGET', 'Employees Time Control', 'index.php?module=OSSTimeControl&view=ShowWidget&name=TimeControl');
     $instanceModule->addLink('DASHBOARDWIDGET', 'Delagated Events/To Dos', 'index.php?module=Home&view=ShowWidget&name=AssignedUpcomingCalendarTasks');
     $instanceModule->addLink('DASHBOARDWIDGET', 'Delegated (overdue) Events/ToDos', 'index.php?module=Home&view=ShowWidget&name=AssignedOverdueCalendarTasks');
     $instanceModule->addLink('DASHBOARDWIDGET', 'Delegated (overdue) project tasks', 'index.php?module=Home&view=ShowWidget&name=AssignedOverdueProjectsTasks');
     $instanceModule->addLink('DASHBOARDWIDGET', 'Delegated project tasks', 'index.php?module=Home&view=ShowWidget&name=AssignedUpcomingProjectsTasks');
     $instanceModule->addLink('DASHBOARDWIDGET', 'Leads by Status Converted', 'index.php?module=Leads&view=ShowWidget&name=LeadsByStatusConverted');
     $instanceModule->addLink('DASHBOARDWIDGET', 'Calculations', 'index.php?module=Calculations&view=ShowWidget&name=Calculations');
     $instanceModule->addLink('DASHBOARDWIDGET', 'PotentialsList', 'index.php?module=Potentials&view=ShowWidget&name=PotentialsList');
     $instanceModule->addLink('DASHBOARDWIDGET', 'Mails List', 'index.php?module=Home&view=ShowWidget&name=MailsList');
     $instanceModule->addLink('DASHBOARDWIDGET', 'Calendar', 'index.php?module=Home&view=ShowWidget&name=Calendar');
     $instanceModule = Vtiger_Module::getInstance('Leads');
     $instanceModule->addLink('DASHBOARDWIDGET', 'Leads by Status Converted', 'index.php?module=Leads&view=ShowWidget&name=LeadsByStatusConverted');
     $adb->pquery("UPDATE `vtiger_links` SET `handler_path` = NULL, `handler` = '', `handler_class` = '', `linkicon` = 'icon-file'  WHERE `linklabel` = ?;", array('Add Note'));
     $adb->pquery("UPDATE `vtiger_links` SET `handler_path` = NULL, `handler` = '', `handler_class` = '', `linkicon` = 'icon-tasks' WHERE `linklabel` = ?;", array('Add Project Task'));
     $result = $adb->pquery("SELECT * FROM `vtiger_links` WHERE tabid = ? AND linktype = ? AND linklabel = ?;", array(getTabid('SalesOrder'), 'DETAILVIEWWIDGET', 'DetailViewBlockCommentWidget'));
     if ($adb->num_rows($result) == 0) {
         $modcommentsModuleInstance = Vtiger_Module::getInstance('ModComments');
         if ($modcommentsModuleInstance && file_exists('modules/ModComments/ModComments.php')) {
             include_once 'modules/ModComments/ModComments.php';
             if (class_exists('ModComments')) {
                 ModComments::addWidgetTo(array('SalesOrder'));
             }
         }
     }
     $result = $adb->query("SELECT * FROM `vtiger_fieldmodulerel` WHERE module = 'HelpDesk' AND relmodule = 'Products'");
     if ($adb->num_rows($result) == 0) {
         $adb->query("insert  into `vtiger_fieldmodulerel`(`fieldid`,`module`,`relmodule`,`status`,`sequence`) values ((SELECT fieldid FROM `vtiger_field` WHERE `columnname` = 'product_id' AND `tablename` = 'vtiger_troubletickets'),'HelpDesk','Products',NULL,1);");
     }
     $result = $adb->query("SELECT * FROM `vtiger_fieldmodulerel` WHERE module = 'HelpDesk' AND relmodule = 'Services'");
     if ($adb->num_rows($result) == 0) {
         $adb->query("insert  into `vtiger_fieldmodulerel`(`fieldid`,`module`,`relmodule`,`status`,`sequence`) values ((SELECT fieldid FROM `vtiger_field` WHERE `columnname` = 'product_id' AND `tablename` = 'vtiger_troubletickets'),'HelpDesk','Services',NULL,2);");
     }
     $result = $adb->pquery("SELECT * FROM `vtiger_links` WHERE linklabel = ?", array('LIST_OF_LAST_UPDATED_RECORD'));
     if ($adb->num_rows($result) == 0) {
         $instanceModule = Vtiger_Module::getInstance('Home');
         $instanceModule->addLink('DASHBOARDWIDGET', 'LIST_OF_LAST_UPDATED_RECORD', 'index.php?module=Home&view=ShowWidget&name=ListUpdatedRecord');
     }
     $result1 = $adb->pquery("SELECT fieldid FROM `vtiger_field` WHERE columnname = ? AND tablename = ?", array('parentid', 'vtiger_contactdetails'));
     $result2 = $adb->pquery("SELECT * FROM `vtiger_fieldmodulerel` WHERE fieldid = ? AND relmodule = ?", array($adb->query_result($result1, 0, 'fieldid'), 'Vendors'));
     if ($adb->num_rows($result2) == 0) {
         $adb->query("insert  into `vtiger_fieldmodulerel`(`fieldid`,`module`,`relmodule`) values (" . $adb->query_result($result1, 0, 'fieldid') . ",'Contacts','Vendors');");
     }
     $adb->pquery("UPDATE `vtiger_entityname` SET `searchcolumn` = ? WHERE `modulename` IN (?,?);", array('subject', 'RequirementCards', 'QuotesEnquires'));
     $adb->pquery("UPDATE `vtiger_entityname` SET `searchcolumn` = ?, fieldname = ?  WHERE `modulename` = ?;", array('holidaysentitlement_year,ossemployeesid', 'holidaysentitlement_year', 'HolidaysEntitlement'));
     $adb->pquery("UPDATE `vtiger_entityname` SET fieldname = ?  WHERE `modulename` = ?;", array('lastname', 'Leads'));
     $result = $adb->pquery("SELECT * FROM `vtiger_links` WHERE tabid = ? AND linktype = ? AND linklabel = ?;", array(getTabid('Quotes'), 'DETAILVIEWWIDGET', 'DetailViewBlockCommentWidget'));
     if ($adb->num_rows($result) == 0) {
         $modcommentsModuleInstance = Vtiger_Module::getInstance('ModComments');
         if ($modcommentsModuleInstance && file_exists('modules/ModComments/ModComments.php')) {
             include_once 'modules/ModComments/ModComments.php';
             if (class_exists('ModComments')) {
                 ModComments::addWidgetTo(array('Quotes'));
             }
         }
     }
     $modulename = 'Quotes';
     $modcommentsModuleInstance = Vtiger_Module::getInstance('ModTracker');
     if ($modcommentsModuleInstance && file_exists('modules/ModTracker/ModTracker.php')) {
         include_once 'vtlib/Vtiger/Module.php';
         include_once 'modules/ModTracker/ModTracker.php';
         $tabid = Vtiger_Functions::getModuleId($modulename);
         $moduleModTrackerInstance = new ModTracker();
         if (!$moduleModTrackerInstance->isModulePresent($tabid)) {
             $res = $adb->pquery("INSERT INTO vtiger_modtracker_tabs VALUES(?,?)", array($tabid, 1));
             $moduleModTrackerInstance->updateCache($tabid, 1);
         } else {
             $updatevisibility = $adb->pquery("UPDATE vtiger_modtracker_tabs SET visible = 1 WHERE tabid = ?", array($tabid));
             $moduleModTrackerInstance->updateCache($tabid, 1);
         }
         if (!$moduleModTrackerInstance->isModTrackerLinkPresent($tabid)) {
             $moduleInstance = Vtiger_Module::getInstance($tabid);
             $moduleInstance->addLink('DETAILVIEWBASIC', 'View History', "javascript:ModTrackerCommon.showhistory('\$RECORD\$')", '', '', array('path' => 'modules/ModTracker/ModTracker.php', 'class' => 'ModTracker', 'method' => 'isViewPermitted'));
         }
     }
     $query = "DELETE FROM vtiger_fieldmodulerel WHERE module = ? AND relmodule = ? ;";
     $adb->pquery($query, array('Potentials', 'Contacts'));
     $query = "DELETE FROM vtiger_fieldmodulerel WHERE module = ? AND relmodule = ? ;";
     $adb->pquery($query, array('Assets', 'Accounts'));
     $query = "DELETE FROM vtiger_fieldmodulerel WHERE module = ? AND relmodule = ? ;";
     $adb->pquery($query, array('PBXManager', 'Leads'));
     $query = "DELETE FROM `vtiger_relatedlists` WHERE `tabid` = ? AND `related_tabid` = ? AND `label` = ?;";
     $adb->pquery($query, array(getTabid('Leads'), getTabid('PBXManager'), 'PBXManager'), true);
     $adb->pquery("UPDATE `vtiger_calendar_user_activitytypes` SET `visible` = ? WHERE `id` > ? ;", array(0, 2));
     $result = $adb->pquery("SELECT * FROM `vtiger_links` WHERE linklabel = ? AND linkicon = ? ; ", array('LBL_SHOW_ACCOUNT_HIERARCHY', 'icon-align-justify'));
     if ($adb->num_rows($result) == 0) {
         $adb->pquery("UPDATE `vtiger_links` SET `linkicon` = ? WHERE `linklabel`= ? ;", array('icon-align-justify', 'LBL_SHOW_ACCOUNT_HIERARCHY'));
         $adb->pquery("UPDATE `vtiger_links` SET `linkicon` = ? WHERE `linklabel`= ? ;", array('icon-file', 'LBL_ADD_NOTE'));
     }
     $result1 = $adb->pquery("SELECT fieldid FROM `vtiger_field` WHERE columnname = ? AND tablename = ?", array('parent_id', 'vtiger_assets'));
     $result2 = $adb->pquery("SELECT * FROM `vtiger_fieldmodulerel` WHERE fieldid = ? AND relmodule = ?", array($adb->query_result($result1, 0, 'fieldid'), 'Accounts'));
     if ($adb->num_rows($result2) == 0) {
         $adb->query("insert  into `vtiger_fieldmodulerel`(`fieldid`,`module`,`relmodule`) values (" . $adb->query_result($result1, 0, 'fieldid') . ",'Assets','Accounts');");
     }
     $log->debug("Exiting VT620_to_YT::updateRecords() method ...");
 }
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:101,代码来源:VT620_to_YT.php


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