Task::updateAfterDelete

  1. Bitrix24 API (v. 23.675.0)
  2. tasks
  3. Task
  4. updateAfterDelete
  • Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/lib/control/task.php
  • Класс: BitrixTasksControlTask
  • Вызов: Task::updateAfterDelete
private function updateAfterDelete()
{
	$connection = Application::getConnection();

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

	SortingTable::fixSiblingsEx($this->taskId);

	$parentId = $taskData["PARENT_ID"] ? $taskData["PARENT_ID"] : "NULL";

	$sql = "
		UPDATE b_tasks_template 
		SET TASK_ID = NULL 
		WHERE TASK_ID = ". $this->taskId;
	$connection->queryExecute($sql);

	$sql = "
		UPDATE b_tasks_template 
		SET PARENT_ID = ". $parentId ." 
		WHERE PARENT_ID = ". $this->taskId;
	$connection->queryExecute($sql);

	$sql = "
		UPDATE b_tasks 
		SET PARENT_ID = ". $parentId ." 
		WHERE PARENT_ID = ". $this->taskId;
	$connection->queryExecute($sql);
}

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