CBPDocument::startWorkflowParametersShow

  1. Bitrix24 API (v. 23.675.0)
  2. bizproc
  3. CBPDocument
  4. startWorkflowParametersShow
  • Модуль: bizproc
  • Путь к файлу: ~/bitrix/modules/bizproc/classes/general/document.php
  • Класс: CBPDocument
  • Вызов: CBPDocument::startWorkflowParametersShow
static function startWorkflowParametersShow($templateId, $arWorkflowParameters, $formName, $bVarsFromForm, $documentType = null)
{
	$templateId = intval($templateId);
	if ($templateId <= 0)
		return;

	if (!isset($arWorkflowParameters) || !is_array($arWorkflowParameters))
		$arWorkflowParameters = array();

	if ($formName == '')
		$formName = "start_workflow_form1";

	if ($documentType == null)
	{
		$dbResult = CBPWorkflowTemplateLoader::GetList(array(), array("ID" => $templateId), false, false, array("ID", "MODULE_ID", "ENTITY", "DOCUMENT_TYPE"));
		if ($arResult = $dbResult->Fetch())
			$documentType = $arResult["DOCUMENT_TYPE"];
	}

	$arParametersValues = array();
	$keys = array_keys($arWorkflowParameters);
	foreach ($keys as $key)
	{
		$v = ($bVarsFromForm ? $_REQUEST["bizproc".$templateId."_".$key] : $arWorkflowParameters[$key]["Default"]);
		if (!is_array($v))
		{
			$arParametersValues[$key] = $v;
		}
		else
		{
			$keys1 = array_keys($v);
			foreach ($keys1 as $key1)
				$arParametersValues[$key][$key1] = $v[$key1];
		}
	}

	$runtime = CBPRuntime::GetRuntime();
	$runtime->StartRuntime();
	$documentService = $runtime->GetService("DocumentService");

	foreach ($arWorkflowParameters as $parameterKey => $arParameter)
	{
		$parameterKeyExt = "bizproc".$templateId."_".$parameterKey;
		?>
			* " : ""?>: '') echo "
".htmlspecialcharsbx($arParameter["Description"])."
";?> GetFieldInputControl( $documentType, $arParameter, array("Form" => $formName, "Field" => $parameterKeyExt), $arParametersValues[$parameterKey], false, true ); ?>

Добавить комментарий