本文整理汇总了PHP中VTEventsManager类的典型用法代码示例。如果您正苦于以下问题:PHP VTEventsManager类的具体用法?PHP VTEventsManager怎么用?PHP VTEventsManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了VTEventsManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: vt530_registerVTEntityDeltaApi
function vt530_registerVTEntityDeltaApi()
{
$db = PearDatabase::getInstance();
$em = new VTEventsManager($db);
$em->registerHandler('vtiger.entity.beforesave', 'data/VTEntityDelta.php', 'VTEntityDelta');
$em->registerHandler('vtiger.entity.aftersave', 'data/VTEntityDelta.php', 'VTEntityDelta');
}
示例2: registerEvent
function registerEvent($event)
{
global $adb;
$em = new VTEventsManager($adb);
$em->registerHandler($event, 'build/HelperScripts/coreBOSEventsExample.php', 'coreBOSEventsExample');
echo "<h4>Event {$event} registered.</h4>";
}
示例3: applyChange
function applyChange()
{
if ($this->hasError()) {
$this->sendError();
}
if ($this->isApplied()) {
$this->sendMsg('Changeset ' . get_class($this) . ' already applied!');
} else {
global $adb;
if (vtlib_isModuleActive("Timecontrol") && !vtlib_isModuleActive("Task")) {
$result = $adb->pquery("SELECT eventhandler_id FROM vtiger_eventhandlers WHERE handler_path = 'modules/Timecontrol/convertTZListView.php'", array());
if ($adb->num_rows($result) == 0) {
$result = $adb->pquery("SELECT eventhandler_id FROM vtiger_eventhandlers WHERE handler_path = 'modules/Task/convertTZListView.php'", array());
if ($adb->num_rows($result) == 1) {
$handler_id = $adb->query_result($result, 0, 'eventhandler_id');
$this->ExecuteQuery("UPDATE vtiger_eventhandlers SET handler_path = 'modules/Timecontrol/convertTZListView.php', handler_class = 'convertTZListViewOnTimecontrol' WHERE eventhandler_id = ?", array($handler_id));
} else {
$em = new VTEventsManager($adb);
$em->registerHandler('corebos.filter.listview.render', 'modules/Timecontrol/convertTZListView.php', 'convertTZListViewOnTimecontrol');
}
}
} elseif (vtlib_isModuleActive("Timecontrol") && vtlib_isModuleActive("Task")) {
$result = $adb->pquery("SELECT eventhandler_id FROM vtiger_eventhandlers WHERE handler_path = 'modules/Timecontrol/convertTZListView.php'", array());
if ($adb->num_rows($result) == 0) {
$em = new VTEventsManager($adb);
$em->registerHandler('corebos.filter.listview.render', 'modules/Timecontrol/convertTZListView.php', 'convertTZListViewOnTimecontrol');
}
}
$this->sendMsg('Changeset ' . get_class($this) . ' applied!');
$this->markApplied(false);
}
$this->finishExecution();
}
示例4: process
public function process(Vtiger_Request $request)
{
$adb = \PearDatabase::getInstance();
switch ($request->get('option')) {
case 'recreateUserPrivilegs':
$sql = 'SELECT id FROM vtiger_users WHERE status = "Active"';
$result = $adb->query($sql);
require_once 'modules/Users/CreateUserPrivilegeFile.php';
while ($row = $adb->fetchByAssoc($result)) {
createUserPrivilegesfile($row['id']);
createUserSharingPrivilegesfile($row['id']);
ini_set('display_errors', 1);
global $root_directory;
require_once $root_directory . 'user_privileges/user_privileges_' . $row['id'] . '.php';
require_once $root_directory . 'user_privileges/sharing_privileges_' . $row['id'] . '.php';
}
break;
case 'enableModComments':
$commentsModuleModel = Vtiger_Module_Model::getInstance('ModComments');
if ($commentsModuleModel && $commentsModuleModel->isActive()) {
$relatedToFieldResult = $adb->pquery('SELECT fieldid FROM vtiger_field WHERE fieldname = ? AND tabid = ?', array('related_to', $commentsModuleModel->getId()));
$fieldId = $adb->query_result($relatedToFieldResult, 0, 'fieldid');
$sql = 'SELECT * FROM vtiger_tab WHERE (isentitytype = 1 AND presence = 0) OR name = "Events"';
$result = $adb->query($sql);
while ($row = $adb->fetchByAssoc($result)) {
$sql = 'SELECT fieldid FROM vtiger_fieldmodulerel WHERE fieldid = ? AND module = "ModComments" AND relmodule = ?';
$check = $adb->pquery($sql, array($fieldId, $row['name']));
if ($adb->num_rows($check) == 0) {
$sql = 'INSERT INTO vtiger_fieldmodulerel SET fieldid = ?, module = "ModComments", relmodule = ?';
$adb->pquery($sql, array($fieldId, $row['name']));
}
}
}
break;
case 'initFilterSortOrder':
\SwVtTools\DbCheck::checkColumn('vtiger_customview', 'order_col', 'VARCHAR(255)');
\SwVtTools\DbCheck::checkColumn('vtiger_customview', 'order_dir', 'VARCHAR(4)');
\SwVtTools\DbCheck::checkColumn('vtiger_customview', 'order_numeric_check', 'TINYINT');
\SwVtTools\DbCheck::checkColumn('vtiger_customview', 'order_numeric', 'VARCHAR(10)');
$adb = PearDatabase::getInstance();
$em = new VTEventsManager($adb);
// Registering event for Recurring Invoices
$em->registerHandler('vtiger.filter.process.customview.editajax.view.before', 'modules/SwVtTools/EventHandler.php', 'SwVtToolsEventHandler', "");
$em->registerHandler('vtiger.process.customview.editajax.view.finish', 'modules/SwVtTools/EventHandler.php', 'SwVtToolsEventHandler', "");
$em->registerHandler('vtiger.filter.process.customview.save.action.before', 'modules/SwVtTools/EventHandler.php', 'SwVtToolsEventHandler', "");
$em->registerHandler('vtiger.filter.listview.orderby', 'modules/SwVtTools/EventHandler.php', 'SwVtToolsEventHandler', "");
break;
}
}
示例5: applyChange
function applyChange()
{
global $adb;
if ($this->hasError()) {
$this->sendError();
}
if ($this->isApplied()) {
$this->sendMsg('Changeset ' . get_class($this) . ' already applied!');
} else {
$em = new VTEventsManager($adb);
$em->registerHandler('vtiger.entity.aftersave', 'modules/PBXManager/PBXManagerHandler.php', 'PBXManagerAfterSaveCreateActivity');
$this->sendMsg('Changeset ' . get_class($this) . ' applied!');
$this->markApplied();
}
$this->finishExecution();
}
示例6: vtlib_handler
/**
* 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') {
$fieldid = $adb->getUniqueID('vtiger_settings_field');
$blockid = getSettingsBlockId('LBL_MODULE_MANAGER');
$seq_res = $adb->query("SELECT max(sequence) AS max_seq FROM vtiger_settings_field");
$seq = 1;
if ($adb->num_rows($seq_res) > 0) {
$cur_seq = $adb->query_result($seq_res, 0, 'max_seq');
if ($cur_seq != null) {
$seq = $cur_seq + 1;
}
}
$adb->pquery('INSERT INTO vtiger_settings_field(fieldid, blockid, name, iconpath, description, linkto, sequence)
VALUES (?,?,?,?,?,?,?)', array($fieldid, $blockid, 'LBL_FIELDFORMULAS', 'modules/FieldFormulas/resources/FieldFormulas.png', 'LBL_FIELDFORMULAS_DESCRIPTION', 'index.php?module=FieldFormulas&action=index&parenttab=Settings', $seq));
$tabid = getTabid('FieldFormulas');
if (isset($tabid) && $tabid != '') {
$adb->pquery('DELETE FROM vtiger_profile2tab WHERE tabid = ?', array($tabid));
}
// Mark the module as Standard module
$adb->pquery('UPDATE vtiger_tab SET customized=0 WHERE name=?', array($moduleName));
} else {
if ($eventType == 'module.disabled') {
$em = new VTEventsManager($adb);
$em->setHandlerInActive('VTFieldFormulasEventHandler');
} else {
if ($eventType == 'module.enabled') {
$em = new VTEventsManager($adb);
$em->setHandlerActive('VTFieldFormulasEventHandler');
} 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.
}
}
}
}
}
}
}
示例7: vtlib_handler
/**
* Invoked when special actions are performed on the module.
* @param String Module name
* @param String Event Type
*/
function vtlib_handler($moduleName, $eventType)
{
global $adb, $currentModule;
$modtrackerModule = Vtiger_Module::getInstance($currentModule);
$otherModuleNames = $this->getModTrackerEnabledModules();
if ($eventType == 'module.postinstall') {
$adb->pquery('UPDATE vtiger_tab SET customized=0 WHERE name=?', array($moduleName));
$fieldid = $adb->getUniqueID('vtiger_settings_field');
$blockid = getSettingsBlockId('LBL_OTHER_SETTINGS');
$seq_res = $adb->pquery("SELECT max(sequence) AS max_seq FROM vtiger_settings_field WHERE blockid = ?", array($blockid));
if ($adb->num_rows($seq_res) > 0) {
$cur_seq = $adb->query_result($seq_res, 0, 'max_seq');
if ($cur_seq != null) {
$seq = $cur_seq + 1;
}
}
$adb->pquery('INSERT INTO vtiger_settings_field(fieldid, blockid, name, iconpath, description, linkto, sequence)
VALUES (?,?,?,?,?,?,?)', array($fieldid, $blockid, 'ModTracker', 'set-IcoLoginHistory.gif', 'LBL_MODTRACKER_DESCRIPTION', 'index.php?module=ModTracker&action=BasicSettings&parenttab=Settings&formodule=ModTracker', $seq));
} else {
if ($eventType == 'module.disabled') {
$em = new VTEventsManager($adb);
$em->setHandlerInActive('ModTrackerHandler');
// De-register Common Javascript
$modtrackerModule->deleteLink('HEADERSCRIPT', 'ModTrackerCommon_JS');
} else {
if ($eventType == 'module.enabled') {
$em = new VTEventsManager($adb);
$em->setHandlerActive('ModTrackerHandler');
// Register Common Javascript
$modtrackerModule->addLink('HEADERSCRIPT', 'ModTrackerCommon_JS', 'modules/ModTracker/ModTrackerCommon.js');
} 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.
}
}
}
}
}
}
}
示例8: process
function process(Vtiger_Request $request)
{
vimport('~include/events/include.inc');
$db = PearDatabase::getInstance();
$em = new VTEventsManager($db);
$em->initTriggerCache();
$em->triggerEvent('user.logout.before', []);
Vtiger_Session::regenerateId(true);
// to overcome session id reuse.
Vtiger_Session::destroy();
//Track the logout History
$moduleName = $request->getModule();
$moduleModel = Users_Module_Model::getInstance($moduleName);
$moduleModel->saveLogoutHistory();
//End
header('Location: index.php');
}
示例9: addHandler
public function addHandler($addHandler = [])
{
$log = vglobal('log');
$adb = PearDatabase::getInstance();
$log->debug('Entering ' . __CLASS__ . '::' . __METHOD__ . ' method ...');
if ($addHandler) {
$em = new VTEventsManager($adb);
foreach ($addHandler as $handler) {
$result = $adb->pquery('SELECT * FROM `vtiger_eventhandlers` WHERE event_name = ? AND handler_class = ?;', [$handler[0], $handler[2]]);
if ($result->rowCount() == 0) {
$em->registerHandler($handler[0], $handler[1], $handler[2], $handler[3], $handler[5]);
}
}
}
$log->debug('Exiting ' . __CLASS__ . '::' . __METHOD__ . ' method ...');
}
示例10: VTEventsManager
<?php
require_once 'include/utils/utils.php';
require 'include/events/include.inc';
$em = new VTEventsManager($adb);
$em->registerHandler("vtiger.entity.beforesave", "modules/Contacts/ContactosHandler.php", "ContactosHandler", "ModuleName in ['Contacts']");
echo 'Custom Handler Registered !';
示例11: relateEntities
/**
* Function to related two records of different entity types
*/
function relateEntities($focus, $sourceModule, $sourceRecordId, $destinationModule, $destinationRecordIds)
{
$adb = PearDatabase::getInstance();
$log = vglobal('log');
$log->debug("Entering relateEntities method ({$sourceModule}, {$sourceRecordId}, {$destinationModule}, {$destinationRecordIds})");
require_once 'include/events/include.inc';
//require_once('modules/com_vtiger_workflow/VTWorkflowManager.inc');
//require_once('modules/com_vtiger_workflow/VTEntityCache.inc');
$em = new VTEventsManager($adb);
$em->initTriggerCache();
if (!is_array($destinationRecordIds)) {
$destinationRecordIds = [$destinationRecordIds];
}
$data = [];
$data['CRMEntity'] = $focus;
$data['entityData'] = VTEntityData::fromEntityId($adb, $sourceRecordId);
$data['sourceModule'] = $sourceModule;
$data['sourceRecordId'] = $sourceRecordId;
$data['destinationModule'] = $destinationModule;
foreach ($destinationRecordIds as $destinationRecordId) {
$data['destinationRecordId'] = $destinationRecordId;
$em->triggerEvent('vtiger.entity.link.before', $data);
$focus->save_related_module($sourceModule, $sourceRecordId, $destinationModule, $destinationRecordId);
$focus->trackLinkedInfo($sourceModule, $sourceRecordId, $destinationModule, $destinationRecordId);
/*
$wfs = new VTWorkflowManager($adb);
$workflows = $wfs->getWorkflowsForModule($sourceModule, VTWorkflowManager::$ON_RELATED);
$entityCache = new VTEntityCache(Users_Record_Model::getCurrentUserModel());
$entityData = VTEntityData::fromCRMEntity($focus);
$entityData->eventType = VTWorkflowManager::$ON_RELATED;
$entityData->relatedInfo = [
'destId' => $destinationRecordId,
'destModule' => $destinationModule,
];
foreach ($workflows as $id => $workflow) {
if ($workflow->evaluate($entityCache, $entityData->getId())) {
$workflow->performTasks($entityData);
}
}
*/
$em->triggerEvent('vtiger.entity.link.after', $data);
}
$log->debug("Exiting relateEntities method ...");
}
示例12: array
//Avoid premature deletion of activity related records
$relatedToQuery = "SELECT fieldid FROM vtiger_field WHERE tabid=? AND fieldname=?";
$calendarInstance = Vtiger_Module::getInstance('Calendar');
$tabId = $calendarInstance->id;
$result = $adb->pquery($relatedToQuery, array($tabId, 'parent_id'));
$fieldId = $adb->query_result($result, 0, 'fieldid');
$insertQuery = "DELETE FROM vtiger_fieldmodulerel where fieldid=?";
$adb->pquery($insertQuery, array($fieldId));
//For contacts the fieldname is contact_id
$contactsRelatedToQuery = "SELECT fieldid FROM vtiger_field WHERE tabid=? AND fieldname=?";
$contactsResult = $adb->pquery($contactsRelatedToQuery, array($tabId, 'contact_id'));
$contactsFieldId = $adb->query_result($contactsResult, 0, 'fieldid');
$insertQuery = "DELETE FROM vtiger_fieldmodulerel where fieldid=?";
$adb->pquery($insertQuery, array($contactsFieldId));
$module = Vtiger_Module::getInstance('PBXManager');
$ev = new VTEventsManager($adb);
$ev->unregisterHandler('PBXManagerHandler');
$ev->unregisterHandler('PBXManagerBatchHandler');
if ($module) {
$module->deleteRelatedLists();
$module->deleteLinks();
$module->delete();
ExecuteQuery("DELETE FROM vtiger_def_org_share WHERE tabid=?", array($module->id));
}
ExecuteQuery("delete from vtiger_asterisk");
ExecuteQuery("DROP TABLE vtiger_pbxmanager");
ExecuteQuery("DROP TABLE vtiger_pbxmanager_phonelookup");
ExecuteQuery("DELETE FROM vtiger_links WHERE linktype=? AND linklabel=? AND linkurl=?", array('HEADERSCRIPT', 'Incoming Calls', 'modules/PBXManager/resources/PBXManagerJS.js'));
ExecuteQuery("DELETE FROM vtiger_relatedlists WHERE name=? and label=?", array('get_dependents_list', "PBXManager"));
vtws_deleteWebserviceEntity('PBXManager');
ExecuteQuery('DELETE FROM vtiger_settings_blocks WHERE label=?', array('LBL_INTEGRATION'));
示例13: createRecords
//.........这里部分代码省略.........
}
$baseRecordId = $adb->query_result($duplicatesResult, $noOfDuplicates - 1, $fieldColumnMapping['id']);
$baseEntityId = vtws_getId($moduleObjectId, $baseRecordId);
if ($mergeType == Import_Utils_Helper::$AUTO_MERGE_OVERWRITE) {
$fieldData = $this->transformForImport($fieldData, $moduleMeta);
$fieldData['id'] = $baseEntityId;
$entityInfo = vtws_update($fieldData, $this->user);
$entityInfo['status'] = self::$IMPORT_RECORD_UPDATED;
}
if ($mergeType == Import_Utils_Helper::$AUTO_MERGE_MERGEFIELDS) {
$filteredFieldData = array();
foreach ($fieldData as $fieldName => $fieldValue) {
// empty will give false for value = 0
if (!empty($fieldValue) || $fieldValue != "") {
$filteredFieldData[$fieldName] = $fieldValue;
}
}
// Custom handling for default values & mandatory fields
// need to be taken care than normal import as we merge
// existing record values with newer values.
$fillDefault = false;
$mandatoryValueChecks = false;
$existingFieldValues = vtws_retrieve($baseEntityId, $this->user);
$defaultFieldValues = $this->getDefaultFieldValues($moduleMeta);
foreach ($existingFieldValues as $fieldName => $fieldValue) {
if (empty($fieldValue) && empty($filteredFieldData[$fieldName]) && !empty($defaultFieldValues[$fieldName])) {
$filteredFieldData[$fieldName] = $defaultFieldValues[$fieldName];
}
}
$filteredFieldData = $this->transformForImport($filteredFieldData, $moduleMeta, $fillDefault, $mandatoryValueChecks);
$filteredFieldData['id'] = $baseEntityId;
$entityInfo = vtws_revise($filteredFieldData, $this->user);
$entityInfo['status'] = self::$IMPORT_RECORD_MERGED;
$fieldData = $filteredFieldData;
}
} else {
$createRecord = true;
}
} else {
$createRecord = true;
}
} else {
$createRecord = true;
}
if ($createRecord) {
$fieldData = $this->transformForImport($fieldData, $moduleMeta);
if ($fieldData == null) {
$entityInfo = null;
} else {
try {
$entityInfo = vtws_create($moduleName, $fieldData, $this->user);
} catch (Exception $e) {
}
}
}
}
if ($entityInfo == null) {
$entityInfo = array('id' => null, 'status' => self::$IMPORT_RECORD_FAILED);
} else {
if ($createRecord) {
$entityInfo['status'] = self::$IMPORT_RECORD_CREATED;
}
}
if ($createRecord || $mergeType == Import_Utils_Helper::$AUTO_MERGE_MERGEFIELDS || $mergeType == Import_Utils_Helper::$AUTO_MERGE_OVERWRITE) {
$entityIdComponents = vtws_getIdComponents($entityInfo['id']);
$recordId = $entityIdComponents[1];
$entityfields = getEntityFieldNames($this->module);
switch ($this->module) {
case 'HelpDesk':
$entityfields['fieldname'] = array('ticket_title');
break;
case 'Documents':
$entityfields['fieldname'] = array('notes_title');
break;
case 'Documents':
$entityfields['fieldname'] = array('notes_title');
break;
}
$label = '';
if (is_array($entityfields['fieldname'])) {
foreach ($entityfields['fieldname'] as $field) {
$label .= $fieldData[$field] . " ";
}
} else {
$label = $fieldData[$entityfields['fieldname']];
}
$label = trim($label);
$adb->pquery('UPDATE vtiger_crmentity SET label=? WHERE crmid=?', array($label, $recordId));
}
$this->importedRecordInfo[$rowId] = $entityInfo;
$this->updateImportStatus($rowId, $entityInfo);
}
if ($this->entityData) {
$entity = new VTEventsManager($adb);
$entity->triggerEvent('vtiger.batchevent.save', $this->entityData);
}
$this->entityData = null;
$result = null;
return true;
}
示例14: restore
/** Function to restore a deleted record of specified module with given crmid
* @param $module -- module name:: Type varchar
* @param $entity_ids -- list of crmids :: Array
*/
function restore($module, $id)
{
global $current_user, $adb;
$this->db->println("TRANS restore starts {$module}");
$this->db->startTransaction();
$date_var = date("Y-m-d H:i:s");
$query = 'UPDATE vtiger_crmentity SET deleted=0,modifiedtime=?,modifiedby=? WHERE crmid = ?';
$this->db->pquery($query, array($this->db->formatDate($date_var, true), $current_user->id, $id), true, "Error restoring records :");
//Restore related entities/records
$this->restoreRelatedRecords($module, $id);
//Event triggering code
require_once "include/events/include.inc";
global $adb;
$em = new VTEventsManager($adb);
// Initialize Event trigger cache
$em->initTriggerCache();
$this->id = $id;
$entityData = VTEntityData::fromCRMEntity($this);
//Event triggering code
$em->triggerEvent("vtiger.entity.afterrestore", $entityData);
//Event triggering code ends
$this->db->completeTransaction();
$this->db->println("TRANS restore ends");
}
示例15: applyChange
function applyChange()
{
global $adb;
if ($this->hasError()) {
$this->sendError();
}
if ($this->isApplied()) {
$this->sendMsg('Changeset ' . get_class($this) . ' already applied!');
} else {
global $adb;
$em = new VTEventsManager($adb);
$em->registerHandler('vtiger.entity.aftersave', 'modules/Emails/evcbrcHandler.php', 'evcbrcHandler');
$modPrj = Vtiger_Module::getInstance('Project');
$modPrjTsk = Vtiger_Module::getInstance('ProjectTask');
$modPot = Vtiger_Module::getInstance('Potentials');
$modHD = Vtiger_Module::getInstance('HelpDesk');
$modEmail = Vtiger_Module::getInstance('Emails');
$modPrj->setRelatedList($modEmail, 'Emails', array('add'), 'get_emails');
$modPrjTsk->setRelatedList($modEmail, 'Emails', array('add'), 'get_emails');
$modPot->setRelatedList($modEmail, 'Emails', array('add'), 'get_emails');
$modHD->setRelatedList($modEmail, 'Emails', array('add'), 'get_emails');
$block = VTiger_Block::getInstance('LBL_PROJECT_INFORMATION', $modPrj);
$field = Vtiger_Field::getInstance('email', $modPrj);
if ($field) {
$this->ExecuteQuery('update vtiger_field set presence=2 where fieldid=' . $field->id);
} else {
$field = new Vtiger_Field();
$field->name = 'email';
$field->uitype = 13;
$field->label = 'Email';
$field->columntype = 'VARCHAR(150)';
$field->typeofdata = 'E~O';
$field->displaytype = 2;
$block->addField($field);
}
$block = VTiger_Block::getInstance('LBL_PROJECT_TASK_INFORMATION', $modPrjTsk);
$field = Vtiger_Field::getInstance('email', $modPrjTsk);
if ($field) {
$this->ExecuteQuery('update vtiger_field set presence=2 where fieldid=' . $field->id);
} else {
$field = new Vtiger_Field();
$field->name = 'email';
$field->uitype = 13;
$field->label = 'Email';
$field->columntype = 'VARCHAR(150)';
$field->typeofdata = 'E~O';
$field->displaytype = 2;
$block->addField($field);
}
$block = VTiger_Block::getInstance('LBL_OPPORTUNITY_INFORMATION', $modPot);
$field = Vtiger_Field::getInstance('email', $modPot);
if ($field) {
$this->ExecuteQuery('update vtiger_field set presence=2 where fieldid=' . $field->id);
} else {
$field = new Vtiger_Field();
$field->name = 'email';
$field->uitype = 13;
$field->label = 'Email';
$field->columntype = 'VARCHAR(150)';
$field->typeofdata = 'E~O';
$field->displaytype = 2;
$block->addField($field);
}
$block = VTiger_Block::getInstance('LBL_TICKET_INFORMATION', $modHD);
$field = Vtiger_Field::getInstance('email', $modHD);
if ($field) {
$this->ExecuteQuery('update vtiger_field set presence=2 where fieldid=' . $field->id);
} else {
$field = new Vtiger_Field();
$field->name = 'email';
$field->uitype = 13;
$field->label = 'Email';
$field->columntype = 'VARCHAR(150)';
$field->typeofdata = 'E~O';
$field->displaytype = 2;
$block->addField($field);
}
$this->sendMsg('Changeset ' . get_class($this) . ' applied!');
$this->markApplied();
}
$this->finishExecution();
}