<?php } foreach ($arResult['WORKFLOW_TEMPLATES'] as $workflowTemplate) { if (!empty($workflowTemplate['PARAMETERS'])) { ?> <tr> <td class="bx-disk-form-bizproc-start-td-name-bizproc" colspan="2"> <?php echo $workflowTemplate['NAME']; ?> <input type="hidden" value="1" name="checkBp" /> <input type="hidden" value="2" name="autoExecute" /> </td> </tr> <?php CBPDocument::StartWorkflowParametersShow($workflowTemplate['ID'], $workflowTemplate['PARAMETERS'], 'formAutoloadBizProc', false); } else { ?> <tr> <td class="bx-disk-form-bizproc-start-td-name-bizproc" colspan="2"> <input type="hidden" value="1" name="checkBp" /> <input type="hidden" value="2" name="autoExecute" /> </td> </tr> <?php } } } ?> </table> </div>
<td width="40%"><?echo GetMessage("IBEL_BIZPROC_STATE")?></td> <td width="60%"><?if (strlen($arDocumentState["ID"]) > 0):?><a href="/bitrix/admin/bizproc_log.php?ID=<?php echo $arDocumentState["ID"]; ?> "><?endif;?><?php echo strlen($arDocumentState["STATE_TITLE"]) > 0 ? $arDocumentState["STATE_TITLE"] : $arDocumentState["STATE_NAME"]; ?> <?if (strlen($arDocumentState["ID"]) > 0):?></a><?endif;?></td> </tr> <?endif;?> <? if (strlen($arDocumentState["ID"]) <= 0) { CBPDocument::StartWorkflowParametersShow( $arDocumentState["TEMPLATE_ID"], $arDocumentState["TEMPLATE_PARAMETERS"], ($bCustomForm ? "tabControl" : "form_element_".$IBLOCK_ID)."_form", $bVarsFromForm ); } ?> <? $arEvents = CBPDocument::GetAllowableEvents($GLOBALS["USER"]->GetID(), $arCurrentUserGroups, $arDocumentState); if (!empty($arEvents)) { ?> <tr> <td width="40%"><?echo GetMessage("IBEL_BIZPROC_RUN_CMD")?></td> <td width="60%"> <input type="hidden" name="bizproc_id_<?php echo $bizProcIndex; ?>
if (!$canViewWorkflow) { continue; } $arResult['FIELDS']['tab_1'][] = array('id' => 'section_bp_name_' . $bizProcIndex, 'name' => $arDocumentState['TEMPLATE_NAME'], 'type' => 'section'); if ($arDocumentState['TEMPLATE_DESCRIPTION'] != '') { $arResult['FIELDS']['tab_1'][] = array('id' => 'BP_DESC_' . $bizProcIndex, 'name' => GetMessage('CRM_FIELD_BP_TEMPLATE_DESC'), 'type' => 'label', 'colspan' => true, 'value' => $arDocumentState['TEMPLATE_DESCRIPTION']); } if (!empty($arDocumentState['STATE_MODIFIED'])) { $arResult['FIELDS']['tab_1'][] = array('id' => 'BP_STATE_MODIFIED_' . $bizProcIndex, 'name' => GetMessage('CRM_FIELD_BP_STATE_MODIFIED'), 'type' => 'label', 'value' => $arDocumentState['STATE_MODIFIED']); } if (!empty($arDocumentState['STATE_NAME'])) { $arResult['FIELDS']['tab_1'][] = array('id' => 'BP_STATE_NAME_' . $bizProcIndex, 'name' => GetMessage('CRM_FIELD_BP_STATE_NAME'), 'type' => 'label', 'value' => strlen($arDocumentState['STATE_TITLE']) > 0 ? $arDocumentState['STATE_TITLE'] : $arDocumentState['STATE_NAME']); } if (strlen($arDocumentState['ID']) <= 0) { ob_start(); CBPDocument::StartWorkflowParametersShow($arDocumentState['TEMPLATE_ID'], $arDocumentState['TEMPLATE_PARAMETERS'], 'form_' . $arResult['FORM_ID'], $varsFromForm); $sVal = ob_get_contents(); ob_end_clean(); if ($sVal !== '') { $arResult['FIELDS']['tab_1'][] = array('id' => 'BP_PARAMETERS', 'name' => GetMessage('CRM_FIELD_BP_PARAMETERS'), 'colspan' => true, 'type' => 'custom', 'value' => "<table>{$sVal}</table>"); } } $_arEvents = CBPDocument::GetAllowableEvents($USER->GetID(), $CCrmBizProc->arCurrentUserGroups, $arDocumentState); if (count($_arEvents) > 0) { $arEvent = array('' => GetMessage('CRM_FIELD_BP_EMPTY_EVENT')); foreach ($_arEvents as $_arEvent) { $arEvent[$_arEvent['NAME']] = $_arEvent['TITLE']; } $arResult['FIELDS']['tab_1'][] = array('id' => 'BP_EVENTS', 'name' => GetMessage('CRM_FIELD_BP_EVENTS'), 'params' => array(), 'items' => $arEvent, 'type' => 'list', 'value' => isset($_REQUEST['bizproc_event_' . $bizProcIndex]) ? $_REQUEST['bizproc_event_' . $bizProcIndex] : ''); $arResult['FORM_CUSTOM_HTML'] = ' <input type="hidden" name="bizproc_id_' . $bizProcIndex . '" value="' . $arDocumentState["ID"] . '">
?> :</td> <td class="bizproc-field-value"> <?php echo strlen($arDocumentState["STATE_TITLE"]) > 0 ? $arDocumentState["STATE_TITLE"] : $arDocumentState["STATE_NAME"]; ?> </td> </tr> <?php } ?> <?php if (strlen($arDocumentState["ID"]) <= 0) { $iCountRow++; CBPDocument::StartWorkflowParametersShow($arDocumentState["TEMPLATE_ID"], $arDocumentState["TEMPLATE_PARAMETERS"], "start_workflow_form1", !empty($arResult["ERROR_MESSAGE"])); } ?> <?php if (count($arEvents) > 0) { $bShowButtons = true; $iCountRow++; ?> <tr class="<?php echo $iCountRow == 1 ? "bizproc-item-row-first" : ""; ?> <?php echo empty($arTasks) ? "bizproc-item-row-last" : ""; ?> "> <td class="bizproc-field-name"><?php
</span> </label> <span class="bizproc-field-value"> <?php echo strlen($arDocumentState["STATE_TITLE"]) > 0 ? $arDocumentState["STATE_TITLE"] : $arDocumentState["STATE_NAME"]; ?> </span> </div> <?php } ?> <?php if (strlen($arDocumentState["ID"]) <= 0) { ?> <table class="wd-bp-table-params"><?php CBPDocument::StartWorkflowParametersShow($arDocumentState["TEMPLATE_ID"], $arDocumentState["TEMPLATE_PARAMETERS"], "iu_upload_form_" . $arParams["INDEX_ON_PAGE"], false); ?> </table><?php } $arEvents = CBPDocument::GetAllowableEvents($GLOBALS["USER"]->GetID(), $arResult["CurrentUserGroups"], $arDocumentState); if (count($arEvents) > 0) { ?> <div class="bizproc-workflow-template-param bizproc-field bizproc-field-events"> <label for="" class="bizproc-field-name"> <span class="bizproc-field-title"><?php echo GetMessage("IBEL_BIZPROC_RUN_CMD"); ?> </span> </label> <span class="bizproc-field-value bizproc-field-value-select"> <input type="hidden" name="bizproc_id_<?php