Сообщество IT-специалистов
Ответы на любые вопросы об IT
Профессиональное развитие в IT
Удаленная работа для IT-специалистов
<?php require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_before.php"); CModule::IncludeModule("tasks"); use \Bitrix\Main, \Bitrix\Tasks\CheckList\Task ; $arFields = Array( "TITLE" => "Task title", "DESCRIPTION" => "Task description", "RESPONSIBLE_ID" => 721, "UF_CRM_TASK" => array("D_14359"), ); $obTask = new CTasks; $ID = $obTask->Add($arFields); $success = ($ID>0); if($success) { $taskId = $ID; $userId = 721; $docx = Task\TaskCheckListFacade::add( $taskId, $userId, [ 'TITLE' => 'aaaaaaaa', 'PARENT_ID' => 0, 'IS_COMPLETE' => 'N', 'IS_IMPORTANT' => 'N', 'SORT_INDEX' => '10', 'MEMBERS' => [], 'ATTACHMENTS' => [], ] ); if (isset($result)) { $task = \CTaskItem::getInstance($taskId, $userId); \CTaskCheckListItem::add($task, ['TITLE'=>'First item', 'SORT_INDEX'=>10, 'IS_COMPLETE'=>'N']); \CTaskCheckListItem::add($task, ['TITLE'=>'Second item', 'SORT_INDEX'=>20, 'IS_COMPLETE'=>'N']); \CTaskCheckListItem::add($task, ['TITLE'=>'Third item. Completed', 'SORT_INDEX'=>30, 'IS_COMPLETE'=>'N']); \CTaskCheckListItem::add($task, ['TITLE'=>'Third item. Completed', 'SORT_INDEX'=>30, 'IS_COMPLETE'=>'N']); \CTaskCheckListItem::add($task, ['TITLE'=>'Third item. Completed', 'SORT_INDEX'=>30, 'IS_COMPLETE'=>'N']); \CTaskCheckListItem::add($task, ['TITLE'=>'Third item. Completed', 'SORT_INDEX'=>30, 'IS_COMPLETE'=>'N']); \CTaskCheckListItem::add($task, ['TITLE'=>'Third item. Completed', 'SORT_INDEX'=>30, 'IS_COMPLETE'=>'N']); \CTaskCheckListItem::add($task, ['TITLE'=>'Third item. Completed', 'SORT_INDEX'=>30, 'IS_COMPLETE'=>'N']); \CTaskCheckListItem::add($task, ['TITLE'=>'Third item. Completed', 'SORT_INDEX'=>30, 'IS_COMPLETE'=>'N']); \CTaskCheckListItem::add($task, ['TITLE'=>'Third item. Completed', 'SORT_INDEX'=>30, 'IS_COMPLETE'=>'N']); \CTaskCheckListItem::add($task, ['TITLE'=>'Third item. Completed', 'SORT_INDEX'=>30, 'IS_COMPLETE'=>'N']); \CTaskCheckListItem::add($task, ['TITLE'=>'Third item. Completed', 'SORT_INDEX'=>30, 'IS_COMPLETE'=>'N']); } $results = Task\TaskCheckListFacade::add( $taskId, $userId, [ 'TITLE' => 'Test data2', 'PARENT_ID' => 0, 'IS_COMPLETE' => 'N', 'IS_IMPORTANT' => 'N', 'SORT_INDEX' => '20', 'MEMBERS' => [], 'ATTACHMENTS' => [], ] ); if (isset($results)) { $task = \CTaskItem::getInstance($taskId, $userId); \CTaskCheckListItem::add($task, ['TITLE'=>'ыыыыыыыыыыыыыыыыыыыыы', 'SORT_INDEX'=>10, 'IS_COMPLETE'=>'N']); } } else { if($e = $APPLICATION->GetException()) echo "Error: ".$e->GetString(); }?>
\CTaskCheckListItem::add($task, ['TITLE'=>'First item', 'SORT_INDEX'=>10, 'IS_COMPLETE'=>'N'])
$alias = $modx->runSnippet('searchcity', array($row['name']));
разобрался