28 $this->contractorsProvider = Catalog\v2\Contractor\Provider\Manager::getActiveProvider(
29 Catalog\v2\Contractor\
Provider\Manager::PROVIDER_STORE_DOCUMENT
35 'name' => Main\Localization\Loc::getMessage(
'AGENT_CATALOG_CONTRACT_DATA_PROVIDER_ID'),
42 'name' => Main\Localization\Loc::getMessage(
'AGENT_CATALOG_CONTRACT_DATA_PROVIDER_TITLE'),
47 'id' =>
'CONTRACTOR_ID',
48 'name' => Main\Localization\Loc::getMessage(
'AGENT_CATALOG_CONTRACT_DATA_PROVIDER_CONTRACTOR_ID'),
50 'type' =>
'entity_selector',
54 'id' =>
'DATE_MODIFY',
55 'name' => Main\Localization\Loc::getMessage(
'AGENT_CATALOG_CONTRACT_DATA_PROVIDER_DATE_MODIFY'),
60 Main\UI\Filter\DateType::TOMORROW,
61 Main\UI\Filter\DateType::NEXT_DAYS,
62 Main\UI\Filter\DateType::NEXT_WEEK,
63 Main\UI\Filter\DateType::NEXT_MONTH,
66 'sort' =>
'DATE_MODIFY',
69 'id' =>
'DATE_CREATE',
70 'name' => Main\Localization\Loc::getMessage(
'AGENT_CATALOG_CONTRACT_DATA_PROVIDER_DATE_CREATE'),
75 Main\UI\Filter\DateType::TOMORROW,
76 Main\UI\Filter\DateType::NEXT_DAYS,
77 Main\UI\Filter\DateType::NEXT_WEEK,
78 Main\UI\Filter\DateType::NEXT_MONTH,
81 'sort' =>
'DATE_CREATE',
84 'id' =>
'MODIFIED_BY',
85 'name' => Main\Localization\Loc::getMessage(
'AGENT_CATALOG_CONTRACT_DATA_PROVIDER_MODIFIED_BY'),
87 'type' =>
'entity_selector',
92 'name' => Main\Localization\Loc::getMessage(
'AGENT_CATALOG_CONTRACT_DATA_PROVIDER_CREATED_BY'),
94 'type' =>
'entity_selector',
115 'DATE_MODIFY' => $this->
createField(
'DATE_MODIFY', [
120 Main\UI\
Filter\DateType::TOMORROW,
121 Main\UI\
Filter\DateType::NEXT_DAYS,
122 Main\UI\
Filter\DateType::NEXT_WEEK,
123 Main\UI\
Filter\DateType::NEXT_MONTH,
127 'DATE_CREATE' => $this->
createField(
'DATE_CREATE', [
132 Main\UI\
Filter\DateType::TOMORROW,
133 Main\UI\
Filter\DateType::NEXT_DAYS,
134 Main\UI\
Filter\DateType::NEXT_WEEK,
135 Main\UI\
Filter\DateType::NEXT_MONTH,
139 'MODIFIED_BY' => $this->
createField(
'MODIFIED_BY', [
141 'type' =>
'entity_selector',
146 'type' =>
'entity_selector',
151 if (Main\Loader::includeModule(
'crm'))
153 $fields[
'PRODUCTS'] = $this->
createField(
'PRODUCTS', [
155 'type' =>
'entity_selector',
158 $fields[
'SECTIONS'] = $this->
createField(
'SECTIONS', [
160 'type' =>
'entity_selector',
164 if ($this->contractorsProvider)
166 $contractorsFields = $this->contractorsProvider::getDocumentsGridFilterFields();
167 foreach ($contractorsFields as $contractorsField)
169 $fields[$contractorsField[
'CODE']] = $this->
createField(
170 $contractorsField[
'CODE'],
171 $contractorsField[
'PARAMS']
177 $fields[
'CONTRACTOR_ID'] = $this->
createField(
'CONTRACTOR_ID', [
179 'type' =>
'entity_selector',
194 $userFields = [
'MODIFIED_BY',
'CREATED_BY'];
195 if (in_array($fieldID, $userFields,
true))
200 if ($fieldID ===
'CONTRACTOR_ID')
207 'context' =>
'agent_contract_contractor_filter',
210 'id' =>
'contractor',
211 'dynamicLoad' =>
true,
212 'dynamicSearch' =>
true,
215 'dropdownMode' =>
false,
222 $this->contractorsProvider
223 && $this->contractorsProvider::isDocumentsGridFilterFieldSupported($fieldID)
226 return $this->contractorsProvider::getDocumentsGridFilterFieldData($fieldID);
229 if ($fieldID ===
'PRODUCTS')
232 'iblockId' => Crm\Product\Catalog::getDefaultId(),
233 'basePriceId' => Crm\Product\Price::getBaseId(),
241 'context' =>
'agent_contract_product_filter',
244 'id' =>
'agent-contractor-product',
245 'options' => $options,
248 'id' =>
'agent-contractor-product-variation',
249 'options' => $options,
252 'dropdownMode' =>
false,
258 if ($fieldID ===
'SECTIONS')
261 'iblockId' => Crm\Product\Catalog::getDefaultId(),
262 'basePriceId' => Crm\Product\Price::getBaseId(),
270 'context' =>
'agent_contract_section_filter',
273 'id' =>
'agent-contractor-section',
274 'options' => $options,
277 'dropdownMode' =>
false,