2namespace Bitrix\Landing\Chat;
4use \Bitrix\Landing\Manager;
5use \Bitrix\Landing\File;
7use \Bitrix\Main\Localization\Loc;
9Loc::loadMessages(__FILE__);
29 $avatarId = (int)$avatar[
'ID'];
47 if (array_key_exists(
'CHAT_ID',
$fields))
51 if (array_key_exists(
'AVATAR',
$fields))
67 $chat = new \CIMChat(0);
68 $chatId = $chat->add([
71 'AVATAR_ID' => $avatarId,
73 'ENTITY_TYPE' =>
'LANDING'
78 \CIMChat::addMessage([
81 'TO_CHAT_ID' => $chatId,
82 'MESSAGE' => Loc::getMessage(
'LANDING_CHAT_WELCOME_CREATE_MESSAGE'),
89 \CIMChat::SetChatParams($chatId, [
108 return parent::getList(
$params);
120 if (!array_key_exists($id, $chats))
127 $chats[$id] =
$res->fetch();
145 $result = new \Bitrix\Main\Result;
148 Loc::getMessage(
'LANDING_CHAT_ERROR_CHAT_UPDATE'),
160 $chat = new \CIMChat(0);
164 $chatRow[
'TITLE'] !=
$fields[
'TITLE']
176 $chatRow[
'AVATAR'] !=
$fields[
'AVATAR']
205 if ($chatId && \
Bitrix\
Main\Loader::includeModule(
'im'))
209 foreach ($users as
$user)
211 $ids[] =
$user[
'id'];
223 public static function joinChat(
int $internalId): int
228 if ($chatRow && \
Bitrix\
Main\Loader::includeModule(
'im'))
230 $chatId = $chatRow[
'CHAT_ID'];
233 if (!in_array(
$userId, $users))
235 $chat = new \CIMChat(0);
236 $chat->addUser($chatId, [
$userId],
false);
if(!is_object($USER)||! $USER->IsAuthorized()) $userId
static getUsers($chatId, $options=[])
static getList($params=[])
static getMembersId(int $chatId)
static joinChat(int $internalId)
static getAvatarId($avatarId)
static update($id, $fields=[])
static deletePhysical(int $fileId)
static getFileArray($fileId)
static releaseFile(int $fileId)
</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']