• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/timeline/tasks/controller.php
  • Класс: Bitrix\Crm\Timeline\Tasks\Controller
  • Вызов: Controller::onTaskAllCommentViewed
public function onTaskAllCommentViewed(Bindings $bindings, array $timelineParams): void
{
	$timelineParams = $this->filterParams($timelineParams);
	if ($bindings->isEmpty())
	{
		return;
	}
	$taskId = $timelineParams['TASK_ID'];

	foreach ($bindings as $identifier)
	{
		$responsibleId = $this->getAssignedByEntity($identifier);
		if (is_null($responsibleId))
		{
			return;
		}
		$authorId = $timelineParams['AUTHOR_ID'];

		if ($responsibleId === $authorId)
		{
			$unreadCommentsCount = TaskCounter::getCommentsCount($taskId, $responsibleId);
			if ($unreadCommentsCount === 0)
			{
				$activity = $this->commentActivityProvider->find($taskId, $identifier);
				if (!is_null($activity))
				{
					$this->commentActivityProvider->delete($activity->getId());
					$timelineParams['SKIP_BINDINGS_UPDATE'] = true;
					$this->handleTaskEvent(CategoryType::ALL_COMMENT_VIEWED, new Bindings(...[$identifier]), $timelineParams);
				}
			}
		}
	}
}