21 return $this->preparedProperties[
$name] ?? parent::__get(
$name);
26 if (!static::checkModules())
28 return \CBPActivityExecutionStatus::Closed;
33 if ($errorCollection->isEmpty())
38 foreach ($errorCollection as
$error)
40 $this->
logError($error->getMessage());
43 return \CBPActivityExecutionStatus::Closed;
48 $fieldsMap = static::getPropertiesDialogMap();
50 foreach (array_keys($this->arProperties) as $propertyId)
55 if (isset($this->arPropertiesTypes) && isset($this->arPropertiesTypes[$propertyId]))
57 $type = $this->arPropertiesTypes[$propertyId][
'Type'] ??
'';
59 if (!
$type && isset($fieldsMap[$propertyId]))
61 $type = $fieldsMap[$propertyId][
'Type'] ??
'';
81 if (
count($value) === 1)
83 $value = array_shift($value);
95 return \CBPHelper::getBool($value);
98 return (
double)$value;
137 if (!static::checkModules())
142 $dialog = new \Bitrix\Bizproc\Activity\PropertiesDialog(static::getFileName(), [
143 'documentType' => $documentType,
144 'activityName' => $activityName,
145 'workflowTemplate' => $workflowTemplate,
146 'workflowParameters' => $workflowParameters,
147 'workflowVariables' => $workflowVariables,
149 'formName' => $formName,
154 ->setMapCallback([static::class,
'getPropertiesDialogMap'])
155 ->setRuntimeData(static::getRuntimeData())
158 if (!static::hasRenderer())
160 $dialog->setRenderer([static::class,
'renderPropertiesDialog']);
166 private static function hasRenderer(): bool
168 $dir = Path::getDirectory(Path::normalize(static::getFileName()));
171 File::isFileExists(Path::combine(
$dir,
'properties_dialog.php'))
172 || File::isFileExists(Path::combine(
$dir,
'robot_properties_dialog.php'))
178 $propertiesDialogHtml =
'';
180 foreach ($dialog->
getMap() as $field)
182 $propertiesDialogHtml .=
184 ? static::renderRobotProperty($dialog, $field)
185 : static::renderBizprocProperty($dialog, $field)
189 return $propertiesDialogHtml;
202 '<tr><td align="right" width="40%%">%s:</td><td width="60%%">%s</td></tr>',
211 <div class="bizproc-automation-popup-settings">
212 <span class="bizproc-automation-popup-settings-title bizproc-automation-popup-settings-title-autocomplete">
230 &$workflowParameters,
236 if (!static::checkModules())
242 'documentType' => $documentType,
243 'activityName' => $activityName,
244 'workflowTemplate' => $workflowTemplate,
245 'workflowParameters' => $workflowParameters,
246 'workflowVariables' => $workflowVariables,
250 $extractingResult = static::extractPropertiesValues($dialog, static::getPropertiesDialogMap($dialog));
251 if (!$extractingResult->isSuccess())
253 foreach ($extractingResult->getErrors() as
$error)
256 'code' =>
$error->getCode(),
257 'message' =>
$error->getMessage(),
258 'parameter' =>
$error->getCustomData(),
264 $errors = static::ValidateProperties(
265 $extractingResult->getData(),
275 $currentActivity = &\CBPWorkflowTemplateLoader::FindActivityByName(
279 $currentActivity[
'Properties'] = $extractingResult->getData();
291 $documentService = static::getDocumentService();
293 foreach ($fieldsMap as $propertyKey => $fieldProperties)
295 $field = $documentService->getFieldTypeObject($dialog->
getDocumentType(), $fieldProperties);
301 $properties[$propertyKey] = $field->extractValue(
302 [
'Field' => $fieldProperties[
'FieldName']],
335 if (!static::checkModules())
340 foreach (static::getPropertiesDialogMap() as $propertyKey => $fieldProperties)
343 \CBPHelper::getBool($fieldProperties[
'Required'] ??
null)
344 && \CBPHelper::isEmptyValue($testProperties[$propertyKey] ??
null)
348 'code' =>
'NotExist',
349 'parameter' =>
'FieldValue',
350 'message' => Loc::getMessage(
'BIZPROC_BA_EMPTY_PROP', [
'#PROPERTY#' => $fieldProperties[
'Name']]),
355 return array_merge(
$errors, parent::ValidateProperties($testProperties,
$user));
360 foreach (static::$requiredModules as $module)
362 if (!Loader::includeModule($module))
373 return \CBPRuntime::GetRuntime(
true)->getDocumentService();
if(!is_object($USER)||! $USER->IsAuthorized()) $userId
static getPropertiesDialogValues( $documentType, $activityName, &$workflowTemplate, &$workflowParameters, &$workflowVariables, $currentValues, &$errors)
static getDocumentService()
convertPropertyValue(string $type, $value)
static getPropertiesDialog( $documentType, $activityName, $workflowTemplate, $workflowParameters, $workflowVariables, $currentValues=null, $formName='', $popupWindow=null, $siteId='')
static validateProperties($testProperties=[], \CBPWorkflowTemplateUser $user=null)
logError(string $message='', int $userId=0)
static getPropertiesDialogMap(?PropertiesDialog $dialog=null)
log(string $message='', int $userId=0, int $type=-1)
static extractPropertiesValues(PropertiesDialog $dialog, array $fieldsMap)
static renderPropertiesDialog(PropertiesDialog $dialog)
static renderBizprocProperty(PropertiesDialog $dialog, array $field)
static renderRobotProperty(PropertiesDialog $dialog, array $field)
getCurrentValues($compatible=false)
renderFieldControl($field, $value=null, $allowSelection=true, $renderMode=FieldType::RENDER_MODE_PUBLIC)
getCurrentValue($valueKey, $default=null)
const RENDER_MODE_DESIGNER
</td ></tr ></table ></td ></tr ><?endif?><? $propertyIndex=0;foreach( $arGlobalProperties as $propertyCode=> $propertyValue
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
if($request->isPost() && $currentAction !==null &&check_bitrix_sessid()) $currentValues
htmlspecialcharsbx($string, $flags=ENT_COMPAT, $doubleEncode=true)
</p ></td >< td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0cm 2.0pt 0cm 2.0pt;height:9.0pt'>< p class=Normal align=center style='margin:0cm;margin-bottom:.0001pt;text-align:center;line-height:normal'>< a name=ТекстовоеПоле54 ></a ><?=($taxRate > count( $arTaxList) > 0) ? $taxRate."%"