Remove reminder_time column, as the cron job uses SQL to calculate the time
This commit is contained in:
parent
2006c3ca70
commit
2863fb82e2
@ -29,9 +29,24 @@ if ($hesk_settings['debug_mode']) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get all reminders that have a reminder date that is now or earlier, and an email has not been sent for the event yet.
|
// Get all reminders that have a reminder date that is now or earlier, and an email has not been sent for the event yet.
|
||||||
// The reminder time is calculated by
|
/*
|
||||||
$sql = "SELECT * FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "calendar_event_reminder`
|
* Reminder units:
|
||||||
WHERE `reminder_time` <= NOW()
|
* 0 - minutes
|
||||||
|
* 1 - hours
|
||||||
|
* 2 - days
|
||||||
|
* 3 - weeks
|
||||||
|
*/
|
||||||
|
$sql = "SELECT `reminder`.`id`, `reminder`.`user_id`, `reminder`.`event_id`,
|
||||||
|
CASE
|
||||||
|
WHEN `unit` = '0' THEN DATE_SUB(`event`.`start`, INTERVAL `reminder`.`amount` MINUTE)
|
||||||
|
WHEN `unit` = '1' THEN DATE_SUB(`event`.`start`, INTERVAL `reminder`.`amount` HOUR)
|
||||||
|
WHEN `unit` = '2' THEN DATE_SUB(`event`.`start`, INTERVAL `reminder`.`amount` DAY)
|
||||||
|
WHEN `unit` = '3' THEN DATE_SUB(`event`.`start`, INTERVAL `reminder`.amount` WEEK)
|
||||||
|
END AS `reminder_date`
|
||||||
|
FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "calendar_event_reminder` AS `reminder`
|
||||||
|
INNER JOIN `" . hesk_dbEscape($hesk_settings['db_pfix']) . "calendar_event` AS `event`
|
||||||
|
ON `reminder`.`event_id` = `event`.`id`
|
||||||
|
WHERE `reminder_date` <= NOW()
|
||||||
AND `email_sent` = '0'";
|
AND `email_sent` = '0'";
|
||||||
|
|
||||||
$rs = hesk_dbQuery($sql);
|
$rs = hesk_dbQuery($sql);
|
||||||
|
@ -735,7 +735,6 @@ function execute260Scripts()
|
|||||||
`event_id` INT NOT NULL,
|
`event_id` INT NOT NULL,
|
||||||
`amount` INT NOT NULL,
|
`amount` INT NOT NULL,
|
||||||
`unit` INT NOT NULL,
|
`unit` INT NOT NULL,
|
||||||
`reminder_time` DATETIME NOT NULL,
|
|
||||||
`email_sent` ENUM('0', '1') NOT NULL DEFAULT '0') ENGINE = MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci");
|
`email_sent` ENUM('0', '1') NOT NULL DEFAULT '0') ENGINE = MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci");
|
||||||
executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "tickets` ADD COLUMN `due_date` DATETIME");
|
executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "tickets` ADD COLUMN `due_date` DATETIME");
|
||||||
executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "categories` ADD COLUMN `color` VARCHAR(7)");
|
executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "categories` ADD COLUMN `color` VARCHAR(7)");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user