- Модуль: timeman
- Путь к файлу: ~/bitrix/modules/timeman/lib/service/worktime/action/worktimeactionlist.php
- Класс: BitrixTimemanServiceWorktimeActionWorktimeActionList
- Вызов: WorktimeActionList::buildPossibleActionsListForUser
public function buildPossibleActionsListForUser($paramUserId, ?DateTime $paramUserDate = null)
{
$userId = (int)$paramUserId;
if ($paramUserDate)
{
$userDate = clone $paramUserDate;
}
else
{
$userDate = TimeHelper::getInstance()->getUserDateTimeNow($userId);
}
$this->userId = $userId;
$this->userDateTime = $userDate;
$record = $this->worktimeRepository->findLatestRecord($this->userId);
$scheduleCollection = $this->scheduleProvider->findSchedulesCollectionByUserId($this->userId);
$this->shiftsManager = new ShiftsManager(
$this->userId,
$scheduleCollection,
$this->shiftPlanProvider
);
if ($record)
{
$recordSchedule = $record->obtainSchedule();
$this->recordManager = new WorktimeRecordManager(
$record,
$recordSchedule,
$record->obtainShift(),
$this->userDateTime,
$this->shiftsManager
);
}
$this->actions = $this->buildActions($record);
return $this;
}