• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/Service/Timeline/Item/Activity/Email.php
  • Класс: Bitrix\Crm\Service\Timeline\Item\Activity\Email
  • Вызов: Email::getButtons
public function getButtons(): array
{
	if ($this->isScheduled())
	{
		$type = Button::TYPE_PRIMARY;
	}
	else
	{
		$type = Button::TYPE_SECONDARY;
	}

	$nearestWorkday = (new WorkTime())->detectNearestWorkDateTime(3, 1);
	$scheduleButton = (new Button(Loc::getMessage('CRM_TIMELINE_BUTTON_EMAIL_SCHEDULE'), Button::TYPE_SECONDARY))
		->setAction((new JsEvent('Email::Schedule'))
			->addActionParamInt('activityId', $this->getActivityId())
			->addActionParamString('scheduleDate', $nearestWorkday->toString())
			->addActionParamInt('scheduleTs', $nearestWorkday->getTimestamp()));

	return [
		'openButton' => (new Button(Loc::getMessage('CRM_TIMELINE_BUTTON_EMAIL_OPEN'), $type))
			->setAction(($this->getTitleAction())),
		'scheduleButton' => $scheduleButton,
	];
}