21 private array $lockedColumns;
28 $this->initLockedColumns($settings);
31 $this->getProcessedColumnIds(),
43 $this->lockedColumns = [];
45 $lockedFieldNames = CCatalogAdminTools::getLockedGridFields([
49 $removePrefix =
'CATALOG_';
50 foreach ($lockedFieldNames as $productType => $map)
52 foreach ($map as $columnId => $value)
54 $columnId = str_replace($removePrefix,
'', $columnId);
55 $this->lockedColumns[$productType][$columnId] = $value ===
false;
65 private function getProcessedColumnIds(): array
67 if (empty($this->lockedColumns))
72 return array_keys(reset($this->lockedColumns));
81 private function isLockedField(array $row,
string $columnId): bool
83 $rowType = $row[
'data'][
'ROW_TYPE'] ?? RowType::ELEMENT;
84 $productType = (int)($row[
'data'][
'TYPE'] ?? 0);
87 $rowType === RowType::ELEMENT
88 && isset($this->lockedColumns[$productType][$columnId])
89 && $this->lockedColumns[$productType][$columnId] === true
107 $isLocked = $this->isLockedField($row, $columnId);
110 $row[
'editableColumns'][$columnId] =
false;