Метод applyServerFloor

private

Сигнатура метода

private function applyServerFloor(string $statusTypeId, DateTime $deadline): DateTime

Возвращает: DateTime

Описание

Independent safety net anchored on the raw, unconverted server clock. Both the calculated deadline and the DatePeriods stage windows go through the same toUserTime()->getServerTime() round-trip, so a broken portal timezone/work-time sync shifts them together and clampToStageWindow() alone cannot detect a deadline that ended up in the past. The raw server clock does not pass through that round-trip, so it stays a stable anchor. The floor triggers only when the deadline server-day is actually earlier than the real today, i.e. exactly the overdue definition used by kanban classification in ActivityTrait::hasOverdueActivities(). In that case the date is lifted to today (PENDING) or tomorrow (future stages). Deadlines that are already today or later are left untouched, so the legitimate "today" result for the last day of the week is preserved. For portals where the user timezone differs a lot from the server one an extra correction could still be desirable, but that is out of the ticket's scope; the reported case has user timezone close to the server one.

Параметры

2
Имя Тип По умолчанию Флаги
$statusTypeId string —
—
$deadline DateTime —
—

Расположение

Исходный файл метода в Bitrix Framework

Путь к исходному файлу Source
~/bitrix/modulescrm/lib/kanban/entityactivitydeadline.php
Расположение метода в файле
Строки 95–115

Исходный код

PHP