mirror of
https://github.com/SuiteCRM/SuiteCRM-Core.git
synced 2025-09-04 08:28:56 +08:00
[Legacy] Update AlertSchedulers alert reminder time calculation
Update calculation to on create the notification with the time that as scheduled for
This commit is contained in:
parent
dbd0d738ff
commit
1eddcb50bf
1 changed files with 18 additions and 6 deletions
|
@ -89,7 +89,9 @@ class AddScheduledReminderAlerts
|
|||
continue;
|
||||
}
|
||||
|
||||
if ($this->isOutsideOfExecutionDateRange($relatedEventStart, $dateTimeNowStamp, $dateTimeMaxStamp)) {
|
||||
$relatedEventStart -= $popupReminder->timer_popup;
|
||||
|
||||
if (!$this->isWithinExecutionDateRange($relatedEventStart, $dateTimeNowStamp, $dateTimeMaxStamp)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -104,8 +106,6 @@ class AddScheduledReminderAlerts
|
|||
continue;
|
||||
}
|
||||
|
||||
$relatedEventStart -= $popupReminder->timer_popup;
|
||||
|
||||
$url = $this->getURL($popupReminder);
|
||||
$instructions = $this->getInstructions($app_strings['MSG_JS_ALERT_MTG_REMINDER_MEETING_MSG']);
|
||||
|
||||
|
@ -302,10 +302,22 @@ class AddScheduledReminderAlerts
|
|||
* @param $dateTimeMaxStamp
|
||||
* @return bool
|
||||
*/
|
||||
protected function isOutsideOfExecutionDateRange($relatedEventStart, $dateTimeNowStamp, $dateTimeMaxStamp): bool
|
||||
protected function isWithinExecutionDateRange($relatedEventStart, $dateTimeNowStamp, $dateTimeMaxStamp): bool
|
||||
{
|
||||
return $relatedEventStart
|
||||
&& ($relatedEventStart <= $dateTimeNowStamp || $relatedEventStart >= $dateTimeMaxStamp);
|
||||
if (empty($relatedEventStart)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
//increase time by 10 secs to make sure we calculate within the correct minute
|
||||
if (($dateTimeNowStamp + 10) < $relatedEventStart) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($relatedEventStart > $dateTimeMaxStamp) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue