CBPDocument :: StartWorkflowParametersShow: Bitrix method

      
<?php 
//  CBPDocument :: StartWorkflowParametersShow()
//  /dist/bitrix/modules/bizproc/classes/general/document.php:763

    
public 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 (
strlen($formName) <= 0)
            
$formName "start_workflow_form1";

        if (
$documentType == null)
        {
            
$dbResult CBPWorkflowTemplateLoader::GetList(array(), array("ID" => $templateId), falsefalse, 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;
            
?><tr>
                <td align="right" width="40%" valign="top" class="field-name"><?= $arParameter["Required"] ? "<span class=\"required\">*</span> " ""?><?= htmlspecialcharsbx($arParameter["Name"]) ?>:<?if (strlen($arParameter["Description"]) > 0) echo "<br /><small>".htmlspecialcharsbx($arParameter["Description"])."</small><br />";?></td>
                <td width="60%" valign="top"><?
            
echo $documentService->GetFieldInputControl(
                
$documentType,
                
$arParameter,
                array(
"Form" => $formName"Field" => $parameterKeyExt),
                
$arParametersValues[$parameterKey],
                
false,
                
true
            
);
            
?></td></tr><?
        
}
    }