CCrmActivityConverter::IsTaskConvertigRequired

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. CCrmActivityConverter
  4. IsTaskConvertigRequired
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/classes/general/crm_activity_converter.php
  • Класс: \CCrmActivityConverter
  • Вызов: CCrmActivityConverter::IsTaskConvertigRequired
static function IsTaskConvertigRequired()
{
	if(!(IsModuleInstalled('tasks') && CModule::IncludeModule('tasks')))
	{
		return false;
	}

	$dbTask = CTasks::getCount(
		array('!UF_CRM_TASK' => null),
		array('bIgnoreDbErrors' => true, 'bSkipExtraTables' => true)
	);

	$task = $dbTask ? $dbTask->Fetch() : null;
	$taskCount = is_array($task) && isset($task['CNT']) ? intval($task['CNT']) : 0;
	$activityCount = CCrmActivity::GetCount(
		array(
			'=TYPE_ID' =>  CCrmActivityType::Task,
			'>ASSOCIATED_ENTITY_ID' => 0
		)
	);

	return $taskCount !== $activityCount;
}

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