• Модуль: crmmobile
  • Путь к файлу: ~/bitrix/modules/crmmobile/lib/Kanban/ControllerStrategy/ListStrategy.php
  • Класс: BitrixCrmMobileKanbanControllerStrategyListStrategy
  • Вызов: ListStrategy::markUnsupportedPresetsAsDisabled
private function markUnsupportedPresetsAsDisabled(array &$preparedPresets, array $presets, array $availableFields): void
{
	$preparedPresetIds = array_column($preparedPresets, 'id');

	foreach ($presets as $presetId => $preset)
	{
		if (empty($preset['fields']))
		{
			continue;
		}

		$fieldNames = $this->getPresetFilterFieldNames($preset['fields']);
		$unsupportedFieldIds = array_diff($fieldNames, $availableFields);
		if (empty($unsupportedFieldIds))
		{
			continue;
		}

		$foundKey = array_search($presetId, $preparedPresetIds, true);
		if (!$foundKey)
		{
			continue;
		}

		$preparedPresets[$foundKey]['disabled'] = true;
		$preparedPresets[$foundKey]['unsupportedFields'] = $this->getUnsupportedFields($unsupportedFieldIds);
	}
}