Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
bot.php
1
<?php
2
namespace
Bitrix\Im\Update
;
3
4
class
Bot
5
{
6
public
static
function
removeDepartmentLinkAgent
()
7
{
8
if
(!\
Bitrix
\Main\
ModuleManager::isModuleInstalled
(
'intranet'
))
9
{
10
return
""
;
11
}
12
13
$result = \Bitrix\Main\UserTable::getList([
14
'select'
=> [
'ID'
],
15
'filter'
=> [
16
'=EXTERNAL_AUTH_ID'
=> \
Bitrix
\Im\Bot::EXTERNAL_AUTH_ID,
17
'!UF_DEPARTMENT'
=>
false
18
]
19
]);
20
21
$user = new \CUser;
22
while
($row = $result->fetch())
23
{
24
$user->Update($row[
'ID'
], [
'UF_DEPARTMENT'
=> []]);
25
}
26
27
$departmentId = \Bitrix\Im\Bot\Department::getId(
true
);
28
if
($departmentId && \CModule::IncludeModule(
'iblock'
))
29
{
30
\CIBlockSection::Delete($departmentId);
31
}
32
33
return
""
;
34
}
35
}
Bitrix\Im\Bot
Definition
bot.php:11
Bitrix\Im\Update\Bot\removeDepartmentLinkAgent
static removeDepartmentLinkAgent()
Definition
bot.php:6
Bitrix\Main\ModuleManager\isModuleInstalled
static isModuleInstalled($moduleName)
Definition
modulemanager.php:67
Bitrix\Im\Update
Definition
bot.php:2
Bitrix
modules
im
lib
update
bot.php
Создано системой
1.10.0