• Модуль: iblock
  • Путь к файлу: ~/bitrix/modules/iblock/lib/component/element.php
  • Класс: BitrixIblockComponentElement
  • Вызов: Element::showWorkflowHistory
protected function showWorkflowHistory()
{
	$wfShowHistory = 'N';

	if ($this->arParams['SHOW_WORKFLOW'] && Loader::includeModule('workflow'))
	{
		$this->storage['modules']['workflow'] = true;

		$wfElementId = CIBlockElement::WF_GetLast($this->arParams['ELEMENT_ID']);
		$wfStatusId = CIBlockElement::WF_GetCurrentStatus($wfElementId, $wfStatusTitle);
		$wfStatusPermission = CIBlockElement::WF_GetStatusPermission($wfStatusId);

		if ($wfStatusId == 1 || $wfStatusPermission < 1)
		{
			$wfElementId = $this->arParams['ELEMENT_ID'];
		}
		else
		{
			$wfShowHistory = 'Y';
		}

		$this->arParams['ELEMENT_ID'] = $wfElementId;
	}

	return $wfShowHistory;
}