• Модуль: timeman
  • Путь к файлу: ~/bitrix/modules/timeman/classes/general/timeman_user.php
  • Класс: CTimeManUser
  • Вызов: CTimeManUser::pauseDay
public function pauseDay($extraInformation = [])
{
	global $APPLICATION;

	$recordForm = $this->buildPauseForm($extraInformation);

	if ($recordForm->validate())
	{
		$result = (new ManagePauseHandler())->handle($recordForm);

		if ($result->isSuccess())
		{
			CUser::SetLastActivityDate($this->USER_ID);

			static::clearFullReportCache();

			$data = WorktimeRecordTable::convertFieldsCompatible($result->getWorktimeRecord()->collectValues());

			$e = GetModuleEvents('timeman', 'OnAfterTMDayPause');
			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('WD_NOT_OPEN');
		}
	}

	return false;
}