• Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/lib/update/templatechecklistconverter.php
  • Класс: BitrixTasksUpdateTemplateCheckListConverter
  • Вызов: TemplateCheckListConverter::insertCheckListRootItems
static function insertCheckListRootItems($templateId, $items)
{
	// insert BX_CHECKLIST_#NUM# items
	$itemsCount = count($items);
	$connection = Application::getConnection();

	$sql = "INSERT INTO b_tasks_template_chl_item (TEMPLATE_ID, TITLE, SORT)
			VALUES ";

	for ($i = 0; $i < $itemsCount; $i++)
	{
		if ($i)
		{
			$sql .= ",";
		}

		$sql.= "(" . $templateId . ",'BX_CHECKLIST_" . ($i + 1) . "'," . $i . ")";
	}

	$connection->query($sql);
}