• Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/classes/general/tasknotifications.php
  • Класс: CTaskNotifications
  • Вызов: CTaskNotifications::sendPingStatusMessage
static function sendPingStatusMessage(array $taskData, int $authorId): void
{
	if (self::useNewNotifications())
	{
		$task = BitrixTasksInternalsRegistryTaskRegistry::getInstance()->getObject($taskData['ID'], true);
		if (!$task)
		{
			return;
		}
		$controller = new BitrixTasksInternalsNotificationController();
		$controller->onTaskPingSend($task, $authorId);
		$controller->push();
		return;
	}

	$cacheWasEnabled = self::enableStaticCache();

	$responsibleId = (int)$taskData['RESPONSIBLE_ID'];
	$accomplices = array_map('intval', $taskData['ACCOMPLICES']);
	$recipients = array_unique(array_merge([$responsibleId], $accomplices));
	static::onPingAction($taskData['ID'], $authorId);

	if (in_array($authorId, $recipients, true))
	{
		unset($recipients[array_search($authorId, $recipients, true)]);
	}
	if (empty($recipients))
	{
		if ($cacheWasEnabled)
		{
			self::disableStaticCache();
		}
		return;
	}

	$parameters = [
		'ENTITY_CODE' => 'TASK',
		'ENTITY_OPERATION' => 'PING_STATUS',
		'EVENT_DATA' => [
			'ACTION' => 'TASK_PINGED_STATUS',
			'arFields' => $taskData,
		],
	];
	$title = self::formatTaskName($taskData['ID'], $taskData['TITLE'], $taskData['GROUP_ID']);

	$messageKey = 'TASKS_TASK_PINGED_STATUS_MESSAGE';
	$messages = [
		'INSTANT' => str_replace(['#TASK_TITLE#'], [$title], self::getGenderMessage(0, $messageKey)),
		'EMAIL' => str_replace(['#TASK_TITLE#'], [strip_tags($title)], self::getGenderMessage(0, $messageKey)),
		'PUSH' => self::makePushMessage($messageKey, $authorId, $taskData),
	];

	self::sendMessageEx($taskData['ID'], $authorId, $recipients, $messages, $parameters);

	if ($cacheWasEnabled)
	{
		self::disableStaticCache();
	}
}