installer fix
This commit is contained in:
@@ -512,6 +512,8 @@ class Installer
|
||||
/** afterInstall scripts */
|
||||
$result = $this->createRecords();
|
||||
$result &= $this->executeQueries();
|
||||
|
||||
$this->executeFinalScript();
|
||||
/** END: afterInstall scripts */
|
||||
|
||||
$installerConfig = $this->getInstallerConfig();
|
||||
@@ -667,4 +669,28 @@ class Installer
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
protected function executeFinalScript()
|
||||
{
|
||||
$this->prepareDummyJob();
|
||||
}
|
||||
|
||||
protected function prepareDummyJob()
|
||||
{
|
||||
$scheduledJob = $this->getEntityManager()
|
||||
->getRepository('ScheduledJob')
|
||||
->where([
|
||||
'job' => 'Dummy',
|
||||
])
|
||||
->findOne();
|
||||
|
||||
if (!$scheduledJob) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->getEntityManager()->createEntity('Job', [
|
||||
'name' => 'Dummy',
|
||||
'scheduledJobId' => $scheduledJob->id,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,6 +27,4 @@
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
|
||||
return array(
|
||||
"INSERT INTO `job` (`id`, `name`, `deleted`, `status`, `execute_time`, `method_name`, `created_at`, `modified_at`, `scheduled_job_id`) VALUES ('". uniqid() ."', 'Dummy', '0', 'Pending', '" . gmdate('Y-m-d H:i:s') . "', 'Dummy', '" . gmdate('Y-m-d H:i:s') . "', '" . gmdate('Y-m-d H:i:s') . "', (SELECT id FROM scheduled_job WHERE deleted = 0 AND job = 'Dummy'));"
|
||||
);
|
||||
return [];
|
||||
@@ -27,69 +27,70 @@
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
|
||||
return array(
|
||||
'EmailTemplate' => array(
|
||||
array(
|
||||
return [
|
||||
'EmailTemplate' => [
|
||||
[
|
||||
'name' => 'Case-to-Email auto-reply',
|
||||
'subject' => 'Case has been created',
|
||||
'body' => '<p>{Person.name},</p><p>Case \'{Case.name}\' has been created with number {Case.number} and assigned to {User.name}.</p>',
|
||||
'isHtml ' => '1'
|
||||
)
|
||||
),
|
||||
'ScheduledJob' => array(
|
||||
array(
|
||||
'body' => '<p>{Person.name},</p><p>Case \'{Case.name}\' has been created with number '.
|
||||
'{Case.number} and assigned to {User.name}.</p>',
|
||||
'isHtml ' => '1',
|
||||
]
|
||||
],
|
||||
'ScheduledJob' => [
|
||||
[
|
||||
'name' => 'Check Group Email Accounts',
|
||||
'job' => 'CheckInboundEmails',
|
||||
'status' => 'Active',
|
||||
'scheduling' => '*/2 * * * *'
|
||||
),
|
||||
array(
|
||||
'scheduling' => '*/2 * * * *',
|
||||
],
|
||||
[
|
||||
'name' => 'Check Personal Email Accounts',
|
||||
'job' => 'CheckEmailAccounts',
|
||||
'status' => 'Active',
|
||||
'scheduling' => '*/1 * * * *'
|
||||
),
|
||||
array(
|
||||
'scheduling' => '*/1 * * * *',
|
||||
],
|
||||
[
|
||||
'name' => 'Send Email Reminders',
|
||||
'job' => 'SendEmailReminders',
|
||||
'status' => 'Active',
|
||||
'scheduling' => '*/2 * * * *'
|
||||
),
|
||||
array(
|
||||
'scheduling' => '*/2 * * * *',
|
||||
],
|
||||
[
|
||||
'name' => 'Send Email Notifications',
|
||||
'job' => 'SendEmailNotifications',
|
||||
'status' => 'Active',
|
||||
'scheduling' => '*/2 * * * *'
|
||||
),
|
||||
array(
|
||||
'scheduling' => '*/2 * * * *',
|
||||
],
|
||||
[
|
||||
'name' => 'Clean-up',
|
||||
'job' => 'Cleanup',
|
||||
'status' => 'Active',
|
||||
'scheduling' => '1 1 * * 0'
|
||||
),
|
||||
array(
|
||||
'scheduling' => '1 1 * * 0',
|
||||
],
|
||||
[
|
||||
'name' => 'Send Mass Emails',
|
||||
'job' => 'ProcessMassEmail',
|
||||
'status' => 'Active',
|
||||
'scheduling' => '15 * * * *'
|
||||
),
|
||||
array(
|
||||
'scheduling' => '15 * * * *',
|
||||
],
|
||||
[
|
||||
'name' => 'Auth Token Control',
|
||||
'job' => 'AuthTokenControl',
|
||||
'status' => 'Active',
|
||||
'scheduling' => '*/6 * * * *'
|
||||
),
|
||||
array(
|
||||
'scheduling' => '*/6 * * * *',
|
||||
],
|
||||
[
|
||||
'name' => 'Control Knowledge Base Article Status',
|
||||
'job' => 'ControlKnowledgeBaseArticleStatus',
|
||||
'status' => 'Active',
|
||||
'scheduling' => '10 1 * * *'
|
||||
),
|
||||
'scheduling' => '10 1 * * *',
|
||||
],
|
||||
[
|
||||
'name' => 'Process Webhook Queue',
|
||||
'job' => 'ProcessWebhookQueue',
|
||||
'status' => 'Active',
|
||||
'scheduling' => '*/5 * * * *',
|
||||
],
|
||||
)
|
||||
);
|
||||
],
|
||||
];
|
||||
Reference in New Issue
Block a user