- Модуль: tasks
- Путь к файлу: ~/bitrix/modules/tasks/lib/item/replicator/task/template.php
- Класс: BitrixTasksItemReplicatorTaskTemplate
- Вызов: Template::getSubEntitiesData
protected function getSubEntitiesData($id)
{
$result = array();
$id = intval($id);
if(!$id)
{
return $result;
}
// todo: move CTaskTemplates to orm then replace here
$res = CTaskTemplates::getList(array('BASE_TEMPLATE_ID' => 'asc'), array('BASE_TEMPLATE_ID' => $id), false, array('INCLUDE_TEMPLATE_SUBTREE' => true), array('*', 'UF_*', 'BASE_TEMPLATE_ID'));
while($item = $res->fetch())
{
if($item['ID'] == $id)
{
continue;
}
$result[$item['ID']] = $item;
}
// get check lists
// todo: convert getListByTemplateDependency() to a runtime mixin for the template entity
$res = BitrixTasksInternalsTaskTemplateCheckListTable::getListByTemplateDependency($id, array(
'order' => array('SORT' => 'ASC'),
'select' => array('ID', 'TEMPLATE_ID', 'IS_COMPLETE', 'SORT_INDEX', 'TITLE')
));
while($item = $res->fetch())
{
if(isset($result[$item['TEMPLATE_ID']]))
{
$result[$item['TEMPLATE_ID']]['SE_CHECKLIST'][$item['ID']] = $item;
}
}
return $result;
}