Commit b5fa5ea3 authored by Carsten  Rose's avatar Carsten Rose
Browse files

AutoCron.php: STORE_PARENT will be filled with - Webpage: either the current...

AutoCron.php: STORE_PARENT will be filled with - Webpage: either the current cron job, Mail: the current Mailrecord (sql1). Use them with {{....:PE:all}}
parent b310c7aa
......@@ -159,6 +159,8 @@ class AutoCron {
$mailsSent = 0;
foreach ($mailArr as $mailEntry) {
$this->store->setStore($mailEntry, STORE_PARENT_RECORD, true);
$mailEntry = $this->mailEntryFill($mailEntry);
$content = $this->evaluate->parse($job[AUTOCRON_CONTENT]);
......@@ -196,12 +198,14 @@ class AutoCron {
public function process() {
// Select pending jobs
$sql = "SELECT c.id, c.type, c.content, c.frequency, c.nextRun, c.sql1 FROM Cron AS c WHERE c.status='enable' AND c.nextRun < NOW() AND c.nextRun!=0 AND c.inProgress=0";
$sql = "SELECT * FROM Cron AS c WHERE c.status='enable' AND c.nextRun < NOW() AND c.nextRun!=0 AND c.inProgress=0";
$jobs = $this->db->sql($sql);
// Iterate over all AutoCron Jobs
foreach ($jobs as $job) {
$this->store->setStore($job, STORE_PARENT_RECORD, true);
// Start progress counter
$this->db->sql("UPDATE Cron SET inProgress=NOW() WHERE id=? LIMIT 1", ROW_REGULAR, [$job[COLUMN_ID]]);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment