2namespace Bitrix\Sale\Services\Base;
4use Bitrix\Main\GroupTable;
5use Bitrix\Main\Localization\Loc;
6use Bitrix\Main\NotImplementedException;
7use Bitrix\Sale\Internals\Entity;
8use Bitrix\Sale\Internals\UserGroupRestrictionTable;
11Loc::loadMessages(__FILE__);
27 return Loc::getMessage(
"SALE_SRV_RSTR_BY_UG_NAME");
35 return Loc::getMessage(
"SALE_SRV_RSTR_BY_UG_DESC");
40 return Loc::getMessage(
'SALE_SRV_RSTR_BY_UG_ON_APPLY_ERROR_MSG');
57 $commonGroups = array_intersect(
$groups, $restrictionParams[
'GROUP_IDS']);
58 return !empty($commonGroups);
102 $entityTypeId = (int)static::getEntityTypeId();
105 if(is_array(
$params[
'GROUP_IDS']) && !empty(
$params[
'GROUP_IDS']))
107 foreach(
$params[
'GROUP_IDS'] as $groupId)
110 'ENTITY_TYPE_ID' => $entityTypeId,
112 'GROUP_ID' => (
int)$groupId
123 $res = GroupTable::getList([
124 'filter' => [
'ACTIVE' =>
'Y'],
125 'order' => [
'NAME' =>
'ASC']
128 while($group =
$res->fetch())
130 $result[$group[
'ID']] = $group[
'NAME'];
139 "GROUP_IDS" =>
array(
142 "LABEL" => Loc::getMessage(
"SALE_SRV_RSTR_BY_UG_LIST"),
143 "OPTIONS" => static::getUserGroups()
153 '=ENTITY_TYPE_ID' => static::getEntityTypeId(),
157 while($row =
$res->fetch())
168 return parent::save(
$fields, $restrictionId);
171 public static function delete($restrictionId,
$entityId = 0)
174 return parent::delete($restrictionId);
184 if(empty($restrictionFields))
194 $entityIds = array_keys($restrictionFields);
198 '=ENTITY_TYPE_ID' => static::getEntityTypeId(),
199 '=ENTITY_ID' => $entityIds,
206 while($row =
$res->fetch())
208 if(!isset(
$result[$row[
'ENTITY_ID']]))
210 $result[$row[
'ENTITY_ID']] =
true;
static getList(array $parameters=array())
static getUserGroupIds($userId)
static deleteByEntity($entityType, $entityId)
static extractParams(Entity $entity)
static prepareParamsValues(array $paramsValues, $entityId=0)
static prepareParamsForSaving(array $params=array(), $entityId=0)
static save(array $fields, $restrictionId=0)
static getClassDescription()
static filterServicesArray(Entity $entity, array $restrictionFields)
static getOrder(Entity $entity)
static getOnApplyErrorMessage()
static getParamsStructure($entityId=0)
static check($groups, array $restrictionParams, $entityId=0)
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']