- Модуль: bizproc
- Путь к файлу: ~/bitrix/modules/bizproc/lib/integration/ui/entityselector/templateprovider.php
- Класс: BitrixBizprocIntegrationUIEntitySelectorTemplateProvider
- Вызов: TemplateProvider::doSearch
public function doSearch(SearchQuery $searchQuery, Dialog $dialog): void
{
$currentUserId = $this->getCurrentUserId();
$templates =
WorkflowTemplateTable::query()
->setSelect(['ID', 'MODULE_ID', 'ENTITY', 'DOCUMENT_TYPE', 'NAME'])
->whereLike('NAME', "%{$searchQuery->getQuery()}%")
->where($this->getDefaultTemplateFilter())
->exec()
->fetchCollection();
$items = [];
foreach ($templates as $template)
{
if ($this->canUserStartWorkflow($currentUserId, $template->getDocumentComplexType()))
{
$items[] = $this->makeItem(['id' => $template->getId(), 'title' => $template->getName()], false);
}
}
if ($items)
{
$dialog->addItems($items);
}
}