• Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/lib/internals/counter/user.php
  • Класс: BitrixTasksInternalsCounterUser
  • Вызов: User::calcOriginatorWithoutDeadline
private function calcOriginatorWithoutDeadline($reCache = false)
{
	static $count = null;

	if ($count == null || $reCache)
	{
		$statusSupposedlyCompleted = CTasks::STATE_SUPPOSEDLY_COMPLETED;
		$statusCompleted = CTasks::STATE_COMPLETED;
		$statusDeferred = CTasks::STATE_DEFERRED;

		$sql = "
			SELECT 
				COUNT(ID) as COUNT,
				GROUP_ID
			FROM 
				b_tasks 
			WHERE 
				(DEADLINE IS NULL OR DEADLINE = '')
				AND CREATED_BY = {$this->userId}
				AND RESPONSIBLE_ID != CREATED_BY
				AND ZOMBIE = 'N'
				".($this->groupId > 0 ? " AND GROUP_ID = {$this->groupId}" : "")."
				AND (
					STATUS != {$statusSupposedlyCompleted}
					AND STATUS != {$statusCompleted}
					AND	STATUS != {$statusDeferred}
				)
			GROUP BY 
				GROUP_ID
		";

		$this->changeCounter(
			CounterName::ORIGINATOR_WITHOUT_DEADLINE,
			Application::getConnection()->query($sql)->fetchAll()
		);
	}
}