本文整理汇总了PHP中Vtiger_Cron类的典型用法代码示例。如果您正苦于以下问题:PHP Vtiger_Cron类的具体用法?PHP Vtiger_Cron怎么用?PHP Vtiger_Cron使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Vtiger_Cron类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: applyChange
function applyChange()
{
if ($this->isBlocked()) {
return true;
}
if ($this->hasError()) {
$this->sendError();
}
if ($this->isApplied()) {
$this->sendMsg('Changeset ' . get_class($this) . ' already applied!');
} else {
Vtiger_Cron::register('cronWatcherService', 'modules/CronTasks/cronWatcher.service', 1800, 'CronTasks', Vtiger_Cron::$STATUS_ENABLED, 0, 'Send out warning email for long running cron tasks');
$this->sendMsg('Changeset ' . get_class($this) . ' applied!');
$this->markApplied();
// this should not be done if changeset is Continuous
}
$this->finishExecution();
}
示例2: vtDisplayWorkflowList
function vtDisplayWorkflowList($adb, $request, $requestUrl, $app_strings, $current_language)
{
global $theme;
$image_path = "themes/{$theme}/images/";
$module = new VTWorkflowApplication("workflowlist");
$util = new VTWorkflowUtils();
$mod = return_module_language($current_language, $module->name);
if (!$util->checkAdminAccess()) {
$errorUrl = $module->errorPageUrl($mod['LBL_ERROR_NOT_ADMIN']);
$util->redirectTo($errorUrl, $mod['LBL_ERROR_NOT_ADMIN']);
return;
}
$smarty = new vtigerCRM_Smarty();
$wfs = new VTWorkflowManager($adb);
$smarty->assign("moduleNames", $util->vtGetModules($adb));
$smarty->assign("returnUrl", $requestUrl);
$listModule = $request['list_module'];
$smarty->assign("listModule", $listModule);
if ($listModule == null || strtolower($listModule) == "all") {
$smarty->assign("workflows", $wfs->getWorkflows());
} else {
$smarty->assign("workflows", $wfs->getWorkflowsForModule($listModule));
}
$smarty->assign("MOD", array_merge(return_module_language($current_language, 'Settings'), return_module_language($current_language, $module->name)));
$smarty->assign("APP", $app_strings);
$smarty->assign("THEME", $theme);
$smarty->assign("IMAGE_PATH", $image_path);
$smarty->assign("MODULE_NAME", $module->label);
$smarty->assign("PAGE_NAME", $mod['LBL_WORKFLOW_LIST']);
$smarty->assign("PAGE_TITLE", $mod['LBL_AVAILABLE_WORKLIST_LIST']);
$smarty->assign("module", $module);
$smarty->assign('MODULE', $module->name);
$smarty->assign("CRON_TASK", Vtiger_Cron::getInstance('Workflow'));
$smarty->display("{$module->name}/ListWorkflows.tpl");
}
示例3: applyChange
function applyChange()
{
if ($this->isBlocked()) {
return true;
}
if ($this->hasError()) {
$this->sendError();
}
if ($this->isApplied()) {
$this->sendMsg('Changeset ' . get_class($this) . ' already applied!');
} else {
Vtiger_Cron::register('ExpirePasswordAfterDays', 'cron/ExpirePasswordAfterDays.service', 86400, 'Home', Vtiger_Cron::$STATUS_DISABLED, 0, 'Expire users passwords after Application_ExpirePasswordAfterDays days.');
$this->sendMsg('Changeset ' . get_class($this) . ' applied!');
$this->markApplied();
// this should not be done if changeset is Continuous
}
$this->finishExecution();
}
示例4: process
public function process(Vtiger_Request $request)
{
$adb = PearDatabase::getInstance();
//$params = $request->getAll();
$value = $request->get('value');
$cron = array('name' => 'SWVTTool GoogleCalSync', 'handler_file' => 'modules/SwVtTools/cron/gcal_sync.service.php', 'frequency' => '600', 'module' => 'SwVtTools', 'desc' => 'Check every 10 minutes if Calendar needs to be synced');
if ($value == 'false') {
Vtiger_Cron::deregister($cron['name']);
} else {
$sql = 'SELECT * FROM vtiger_cron_task WHERE name = ?';
$result = $adb->pquery($sql, array($cron['name']));
if ($adb->num_rows($result) > 0) {
$sql = 'UPDATE vtiger_cron_task SET status = 1, handler_file = "' . $cron['handler_file'] . '" WHERE id = ' . $adb->query_result($result, 0, 'id');
$adb->query($sql);
} else {
Vtiger_Cron::register($cron['name'], $cron['handler_file'], $cron['frequency'], $cron['module'], 1, Vtiger_Cron::nextSequence(), $cron['desc']);
}
}
}
示例5: undoChange
function undoChange()
{
if ($this->isBlocked()) {
return true;
}
if ($this->hasError()) {
$this->sendError();
}
if ($this->isSystemUpdate()) {
$this->sendMsg('Changeset ' . get_class($this) . ' is a system update, it cannot be undone!');
} else {
if ($this->isApplied()) {
Vtiger_Cron::deregister('UpdateExchangeRate');
$this->sendMsg('Changeset ' . get_class($this) . ' undone!');
$this->markUndone();
// this should not be done if changeset is Continuous
} else {
$this->sendMsg('Changeset ' . get_class($this) . ' not applied!');
}
}
$this->finishExecution();
}
示例6: array
}
}
$dropflds = array('com_vtiger_workflows.schtypeid', 'com_vtiger_workflows.schtime', 'com_vtiger_workflows.schdayofmonth', 'com_vtiger_workflows.schdayofweek', 'com_vtiger_workflows.schannualdates', 'com_vtiger_workflows.nexttrigger_time', 'vtiger_mailmanager_mailattachments.cid', 'vtiger_mailscanner_rules.assigned_to', 'vtiger_mailscanner_rules.cc', 'vtiger_mailscanner_rules.bcc', 'vtiger_recurringevents.recurringenddate', 'vtiger_mailscanner.time_zone', 'vtiger_portal.createdtime', 'vtiger_mail_accounts.sent_folder', 'vtiger_organizationdetails.vatid', 'vtiger_tab.trial');
foreach ($dropflds as $fqfn) {
list($table, $field) = explode('.', $fqfn);
ExecuteQuery("ALTER TABLE {$table} DROP {$field}");
}
$droptable = array('vtiger_feedback', 'vtiger_shareduserinfo', 'vtiger_schedulereports', 'vtiger_calendar_default_activitytypes', 'vtiger_calendar_user_activitytypes', 'vtiger_reporttype');
foreach ($droptable as $table) {
ExecuteQuery("DROP TABLE {$table}");
}
//Schema changes for vtiger_troubletickets hours & days column
ExecuteQuery('ALTER TABLE vtiger_troubletickets MODIFY hours varchar(200)', array());
ExecuteQuery('ALTER TABLE vtiger_troubletickets MODIFY days varchar(200)', array());
ExecuteQuery('UPDATE vtiger_field set typeofdata=? WHERE fieldname IN(?,?) AND tablename = ?', array('I~O', 'hours', 'days', 'vtiger_troubletickets'));
Vtiger_Cron::deregister('ScheduleReports');
//Updating actions for PriceBooks related list in Products and Services
$productsTabId = getTabId('Products');
ExecuteQuery('UPDATE vtiger_relatedlists SET actions=? WHERE label=? and tabid=?', array('ADD', 'PriceBooks', $productsTabId));
$eventsManager = new VTEventsManager($adb);
$eventsManager->unregisterHandler('Vtiger_RecordLabelUpdater_Handler');
//Start: Customer - Feature #17656 Allow users to add/remove date format with the date fields in workflow send mail task.
$fieldResult = $adb->pquery('SELECT fieldname, name, typeofdata FROM vtiger_field
INNER JOIN vtiger_tab ON vtiger_tab.tabid = vtiger_field.tabid WHERE typeofdata LIKE ?', array('D%'));
$dateFieldsList = $dateTimeFieldsList = array();
while ($rowData = $adb->fetch_array($fieldResult)) {
$moduleName = $rowData['name'];
$fieldName = $rowData['fieldname'];
$pos = stripos($rowData['typeofdata'], 'DT');
if ($pos !== false) {
$dateTimeFieldsList[$moduleName][$fieldName] = $fieldName;
示例7: array
vtiger_seattachmentsrel.attachmentsid = vtiger_attachments.attachmentsid INNER JOIN vtiger_contactdetails ON
vtiger_contactdetails.contactid = vtiger_seattachmentsrel.crmid';
$contactIds = $adb->pquery($ContactIdSql, array());
$numOfRows = $adb->num_rows($contactIds);
for ($i = 0; $i < $numOfRows; $i++) {
$contactId = $adb->query_result($contactIds, $i, "contactid");
$imageName = decode_html($adb->query_result($contactIds, $i, "name"));
Migration_Index_View::ExecuteQuery('UPDATE vtiger_contactdetails SET imagename = ? WHERE contactid = ?', array($imageName, $contactId));
}
echo 'updating image information for contacts table is completed';
//Updating actions for PriceBooks related list in Products and Services
$productsTabId = getTabId('Products');
Migration_Index_View::ExecuteQuery("UPDATE vtiger_relatedlists SET actions=? WHERE label=? and tabid=? ", array('ADD,SELECT', 'PriceBooks', $productsTabId));
echo '<br>Updated PriceBooks related list actions for products and services';
$adb->pquery("CREATE TABLE IF NOT EXISTS vtiger_schedulereports(\n reportid INT(10),\n scheduleid INT(3),\n recipients TEXT,\n schdate VARCHAR(20),\n schtime TIME,\n schdayoftheweek VARCHAR(100),\n schdayofthemonth VARCHAR(100),\n schannualdates VARCHAR(500),\n specificemails VARCHAR(500),\n next_trigger_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP)\n ENGINE=InnoDB DEFAULT CHARSET=utf8;", array());
Vtiger_Cron::register('ScheduleReports', 'cron/modules/Reports/ScheduleReports.service', 900);
Migration_Index_View::ExecuteQuery('UPDATE vtiger_cron_task set description = ? where name = "ScheduleReports" ', array("Recommended frequency for ScheduleReports is 15 mins"));
Migration_Index_View::ExecuteQuery('UPDATE vtiger_cron_task set module = ? where name = "ScheduleReports" ', array("Reports"));
echo '<br>Enabled Scheduled reports feature';
/**
* To add defaulteventstatus and defaultactivitytype fields to Users Module
* Save 2 clicks usability feature
*/
require_once 'vtlib/Vtiger/Module.php';
$module = Vtiger_Module::getInstance('Users');
if ($module) {
$blockInstance = Vtiger_Block::getInstance('LBL_CALENDAR_SETTINGS', $module);
if ($blockInstance) {
$desField = Vtiger_Field::getInstance('defaulteventstatus', $module);
if (!$desField) {
$fieldInstance = new Vtiger_Field();
示例8: update_CronTasks
function update_CronTasks($modulenode)
{
if (empty($modulenode->crons) || empty($modulenode->crons->cron)) {
return;
}
$cronTasks = Vtiger_Cron::listAllInstancesByModule($modulenode->name);
foreach ($modulenode->crons->cron as $importCronTask) {
foreach ($cronTasks as $cronTask) {
if ($cronTask->getName() == $importCronTask->name && $importCronTask->handler == $cronTask->getHandlerFile()) {
Vtiger_Cron::deregister($importCronTask->name);
}
}
if (empty($importCronTask->status)) {
$cronTask->status = Vtiger_Cron::$STATUS_DISABLED;
} else {
$cronTask->status = Vtiger_Cron::$STATUS_ENABLED;
}
if (empty($importCronTask->sequence)) {
$importCronTask->sequence = Vtiger_Cron::nextSequence();
}
// SalesPlatform.ru begin added support laststart/lastend
Vtiger_Cron::register("{$importCronTask->name}", "{$importCronTask->handler}", "{$importCronTask->frequency}", "{$modulenode->name}", "{$importCronTask->status}", "{$importCronTask->sequence}", "{$cronTask->description}", "{$importCronTask->laststart}", "{$importCronTask->lastend}");
//Vtiger_Cron::register("$importCronTask->name","$importCronTask->handler", "$importCronTask->frequency", "$modulenode->name","$importCronTask->status","$importCronTask->sequence","$cronTask->description");
// SalesPlatform.ru end
}
}
示例9: registerCronTasks
function registerCronTasks()
{
include_once 'vtlib/Vtiger/Cron.php';
Vtiger_Cron::register('Workflow', 'cron/modules/com_vtiger_workflow/com_vtiger_workflow.service', 900, 'com_vtiger_workflow', 1, 1, 'Recommended frequency for Workflow is 15 mins');
Vtiger_Cron::register('RecurringInvoice', 'cron/modules/SalesOrder/RecurringInvoice.service', 43200, 'SalesOrder', 1, 2, 'Recommended frequency for RecurringInvoice is 12 hours');
Vtiger_Cron::register('SendReminder', 'cron/SendReminder.service', 900, 'Calendar', 1, 3, 'Recommended frequency for SendReminder is 15 mins');
Vtiger_Cron::register('ScheduleReports', 'cron/modules/Reports/ScheduleReports.service', 900, 'Reports', 1, 4, 'Recommended frequency for ScheduleReports is 15 mins');
Vtiger_Cron::register('MailScanner', 'cron/MailScanner.service', 900, 'Settings', 1, 5, 'Recommended frequency for MailScanner is 15 mins');
}
示例10: export_CronTasks
/**
* Export cron tasks for the module.
* @access private
*/
function export_CronTasks($moduleInstance)
{
$cronTasks = Vtiger_Cron::listAllInstancesByModule($moduleInstance->name);
$this->openNode('crons');
foreach ($cronTasks as $cronTask) {
$this->openNode('cron');
$this->outputNode($cronTask->getName(), 'name');
$this->outputNode($cronTask->getFrequency(), 'frequency');
$this->outputNode($cronTask->getStatus(), 'status');
$this->outputNode($cronTask->getHandlerFile(), 'handler');
$this->outputNode($cronTask->getSequence(), 'sequence');
$this->outputNode($cronTask->getDescription(), 'description');
$this->closeNode('cron');
}
$this->closeNode('crons');
}
示例11: import_CronTasks
/**
* Import cron jobs of the module.
* @access private
*/
function import_CronTasks($modulenode)
{
if (empty($modulenode->crons) || empty($modulenode->crons->cron)) {
return;
}
foreach ($modulenode->crons->cron as $cronTask) {
if (empty($cronTask->status)) {
$cronTask->status = Vtiger_Cron::$STATUS_DISABLED;
} else {
$cronTask->status = Vtiger_Cron::$STATUS_ENABLED;
}
if (empty($cronTask->sequence)) {
$cronTask->sequence = Vtiger_Cron::nextSequence();
}
// SalesPlatform.ru begin added support laststart/lastend
Vtiger_Cron::register("{$cronTask->name}", "{$cronTask->handler}", "{$cronTask->frequency}", "{$modulenode->name}", "{$cronTask->status}", "{$cronTask->sequence}", "{$cronTask->description}", "{$cronTask->laststart}", "{$cronTask->lastend}");
//Vtiger_Cron::register("$cronTask->name","$cronTask->handler", "$cronTask->frequency", "$modulenode->name","$cronTask->status","$cronTask->sequence","$cronTask->description");
// SalesPlatform.ru end
}
}
示例12: vtigerCRM_Smarty
<?php
/*********************************************************************************
* The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
*
********************************************************************************/
require_once 'modules/Settings/MailScanner/core/MailScannerInfo.php';
require_once 'Smarty_setup.php';
require_once 'vtlib/Vtiger/Cron.php';
global $app_strings, $mod_strings, $currentModule, $theme, $current_language;
global $application_unique_key;
// defined in config.inc.php
$smarty = new vtigerCRM_Smarty();
$smarty->assign("MOD", return_module_language($current_language, 'Settings'));
$smarty->assign("CMOD", $mod_strings);
$smarty->assign("APP", $app_strings);
$smarty->assign("THEME", $theme);
$smarty->assign("IMAGE_PATH", "themes/{$theme}/images/");
$scanners = Vtiger_MailScannerInfo::listAll();
$smarty->assign("SCANNERS", $scanners);
$smarty->assign("APP_KEY", $application_unique_key);
$smarty->assign("CRON_TASK", Vtiger_Cron::getInstance('MailScanner'));
$smarty->display('MailScanner/MailScannerInfo.tpl');
示例13: databaseData
function databaseData()
{
global $log, $adb;
$log->debug("Entering YetiForceUpdate::databaseData() method ...");
$result = $adb->pquery("SELECT * FROM `vtiger_blocks` WHERE `blocklabel` = ? AND `tabid` = ?;", ['Oryginalna wiadomość', getTabid('OSSMailView')]);
if ($adb->num_rows($result)) {
$adb->pquery("UPDATE `vtiger_blocks` SET `blocklabel` = ? WHERE `blocklabel` = ? AND `tabid` = ?;", ['LBL_ORIGN_MESSAGE', 'Oryginalna wiadomość', getTabid('OSSMailView')]);
}
$result = $adb->query("SELECT * FROM `vtiger_field` WHERE `fieldlabel` = 'Treść' AND `columnname` = 'orginal_mail';");
if ($adb->num_rows($result)) {
$adb->pquery("UPDATE `vtiger_field` SET `fieldlabel` = ? WHERE `fieldlabel` = ? AND `columnname` = ?;", ['Content', 'Treść', 'orginal_mail']);
}
$this->relatedList();
$result = $adb->query("SELECT * FROM `yetiforce_proc_marketing` WHERE `type` = 'lead' AND `param` = 'convert_status';");
if (!$adb->num_rows($result)) {
$adb->query("insert into `yetiforce_proc_marketing`(`type`,`param`,`value`) values ('lead','convert_status','LBL_LEAD_ACQUIRED');");
}
$result = $adb->pquery("SELECT * FROM `vtiger_settings_field` WHERE `name` = ? ", ['LBL_CUSTOM_FIELD_MAPPING']);
if (!$adb->num_rows($result)) {
$blockid = $adb->query_result($adb->pquery("SELECT blockid FROM vtiger_settings_blocks WHERE label='LBL_STUDIO'", []), 0, 'blockid');
$sequence = (int) $adb->query_result($adb->pquery("SELECT max(sequence) as sequence FROM vtiger_settings_field WHERE blockid=?", [$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\tVALUES (?,?,?,?,?,?,?)", array($fieldid, $blockid, $sequence, 'LBL_CUSTOM_FIELD_MAPPING', '', 'LBL_CUSTOM_FIELD_MAPPING_DESCRIPTION', 'index.php?parent=Settings&module=Leads&view=MappingDetail'));
}
$mailTemplates = ['Notify Owner On Ticket Change', 'Notify Account On Ticket Change', 'Notify Contact On Ticket Closed', 'Notify Account On Ticket Closed', 'Notify Contact On Ticket Create', 'Notify Account On Ticket Create', 'Notify Contact On Ticket Change', 'Notify Owner On Ticket Closed', 'Notify Owner On Ticket Create'];
$result = $adb->pquery("SELECT `content`,`name` FROM `vtiger_ossmailtemplates` WHERE `name` IN (" . generateQuestionMarks($mailTemplates) . ") AND `oss_module_list` = ?;", [$mailTemplates, 'HelpDesk']);
while ($row = $adb->fetch_array($result)) {
$content = str_replace('
<li>#b#718#bEnd#: #a#718#aEnd#</li>', '', $row['content']);
$adb->pquery("UPDATE `vtiger_ossmailtemplates` SET `content` = ? WHERE `name` = ? AND `oss_module_list` = ?;", [$content, $row['name'], 'HelpDesk']);
}
$result = $adb->query("SELECT * FROM `vtiger_entityname` WHERE `fieldname` = 'holidaysentitlement_year' AND `modulename` = 'HolidaysEntitlement';");
if ($adb->num_rows($result)) {
$adb->pquery("UPDATE `vtiger_entityname` SET `fieldname` = ?, `searchcolumn` = ? WHERE `modulename` = ?;", ['ossemployeesid,days', 'ossemployeesid', 'HolidaysEntitlement']);
Settings_Search_Module_Model::UpdateLabels(['tabid' => getTabid('HolidaysEntitlement')]);
}
$result = $adb->query("SELECT * FROM `vtiger_links` WHERE `linklabel` = 'LBL_CREATED_BY_ME_BUT_NOT_MINE_ACTIVITIES' AND `linktype` = 'DASHBOARDWIDGET';");
if (!$adb->num_rows($result)) {
$linkModule = Vtiger_Module::getInstance('Home');
$linkModule->addLink('DASHBOARDWIDGET', "LBL_CREATED_BY_ME_BUT_NOT_MINE_ACTIVITIES", 'index.php?module=Home&view=ShowWidget&name=CreatedNotMineActivities');
}
$result = $adb->query("SELECT * FROM `vtiger_cron_task` WHERE `module` = 'CurrencyUpdate';");
if (!$adb->num_rows($result)) {
$cron = ['LBL_CURRENCY_UPDATE', 'modules/Settings/CurrencyUpdate/cron/CurrencyUpdateCron.php', 86400, NULL, NULL, 1, 'CurrencyUpdate', 4, 'Recommended frequency for Currency Update is 24 hours'];
Vtiger_Cron::register($cron[0], $cron[1], $cron[2], $cron[6], $cron[5], 0, $cron[8]);
}
$result = $adb->pquery("SELECT * FROM `vtiger_settings_field` WHERE `name` = ? ", ['LBL_CURRENCY_UPDATE']);
if (!$adb->num_rows($result)) {
$blockid = $adb->query_result($adb->pquery("SELECT blockid FROM vtiger_settings_blocks WHERE label='LBL_OTHER_SETTINGS'", []), 0, 'blockid');
$sequence = (int) $adb->query_result($adb->pquery("SELECT max(sequence) as sequence FROM vtiger_settings_field WHERE blockid=?", [$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\tVALUES (?,?,?,?,?,?,?)", [$fieldid, $blockid, $sequence, 'LBL_CURRENCY_UPDATE', '', 'LBL_CURRENCY_UPDATE_DESCRIPTION', 'index.php?module=CurrencyUpdate&view=Index&parent=Settings']);
}
$result = $adb->query("SELECT * FROM `vtiger_ossmailscanner_config` WHERE `conf_type` = 'exceptions';");
if (!$adb->num_rows($result)) {
$adb->pquery('insert into `vtiger_ossmailscanner_config`(`conf_type`,`parameter`,`value`) values (?,?,?);', ['exceptions', 'crating_mails', NULL]);
$adb->pquery('insert into `vtiger_ossmailscanner_config`(`conf_type`,`parameter`,`value`) values (?,?,?);', ['exceptions', 'crating_mails', NULL]);
}
$adb->pquery("UPDATE `vtiger_settings_field` SET `linkto` = ? WHERE `linkto` = ?;", ['index.php?module=OSSMailScanner&parent=Settings&view=Index', 'index.php?module=OSSMailScanner&parent=Settings&view=index']);
$result1 = $adb->pquery("SELECT fieldid FROM `vtiger_field` WHERE columnname = ? AND tablename = ?", ['parent_id', 'vtiger_troubletickets']);
$result2 = $adb->pquery("SELECT * FROM `vtiger_fieldmodulerel` WHERE fieldid = ? AND relmodule = ?", [$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') . ",'HelpDesk','Vendors');");
}
$result1 = $adb->pquery("SELECT fieldid FROM `vtiger_field` WHERE columnname = ? AND tablename = ?", ['linktoaccountscontacts', 'vtiger_project']);
$result2 = $adb->pquery("SELECT * FROM `vtiger_fieldmodulerel` WHERE fieldid = ? AND relmodule = ?", [$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') . ",'Project','Vendors');");
}
$moduleInstance = Vtiger_Module::getInstance('HelpDesk');
$target_Module = Vtiger_Module::getInstance('Vendors');
$target_Module->setRelatedList($moduleInstance, 'HelpDesk', array('add'), 'get_dependents_list');
$moduleInstance = Vtiger_Module::getInstance('Project');
$target_Module = Vtiger_Module::getInstance('Vendors');
$target_Module->setRelatedList($moduleInstance, 'Project', array('add'), 'get_dependents_list');
$log->debug("Exiting YetiForceUpdate::databaseData() method ...");
}
示例14: checkCron
public function checkCron()
{
${"GLOBALS"}["zxgfwdm"] = "adb";
${"GLOBALS"}["lxljfuqjkxr"] = "cron";
${${"GLOBALS"}["zxgfwdm"]} = \PearDatabase::getInstance();
${${"GLOBALS"}["lxljfuqjkxr"]} = array("name" => "Workflow2 Queue", "handler_file" => "cron/modules/Workflow2/queue.service", "frequency" => "600", "module" => "Workflow2", "desc" => "Check every 10 minutes if Workflows should be continued");
${${"GLOBALS"}["wpvlkaycsb"]} = "SELECT * FROM vtiger_cron_task WHERE name = ?";
${${"GLOBALS"}["bcibcujqqmt"]} = $adb->pquery(${${"GLOBALS"}["wpvlkaycsb"]}, array(${${"GLOBALS"}["mfbcocs"]}["name"]));
if ($adb->num_rows(${${"GLOBALS"}["bcibcujqqmt"]}) > 0) {
$ittvvhdfhyb = "cron";
$rbhwvnqkbcd = "result";
${"GLOBALS"}["lwujovtyaf"] = "sql";
${${"GLOBALS"}["lwujovtyaf"]} = "UPDATE vtiger_cron_task SET status = 1, handler_file = \"" . ${$ittvvhdfhyb}["handler_file"] . "\" WHERE id = " . $adb->query_result(${$rbhwvnqkbcd}, 0, "id");
$adb->query(${${"GLOBALS"}["wpvlkaycsb"]});
} else {
${"GLOBALS"}["osasktn"] = "cron";
$shilvibxs = "cron";
Vtiger_Cron::register(${${"GLOBALS"}["osasktn"]}["name"], ${${"GLOBALS"}["mfbcocs"]}["handler_file"], ${$shilvibxs}["frequency"], ${${"GLOBALS"}["mfbcocs"]}["module"], 1, Vtiger_Cron::nextSequence(), ${${"GLOBALS"}["mfbcocs"]}["desc"]);
}
}
示例15: php_uname
$php = $version[0] * 10000 + $version[1] * 100 + $version[2];
if ($php < 50300) {
$hostName = php_uname('n');
} else {
$hostName = gethostname();
}
$mailbody = "Instance dir : {$root_directory} <br/> Company Name : {$organization_name} <br/> Site Url : {$site_URL} <br/> Host Name : {$hostName}<br/>";
$mailSubject = "[Alert] {$organization_name} ";
if (PHP_SAPI === "cli" || isset($_SESSION["authenticated_user_id"]) && isset($_SESSION["app_unique_key"]) && $_SESSION["app_unique_key"] == $application_unique_key) {
$cronTasks = false;
if (isset($_REQUEST['service'])) {
// Run specific service
$cronTasks = array(Vtiger_Cron::getInstance($_REQUEST['service']));
} else {
// Run all service
$cronTasks = Vtiger_Cron::listAllActiveInstances();
}
$cronRunId = microtime(true);
$cronStarts = date('Y-m-d H:i:s');
//set global current user permissions
global $current_user;
$current_user = Users::getActiveAdminUser();
echo sprintf('[CRON],"%s",%s,Instance,"%s","",[STARTS]', $cronRunId, $site_URL, $cronStarts) . "\n";
foreach ($cronTasks as $cronTask) {
try {
$cronTask->setBulkMode(true);
// Not ready to run yet?
if (!$cronTask->isRunnable()) {
echo sprintf("[INFO] %s - not ready to run as the time to run again is not completed\n", $cronTask->getName());
continue;
}