26 global $APPLICATION, $USER_FIELD_MANAGER;
28 $userType = static::getUserType($fieldType);
30 if ($userType ===
'crm')
32 return self::formatCrmValuePrintable($fieldType, $value);
35 $userFieldType = $USER_FIELD_MANAGER->GetUserType($userType);
37 'ENTITY_ID' => sprintf(
'%s_%s',
41 'FIELD_NAME' =>
'UF_XXXXXXX',
42 'USER_TYPE_ID' => $userType,
44 'MULTIPLE' => $fieldType->
isMultiple() ?
'Y' :
'N',
45 'MANDATORY' => $fieldType->
isRequired() ?
'Y' :
'N',
46 'EDIT_FORM_LABEL' => $userFieldType[
'DESCRIPTION'],
48 'USER_TYPE' => $userFieldType
53 $userField[
'SETTINGS'] = $settings;
56 if ($userType ===
'boolean' && ($value ===
'Y' || $value ===
'N'))
59 $userField[
'VALUE'] = $value = ($value ===
'Y') ? 1 : 0;
63 $APPLICATION->IncludeComponent(
64 'bitrix:system.field.view',
67 'arUserField' => $userField,
68 'bVarsFromForm' =>
false,
71 'FILE_MAX_HEIGHT' => 400,
72 'FILE_MAX_WIDTH' => 400,
73 'FILE_SHOW_POPUP' =>
true
79 return HTMLToTxt(ob_get_clean(), maxlen: 0);
117 global $USER_FIELD_MANAGER, $APPLICATION;
119 $selectorValue =
null;
121 if (!is_array($value) || \CBPHelper::isAssociativeArray($value))
126 foreach ($value as $v)
128 if (\CBPActivity::isExpression($v))
134 $typeValue[] = is_array($v) && isset($v[
'VALUE']) ? $value[
'VALUE'] : $v;
138 $sType = static::getUserType($fieldType);
141 $arUserFieldType = $USER_FIELD_MANAGER->GetUserType($sType);
144 'ENTITY_ID' => sprintf(
'%s_%s',
148 'FIELD_NAME' => static::generateControlName($field),
149 'USER_TYPE_ID' => $sType,
151 'MULTIPLE' => $fieldType->
isMultiple() ?
'Y' :
'N',
152 'MANDATORY' => $fieldType->
isRequired() ?
'Y' :
'N',
153 'EDIT_IN_LIST' =>
'Y',
154 'EDIT_FORM_LABEL' => $arUserFieldType[
'DESCRIPTION'],
156 'USER_TYPE' => $arUserFieldType,
158 'ENTITY_VALUE_ID' => 1,
161 if ($sType ==
'boolean' && ($userField[
'VALUE'] ==
"Y" || $userField[
'VALUE'] ==
"N"))
163 $userField[
'VALUE'] = ($userField[
'VALUE'] ==
"Y") ? 1 : 0;
166 $userField[
'SETTINGS'] = $fieldType->
getSettings();
171 $userField[
'SETTINGS'][
'DISPLAY'] =
'LIST';
173 elseif ($sType ==
'crm' && empty($userField[
'SETTINGS']))
175 $userField[
'SETTINGS'] = [
'LEAD' =>
'Y',
'CONTACT' =>
'Y',
'COMPANY' =>
'Y',
'DEAL' =>
'Y'];
179 $userField[
'SETTINGS'][
'DISPLAY'] =
'UI';
183 $APPLICATION->IncludeComponent(
184 'bitrix:system.field.edit',
187 'arUserField' => $userField,
188 'bVarsFromForm' =>
false,
189 'form_name' => $field[
'Form'],
190 'FILE_MAX_HEIGHT' => 400,
191 'FILE_MAX_WIDTH' => 400,
192 'FILE_SHOW_POPUP' =>
true
195 [
'HIDE_ICONS' =>
'Y']
198 $renderResult = ob_get_clean();
202 $renderResult .= static::renderControlSelector($field, $selectorValue,
true,
'', $fieldType);
205 return $renderResult;
218 return static::renderControlSingle($fieldType, $field, $value, $allowSelection, $renderMode);
226 static::cleanErrors();
227 $result = static::extractValue($fieldType, $field, $request);
229 $nameText = $field[
'Field'].
'_text';
230 $text = isset($request[$nameText]) ? $request[$nameText] :
null;
231 if (\CBPActivity::isExpression($text))
289 return sprintf(
'[b]%s:[/b] [url=%s]%s[/url]', $entityDesc, $entityUrl, $entityName);