mirror of
https://github.com/SuiteCRM/SuiteCRM-Core.git
synced 2025-09-04 10:14:13 +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;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->isOutsideOfExecutionDateRange($relatedEventStart, $dateTimeNowStamp, $dateTimeMaxStamp)) {
|
$relatedEventStart -= $popupReminder->timer_popup;
|
||||||
|
|
||||||
|
if (!$this->isWithinExecutionDateRange($relatedEventStart, $dateTimeNowStamp, $dateTimeMaxStamp)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -104,8 +106,6 @@ class AddScheduledReminderAlerts
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
$relatedEventStart -= $popupReminder->timer_popup;
|
|
||||||
|
|
||||||
$url = $this->getURL($popupReminder);
|
$url = $this->getURL($popupReminder);
|
||||||
$instructions = $this->getInstructions($app_strings['MSG_JS_ALERT_MTG_REMINDER_MEETING_MSG']);
|
$instructions = $this->getInstructions($app_strings['MSG_JS_ALERT_MTG_REMINDER_MEETING_MSG']);
|
||||||
|
|
||||||
|
@ -302,10 +302,22 @@ class AddScheduledReminderAlerts
|
||||||
* @param $dateTimeMaxStamp
|
* @param $dateTimeMaxStamp
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
protected function isOutsideOfExecutionDateRange($relatedEventStart, $dateTimeNowStamp, $dateTimeMaxStamp): bool
|
protected function isWithinExecutionDateRange($relatedEventStart, $dateTimeNowStamp, $dateTimeMaxStamp): bool
|
||||||
{
|
{
|
||||||
return $relatedEventStart
|
if (empty($relatedEventStart)) {
|
||||||
&& ($relatedEventStart <= $dateTimeNowStamp || $relatedEventStart >= $dateTimeMaxStamp);
|
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