Group::copy

  1. Bitrix24 API (v. 23.675.0)
  2. tasks
  3. Group
  4. copy
  • Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/lib/copy/integration/group.php
  • Класс: BitrixTasksCopyIntegrationGroup
  • Вызов: Group::copy
public function copy($groupId, $copiedGroupId)
{
	$taskCopyManager = new TaskManager($this->executiveUserId, []);
	$mapIdsCopiedStages = $taskCopyManager->copyKanbanStages($groupId, $copiedGroupId);
	if (in_array("robots", $this->features))
	{
		$taskCopyManager->copyGroupRobots($groupId, $copiedGroupId);
	}

	$tasksIds = $this->getTasksIdsByGroupId($this->executiveUserId, $groupId);
	if (!$tasksIds)
	{
		return;
	}

	$this->addToQueue($copiedGroupId);

	Option::set(self::MODULE_ID, self::CHECKER_OPTION.$copiedGroupId, "Y");

	$dataToCopy = [
		"executiveUserId" => $this->executiveUserId,
		"groupId" => $groupId,
		"copiedGroupId" => $copiedGroupId,
		"features" => $this->features,
		"mapIdsCopiedStages" => $mapIdsCopiedStages,
		"projectTerm" => $this->projectTerm
	];
	Option::set(self::MODULE_ID, self::STEPPER_OPTION.$copiedGroupId, serialize($dataToCopy));

	$agent = CAgent::getList([], [
		"MODULE_ID" => self::MODULE_ID,
		"NAME" => GroupStepper::class."::execAgent();"
	])->fetch();
	if (!$agent)
	{
		GroupStepper::bind(1);
	}
}

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