25 'ITEMS_LAST' =>
array(),
26 'DEST_SORT' =>
array(),
27 'ADDITIONAL_INFO' =>
array()
30 $filterParams =
array(
31 "DEST_CONTEXT" =>
$options[
"context"],
32 "ALLOW_EMAIL_INVITATION" => (isset(
$options[
"allowEmailInvitation"]) &&
$options[
"allowEmailInvitation"] ==
"Y")
37 $filterParams[
"CODE_TYPE"] =
$options[
'contextCode'];
40 $dataAdditional =
array();
41 $destSortData = \CSocNetLogDestination::getDestinationSort($filterParams, $dataAdditional);
42 $result[
"DEST_SORT"] = $destSortData;
44 \CSocNetLogDestination::fillLastDestination(
54 isset(
$options[
"allowSearchEmailUsers"])
55 &&
$options[
"allowSearchEmailUsers"] ==
'Y'
58 isset(
$options[
"allowEmailInvitation"])
59 &&
$options[
"allowEmailInvitation"] ==
'Y'
64 "DATA_ADDITIONAL" => $dataAdditional
74 $lastItems[
'GROUPS'] =
array(
81 ModuleManager::isModuleInstalled(
'intranet')
82 ? Loc::getMessage(
"MPF_DESTINATION_3")
83 : Loc::getMessage(
"MPF_DESTINATION_4")
89 $result[
"ITEMS_LAST"] = $lastItems;
91 if (
$options[
"enableSonetgroups"] !=
'N')
93 $limitReached =
false;
98 $result[
"SONETGROUPS_LIMITED"] = ($limitReached ?
'Y' :
'N');
101 !empty($lastItems[
'SONETGROUPS'])
102 && !empty($sonetGroupsList)
105 $lastSonetGroupsList =
array();
106 foreach ($lastItems[
'SONETGROUPS'] as $value)
108 if (!array_key_exists($value, $sonetGroupsList))
110 $lastSonetGroupsList[] = intval(mb_substr($value, 2));
113 if (!empty($lastSonetGroupsList))
115 $sonetGroupsAdditionalList = \CSocNetLogDestination::getSocnetGroup(
array(
116 'features' =>
array(
"blog",
array(
"premoderate_post",
"moderate_post",
"write_post",
"full_post")),
117 'id' => $lastSonetGroupsList
119 if (!empty($sonetGroupsAdditionalList))
121 $sonetGroupsList = array_merge($sonetGroupsList, $sonetGroupsAdditionalList);
125 $items[
'SONETGROUPS'] = $sonetGroupsList;
130 $result[
'EXTRANET_USER'] =
'Y';
131 $items[
'USERS'] = \CSocNetLogDestination::getExtranetUser();
135 $lastUserList =
array();
136 if(!empty($lastItems[
'USERS']))
138 foreach ($lastItems[
'USERS'] as $value)
140 $lastUserList[] = str_replace(
'U',
'', $value);
144 $result[
'EXTRANET_USER'] =
'N';
145 if (!empty($lastUserList))
147 $items[
'USERS'] = \CSocNetLogDestination::getUsers(
array(
148 'id' => $lastUserList,
149 'CRM_ENTITY' => ModuleManager::isModuleInstalled(
'crm')
153 && in_array(
$options[
'extranetContext'],
array(self::EXTRANET_CONTEXT_INTERNAL, self::EXTRANET_CONTEXT_EXTERNAL))
158 if (isset($value[
"isExtranet"]))
162 $value[
"isExtranet"] ==
'Y'
163 &&
$options[
'extranetContext'] == self::EXTRANET_CONTEXT_INTERNAL
166 $value[
"isExtranet"] ==
'N'
167 &&
$options[
'extranetContext'] == self::EXTRANET_CONTEXT_EXTERNAL
184 isset(
$options[
"allowSearchEmailUsers"])
185 &&
$options[
"allowSearchEmailUsers"] ==
'Y'
188 isset(
$options[
"allowEmailInvitation"])
189 &&
$options[
"allowEmailInvitation"] ==
'Y'
194 \CSocNetLogDestination::fillEmails(
$items);
201 $options[
"enableDepartments"] ==
"Y"
202 && ModuleManager::isModuleInstalled(
'intranet')
206 $structure = \CSocNetLogDestination::getStucture(
array(
"LAZY_LOAD" =>
true));
207 $items[
'DEPARTMENT'] = $structure[
'department'];
208 $items[
'DEPARTMENT_RELATION'] = $structure[
'department_relation'];
217 $lastItems =
array();
221 foreach(
$result[
"ITEMS_LAST"][$group] as
$key => $value)
223 $lastItems[$group][
$key] = ++
$i;
226 $result[
"ITEMS_LAST"] = $lastItems;
233 $itemsSelected =
$params[
'itemsSelected'];
237 'SONETGROUPS' =>
array(),
239 'DEPARTMENTS' =>
array()
242 $sonetGroupIdList = $userIdList = $departmentIdList =
array();
243 foreach ($itemsSelected as
$code => $entityGroup)
245 if ($entityGroup ==
'users')
247 $userIdList[] = str_replace(
'U',
'',
$code);
249 elseif ($entityGroup ==
'sonetgroups')
251 $sonetGroupIdList[] = str_replace(
'SG',
'',
$code);
253 elseif ($entityGroup ==
'department')
255 $departmentIdList[] = str_replace(
'DR',
'',
$code);
259 if (!empty($userIdList))
264 if (!empty($sonetGroupIdList))
269 if (!empty($departmentIdList))
279 $entities[
'GROUPS'] =
array(
283 ModuleManager::isModuleInstalled(
'intranet')
284 ? Loc::getMessage(
"MPF_DESTINATION_3")
285 : Loc::getMessage(
"MPF_DESTINATION_4")
292 $entities[
'GROUPS'] =
array();