• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/Service/Timeline/Item/Activity/ToDo.php
  • Класс: Bitrix\Crm\Service\Timeline\Item\Activity\ToDo
  • Вызов: ToDo::buildDeadlineBlock
private function buildDeadlineBlock(): ?ContentBlock
{
	$deadline = $this->getDeadline();
	if (!isset($deadline))
	{
		return null;
	}

	$updateDeadlineAction = null;
	if ($this->isScheduled())
	{
		$updateDeadlineAction = (new Layout\Action\RunAjaxAction('crm.activity.todo.updateDeadline'))
			->addActionParamInt('ownerTypeId', $this->getContext()->getIdentifier()->getEntityTypeId())
			->addActionParamInt('ownerId', $this->getContext()->getIdentifier()->getEntityId())
			->addActionParamInt('id', $this->getActivityId())
		;
	}

	return (new Layout\Body\ContentBlock\LineOfTextBlocks())
		->addContentBlock(
			'completeTo',
			ContentBlockFactory::createTitle(Loc::getMessage('CRM_TIMELINE_ITEM_TODO_COMPLETE_TO'))
		)
		->addContentBlock(
			'deadlineSelector',
			(new Layout\Body\ContentBlock\EditableDate())
				->setStyle(Layout\Body\ContentBlock\EditableDate::STYLE_PILL)
				->setDate($deadline)
				->setAction($updateDeadlineAction)
				->setBackgroundColor($this->isScheduled() ? Layout\Body\ContentBlock\EditableDate::BACKGROUND_COLOR_WARNING : null)
		)
	;
}