8Loc::loadMessages(__FILE__);
26 $result =
new Main\Entity\Result();
28 $propertyId = (int)$propertyId;
32 Loc::getMessage(
'PROPERTY_FEATURE_ERR_BAD_PROPERTY_ID')
40 Loc::getMessage(
'PROPERTY_FEATURE_ERR_EMPTY_FEATURE_LIST')
45 if ($features ===
null)
48 Loc::getMessage(
'PROPERTY_FEATURE_ERR_BAD_FEATURE_LIST')
54 foreach ($features as $row)
56 $row[
'PROPERTY_ID'] = $propertyId;
58 if (!$internalResult->isSuccess())
60 $result->addErrors($internalResult->getErrors());
64 $resultIds[] = $internalResult->getId();
66 unset($internalResult, $row);
81 $result =
new Main\Entity\Result();
83 $propertyId = (int)$propertyId;
87 Loc::getMessage(
'PROPERTY_FEATURE_ERR_BAD_PROPERTY_ID')
95 Loc::getMessage(
'PROPERTY_FEATURE_ERR_EMPTY_FEATURE_LIST')
101 if ($features ===
null)
104 Loc::getMessage(
'PROPERTY_FEATURE_ERR_BAD_FEATURE_LIST')
112 'filter' => [
'=PROPERTY_ID' => $propertyId]
120 foreach ($features as $index => $row)
122 if (isset($currentList[$index]))
125 $currentList[$index][
'ID'],
126 [
'IS_ENABLED' => $row[
'IS_ENABLED']]
131 $row[
'PROPERTY_ID'] = $propertyId;
134 if (!$internalResult->isSuccess())
136 $result->addErrors($internalResult->getErrors());
140 unset($internalResult, $index, $row);
155 $result =
new Main\Entity\Result();
157 $propertyId = (int)$propertyId;
158 if ($propertyId <= 0)
161 Loc::getMessage(
'PROPERTY_FEATURE_ERR_BAD_PROPERTY_ID')
166 if (empty($features))
169 Loc::getMessage(
'PROPERTY_FEATURE_ERR_EMPTY_FEATURE_LIST')
174 if ($features ===
null)
177 Loc::getMessage(
'PROPERTY_FEATURE_ERR_BAD_FEATURE_LIST')
186 'filter' => [
'=PROPERTY_ID' => $propertyId]
190 $row[
'ID'] = (int)$row[
'ID'];
192 $idList[$row[
'ID']] = $row[
'ID'];
196 foreach ($features as $index => $row)
198 if (isset($currentList[$index]))
201 $currentList[$index][
'ID'],
202 [
'IS_ENABLED' => $row[
'IS_ENABLED']]
204 if ($internalResult->isSuccess())
205 unset($idList[$currentList[$index][
'ID']]);
209 $row[
'PROPERTY_ID'] = $propertyId;
212 if (!$internalResult->isSuccess())
214 $result->addErrors($internalResult->getErrors());
218 unset($internalResult, $index, $row);
224 $helper = $conn->getSqlHelper();
226 ' where '.$helper->quote(
'PROPERTY_ID').
' = '.$propertyId.
227 ' and '.$helper->quote(
'ID').
' in ('.implode(
',', $idList).
')';
228 $conn->queryExecute(
$query);
229 unset(
$query, $helper, $conn);
248 foreach ($list as $rawRow)
270 if (!isset($feature[
'MODULE_ID']))
272 $feature[
'MODULE_ID'] = trim((
string)$feature[
'MODULE_ID']);
273 if ($feature[
'MODULE_ID'] ===
'')
275 if (!isset($feature[
'FEATURE_ID']))
277 $feature[
'FEATURE_ID'] = trim((
string)$feature[
'FEATURE_ID']);
278 if ($feature[
'FEATURE_ID'] ===
'')
280 if (!isset($feature[
'IS_ENABLED']))
282 $feature[
'IS_ENABLED'] = trim((
string)$feature[
'IS_ENABLED']);
283 if ($feature[
'IS_ENABLED'] !==
'Y' && $feature[
'IS_ENABLED'] !==
'N')
287 'MODULE_ID' => $feature[
'MODULE_ID'],
288 'FEATURE_ID' => $feature[
'FEATURE_ID'],
289 'IS_ENABLED' => $feature[
'IS_ENABLED']
301 return $feature[
'MODULE_ID'].
':'.$feature[
'FEATURE_ID'];
313 $parts = explode(
':', $index);
314 if (
count($parts) === 2)
317 'MODULE_ID' => $parts[0],
318 'FEATURE_ID' => $parts[1],
334 $result = self::getIblockFeatureList();
338 __CLASS__.
'::'.self::EVENT_ID_FEATURE_LIST,
339 [
'property' => $property,
'description' =>
$description]
342 foreach(
$event->getResults() as $eventResult)
344 if ($eventResult->getType() !==
Main\EventResult::SUCCESS)
346 $list = $eventResult->getParameters();
347 if (empty($list) || !is_array($list))
349 foreach ($list as $item)
351 if (empty($item) || !is_array($item))
353 $item = self::prepareFeatureDescription($item);
385 '=MODULE_ID' =>
'iblock',
386 '=FEATURE_ID' => self::FEATURE_ID_LIST_PAGE_SHOW
412 '=MODULE_ID' =>
'iblock',
413 '=FEATURE_ID' => self::FEATURE_ID_DETAIL_PAGE_SHOW
450 if (
Main\
Config\Option::get(
'iblock',
'property_features_enabled') !==
'Y')
459 if (!isset(
$filter[
'=MODULE_ID']) || !isset(
$filter[
'=FEATURE_ID']))
464 $getCode = (isset($parameters[
'CODE']) && $parameters[
'CODE'] ==
'Y');
468 $filter[
'=PROPERTY.ACTIVE'] =
'Y';
472 'IBLOCK_PROPERTY_ID' =>
'PROPERTY.ID',
473 'IBLOCK_PROPERTY_CODE' =>
'PROPERTY.CODE',
474 'IBLOCK_PROPERTY_SORT' =>
'PROPERTY.SORT',
478 'IBLOCK_PROPERTY_SORT' =>
'ASC',
479 'IBLOCK_PROPERTY_ID' =>
'ASC',
484 $result[(int)$row[
'IBLOCK_PROPERTY_ID']] = self::getPropertyCode(
486 'ID' => $row[
'IBLOCK_PROPERTY_ID'],
487 'CODE' => $row[
'IBLOCK_PROPERTY_CODE']
507 $property[
'ID'] = (string)$property[
'ID'];
510 $property[
'CODE'] = trim((
string)$property[
'CODE']);
511 if ($property[
'CODE'] ===
'')
513 $property[
'CODE'] =
null;
516 return ($property[
'CODE'] ?? $property[
'ID']);
520 return $property[
'ID'];
530 private static function prepareFeatureDescription(
array $row):
array
535 !isset($row[
'MODULE_ID'])
536 || !isset($row[
'FEATURE_ID'])
537 || !isset($row[
'FEATURE_NAME'])
542 'MODULE_ID' => $row[
'MODULE_ID'],
543 'FEATURE_ID' => $row[
'FEATURE_ID'],
544 'FEATURE_NAME' => $row[
'FEATURE_NAME']
554 private static function getIblockFeatureList():
array
558 'MODULE_ID' =>
'iblock',
559 'FEATURE_ID' => self::FEATURE_ID_LIST_PAGE_SHOW,
560 'FEATURE_NAME' => Loc::getMessage(
'PROPERTY_FEATURE_NAME_LIST_PAGE_SHOW')
563 'MODULE_ID' =>
'iblock',
564 'FEATURE_ID' => self::FEATURE_ID_DETAIL_PAGE_SHOW,
565 'FEATURE_NAME' => Loc::getMessage(
'PROPERTY_FEATURE_NAME_DETAIL_PAGE_SHOW')
577 return (
Main\
Config\Option::get(
'iblock',
'property_features_enabled') ==
'Y');
static getIndex(array $feature)
static getDetailPageShowProperties($iblockId, array $parameters=[])
const FEATURE_ID_DETAIL_PAGE_SHOW
static getPropertyCode(array $property, bool $getCode=false)
static setFeatures($propertyId, array $features)
static updateFeatures($propertyId, array $features)
static isPropertyFeaturesExist()
static getPropertyFeatureList(array $property, array $description=[])
static checkFeature(array $feature)
static getListPageShowPropertyCodes($iblockId, array $parameters=[])
const FEATURE_ID_LIST_PAGE_SHOW
static addFeatures($propertyId, array $features)
static checkFeatureList(array $list)
static isEnabledFeatures()
const EVENT_ID_FEATURE_LIST
static parseIndex(string $index)
static getFilteredPropertyCodes(int $iblockId, array $filter, array $parameters=[])
static getDetailPageShowPropertyCodes($iblockId, array $parameters=[])
static getConnection($name="")
static getList(array $parameters=array())
static getCount($filter=array(), array $cache=array())
static update($primary, array $data)
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
if(Loader::includeModule( 'bitrix24')) elseif(Loader::includeModule('intranet') &&CIntranetUtils::getPortalZone() !=='ru') $description
</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."%"