本文整理汇总了PHP中VTTaskManager::unserializeTask方法的典型用法代码示例。如果您正苦于以下问题:PHP VTTaskManager::unserializeTask方法的具体用法?PHP VTTaskManager::unserializeTask怎么用?PHP VTTaskManager::unserializeTask使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VTTaskManager
的用法示例。
在下文中一共展示了VTTaskManager::unserializeTask方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: databaseData
public function databaseData()
{
global $log, $adb;
$log->debug("Entering YetiForceUpdate::databaseData() method ...");
$this->addFields();
$adb->query("UPDATE vtiger_eventhandlers_seq SET `id` = (SELECT MAX(eventhandler_id) FROM `vtiger_eventhandlers`);");
$result = $adb->pquery("SELECT * FROM `vtiger_eventhandlers` WHERE event_name = ? AND handler_class = ?;", array('vtiger.entity.link.after', 'HelpDeskHandler'));
if ($adb->num_rows($result) == 0) {
$addHandler = array();
$addHandler[] = array('vtiger.entity.link.after', 'modules/HelpDesk/handlers/HelpDeskHandler.php', 'HelpDeskHandler', '', '1', '[]');
$em = new VTEventsManager($adb);
foreach ($addHandler as $handler) {
$em->registerHandler($handler[0], $handler[1], $handler[2], $handler[3], $handler[5]);
}
}
$template[] = array('Notify Owner On Ticket Change', 'HelpDesk', 'PLL_RECORD');
$template[] = array('Notify Account On Ticket Change', 'HelpDesk', 'PLL_RECORD');
$template[] = array('Notify Contact On Ticket Closed', 'HelpDesk', 'PLL_RECORD');
$template[] = array('Notify Account On Ticket Closed', 'HelpDesk', 'PLL_RECORD');
$template[] = array('Notify Contact On Ticket Create', 'HelpDesk', 'PLL_RECORD');
$template[] = array('Notify Account On Ticket Create', 'HelpDesk', 'PLL_RECORD');
$template[] = array('Notify Contact On Ticket Change', 'HelpDesk', 'PLL_RECORD');
$template[] = array('Notify Owner On Ticket Closed', 'HelpDesk', 'PLL_RECORD');
$template[] = array('Notify Owner On Ticket Create', 'HelpDesk', 'PLL_RECORD');
$template[] = array('Customer Portal Login Details', 'Contacts', 'PLL_RECORD');
$template[] = array('Send invitations', 'Events', 'PLL_RECORD');
$template[] = array('Send Notification Email to Record Owner', 'Calendar', 'PLL_RECORD');
$template[] = array('Activity Reminder Notification', 'Calendar', 'PLL_RECORD');
$template[] = array('Activity Reminder Notification', 'Events', 'PLL_RECORD');
$template[] = array('Test mail about the mail server configuration.', 'Users', 'PLL_RECORD');
$template[] = array('ForgotPassword', 'Users', 'PLL_RECORD');
$template[] = array('Customer Portal - ForgotPassword', 'Contacts', 'PLL_RECORD');
$template[] = array('New comment added to ticket from portal', 'ModComments', 'PLL_RECORD');
$template[] = array('New comment added to ticket', 'ModComments', 'PLL_RECORD');
$template[] = array('Security risk has been detected - Brute Force', 'Contacts', 'PLL_MODULE');
$template[] = array('Backup has been made', 'Contacts', 'PLL_MODULE');
$result = $adb->query("SHOW COLUMNS FROM `vtiger_ossmailtemplates` LIKE 'ossmailtemplates_type';");
if ($adb->num_rows($result) == 1) {
foreach ($template as $temp) {
$adb->pquery("UPDATE `vtiger_ossmailtemplates` set ossmailtemplates_type = ? WHERE `name` = ? AND oss_module_list = ? ", array($temp[2], $temp[0], $temp[1]));
}
}
$result = $adb->pquery("SELECT * FROM `vtiger_relatedlists` WHERE tabid = ? AND related_tabid = ? AND name = ? AND label = ?;", array(getTabid('OSSMailTemplates'), getTabid('Documents'), 'get_attachments', 'Documents'));
if ($adb->num_rows($result) == 0) {
$moduleInstance = Vtiger_Module::getInstance('Documents');
$target_Module = Vtiger_Module::getInstance('OSSMailTemplates');
$target_Module->setRelatedList($moduleInstance, 'Documents', array('add,select'), 'get_attachments');
}
$result = $adb->pquery("SELECT * FROM `vtiger_relatedlists` WHERE tabid = ? AND related_tabid = ? AND name = ? AND label = ?;", array(getTabid('HelpDesk'), getTabid('Contacts'), 'get_related_list', 'Contacts'));
if ($adb->num_rows($result) == 0) {
$moduleInstance = Vtiger_Module::getInstance('Contacts');
$target_Module = Vtiger_Module::getInstance('HelpDesk');
$target_Module->setRelatedList($moduleInstance, 'Contacts', array('SELECT'), 'get_related_list');
}
$adb->pquery("UPDATE `vtiger_field` set displaytype = ? WHERE `columnname` = ?;", array(2, 'was_read'));
$adb->pquery("UPDATE `vtiger_field` set uitype = ? WHERE `columnname` = ? AND tablename = ?;", array(15, 'industry', 'vtiger_leaddetails'));
$adb->pquery("UPDATE `vtiger_calendar_default_activitytypes` set active = ? ;", array(1));
$adb->pquery("UPDATE `com_vtiger_workflows` SET `type` = ? WHERE `summary` = ? AND module_name = ? ;", array('[]', 'Ticket Creation: Send Email to Record Contact', 'HelpDesk'));
$result = $adb->pquery("SELECT workflow_id FROM `com_vtiger_workflows` WHERE summary = ? AND module_name =? ", array('Send Customer Login Details', 'Contacts'));
if ($adb->num_rows($result) == 1) {
$workflow_id = $adb->query_result_raw($result, 0, 'workflow_id');
$workflowTaskAdd = array(128, 53, 'Mark portal users password as sent.', 'O:18:"VTEntityMethodTask":7:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"53";s:7:"summary";s:35:"Mark portal users password as sent.";s:6:"active";b:0;s:7:"trigger";N;s:10:"methodName";s:16:"MarkPasswordSent";s:2:"id";i:128;}');
$result = $adb->pquery("SELECT * FROM `com_vtiger_workflowtasks` WHERE summary = ? AND workflow_id =? ", array($workflowTaskAdd[2], $workflow_id));
if ($adb->num_rows($result) == 0) {
$taskManager = new VTTaskManager($adb);
$task = $taskManager->unserializeTask($workflowTaskAdd[3]);
$task->id = '';
$task->workflowId = $workflow_id;
$taskManager->saveTask($task);
}
}
$adb->pquery('UPDATE com_vtiger_workflows SET defaultworkflow = "0" WHERE `summary` = ? AND module_name = ?;', array('Ticket Creation: Send Email to Record Contact', 'HelpDesk'));
$result = $adb->pquery('SELECT * FROM com_vtiger_workflows WHERE `summary` = ? AND module_name = ?;', array('Ticket Creation: Send Email to Record Contact', 'HelpDesk'));
for ($i = 0; $i < $adb->num_rows($result); $i++) {
$recordId = $adb->query_result($result, $i, 'workflow_id');
$adb->pquery("DELETE FROM com_vtiger_workflowtasks WHERE workflow_id IN\n\t\t\t\t\t\t\t(SELECT workflow_id FROM com_vtiger_workflows WHERE workflow_id=? AND (defaultworkflow IS NULL OR defaultworkflow != 1))", array($recordId));
$adb->pquery("DELETE FROM com_vtiger_workflows WHERE workflow_id=? AND (defaultworkflow IS NULL OR defaultworkflow != 1)", array($recordId));
}
$result = $adb->pquery('SELECT * FROM com_vtiger_workflowtasks WHERE `summary` IN (?,?);', array('Notify Contact On Ticket Closed', 'Notify Contact On Ticket Change'));
for ($i = 0; $i < $adb->num_rows($result); $i++) {
$recordId = $adb->query_result($result, $i, 'task_id');
$adb->pquery("delete from com_vtiger_workflowtasks where task_id=?", array($recordId));
}
$task_entity_method[] = array('HelpDesk', 'HeldDeskChangeNotifyContacts', 'modules/HelpDesk/workflows/HelpDeskWorkflow.php', 'HeldDeskChangeNotifyContacts');
$task_entity_method[] = array('HelpDesk', 'HeldDeskClosedNotifyContacts', 'modules/HelpDesk/workflows/HelpDeskWorkflow.php', 'HeldDeskClosedNotifyContacts');
$emm = new VTEntityMethodManager($adb);
foreach ($task_entity_method as $method) {
$result = $adb->pquery("SELECT * FROM `com_vtiger_workflowtasks_entitymethod` WHERE method_name = ? ", array($method[1]));
if ($adb->num_rows($result) == 0) {
$emm->addEntityMethod($method[0], $method[1], $method[2], $method[3]);
}
}
$adb->pquery('UPDATE com_vtiger_workflows SET test = ? WHERE `summary` = ? AND module_name = ?;', array('[{"fieldname":"ticketstatus","operation":"has changed","value":null,"valuetype":"rawtext","joincondition":"and","groupjoin":"and","groupid":"0"},{"fieldname":"ticketstatus","operation":"is","value":"Closed","valuetype":"rawtext","joincondition":"","groupjoin":"and","groupid":"0"}]', 'Ticket Closed: Send Email to Record Contact', 'HelpDesk'));
$adb->pquery('UPDATE com_vtiger_workflows SET test = ? WHERE `summary` = ? AND module_name = ?;', array('[{"fieldname":"ticketstatus","operation":"has changed","value":null,"valuetype":"rawtext","joincondition":"and","groupjoin":"and","groupid":"0"},{"fieldname":"ticketstatus","operation":"is not","value":"Closed","valuetype":"rawtext","joincondition":"","groupjoin":"and","groupid":"0"}]', 'Ticket change: Send Email to Record Contact', 'HelpDesk'));
$result = $adb->pquery("SELECT workflow_id FROM `com_vtiger_workflows` WHERE summary = ? AND module_name =? ", array('Ticket change: Send Email to Record Contact', 'HelpDesk'));
if ($adb->num_rows($result) == 1) {
$workflow_id = $adb->query_result_raw($result, 0, 'workflow_id');
$workflowTaskAdd = array(133, 26, 'Notify Contact On Ticket Change', 'O:18:"VTEntityMethodTask":7:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"26";s:7:"summary";s:31:"Notify Contact On Ticket Change";s:6:"active";b:0;s:7:"trigger";N;s:10:"methodName";s:28:"HeldDeskChangeNotifyContacts";s:2:"id";i:133;}');
$result = $adb->pquery("SELECT * FROM `com_vtiger_workflowtasks` WHERE summary = ? AND workflow_id =? ", array($workflowTaskAdd[2], $workflow_id));
if ($adb->num_rows($result) == 0) {
//.........这里部分代码省略.........
示例2: addWorkflow
public function addWorkflow()
{
global $log, $adb;
$workflow = array();
$result = $adb->query("SELECT * FROM `com_vtiger_workflows` WHERE summary = 'Update Closed Time';");
if ($adb->num_rows($result) == 0) {
$workflow[] = array(54, 'HelpDesk', 'Update Closed Time', '[{"fieldname":"ticketstatus","operation":"is","value":"Rejected","valuetype":"rawtext","joincondition":"or","groupjoin":null,"groupid":"1"},{"fieldname":"ticketstatus","operation":"is","value":"Closed","valuetype":"rawtext","joincondition":"","groupjoin":null,"groupid":"1"}]', 2, NULL, 'basic', 6, NULL, NULL, NULL, NULL, NULL, NULL);
}
$result = $adb->query("SELECT * FROM `com_vtiger_workflows` WHERE summary = 'Generate mail address book';");
if ($adb->num_rows($result) == 0) {
$workflow[] = array(55, 'Contacts', 'Generate mail address book', '[]', 3, NULL, 'basic', 6, NULL, NULL, NULL, NULL, NULL, NULL);
}
$workflowTask = array();
$workflowTask[] = array(121, 54, 'Update Closed Time', 'O:18:"VTUpdateClosedTime":6:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"54";s:7:"summary";s:18:"Update Closed Time";s:6:"active";b:1;s:7:"trigger";N;s:2:"id";i:121;}');
$workflowTask[] = array(123, 55, 'Generate mail address book', 'O:17:"VTAddressBookTask":7:{s:18:"executeImmediately";b:0;s:10:"workflowId";s:2:"55";s:7:"summary";s:26:"Generate mail address book";s:6:"active";b:1;s:7:"trigger";N;s:4:"test";s:0:"";s:2:"id";i:123;}');
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';
$workflowManager = new VTWorkflowManager($adb);
$taskManager = new VTTaskManager($adb);
foreach ($workflow as $record) {
$newWorkflow = $workflowManager->newWorkFlow($record[1]);
$newWorkflow->description = $record[2];
$newWorkflow->test = $record[3];
$newWorkflow->executionCondition = $record[4];
$newWorkflow->defaultworkflow = $record[5];
$newWorkflow->type = $record[6];
$newWorkflow->filtersavedinnew = $record[7];
$workflowManager->save($newWorkflow);
foreach ($workflowTask as $indexTask) {
if ($indexTask[1] == $record[0]) {
$task = $taskManager->unserializeTask($indexTask[3]);
$task->id = '';
$task->workflowId = $newWorkflow->id;
$taskManager->saveTask($task);
}
}
}
}