- Модуль: crm
- Путь к файлу: ~/bitrix/modules/crm/lib/Service/Timeline/Item/Activity/CalendarSharing.php
- Класс: Bitrix\Crm\Service\Timeline\Item\Activity\CalendarSharing
- Вызов: CalendarSharing::getButtons
public function getButtons(): ?array
{
$buttons = [];
if ($this->isScheduled())
{
$buttons['completed'] = (
new Layout\Footer\Button(
Loc::getMessage('CRM_TIMELINE_ITEM_CALENDAR_SHARING_COMPLETED_BUTTON'),
Layout\Footer\Button::TYPE_PRIMARY
)
)
->setAction($this->getCompleteAction())->setHideIfReadonly();
$buttons['notCompleted'] = (
new Layout\Footer\Button(
Loc::getMessage('CRM_TIMELINE_ITEM_CALENDAR_SHARING_NOT_COMPLETED_BUTTON'),
Layout\Footer\Button::TYPE_SECONDARY
)
)
->setAction(
(new Layout\Action\RunAjaxAction('crm.timeline.calendar.sharing.completeWithStatus'))
->addActionParamInt('activityId', $this->getActivityId())
->addActionParamInt('ownerTypeId', $this->getContext()->getEntityTypeId())
->addActionParamInt('ownerId', $this->getContext()->getEntityId())
->addActionParamString('status', ActivityHandler::SHARING_STATUS_MEETING_NOT_HELD)
->setAnimation(Layout\Action\Animation::showLoaderForItem()->setForever()
)
);
}
else if ($this->getEventId())
{
$buttons['openEvent'] = (
new Layout\Footer\Button(
Loc::getMessage('CRM_TIMELINE_ITEM_CALENDAR_SHARING_OPEN_MEETING'),
Layout\Footer\Button::TYPE_SECONDARY
)
)
->setScopeWeb()
->setAction(
(new Layout\Action\JsEvent($this->getType() . ':OpenCalendarEvent'))
->addActionParamInt('eventId', $this->getEventId())
->addActionParamBoolean('isSharing', $this->isCanceledByClient())
);
}
return $buttons;
}