• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/Service/Timeline/Item/Activity.php
  • Класс: Bitrix\Crm\Service\Timeline\Item\Activity
  • Вызов: Activity::getPostponeMenu
protected function getPostponeMenu(int $activityId): Layout\Menu
{
	$postponeValues = [
		3600 => Loc::getMessage('CRM_TIMELINE_POSTPONE_1H'),
		7200 => Loc::getMessage('CRM_TIMELINE_POSTPONE_2H'),
		10800 => Loc::getMessage('CRM_TIMELINE_POSTPONE_3H'),
		86400 => Loc::getMessage('CRM_TIMELINE_POSTPONE_1D'),
		172800 => Loc::getMessage('CRM_TIMELINE_POSTPONE_2D'),
		259200 => Loc::getMessage('CRM_TIMELINE_POSTPONE_3D'),
	];

	$postponeMenu = new Layout\Menu();

	foreach ($postponeValues as $offset => $title)
	{
		$postponeMenu->addItem(
			'postpone_' . $offset,
			(new Layout\Menu\MenuItem($title))
				->setAction(
					(new Layout\Action\RunAjaxAction('crm.timeline.activity.postpone'))
						->addActionParamInt('activityId', $activityId)
						->addActionParamInt('offset', $offset)
						->addActionParamInt('ownerTypeId', $this->getContext()->getEntityTypeId())
						->addActionParamInt('ownerId', $this->getContext()->getEntityId())
						->setAnimation(Layout\Action\Animation::showLoaderForBlock()->setForever())
				)
		);
	}

	return $postponeMenu;
}