• Модуль: faceid
  • Путь к файлу: ~/bitrix/modules/faceid/lib/agreement.php
  • Класс: BitrixFaceidAgreementTable
  • Вызов: AgreementTable::onAfterAdd
static function onAfterAdd(EntityEvent $event)
{
	// add default source lead, when it is the first time when face recognition used
	$optionName = 'ftracker_lead_source';
	$optionValue = 'FACE_TRACKER';

	$source = Option::get('faceid', $optionName, '');
	if ($source == '')
	{
		// set only if it doesn't exist
		$sources = BitrixMainLoader::includeModule('crm') ? CCrmStatus::GetStatusList('SOURCE') : array();

		if (!empty($sources) && !isset($sources[$optionValue]))
		{
			$c = new CCrmStatus('SOURCE');
			$c->Add(array(
				'STATUS_ID' => $optionValue,
				'NAME' => Loc::getMessage("FACEID_LEAD_SOURCE_DEFAULT")
			));

			BitrixMainConfigOption::set('faceid', $optionName, $optionValue);
		}
	}
}