17 $agreementsIds = array_keys(
18 Agreement::getActiveList()
21 foreach ($agreementsIds as $agreementId)
24 $agreementData = $agreement->getData();
27 'id' => (int)$agreementData[
'ID'],
28 'name' => (
string)$agreementData[
'NAME'],
29 'labelText' => (string)$agreement->getLabelText(),
34 $publicActionResult->setResult($result);
36 return $publicActionResult;
42 Loader::includeModule(
'crm')
43 && static::checkFormPermission()
47 if ((
int)($options[
'hideVirtual'] ?? 0))
49 $hiddenTypes[] = EntityFieldProvider::TYPE_VIRTUAL;
51 if ((
int)($options[
'hideRequisites'] ?? 1))
53 $hiddenTypes[] = \CCrmOwnerType::Requisite;
55 if ((
int)($options[
'hideSmartDocument'] ?? 0))
57 $hiddenTypes[] = \CCrmOwnerType::SmartDocument;
60 if (isset($options[
'presetId']) && is_numeric($options[
'presetId']))
62 $presetId = (int)$options[
'presetId'];
69 $fields = EntityFieldProvider::getFieldsTree($hiddenTypes, $presetId);
70 foreach ($fields as $key => $item)
72 if (strpos($key,
'DYNAMIC_') === 0)
74 $dynamicId = str_replace(
'DYNAMIC_',
'', $key);
75 $fields[$key][
"DYNAMIC_ID"] = \CCrmOwnerType::ResolveUserFieldEntityID($dynamicId);
85 $publicActionResult->setResult($fields);
87 return $publicActionResult;
132 Loader::includeModule(
'crm')
133 && static::checkFormPermission()
136 $userPermissions = \CCrmPerms::GetCurrentUserPermissions();
137 $map = array_fill_keys(\CCrmDeal::GetPermittedToReadCategoryIDs($userPermissions),
true);
138 $allCategories = DealCategory::getAll(
true);
140 foreach ($allCategories as $key => $category)
142 $ID = (int)$category[
'ID'];
143 if(!isset($map[$ID]))
148 $stages = \CCrmViewHelper::getDealStageInfos($category[
'ID']);
149 \CCrmViewHelper::prepareDealStageExtraParams($stages, $category[
'ID']);
151 $category[
'STAGES'] = array_values($stages);
152 $categories[] = $category;
157 $publicActionResult->setResult($categories);
159 return $publicActionResult;
206 $publicActionResult->setResult([]);
208 if (static::checkFormPermission())
210 $formController = new \Bitrix\Crm\Controller\Form();
211 $publicActionResult->setResult([
212 'crmFields' => static::getCrmFields()->getResult(),
213 'crmCompanies' => static::getCrmCompanies()->getResult(),
214 'crmCategories' => static::getCrmCategories()->getResult(),
215 'agreements' => static::getAgreements()->getResult(),
216 'formOptions' => Options::create($formId)->getArray(),
217 'dictionary' => $formController->getDictAction(),
221 return $publicActionResult;