EntityCounterManager::processSettingChange

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. EntityCounterManager
  4. processSettingChange
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/counter/entitycountermanager.php
  • Класс: Bitrix\Crm\Counter\EntityCounterManager
  • Вызов: EntityCounterManager::processSettingChange
static function processSettingChange($name, $value)
{
	if($name !== \CCrmUserCounterSettings::ReckonActivitylessItems)
	{
		return;
	}

	$codes = self::prepareCodes(\CCrmOwnerType::Lead, array(EntityCounterType::IDLE, EntityCounterType::ALL));
	foreach($codes as $code)
	{
		\CUserCounter::DeleteByCode($code);
	}

	$codes = self::prepareCodes(\CCrmOwnerType::Order, array(EntityCounterType::IDLE, EntityCounterType::ALL));
	foreach($codes as $code)
	{
		\CUserCounter::DeleteByCode($code);
	}

	$categoryIDs = \Bitrix\Crm\Category\DealCategory::getAllIDs();
	foreach($categoryIDs as $categoryID)
	{
		$codes = self::prepareCodes(
			\CCrmOwnerType::Deal,
			array(EntityCounterType::IDLE, EntityCounterType::ALL),
			array('CATEGORY_ID' => $categoryID)
		);
		foreach($codes as $code)
		{
			\CUserCounter::DeleteByCode($code);
		}
	}

	$codes = self::prepareCodes(
		\CCrmOwnerType::Deal,
		array(EntityCounterType::IDLE, EntityCounterType::ALL)
	);
	foreach($codes as $code)
	{
		\CUserCounter::DeleteByCode($code);
	}
}

Добавить комментарий