4use Bitrix\Im\V2\Entity\User\UserCollection;
16 $pagination = isset(
$options[
'LIST'])?
true:
false;
18 $limit = isset(
$options[
'LIST'][
'LIMIT'])? intval(
$options[
'LIST'][
'LIMIT']): 50;
19 $offset = isset(
$options[
'LIST'][
'OFFSET'])? intval(
$options[
'LIST'][
'OFFSET']): 0;
25 foreach ($managers as $departmentId => $users)
27 foreach ($users as
$uid)
37 foreach ($employees as $departmentId => $users)
39 foreach ($users as
$uid)
52 foreach ($managers as $departmentId => $users)
54 foreach ($users as
$uid)
66 $list = array_slice($list, $offset, $limit);
68 $jsonOption =
$options[
'JSON'] ??
null;
69 $userDataOption =
$options[
'USER_DATA'] ??
null;
71 if ($userDataOption ===
'Y')
81 if ($jsonOption ===
'Y')
99 $departments =
$user->getDepartments()->getIds();
101 if (empty($departments))
108 foreach ($employees as $employee)
123 $userCollection->fillOnlineData();
128 $getOptions[
'JSON'] =
'Y';
131 foreach ($userCollection as
$user)
133 $users[] =
$user->getArray($getOptions);
147 $jsonOption =
$options[
'JSON'] ??
null;
148 $userDataOption =
$options[
'USER_DATA'] ??
null;
153 foreach ($list as
$key => $department)
155 if ((
int)$department[
'MANAGER_USER_ID'] !==
$userId)
159 if ($userDataOption ===
'Y')
162 $department[
'MANAGER_USER_DATA'] = $jsonOption ===
'Y'? $userData->getArray(Array(
'JSON' =>
'Y')): $userData;
165 $result[
$key] = $jsonOption ===
'Y'? array_change_key_case($department, CASE_LOWER): $department;
168 if ($jsonOption ===
'Y')
180 if (isset(
$options[
'FILTER'][
'ID']))
182 foreach ($list as
$key => $department)
184 if (!in_array($department[
'ID'],
$options[
'FILTER'][
'ID']))
191 $pagination = isset(
$options[
'LIST'])?
true:
false;
193 $limit = isset(
$options[
'LIST'][
'LIMIT'])? intval(
$options[
'LIST'][
'LIMIT']): 50;
194 $offset = isset(
$options[
'LIST'][
'OFFSET'])? intval(
$options[
'LIST'][
'OFFSET']): 0;
196 if (isset(
$options[
'FILTER'][
'SEARCH']) && mb_strlen(
$options[
'FILTER'][
'SEARCH']) > 1)
199 $breakAfterDigit = $offset === 0? $offset:
false;
202 foreach ($list as
$key => $department)
204 $checkField = mb_strtolower($department[
'FULL_NAME']);
206 mb_strpos($checkField,
$options[
'FILTER'][
'SEARCH']) !== 0
207 && mb_strpos($checkField,
' '.
$options[
'FILTER'][
'SEARCH']) ===
false
212 if ($breakAfterDigit !==
false)
215 if (
$count === $breakAfterDigit)
225 $list = array_slice($list, $offset, $limit);
231 $list = array_values($list);
233 foreach ($list as
$key => $department)
238 $department[
'MANAGER_USER_DATA'] =
$options[
'JSON'] ==
'Y'? $userData->getArray(Array(
'JSON' =>
'Y')): $userData;
241 $list[
$key] =
$options[
'JSON'] ==
'Y'? array_change_key_case($department, CASE_LOWER): $department;
247 $list = $pagination? Array(
'total' =>
$count,
'result' => $list): $list;
251 $list = $pagination? Array(
'TOTAL' =>
$count,
'RESULT' => $list): $list;
261 $userOptions = Array();
262 $jsonOption =
$options[
'JSON'] ??
null;
263 $userDataOption =
$options[
'USER_DATA'] ??
null;
267 $userOptions[
'JSON'] =
'Y';
271 foreach ($list as $department)
273 if ($department[
'MANAGER_USER_ID'] <= 0)
276 if (is_array($ids) && !in_array($department[
'ID'], $ids))
279 if ($userDataOption ===
'Y')
285 $managers[$department[
'ID']][] = $department[
'MANAGER_USER_ID'];
294 if (!\
Bitrix\
Main\Loader::includeModule(
'intranet'))
299 $structure = \CIntranetUtils::GetStructure();
300 if (!$structure || !isset($structure[
'DATA']))
306 foreach ($structure[
'DATA'] as $department)
308 if (is_array($ids) && !in_array($department[
'ID'], $ids))
311 if (!is_array($department[
'EMPLOYEES']))
313 $result[$department[
'ID']] = Array();
317 foreach ($department[
'EMPLOYEES'] as
$key => $value)
319 $department[
'EMPLOYEES'][
$key] = (int)$value;
322 $result[$department[
'ID']] = $department[
'EMPLOYEES'];
332 $userOptions = Array();
334 $jsonOption =
$options[
'JSON'] ??
null;
335 $userDataOption =
$options[
'USER_DATA'] ??
null;
339 $userOptions[
'JSON'] =
'Y';
342 $employees = Array();
343 foreach ($list as $departmentId => $users)
345 if (is_array($ids) && !in_array($departmentId, $ids))
348 foreach ($users as $employeeId)
350 if ($userDataOption ===
'Y')
356 $employees[$departmentId][] = $employeeId;
if(!is_object($USER)||! $USER->IsAuthorized()) $userId
static getUserId($userId=null)
static getColleagues($userId=null, $options=array())
static getUsersData(array $userList, bool $jsonOption=true)
static getColleaguesSimple(\Bitrix\Im\V2\Entity\User\User $user, int $limit=50,)
static getStructure($options=array())
static getEmployeesList($ids=null, $options=array())
static getEmployees($ids=null, $options=array())
static getDepartmentYouManage($userId=null, $options=array())
static getManagers($ids=null, $options=array())
static getList(?array $ids=null)
static getInstance($userId=null)
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
if(empty($signedUserToken)) $key
</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."%"