- Модуль: bizproc
- Путь к файлу: ~/bitrix/modules/bizproc/classes/general/restactivity.php
- Класс: CBPRestActivity
- Вызов: CBPRestActivity::renderPropertiesDialog
static function renderPropertiesDialog(BitrixBizprocActivityPropertiesDialog $dialog)
{
$runtime = CBPRuntime::GetRuntime();
$data = $dialog->getRuntimeData();
$activityData = $data['ACTIVITY_DATA'];
/** @var CBPDocumentService $documentService */
$documentService = $runtime->GetService("DocumentService");
$activityDocumentType = is_array($activityData['DOCUMENT_TYPE']) ? $activityData['DOCUMENT_TYPE'] : $dialog->getDocumentType();
$properties = isset($activityData['PROPERTIES']) && is_array($activityData['PROPERTIES']) ? $activityData['PROPERTIES'] : array();
$currentValues = $dialog->getCurrentValues();
$appPlacement = $data['APP_PLACEMENT'];
$placementSid = null;
$appCurrentValues = [];
ob_start();
if ($appPlacement):
foreach ($properties as $key => $property)
{
$appCurrentValues[$key] = $dialog->getCurrentValue('property_'.mb_strtolower($key));
}
global $APPLICATION;
echo '';
$placementSid = $APPLICATION->includeComponent(
'bitrix:app.layout',
'',
array(
'ID' => $appPlacement['APP_ID'],
'PLACEMENT' => BitrixBizprocRestService::PLACEMENT_ACTIVITY_PROPERTIES_DIALOG,
'PLACEMENT_ID' => $appPlacement['ID'],
"PLACEMENT_OPTIONS" => [
'code' => $activityData['CODE'],
'activity_name' => $dialog->getActivityName(),
'properties' => $properties,
'current_values' => $appCurrentValues,
'document_type' => $dialog->getDocumentType(),
'document_fields' => $documentService->GetDocumentFields($dialog->getDocumentType())
],
'PARAM' => array(
'FRAME_WIDTH' => '100%',
'FRAME_HEIGHT' => '350px'
),
),
null,
array('HIDE_ICONS' => 'Y')
);
echo ' ';
else:
foreach ($properties as $name => $property):
$required = CBPHelper::getBool($property['REQUIRED']);
$name = mb_strtolower($name);
$value = !CBPHelper::isEmptyValue($currentValues[static::PROPERTY_NAME_PREFIX.$name]) ? $currentValues[static::PROPERTY_NAME_PREFIX.$name] : $property['DEFAULT'];
$property['NAME'] = RestActivityTable::getLocalization($property['NAME'], LANGUAGE_ID);
if (isset($property['DESCRIPTION']))
{
$property['DESCRIPTION'] = RestActivityTable::getLocalization($property['DESCRIPTION'], LANGUAGE_ID);
}
?>
= htmlspecialcharsbx($property['NAME']) ?>:
= htmlspecialcharsbx($property['DESCRIPTION']) ?>
=$documentService->getFieldInputControl(
$activityDocumentType,
$property,
array('Field' => static::PROPERTY_NAME_PREFIX.$name, 'Form' => $dialog->getFormName()),
$value,
true,
false
)?>
endforeach;
endif;
if (static::checkAdminPermissions()):?>
= Loc::getMessage("BPRA_PD_USER_ID") ?>:
=$dialog->renderFieldControl('AuthUserId', $currentValues['authuserid'], true, 0)?>
= Loc::getMessage("BPRA_PD_SET_STATUS_MESSAGE") ?>:
= Loc::getMessage("BPRA_PD_STATUS_MESSAGE") ?>:
=CBPDocument::ShowParameterField("string", 'statusmessage', $currentValues['statusmessage'], Array('size'=>'45'))?>
= Loc::getMessage("BPRA_PD_USE_SUBSCRIPTION") ?>:
if ($activityData['USE_SUBSCRIPTION'] !== 'N'):?>
= Loc::getMessage("BPRA_PD_TIMEOUT_DURATION") ?>:
= Loc::getMessage("BPRA_PD_TIMEOUT_DURATION_HINT") ?>
=CBPDocument::ShowParameterField('int', 'timeoutduration', $currentValues["timeoutduration"], array('size' => 20))?>
$delayMinLimit = CBPSchedulerService::getDelayMinLimit();
if ($delayMinLimit):
?>
* = Loc::getMessage("BPRA_PD_TIMEOUT_LIMIT") ?>: =CBPHelper::FormatTimePeriod($delayMinLimit)?>
endif;
?>