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


PHP VTEventsManager::setModuleForHandler方法代码示例

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


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

示例1: register

 /**
  * Handle event registration for module
  * @param Vtiger_Module Instance of the module to use
  * @param String Name of the Event like vtiger.entity.aftersave, vtiger.entity.beforesave
  * @param String Name of the Handler class (should extend VTEventHandler)
  * @param String File path which has Handler class definition
  * @param String Condition for the event to trigger (default blank)
  */
 static function register($moduleInstance, $eventname, $classname, $filename, $condition = '', $dependent = '[]')
 {
     // Security check on fileaccess, don't die if it fails
     if (Vtiger_Utils::checkFileAccess($filename, false)) {
         $adb = PearDatabase::getInstance();
         $eventsManager = new VTEventsManager($adb);
         $eventsManager->registerHandler($eventname, $filename, $classname, $condition, $dependent);
         $eventsManager->setModuleForHandler($moduleInstance->name, $classname);
         self::log("Registering Event {$eventname} with [{$filename}] {$classname} ... DONE");
     }
 }
开发者ID:yozhi,项目名称:YetiForceCRM,代码行数:19,代码来源:Event.php

示例2: handlers

 public function handlers()
 {
     global $log;
     $log->debug("Entering VT620_to_YT::handlers() method ...");
     require_once 'modules/com_vtiger_workflow/include.inc';
     require_once 'modules/com_vtiger_workflow/tasks/VTEntityMethodTask.inc';
     require_once 'modules/com_vtiger_workflow/VTEntityMethodManager.inc';
     require_once 'include/events/include.inc';
     $adb = PearDatabase::getInstance();
     $removeClass = array('none' => 'RecurringInvoiceHandler', 'none1' => 'HelpDeskHandler', 'ModTracker' => 'ModTrackerHandler', 'none2' => 'PBXManagerHandler', 'none3' => 'PBXManagerBatchHandler', 'ServiceContracts' => 'ServiceContractsHandler', 'Invoice' => 'InvoiceHandler', 'PurchaseOrder' => 'PurchaseOrderHandler', 'none4' => 'ModCommentsHandler', 'Home' => 'Vtiger_RecordLabelUpdater_Handler', 'none5' => 'SECURE');
     $addHandler = array();
     $addHandler[] = array(1, 'vtiger.entity.beforesave', 'include/events/VTEntityDelta.php', 'VTEntityDelta', '', 1, '[]');
     $addHandler[] = array(2, 'vtiger.entity.aftersave', 'include/events/VTEntityDelta.php', 'VTEntityDelta', '', 1, '[]');
     $addHandler[] = array(3, 'vtiger.entity.aftersave', 'modules/com_vtiger_workflow/VTEventHandler.inc', 'VTWorkflowEventHandler', '', 1, '["VTEntityDelta"]');
     $addHandler[] = array(4, 'vtiger.entity.afterrestore', 'modules/com_vtiger_workflow/VTEventHandler.inc', 'VTWorkflowEventHandler', '', 1, '[]');
     $addHandler[] = array(5, 'vtiger.entity.unlink.before', 'include/events/VTEntityDelta.php', 'VTEntityDelta', NULL, 1, '[]');
     $addHandler[] = array(6, 'vtiger.entity.unlink.after', 'include/events/VTEntityDelta.php', 'VTEntityDelta', NULL, 1, '[]');
     $addHandler[] = array(7, 'vtiger.entity.aftersave.final', 'modules/ModTracker/handlers/ModTrackerHandler.php', 'ModTrackerHandler', '', 1, '[]');
     $addHandler[] = array(8, 'vtiger.entity.beforedelete', 'modules/ModTracker/handlers/ModTrackerHandler.php', 'ModTrackerHandler', '', 1, '[]');
     $addHandler[] = array(9, 'vtiger.entity.afterrestore', 'modules/ModTracker/handlers/ModTrackerHandler.php', 'ModTrackerHandler', '', 1, '[]');
     $addHandler[] = array(10, 'vtiger.entity.aftersave', 'modules/PBXManager/handlers/PBXManagerHandler.php', 'PBXManagerHandler', '', 1, '["VTEntityDelta"]');
     $addHandler[] = array(11, 'vtiger.entity.afterdelete', 'modules/PBXManager/handlers/PBXManagerHandler.php', 'PBXManagerHandler', '', 1, '[]');
     $addHandler[] = array(12, 'vtiger.entity.afterrestore', 'modules/PBXManager/handlers/PBXManagerHandler.php', 'PBXManagerHandler', '', 1, '[]');
     $addHandler[] = array(13, 'vtiger.batchevent.save', 'modules/PBXManager/handlers/PBXManagerHandler.php', 'PBXManagerBatchHandler', '', 1, '[]');
     $addHandler[] = array(14, 'vtiger.batchevent.delete', 'modules/PBXManager/handlers/PBXManagerHandler.php', 'PBXManagerBatchHandler', '', 1, '[]');
     $addHandler[] = array(15, 'vtiger.entity.beforesave', 'modules/ServiceContracts/handlers/ServiceContractsHandler.php', 'ServiceContractsHandler', '', 1, '[]');
     $addHandler[] = array(16, 'vtiger.entity.aftersave', 'modules/ServiceContracts/handlers/ServiceContractsHandler.php', 'ServiceContractsHandler', '', 1, '[]');
     $addHandler[] = array(17, 'vtiger.entity.aftersave', 'modules/WSAPP/WorkFlowHandlers/WSAPPAssignToTracker.php', 'WSAPPAssignToTracker', '', 1, '["VTEntityDelta"]');
     $addHandler[] = array(18, 'vtiger.entity.aftersave', 'modules/Vtiger/handlers/RecordLabelUpdater.php', 'Vtiger_RecordLabelUpdater_Handler', '', 1, '[]');
     $addHandler[] = array(20, 'vtiger.entity.aftersave', 'modules/PurchaseOrder/handlers/PurchaseOrderHandler.php', 'PurchaseOrderHandler', '', 1, '[]');
     $addHandler[] = array(21, 'vtiger.entity.aftersave', 'modules/ModComments/handlers/ModCommentsHandler.php', 'ModCommentsHandler', '', 1, '[]');
     $addHandler[] = array(22, 'vtiger.picklist.afterrename', 'modules/Settings/Picklist/handlers/PickListHandler.php', 'PickListHandler', '', 1, '[]');
     $addHandler[] = array(23, 'vtiger.picklist.afterdelete', 'modules/Settings/Picklist/handlers/PickListHandler.php', 'PickListHandler', '', 1, '[]');
     $addHandler[] = array(24, 'vtiger.entity.aftersave.final', 'modules/OSSPasswords/handlers/secure.php', 'SECURE', '', 1, '[]');
     $addHandler[] = array(25, 'vtiger.entity.aftersave.final', 'modules/OSSTimeControl/handlers/TimeControl.php', 'TimeControlHandler', '', 1, '[]');
     $addHandler[] = array(26, 'vtiger.entity.aftersave.final', 'modules/Potentials/handlers/PotentialsHandler.php', 'PotentialsHandler', '', 1, '[]');
     $addHandler[] = array(27, 'vtiger.entity.aftersave.final', 'modules/Accounts/handlers/AccountsHandler.php', 'AccountsHandler', NULL, 1, '[]');
     $addHandler[] = array(28, 'vtiger.entity.aftersave.final', 'modules/Vtiger/handlers/SharedOwnerUpdater.php', 'Vtiger_SharedOwnerUpdater_Handler', NULL, 1, '[]');
     $addHandler[] = array(29, 'vtiger.entity.aftersave.final', 'modules/Vtiger/handlers/SharingPrivileges.php', 'Vtiger_SharingPrivileges_Handler', NULL, 1, '[]');
     $addHandler[] = array(30, 'vtiger.entity.aftersave', 'modules/SalesOrder/handlers/RecurringInvoiceHandler.php', 'RecurringInvoiceHandler', '', 1, '[]');
     $addHandler[] = array(31, 'vtiger.entity.aftersave.final', 'modules/HelpDesk/handlers/HelpDeskHandler.php', 'HelpDeskHandler', '', 1, '[]');
     $addHandler[] = array(32, 'vtiger.entity.unlink.after', 'modules/OSSTimeControl/handlers/TimeControl.php', 'TimeControlHandler', NULL, 1, '[]');
     $addHandler[] = array(33, 'vtiger.entity.afterdelete', 'modules/OSSTimeControl/handlers/TimeControl.php', 'TimeControlHandler', NULL, 1, '[]');
     $addHandler[] = array(34, 'vtiger.entity.aftersave.final', 'modules/API/handlers/CardDAV.php', 'API_CardDAV_Handler', '', 1, '[]');
     $addHandler[] = array(35, 'vtiger.entity.aftersave.final', 'modules/API/handlers/CalDAV.php', 'API_CalDAV_Handler', NULL, 1, '[]');
     $addHandler[] = array(36, 'vtiger.entity.link.after', 'modules/HelpDesk/handlers/HelpDeskHandler.php', 'HelpDeskHandler', '', 1, '[]');
     $addHandler[] = array(37, 'vtiger.entity.link.after', 'modules/Vtiger/handlers/SharingPrivileges.php', 'Vtiger_SharingPrivileges_Handler', NULL, 1, '[]');
     $addHandler[] = array(38, 'vtiger.entity.aftersave.final', 'modules/ProjectTask/handlers/ProjectTaskHandler.php', 'ProjectTaskHandler', '', 1, '[]');
     $addHandler[] = array(39, 'vtiger.entity.afterdelete', 'modules/ProjectTask/handlers/ProjectTaskHandler.php', 'ProjectTaskHandler', '', 1, '[]');
     $addHandler[] = array(40, 'vtiger.entity.afterrestore', 'modules/ProjectTask/handlers/ProjectTaskHandler.php', 'ProjectTaskHandler', '', 1, '[]');
     $adb->query('UPDATE vtiger_eventhandlers SET handler_path = "include/events/VTEntityDelta.php" WHERE handler_path = "data/VTEntityDelta.php";');
     try {
         $em = new VTEventsManager($adb);
         foreach ($removeClass as $moduleName => $handlerClass) {
             $em->unregisterHandler($handlerClass);
             if (strpos($moduleName, 'none') === false) {
                 $em->setModuleForHandler($moduleName, $handlerClass);
             }
         }
         foreach ($addHandler as $handler) {
             if (!self::checkHandlerExists($handler)) {
                 $em->registerHandler($handler[1], $handler[2], $handler[3], $handler[4], $handler[6]);
             }
         }
     } catch (Exception $e) {
         Install_InitSchema_Model::addMigrationLog('handlers ' . $e->getMessage(), 'error');
     }
     Install_InitSchema_Model::addMigrationLog('handlers');
     $log->debug("Exiting VT620_to_YT::handlers() method ...");
 }
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:70,代码来源:VT620_to_YT.php


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