$arAllActivities = $runtime->SearchActivitiesByType("activity", array(MODULE_ID, ENTITY, $document_type)); foreach ($arAllActivities as $activity) { if (!empty($activity['CATEGORY']['OWN_ID']) && !empty($activity['CATEGORY']['OWN_NAME'])) { $arAllActGroups[$activity['CATEGORY']['OWN_ID']] = $activity['CATEGORY']['OWN_NAME']; } } $arAllActGroups['other'] = GetMessage("BIZPROC_WFEDIT_CATEGORY_OTHER"); if ($ID > 0) { $APPLICATION->SetTitle(GetMessage("BIZPROC_WFEDIT_TITLE_EDIT")); } else { $APPLICATION->SetTitle(GetMessage("BIZPROC_WFEDIT_TITLE_ADD")); } $arResult['DOCUMENT_TYPE'] = $document_type; $arResult['ACTIVITY_GROUPS'] = $arAllActGroups; $arResult['ACTIVITIES'] = $arAllActivities; $arResult['TEMPLATE_NAME'] = $workflowTemplateName; $arResult['TEMPLATE_DESC'] = $workflowTemplateDescription; $arResult['TEMPLATE_AUTOSTART'] = $workflowTemplateAutostart; $arResult['TEMPLATE'] = $arWorkflowTemplate; $arResult['TEMPLATE_CHECK_STATUS'] = CBPWorkflowTemplateLoader::checkTemplateActivities($arWorkflowTemplate); $arResult['PARAMETERS'] = $arWorkflowParameters; $arResult['VARIABLES'] = $arWorkflowVariables; $arResult['CONSTANTS'] = $arWorkflowConstants; $arResult["ID"] = $ID; $defUserParamsStr = serialize(array("groups" => array())); $userParamsStr = CUserOptions::GetOption("~bizprocdesigner", "activity_settings", $defUserParamsStr); if (empty($userParamsStr) || !CheckSerializedData($userParamsStr)) { $userParamsStr = $defUserParamsStr; } $arResult["USER_PARAMS"] = unserialize($userParamsStr); $this->IncludeComponentTemplate();
$APPLICATION->AuthForm(GetMessage("ACCESS_DENIED") . " " . GetMessage("BIZPROC_WFEDIT_ERROR_TYPE")); } $canWrite = CBPDocument::CanUserOperateDocumentType(CBPCanUserOperateOperation::CreateWorkflow, $GLOBALS["USER"]->GetID(), array(MODULE_ID, ENTITY, $document_type)); $workflowTemplateName = GetMessage("BIZPROC_WFEDIT_DEFAULT_TITLE"); $workflowTemplateDescription = ''; $workflowTemplateAutostart = 1; if ($_GET['init'] == 'statemachine') { $arWorkflowTemplate = array(array("Type" => "StateMachineWorkflowActivity", "Name" => "Template", "Properties" => array(), "Children" => array())); } else { $arWorkflowTemplate = array(array("Type" => "SequentialWorkflowActivity", "Name" => "Template", "Properties" => array(), "Children" => array())); } $arWorkflowParameters = array(); $arWorkflowVariables = array(); $arWorkflowConstants = array(); } $templateCheckStatus = CBPWorkflowTemplateLoader::checkTemplateActivities($arWorkflowTemplate); if (!$canWrite) { $APPLICATION->AuthForm(GetMessage("ACCESS_DENIED")); } function print_rrr($var) { if (is_array($var)) { if ($var == array_values($var)) { foreach ($var as $key => $value) { $var[$key] = print_rrr($value); } return "Array(" . implode(", ", $var) . ")"; } $res = "\nArray(\n"; $first = true; foreach ($var as $key => $value) {