public function executeComponent() { if ($this->getWorkflowId()) { $workflowState = $this->getWorkflowStateInfo(); $tasks = CBPViewHelper::getWorkflowTasks($workflowState['ID'], true, true); $lastUserStatus = CBPTaskUserStatus::Waiting; if (isset($tasks['COMPLETED'][0]['USERS'][0]['STATUS'])) { $lastUserStatus = $tasks['COMPLETED'][0]['USERS'][0]['STATUS']; } if ($this->getTargetTaskId()) { $this->rebuildTaskList($tasks, $this->getTargetTaskId()); } $this->arResult = array('WORKFLOW_ID' => $this->getWorkflowId(), 'STATE_TITLE' => $workflowState['WORKFLOW_STATUS'] === null && empty($tasks['IS_HISTORY']) ? $workflowState['STATE_TITLE'] : '', 'TASKS' => $tasks, 'STARTED_BY' => $this->getStartedBy($workflowState), 'DOCUMENT_ID' => $workflowState['DOCUMENT_ID'], 'LAST_USER_STATUS' => $lastUserStatus); } $this->includeComponentTemplate(); }
<?php if (!defined('B_PROLOG_INCLUDED') || B_PROLOG_INCLUDED !== true) { die; } if (!CModule::IncludeModule('bizproc')) { return false; } if (!$GLOBALS['USER']->IsAuthorized()) { return false; } $arParams['WORKFLOW_ID'] = empty($arParams['WORKFLOW_ID']) ? $_REQUEST['WORKFLOW_ID'] : $arParams['WORKFLOW_ID']; if (!$arParams['WORKFLOW_ID']) { return false; } $arResult['TASKS'] = CBPViewHelper::getWorkflowTasks($arParams['WORKFLOW_ID'], true, true); $arResult['WORKFLOW_STATE_INFO'] = CBPStateService::getWorkflowStateInfo($arParams['WORKFLOW_ID']); $arResult['USER_ID'] = (int) $GLOBALS['USER']->GetId(); if (!empty($arResult['TASKS']['RUNNING'])) { foreach ($arResult['TASKS']['RUNNING'] as &$t) { if ($t['IS_INLINE'] == 'Y') { $controls = CBPDocument::getTaskControls($t); $t['BUTTONS'] = $controls['BUTTONS']; } if (isset($t['PARAMETERS']['AccessControl']) && $t['PARAMETERS']['AccessControl'] == 'Y') { $t['DESCRIPTION'] = ''; } } } $arResult['noWrap'] = isset($arParams['NOWRAP']) && $arParams['NOWRAP'] == 'Y'; ob_start();