• Модуль: imopenlines
  • Путь к файлу: ~/bitrix/modules/imopenlines/lib/queue.php
  • Класс: BitrixImOpenLinesQueue
  • Вызов: Queue::getActiveStatusByTimeman
static function getActiveStatusByTimeman(int $userId, bool $ignorePause = false)
{
	$result = self::REASON_OPERATOR_DAY_END;

	if ($userId > 0)
	{
		if (Config::isTimeManActive())
		{
			$tmUser = new CTimeManUser($userId);
			$tmSettings = $tmUser->GetSettings(['UF_TIMEMAN']);
			if (!$tmSettings['UF_TIMEMAN'])
			{
				$result = true;
			}
			else
			{
				$tmUser->GetCurrentInfo(true); // need for reload cache
				if ((string)$tmUser->State() === 'OPENED')
				{
					$result = true;
				}
				elseif((string)$tmUser->State() === 'PAUSED')
				{
					if($ignorePause === true)
					{
						$result = true;
					}
					else
					{
						$result = self::REASON_OPERATOR_DAY_PAUSE;
					}
				}
			}
		}
		else
		{
			$result = true;
		}
	}

	return $result;
}