Task::sendDeletePush

  1. Bitrix24 API (v. 23.675.0)
  2. tasks
  3. Task
  4. sendDeletePush
  • Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/lib/control/task.php
  • Класс: BitrixTasksControlTask
  • Вызов: Task::sendDeletePush
private function sendDeletePush()
{
	if (!Loader::includeModule('pull'))
	{
		return;
	}

	$taskData = $this->getFullTaskData();
	if (!$taskData)
	{
		return;
	}

	$pushRecipients = array_unique(
		array_merge(
			[
				$taskData["CREATED_BY"],
				$taskData["RESPONSIBLE_ID"]
			],
			$taskData["ACCOMPLICES"],
			$taskData["AUDITORS"]
		)
	);

	$groupId = (isset($taskData['GROUP_ID']) && $taskData['GROUP_ID'] > 0) ? (int)$taskData['GROUP_ID'] : 0;
	if ($groupId > 0)
	{
		$pushRecipients = array_unique(
			array_merge(
				$pushRecipients,
				User::getUsersCanPerformOperation($groupId, 'view_all')
			)
		);
	}

	PushService::addEvent($pushRecipients, [
		'module_id' => 'tasks',
		'command' => PushCommand::TASK_DELETED,
		'params' => [
			'TASK_ID' => $this->taskId,
			'TS' => time(),
			'event_GUID' => $this->eventGuid,
			'BEFORE' => [
				'GROUP_ID' => $groupId,
			],
		],
	]);
}

Добавить комментарий