- Модуль: timeman
- Путь к файлу: ~/bitrix/modules/timeman/classes/general/timeman_user.php
- Класс: CTimeManUser
- Вызов: CTimeManUser::openDay
public function openDay($timestamp = false, $report = '', $extraInformation = [])
{
global $APPLICATION;
$recordForm = $this->buildStartForm($timestamp, $report, $extraInformation);
if ($recordForm->validate())
{
$result = (new ManageStartHandler())->handle($recordForm);
if ($result->isSuccess())
{
CUser::setLastActivityDate($this->USER_ID);
$APPLICATION->resetException();
$this->deleteLastPauseInfo($this->USER_ID);
static::clearFullReportCache();
$data = WorktimeRecordTable::convertFieldsCompatible($result->getWorktimeRecord()->collectValues());
$e = GetModuleEvents('timeman', 'OnAfterTMDayStart');
while ($a = $e->Fetch())
{
ExecuteModuleEventEx($a, [$data]);
}
return $data;
}
if ($result->getErrors()[0]->getCode() === WorktimeServiceResult::ERROR_FOR_USER)
{
$APPLICATION->ThrowException($result->getErrors()[0]->getMessage(), 'ALERT_WARNING');
}
else
{
$APPLICATION->ThrowException($result->getErrorMessages()[0]);
}
return false;
}
$APPLICATION->ThrowException($recordForm->getFirstError()->getMessage());
return false;
}