- Модуль: crm
- Путь к файлу: ~/bitrix/modules/crm/lib/timeline/entitycontroller.php
- Класс: Bitrix\Crm\Timeline\EntityController
- Вызов: EntityController::createManualOpportunityModificationEntry
protected function createManualOpportunityModificationEntry($ownerId, $authorId, $prevValue, $curValue)
{
Container::getInstance()->getLocalization()->loadMessages();
$names = [
'N' => Loc::getMessage('CRM_COMMON_IS_MANUAL_OPPORTUNITY_FALSE'),
'Y' => Loc::getMessage('CRM_COMMON_IS_MANUAL_OPPORTUNITY_TRUE'),
];
$historyEntryID = ModificationEntry::create(
[
'ENTITY_TYPE_ID' => $this->getEntityTypeID(),
'ENTITY_ID' => $ownerId,
'AUTHOR_ID' => $authorId,
'SETTINGS' => [
'FIELD' => 'IS_MANUAL_OPPORTUNITY',
'START' => $prevValue,
'FINISH' => $curValue,
'START_NAME' => isset($names[$prevValue]) ? $names[$prevValue] : $prevValue,
'FINISH_NAME' => isset($names[$curValue]) ? $names[$curValue] : $curValue
]
]
);
$this->sendPullEventOnAdd(new \Bitrix\Crm\ItemIdentifier($this->getEntityTypeID(), $ownerId), $historyEntryID);
}