本文整理汇总了PHP中CUser::GetID方法的典型用法代码示例。如果您正苦于以下问题:PHP CUser::GetID方法的具体用法?PHP CUser::GetID怎么用?PHP CUser::GetID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CUser
的用法示例。
在下文中一共展示了CUser::GetID方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getEdit
public static function getEdit(Order $order, \CUser $user, $showCancel, $showSaveButton)
{
$data = self::prepareData($order);
if ($showCancel) {
$bUserCanCancelOrder = \CSaleOrder::CanUserCancelOrder($order->getId(), $user->GetUserGroupArray(), $user->GetID());
} else {
$bUserCanCancelOrder = false;
}
$result = '
<table border="0" cellspacing="0" cellpadding="0" width="100%" class="adm-detail-content-table edit-table">
<tbody>
<tr>
<td class="adm-detail-content-cell-l" width="40%">' . Loc::getMessage("SALE_ORDER_STATUS_CREATED") . ':</td>
<td class="adm-detail-content-cell-r">
<div>' . $data["DATE_INSERT"] . ' <a href="/bitrix/admin/user_edit.php?lang=' . LANGUAGE_ID . '&ID=' . $data["CREATOR_USER_ID"] . '">' . htmlspecialcharsbx($data["CREATOR_USER_NAME"]) . '</a>
</div>
</td>
</tr>
<tr>
<td class="adm-detail-content-cell-l">' . Loc::getMessage("SALE_ORDER_STATUS_LAST_MODIF") . ':</td>
<td class="adm-detail-content-cell-r"><div>' . $data["DATE_UPDATE"] . '</div></td>
</tr>
<tr>
<td class="adm-detail-content-cell-l">' . Loc::getMessage("SALE_ORDER_STATUS_SITE") . ':</td>
<td class="adm-detail-content-cell-r"><div>' . htmlspecialcharsbx(\Bitrix\Sale\Helpers\Admin\OrderEdit::getSiteName($order->getSiteId())) . '</div></td>
</tr>';
if (strlen($data['SOURCE_NAME']) > 0) {
$result .= '<tr>' . '<td class="adm-detail-content-cell-l">' . Loc::getMessage("SALE_ORDER_STATUS_SOURCE") . ':</td>' . '<td class="adm-detail-content-cell-r">' . $data['SOURCE_NAME'] . '</td>' . '</tr>';
}
$result .= '<tr>
<td class="adm-detail-content-cell-l">' . Loc::getMessage("SALE_ORDER_STATUS") . ':</td>
<td class="adm-detail-content-cell-r">' . \Bitrix\Sale\Helpers\Admin\OrderEdit::makeSelectHtml("STATUS_ID", self::getStatusesList($user->GetID(), $data["STATUS_ID"]), $data["STATUS_ID"], false, array("class" => "adm-bus-select", "id" => "STATUS_ID"));
if ($showSaveButton) {
$result .= '
<span id="save_status_button" class="adm-btn" onclick="BX.Sale.Admin.OrderEditPage.onSaveStatusButton(\'' . $order->getId() . '\',\'STATUS_ID\');">
' . Loc::getMessage("SALE_ORDER_STATUS_SAVE") . '
</span>';
}
$result .= '</td>
</tr>';
if ($showCancel && $bUserCanCancelOrder) {
$result .= self::getCancelBlockHtml($order, $data);
}
$result .= '</tbody>
</table>
';
return $result;
}
示例2: GetUserTopicVisits
public static function GetUserTopicVisits($forumID, $arTopic, $userID = null)
{
global $DB;
$arResult = array();
$forumID = intval($forumID);
if ($userID == null) {
$userID = CUser::GetID();
} else {
$userID = intval($userID);
}
if ($forumID <= 0 || $userID <= 0) {
return $arResult;
}
$arSelectTopic = array();
foreach ($arTopic as $topicID) {
$arSelectTopic[] = intval($topicID);
}
$arSelectTopic = array_unique(array_filter($arSelectTopic));
if (sizeof($arSelectTopic) < 1) {
return $arResult;
}
$sTopicIDs = implode(",", $arSelectTopic);
$strSql = "SELECT FUT.TOPIC_ID,\n\t\t\t" . $DB->DateToCharFunction("FUT.LAST_VISIT", "FULL") . " as LAST_VISIT\n\t\t\tFROM b_forum_user_topic FUT\n\t\t\tWHERE (FORUM_ID=" . $forumID . " AND USER_ID=" . $userID . " AND TOPIC_ID IN (" . $sTopicIDs . "))";
$rVisit = $DB->Query($strSql, false, "File: " . __FILE__ . "<br>Line: " . __LINE__);
if ($rVisit) {
while ($arVisit = $rVisit->Fetch()) {
$arResult[$arVisit['TOPIC_ID']] = $arVisit['LAST_VISIT'];
}
}
return $arResult;
}
示例3: trackStartedTask
function trackStartedTask($stopStartedTask = true)
{
CModule::IncludeModule('iblock');
$res = CIBlockElement::GetList(array(), array("IBLOCK_ID" => TASKS_IBLOCK_ID, 'ACTIVE' => 'Y', "PROPERTY_PROGRAMMER" => CUser::GetID(), "PROPERTY_STATUS" => STATUS_LIST_WORK), false, false, array('ID', 'NAME', 'PROPERTY_PROJECT', 'PROPERTY_STATUS_DATE'));
if ($taskArr = $res->Fetch()) {
if ($stopStartedTask) {
CIBlockElement::SetPropertyValuesEx($taskArr['ID'], TASKS_IBLOCK_ID, array('STATUS' => STATUS_LIST_PAUSE));
}
$link = TASKS_LIST_URL . $taskArr["PROPERTY_PROJECT_VALUE"] . '/' . $taskArr['ID'] . '/';
$date = new DateTime($taskArr["PROPERTY_STATUS_DATE_VALUE"]);
$curdate = new DateTime();
$diff = $date->diff($curdate);
$h = $diff->format('%h');
$i = $diff->format('%i');
if ($h || $i) {
$timingText = '';
if ($h) {
$timingText = "{$h} ч, ";
}
if ($i) {
$timingText = $timingText . "{$i} мин. ";
}
$decTime = $h + $i / 60;
$decTime = round($decTime, 2);
$el = new CIBlockElement();
if ($el->Add(array("DATE_ACTIVE_FROM" => ConvertTimeStamp(time(), "SHORT"), "MODIFIED_BY" => CUser::GetID(), "IBLOCK_SECTION_ID" => false, "IBLOCK_ID" => TRACKING_IBLOCK_ID, "NAME" => 'Без названия' . ' (' . $decTime . 'ч.)', "ACTIVE" => "Y", "PROPERTY_VALUES" => array("HOURS" => $decTime, "TASK" => $taskArr['ID'])))) {
crmEntitiesHelper::recalcTaskTracking($taskArr['ID']);
ToolTip::Add("+ {$timingText} в трекер задачи \"<a target=\"_blank\" href=\"{$link}\">{$taskArr['ID']} {$taskArr['NAME']}</a>\"");
} else {
ToolTip::AddError($el->LAST_ERROR);
}
}
}
}
示例4: Add
public function Add()
{
global $USER;
if ($USER->isAuthorized()) {
return \CUser::GetID();
}
$this->arFields = array_merge($this->getFields(), $this->defaultFields);
if (!$this->arFields["EMAIL"]) {
throw new CRUDException("Please, set email for new user");
}
$u = \CUser::GetList($by = "ID", $order = "DESC", array("EMAIL" => $this->arFields["EMAIL"]))->Fetch();
if ($u) {
return $u["ID"];
}
try {
$this->generate('LOGIN')->generate('PASSWORD')->generate('GROUP_ID');
} catch (CRUDGenerateException $e) {
prentExpection($e->getMessage());
}
$objUser = new \CUser();
$newUserID = $objUser->Add($this->arFields);
if (!intval($newUserID)) {
throw new CRUDException("An error was occured while adding new User in CRUD: " . $objUser->LAST_ERROR . ". Line: " . __LINE__);
} else {
return $newUserID;
}
}
示例5: UserCreate
public static function UserCreate($name, $phone, $domen, $login, $group) //$name - string, $phone - string, $domen - string, $login - string, $group - array
{
if (CUser::IsAuthorized()) {
$userId = CUser::GetID();
return (int)$userId;
} else {
$usersCheck = CUser::GetByLogin($login);
if ($arUser = $usersCheck->Fetch()) {
return (int)$arUser["ID"];
} else {
$stringPhone = preg_replace('~\D~','',$phone);
$password = OrderClick::GeneratePassword(10);
$user = new CUser;
$arFields = Array(
"NAME" => $name,
"EMAIL" => $stringPhone . "@" . $domen,
"LOGIN" => $phone,
"ACTIVE" => "N", // Делаю пользователя не активным
"GROUP_ID" => $group,
"PASSWORD" => $password,
"CONFIRM_PASSWORD" => $password,
"PERSONAL_PHONE" => $stringPhone,
);
return $user->Add($arFields);
}
}
}
示例6: Connect
/**
* Выполняет подключение к Carrot Quest на стороне клиента (JavaScript). JS объект <var>carrotquest</var> уже должен быть инициализирован.
* Если пользователь залогинен, шлет идентификационные данные методом <var>carrotquest.identify()</var>.
* <b>Параметры:</b> отсутствуют
* <b>Возвращаемое значение:</b>
* true, если в параметрах модуля найден API-KEY, false в противном случае
*/
public function Connect ()
{
// В header-е уже должен быть инициализирован carrotquest (в js)
$ApiKey = COption::GetOptionString($this->MODULE_ID,"cqApiKey");
if ($ApiKey)
{?>
<script>
if (typeof(carrotquest) != "undefined")
carrotquest.connect("<?php
echo $ApiKey;
?>
");
else ;
// console.log("Ошибка сервера carrotquest (connect)!");
</script>
<!-- Вызов идентификации -->
<?if (CUser::IsAuthorized()) { ?>
<script>
if (typeof(carrotquest) != "undefined") // На всякий случай, чтобы не выдавал в консоль ругань
{
carrotquest.identify({
$uid: "<?php
echo CUser::GetID();
?>
",
$email: "<?php
echo CUser::GetEmail();
?>
",
$name: "<?php
echo CUser::GetLogin();
?>
"
});
}
else ;
// console.log("Ошибка сервера carrotquest (identify)!");
</script>
<? }
}
else
{
return false;
}
return true;
}
示例7: elemGet
function elemGet($elemId = false)
{
$usr = new CUser();
$hlHandler = $this->hlHandler;
$getList = new Entity\Query($hlHandler);
$getList->setSelect(array('*'));
$getList->setOrder(array("ID" => "ASC"));
$filter = array("UF_USER_ID" => $usr->GetID());
if (!empty($elemId)) {
$filter += array("ID" => $elemId);
}
$getList->setFilter($filter);
$result = $getList->exec();
$result = new CDBResult($result);
$arRes = array();
while ($row = $result->Fetch()) {
$arRes[] = $row;
}
return $arRes;
}
示例8: IsHistoryUpdate
public static function IsHistoryUpdate($documentID)
{
static $arHistoryFields = array("ID", "DOCUMENT_ID", "MODIFIED", "DOCUMENT");
$historyService = self::GetHistoryService();
$result = false;
if (self::IsGlueEnabled()) {
$arFilter = array("DOCUMENT_ID" => $documentID, "USER_ID" => CUser::GetID());
$dbDoc = $historyService->GetHistoryList(array("ID" => "DESC"), $arFilter, false, false, $arHistoryFields);
CTimeZone::Disable();
if ($dbDoc && ($arDoc = $dbDoc->Fetch())) {
CTimeZone::Enable();
if (CWebdavDocumentHistory::GetHistoryState($documentID, $arDoc['ID'], $arDoc) == 'Y') {
$result = $arDoc;
}
} else {
CTimeZone::Enable();
}
}
return $result;
}
示例9: getUsersArrByIds
public static function getUsersArrByIds($usersIds)
{
if (!$usersIds) {
$usersIds = array(CUser::GetID());
}
if (!is_array($usersIds)) {
$usersIds = array($usersIds);
}
if (!count($usersIds)) {
return;
}
$usersIds = array_unique($usersIds);
$otherUsersIds = array();
foreach ($usersIds as $id) {
$id = intval($id);
if (!$id) {
continue;
}
if (isset(self::$usersCache[$id])) {
$users[$id] = self::$usersCache[$id];
} else {
$otherUsersIds[] = $id;
}
}
if (count($otherUsersIds)) {
$rsUsers = CUser::GetList($by = "NAME", $order = "ASCS", array('ACTIVE' => 'Y', 'ID' => implode(' | ', $otherUsersIds)), array('FIELDS' => array('ID', 'NAME', 'LOGIN', 'LAST_NAME', 'PERSONAL_PHOTO', 'EMAIL', 'IS_ONLINE')));
while ($arUser = $rsUsers->Fetch()) {
if ($arUser['PERSONAL_PHOTO']) {
$arimg = CFile::ResizeImageGet($arUser['PERSONAL_PHOTO'], array('width' => 100, 'height' => 100), BX_RESIZE_IMAGE_EXACT, true);
$src = $arimg['src'];
} else {
$src = self::$defaultUserPicture;
}
$arUser['PERSONAL_PHOTO'] = $src;
$arUser['FULL_NAME'] = $arUser['NAME'] . ' ' . $arUser['LAST_NAME'];
self::$usersCache[$arUser['ID']] = $arUser;
$users[$arUser['ID']] = $arUser;
}
}
return $users;
}
示例10: CUser
CModule::IncludeModule("sale");
CModule::IncludeModule("catalog");
global $USER;
if (!is_object($USER)) {
$USER = new CUser();
}
$result = array();
$result['status'] = false;
$result['message'] = '';
$result['errors'] = array();
if (strlen($_POST['ajax_key']) && $_POST['ajax_key'] != md5('ajax_' . LICENSE_KEY) || !check_bitrix_sessid()) {
$result['errors']["old-password"] = "Сессия не действительна!";
}
$action = htmlspecialcharsbx($_REQUEST["action"]);
if ($USER->IsAuthorized()) {
$rsUser = CUser::GetByID($USER->GetID());
$arUser = $rsUser->Fetch();
$arPost = $_REQUEST["USER"];
if ($action == "profile") {
foreach ($arPost as &$value) {
$value = htmlspecialcharsbx(trim($value));
}
$arPost["PERSONAL_PHONE"] = preg_replace("/[^0-9]/", '', $arPost["PERSONAL_PHONE"]);
if (!preg_match("/^([a-zA-Z0-9])+([\\.a-zA-Z0-9_-])*@([a-zA-Z0-9_-])+(\\.[a-zA-Z0-9_-]+)*\\.([a-zA-Z]{2,6})\$/", $arPost["EMAIL"])) {
$result['errors']['USER[EMAIL]'] = "Неправильный формат электроной почты.";
}
if (!empty($arPost["EMAIL"])) {
$rsUsers = CUser::GetList($by = "EMAIL", $order = "desc", array("=EMAIL" => $arPost["EMAIL"], "!ID" => $arUser["ID"]));
if ($rsUsers->NavNext(true, "f_")) {
$result['errors']['USER[EMAIL]'] = "Такая электроная почта существует на сайте.";
} else {
示例11: array
function Set_InitVar(&$arFields, $id, $checkRights, $sendEmailToAuthor, $sendEmailToTechsupport)
{
global $APPLICATION, $USER, $DB;
$f = self::GetCSupportTableFields("b_ticket");
$v = (object) array();
if (!is_object($USER)) {
$USER = new CUser();
}
$uid = $USER->GetID();
if (isset($arFields["CURRENT_USER_ID"]) && intval($arFields["CURRENT_USER_ID"]) > 0) {
$uid = intval($arFields["CURRENT_USER_ID"]);
}
$f->ID = intval($id);
$v->isNew = $f->ID <= 0;
$v->CHECK_RIGHTS = $checkRights == "Y" ? "Y" : "N";
$v->SEND_EMAIL_TO_AUTHOR = $sendEmailToAuthor == "Y" ? "Y" : "N";
$v->SEND_EMAIL_TO_TECHSUPPORT = $sendEmailToTechsupport == "Y" ? "Y" : "N";
$v->newSLA = false;
// заголовок и сообщение - обязательные поля для нового обращения
if ($v->isNew) {
if (strlen($arFields["TITLE"]) <= 0) {
$APPLICATION->ThrowException(GetMessage('SUP_ERROR_EMPTY_TITLE'));
return false;
}
if (strlen($arFields["MESSAGE"]) <= 0) {
$APPLICATION->ThrowException(GetMessage('SUP_ERROR_EMPTY_MESSAGE'));
return false;
}
}
if (is_object($APPLICATION)) {
$APPLICATION->ResetException();
}
if (!$GLOBALS["USER_FIELD_MANAGER"]->CheckFields("SUPPORT", $f->ID, $arFields)) {
if (is_object($APPLICATION) && $APPLICATION->GetException()) {
return false;
} else {
$APPLICATION->ThrowException("Unknown error. ");
return false;
}
}
// установка прав
$v->bAdmin = $v->bSupportTeam = $v->bSupportClient = $v->bDemo = $v->bOwner = false;
if ($v->CHECK_RIGHTS == "Y") {
$v->uid = $uid;
$v->bAdmin = CTicket::IsAdmin($uid);
$v->bSupportTeam = CTicket::IsSupportTeam($uid);
$v->bSupportClient = CTicket::IsSupportClient($uid);
$v->bDemo = CTicket::IsDemo($uid);
if ($v->isNew) {
$v->bOwner = true;
} else {
$v->bOwner = CTicket::IsOwner($f->ID, $v->uid);
}
} else {
$v->bAdmin = $v->bSupportTeam = $v->bSupportClient = $v->bDemo = $v->bOwner = true;
$v->uid = 0;
}
if (!$v->bAdmin && !$v->bSupportTeam && !$v->bSupportClient) {
return false;
}
if (!$v->bAdmin && !$v->bSupportTeam && ($v->bDemo && !$v->bOwner)) {
return false;
}
// Это спам?
$f->FromArray($arFields, "IS_SPAM");
$v->bActiveCoupon = false;
$f->FromArray($_SESSION, array("MODIFIED_GUEST_ID" => "SESS_GUEST_ID"), array(CSupportTableFields::MORE0));
$f->FromArray($arFields, "OWNER_USER_ID,OWNER_SID,HOLD_ON", array(CSupportTableFields::MORE0, CSupportTableFields::NOT_EMTY_STR));
// получим SITE_ID
if (strlen($arFields["SITE_ID"]) > 0) {
$f->SITE_ID = $arFields["SITE_ID"];
} elseif (strlen($arFields["SITE"]) > 0) {
$f->SITE_ID = $arFields["SITE"];
} elseif (strlen($arFields["LANG"]) > 0) {
$f->SITE_ID = $arFields["LANG"];
} else {
$f->SITE_ID = SITE_ID;
}
// получаем ID записей справочника по SID
$arr = array("CATEGORY" => "C", "CRITICALITY" => "K", "STATUS" => "S", "MARK" => "M", "SOURCE" => "SR", "MESSAGE_SOURCE" => "SR", "DIFFICULTY" => "D");
foreach ($arr as $key => $value) {
if ((array_key_exists($key . "_ID", $arFields) || intval($arFields[$key . "_ID"]) <= 0) && array_key_exists($key . "_SID", $arFields) && strlen($arFields[$key . "_SID"]) > 0) {
$z = CTicketDictionary::GetBySID($arFields[$key . "_SID"], $value, $f->SITE_ID);
$zr = $z->Fetch();
$arFields[$key . "_ID"] = $zr["ID"];
}
}
return array("v" => $v, "f" => $f);
}
示例12: ShowError
<?php
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
die;
}
if (!$arParams['USER_ID']) {
$arParams['USER_ID'] = CUser::GetID();
}
$arResult['USERS'] = BitrixHelper::getUsersArrByIds($arParams['USER_ID']);
if (!count($arResult['USERS'])) {
ShowError('Пользователь не найден');
return;
}
/* programmer */
$res = CIBlockElement::GetList(array(), array("IBLOCK_ID" => TASKS_IBLOCK_ID, 'ACTIVE' => 'Y', "PROPERTY_PROGRAMMER" => $arParams['USER_ID']), false, false, array('ID', 'NAME', 'IBLOCK_ID', 'PROPERTY_PROJECT', 'PROPERTY_CALC', 'PROPERTY_TRACKING', 'PROPERTY_STATUS_DATE', 'PROPERTY_STATUS', 'PROPERTY_CALC_COMMENTS'));
while ($task = $res->GetNext()) {
if (!$task['PROPERTY_STATUS_ENUM_ID']) {
$task['PROPERTY_STATUS_ENUM_ID'] = 0;
}
switch ($task['PROPERTY_STATUS_ENUM_ID']) {
case STATUS_LIST_WORK:
$task['DETAIL_PAGE_URL'] = TASKS_LIST_URL . $task["PROPERTY_PROJECT_VALUE"] . '/' . $task['ID'] . '/';
$date = new DateTime($task["PROPERTY_STATUS_DATE_VALUE"]);
$curdate = new DateTime();
$diff = $date->diff($curdate);
$task['TIME'] = $diff->format('%H:%I:%S');
$arResult['CURRENT_TASK'] = $task;
default:
$arResult['COUNTERS'][$task['PROPERTY_STATUS_ENUM_ID']]['TRACKING'] += $task['PROPERTY_TRACKING_VALUE'];
$arResult['COUNTERS'][$task['PROPERTY_STATUS_ENUM_ID']]['CALC_COMMENTS'] += $task['PROPERTY_CALC_COMMENTS_VALUE'];
$arResult['COUNTERS'][$task['PROPERTY_STATUS_ENUM_ID']]['COUNT']++;
示例13: yandex_replace_special
{
$bTmpUserCreated = true;
if (isset($USER))
{
$USER_TMP = $USER;
unset($USER);
}
$USER = new CUser();
}
CCatalogDiscountSave::Disable();
CCatalogDiscountCoupon::ClearCoupon();
if ($USER->IsAuthorized())
{
CCatalogDiscountCoupon::ClearCouponsByManage($USER->GetID());
}
function yandex_replace_special($arg)
{
if (in_array($arg[0], array(""", "&", "<", ">")))
return $arg[0];
else
return " ";
}
function yandex_text2xml($text, $bHSC = false, $bDblQuote = false)
{
global $APPLICATION;
$bHSC = (true == $bHSC ? true : false);
示例14: Array
$PROP_VAL_PROPERTY_XML_ID = $xPropertyValueNode->GetAttribute($nameUTF['PropertyId']);
$PROP_VAL_VALUE = $xPropertyValueNode->GetAttribute($nameUTF['Value']);
if(strlen($arProperties[$PROP_VAL_PROPERTY_XML_ID])>0)
{
if(is_array($arPropertiesEnum[$PROP_VAL_PROPERTY_XML_ID]))
{
if(strlen($arPropertiesEnum[$PROP_VAL_PROPERTY_XML_ID][$PROP_VAL_VALUE])>0)
$PROP[$arProperties[$PROP_VAL_PROPERTY_XML_ID]][] = $arPropertiesEnum[$PROP_VAL_PROPERTY_XML_ID][$PROP_VAL_VALUE];
}
else
$PROP[$arProperties[$PROP_VAL_PROPERTY_XML_ID]][] = $PROP_VAL_VALUE;
}
}
$arLoadProductArray = Array(
"MODIFIED_BY" => $USER->GetID(),
"IBLOCK_SECTION" => $GROUPS_ID,
"IBLOCK_ID" => $IBLOCK_ID,
"NAME" => $PRODUCT_NAME,
"XML_ID" => $PRODUCT_XML_ID,
"TMP_ID" => $tmpid,
"PROPERTY_VALUES" => $PROP
);
if ($boolTranslitElement)
$arLoadProductArray['CODE'] = CUtil::translit($PRODUCT_NAME, 'ru', $arTranslitElement);
$res = CIBlockElement::GetList(array(), Array("IBLOCK_ID"=>$IBLOCK_ID, "XML_ID"=>$PRODUCT_XML_ID));
$bNewRecord_tmp = False;
if ($arr = $res->Fetch())
{
$PRODUCT_ID = $arr["ID"];
示例15: unset
unset($arGroupsTmp[$i]["DETAIL_PICTURE"]);
}
}
$res = CIBlockSection::GetList(array(), $arFilter);
if ($arr = $res->Fetch()) {
$LAST_GROUP_CODE = $arr["ID"];
$res = $bs->Update($LAST_GROUP_CODE, $arGroupsTmp[$i], true, true, 'Y' === $IMAGE_RESIZE);
} else {
$arGroupsTmp[$i]["IBLOCK_ID"] = $IBLOCK_ID;
if ($arGroupsTmp[$i]["ACTIVE"] != "N") {
$arGroupsTmp[$i]["ACTIVE"] = "Y";
}
$LAST_GROUP_CODE = $bs->Add($arGroupsTmp[$i], true, true, 'Y' === $IMAGE_RESIZE);
}
}
$arLoadProductArray = array("MODIFIED_BY" => $USER->GetID(), "IBLOCK_ID" => $IBLOCK_ID, "TMP_ID" => $tmpid);
foreach ($arAvailProdFields_names as $key => $value) {
$ind = -1;
for ($i_tmp = 0; $i_tmp < $NUM_FIELDS; $i_tmp++) {
if (${"field_" . $i_tmp} == $key) {
$ind = $i_tmp;
break;
}
}
if ($ind > -1) {
$arLoadProductArray[$value["field"]] = Trim($arRes[$ind]);
}
}
$arFilter = array("IBLOCK_ID" => $IBLOCK_ID);
if (strlen($arLoadProductArray["XML_ID"]) > 0) {
$arFilter["=XML_ID"] = $arLoadProductArray["XML_ID"];