43 $profileId = intval($profileId);
50 array(
"ID" => $profileId),
53 array(
"ID",
"NAME",
"USER_ID",
"PERSON_TYPE_ID")
55 $arProfile = $dbProfile->Fetch();
58 $arErrors[] =
array(
"CODE" =>
"PROFILE_NOT_FOUND",
"TEXT" =>
GetMessage(
'SKGOUP_PROFILE_NOT_FOUND'));
61 if ($arProfile[
"USER_ID"] !=
$userId || $arProfile[
"PERSON_TYPE_ID"] != $personTypeId)
63 $arErrors[] =
array(
"CODE" =>
"PARAM",
"TEXT" =>
GetMessage(
'SKGOUP_PARRAMS_ERROR'));
68 if ($profileName <>
'')
76 array(
"USER_PROPS_ID" => $profileId),
79 array(
"ID",
"ORDER_PROPS_ID")
81 while ($arUserPropsValue = $dbUserPropsValues->Fetch())
82 $arIDs[$arUserPropsValue[
"ORDER_PROPS_ID"]] = $arUserPropsValue[
"ID"];
85 if (!is_array($orderProps) && (
int)$orderProps > 0)
89 array(
"ORDER_ID" => intval($orderProps)),
92 array(
"ORDER_PROPS_ID",
"VALUE")
94 $orderProps =
array();
95 while ($arOrderPropsValue = $dbOrderPropsValues->Fetch())
96 $orderProps[$arOrderPropsValue[
"ORDER_PROPS_ID"]] = $arOrderPropsValue[
"VALUE"];
99 if (empty($orderProps))
109 array(
"PERSON_TYPE_ID" => $personTypeId,
"ACTIVE" =>
"Y",
"USER_PROPS" =>
"Y"),
112 array(
"ID",
"TYPE",
"NAME",
"CODE",
"UTIL",
"MULTIPLE")
114 while ($arOrderProperty = $dbOrderProperties->Fetch())
116 if (isset($orderProps[$arOrderProperty[
"ID"]]))
118 $curVal = $orderProps[$arOrderProperty[
"ID"]];
123 $arOrderProperty[
"TYPE"] ===
"MULTISELECT"
124 || $arOrderProperty[
"TYPE"] ===
"SELECT"
129 $curVal = implode(
",", $curVal);
132 if (($arOrderProperty[
"TYPE"] ===
"FILE") && is_array($curVal))
136 foreach ($curVal as $fileDat)
138 if (!empty($fileDat[
'ID']))
140 $fileList[] = $fileDat[
'ID'];
144 $curVal = serialize($fileList);
147 if ($arOrderProperty[
"MULTIPLE"] ===
"Y" && is_array($curVal))
149 $curVal = serialize($curVal);
156 if ($profileName ==
'')
157 $profileName =
GetMessage(
"SOA_PROFILE").
" ".Date(
"Y-m-d");
160 "NAME" => $profileName,
162 "PERSON_TYPE_ID" => $personTypeId
167 $arErrors[] =
array(
"CODE" =>
"PROFILE_CREATE_ERROR",
"TEXT" =>
GetMessage(
'SKGOUP_PROFILE_CREATE_ERROR'));
172 if (array_key_exists($arOrderProperty[
"ID"], $arIDs))
175 "NAME" => $arOrderProperty[
"NAME"],
179 unset($arIDs[$arOrderProperty[
"ID"]]);
184 "USER_PROPS_ID" => $profileId,
185 "ORDER_PROPS_ID" => $arOrderProperty[
"ID"],
186 "NAME" => $arOrderProperty[
"NAME"],
208 if ($personTypeId !=
null)
209 $arFilter[
"PERSON_TYPE_ID"] = $personTypeId;
212 array(
"DATE_UPDATE" =>
"DESC",
"NAME" =>
"ASC"),
216 array(
"ID",
"NAME",
"PERSON_TYPE_ID",
"DATE_UPDATE")
219 while ($arProfile = $dbProfile->GetNext())
221 if (!array_key_exists($arProfile[
"PERSON_TYPE_ID"],
$arResult))
224 $arResult[$arProfile[
"PERSON_TYPE_ID"]][$arProfile[
"ID"]] =
array(
"NAME" => $arProfile[
"NAME"],
"VALUES" =>
array(),
"VALUES_ORIG" =>
array());
228 array(
"USER_PROPS_ID" => $arProfile[
"ID"]),
231 array(
"ORDER_PROPS_ID",
"NAME",
"VALUE",
"VALUE_ORIG")
233 while ($arProps = $dbProps->GetNext())
235 $arResult[$arProfile[
"PERSON_TYPE_ID"]][$arProfile[
"ID"]][
"VALUES"][$arProps[
"ORDER_PROPS_ID"]] = $arProps[
"VALUE"];
237 if(isset($arProps[
"VALUE_ORIG"]))
238 $arResult[$arProfile[
"PERSON_TYPE_ID"]][$arProfile[
"ID"]][
"VALUES_ORIG"][$arProps[
"ORDER_PROPS_ID"]] = $arProps[
"VALUE_ORIG"];
244 if ($personTypeId !=
null)
258 "FROM b_sale_user_props ".
259 "WHERE ID = ".$ID.
"";
275 $GLOBALS[
"APPLICATION"]->ThrowException(
GetMessage(
"SKGOUP_EMPTY_PERS_TYPE"),
"ERROR_NO_PERSON_TYPE_ID");
279 if (
false && !
$USER->IsAuthorized())
281 $GLOBALS[
"APPLICATION"]->ThrowException(
GetMessage(
"SKGOUP_UNAUTH"),
"ERROR_NO_AUTH");
290 $GLOBALS[
"APPLICATION"]->ThrowException(
GetMessage(
"SKGOUP_NO_USER_ID"),
"ERROR_NO_PERSON_TYPE_ID");
305 $strUpdate =
$DB->PrepareUpdate(
"b_sale_user_props",
$arFields);
308 "UPDATE b_sale_user_props SET ".
310 " DATE_UPDATE = ".$DB->GetNowFunction().
" ".
311 "WHERE ID = ".$ID.
" ";
322 "FROM b_sale_user_props UP ".
323 " LEFT JOIN b_sale_user_props_value UPV ON (UP.ID = UPV.USER_PROPS_ID) ".
324 "WHERE UPV.ID IS NULL ";
328 $DB->Query(
"DELETE FROM b_sale_user_props WHERE ID = ".
$res[
"ID"].
"");
336 $DB->Query(
"DELETE FROM b_sale_user_props_value WHERE USER_PROPS_ID = ".
$ID.
"",
true);
337 return $DB->Query(
"DELETE FROM b_sale_user_props WHERE ID = ".
$ID.
"",
true);
if(!is_object($USER)||! $USER->IsAuthorized()) $userId
static GetList($arOrder=array(), $arFilter=array(), $arGroupBy=false, $arNavStartParams=false, $arSelectFields=array())
static CheckFields($ACTION, &$arFields, $ID=0)
static DoLoadProfiles($userId, $personTypeId=null)
static DoSaveUserProfile($userId, $profileId, $profileName, $personTypeId, $orderProps, &$arErrors)
static Update($ID, $arFields)
static Update($ID, $arFields)
static GetList($arOrder=array(), $arFilter=array(), $arGroupBy=false, $arNavStartParams=false, $arSelectFields=array())
static GetList($arOrder=array(), $arFilter=array(), $arGroupBy=false, $arNavStartParams=false, $arSelectFields=array())
static GetList($arOrder=array(), $arFilter=array(), $arGroupBy=false, $arNavStartParams=false, $arSelectFields=array())
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
IncludeModuleLangFile($filepath, $lang=false, $bReturnArray=false)
GetMessage($name, $aReplace=null)
</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."%"
$GLOBALS['_____370096793']