3namespace Bitrix\Iblock\Integration\UI\Grid\Filter\Property;
5use Bitrix\Iblock\Helpers\Admin\Property;
6use Bitrix\Iblock\Integration\UI\Grid\Property\PropertyGridProvider;
7use Bitrix\Main\Filter\EntityDataProvider;
8use Bitrix\Main\Filter\Settings;
9use Bitrix\Main\Localization\Loc;
10use Bitrix\Main\Type\Collection;
17 private int $iblockId;
25 $this->iblockId = $iblockId;
26 $this->gridProvider = $gridProvider;
35 'ID' =>
"iblock_property_{$this->iblockId}",
56 'name' => $this->gridProvider->getFieldName(
'NAME'),
60 'name' => $this->gridProvider->getFieldName(
'CODE'),
63 'name' => $this->gridProvider->getFieldName(
'ACTIVE'),
68 'Y' => Loc::getMessage(
'IBLOCK_YES'),
69 'N' => Loc::getMessage(
'IBLOCK_NO')
74 'name' => $this->gridProvider->getFieldName(
'SEARCHABLE'),
78 'Y' => Loc::getMessage(
'IBLOCK_YES'),
79 'N' => Loc::getMessage(
'IBLOCK_NO')
84 'name' => $this->gridProvider->getFieldName(
'FILTRABLE'),
88 'Y' => Loc::getMessage(
'IBLOCK_YES'),
89 'N' => Loc::getMessage(
'IBLOCK_NO')
93 'IS_REQUIRED' => $this->
createField(
'IS_REQUIRED', [
94 'name' => $this->gridProvider->getFieldName(
'IS_REQUIRED'),
98 'Y' => Loc::getMessage(
'IBLOCK_YES'),
99 'N' => Loc::getMessage(
'IBLOCK_NO')
104 'name' => $this->gridProvider->getFieldName(
'MULTIPLE'),
108 'Y' => Loc::getMessage(
'IBLOCK_YES'),
109 'N' => Loc::getMessage(
'IBLOCK_NO')
114 'name' => $this->gridProvider->getFieldName(
'XML_ID'),
116 'PROPERTY_TYPE' => $this->
createField(
'PROPERTY_TYPE', [
117 'name' => $this->gridProvider->getFieldName(
'PROPERTY_TYPE'),
121 'items' => $this->getPropertyTypes(),
132 private function getPropertyTypes():
array
136 $baseTypes = Property::getBaseTypeList(
true);
142 $userTypes = CIBlockProperty::GetUserType();
143 Collection::sortByColumn($userTypes, [
144 'DESCRIPTION' => SORT_STRING,
147 foreach ($userTypes as
$type => $item)
149 $key =
"{$item['PROPERTY_TYPE']}:{$type}";
169 $isEmpty = empty($rawFilterValue);
174 return $rawFilterValue;
178 if (isset($rawFilterValue[
'PROPERTY_TYPE']))
180 $parts = explode(
':', $rawFilterValue[
'PROPERTY_TYPE']);
181 if (
count($parts) === 2)
183 $rawFilterValue[
'PROPERTY_TYPE'] = $parts[0];
184 $rawFilterValue[
'USER_TYPE'] = $parts[1];
189 $filterOperations = [
195 'IS_REQUIRED' =>
'=',
198 'PROPERTY_TYPE' =>
'=',
201 foreach ($rawFilterValue as $field => $value)
203 $operator = $filterOperations[$field] ??
null;
204 if (isset($operator))
206 $rawFilterValue[$operator . $field] = $value;
207 unset($rawFilterValue[$field]);
212 if (isset($rawFilterValue[
'FIND']))
214 $rawFilterValue[] = [
215 '?NAME' => $rawFilterValue[
'FIND'],
219 return $rawFilterValue;
prepareFieldData($fieldID)
prepareFilterValue(array $rawFilterValue)
__construct(int $iblockId, PropertyGridProvider $gridProvider)
createField($fieldID, array $params=null)
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
if(empty($signedUserToken)) $key
</p ></td >< td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0cm 2.0pt 0cm 2.0pt;height:9.0pt'>< p class=Normal align=center style='margin:0cm;margin-bottom:.0001pt;text-align:center;line-height:normal'>< a name=ТекстовоеПоле54 ></a ><?=($taxRate > count( $arTaxList) > 0) ? $taxRate."%"