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

	if ($count == null || $reCache)
	{
		$statusSupposedlyCompleted = CTasks::STATE_SUPPOSEDLY_COMPLETED;

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

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