本文整理汇总了PHP中CSocNetGroup::SetLastActivity方法的典型用法代码示例。如果您正苦于以下问题:PHP CSocNetGroup::SetLastActivity方法的具体用法?PHP CSocNetGroup::SetLastActivity怎么用?PHP CSocNetGroup::SetLastActivity使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSocNetGroup
的用法示例。
在下文中一共展示了CSocNetGroup::SetLastActivity方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
CSocNetLogRights::DeleteByLogID($arRes["ID"]);
CSocNetLogRights::Add($arRes["ID"], $socnetPerms, true);
if (count(array_diff($arLogSitesNew, $arLogSites)) > 0) {
CSocNetLog::Update($arRes["ID"], array("ENTITY_TYPE" => $arRes["ENTITY_TYPE"], "SITE_ID" => $arLogSitesNew, "=LOG_UPDATE" => $DB->CurrentTimeFunction()));
} else {
CSocNetLog::Update($arRes["ID"], array("=LOG_UPDATE" => $DB->CurrentTimeFunction()));
}
/* subscribe share author */
CSocNetLogFollow::Set($user_id, "L" . $arRes["ID"], "Y", ConvertTimeStamp(time() + CTimeZone::GetOffset(), "FULL"));
}
/* update socnet groupd activity*/
foreach ($arNewRights as $v) {
if (substr($v, 0, 2) == "SG") {
$group_id_tmp = substr($v, 2);
if (IntVal($group_id_tmp) > 0) {
CSocNetGroup::SetLastActivity(IntVal($group_id_tmp));
}
}
}
\Bitrix\Main\FinderDestTable::merge(array("CONTEXT" => "blog_post", "CODE" => \Bitrix\Main\FinderDestTable::convertRights($arNewRights)));
}
}
die;
}
/* end share */
if (!$arResult["bFromList"]) {
$strTitle = $arPost["MICRO"] != "Y" ? $arPost["TITLE"] : TruncateText(blogTextParser::killAllTags($arPost["DETAIL_TEXT"]), 100);
if (IsModuleInstalled("intranet")) {
$APPLICATION->SetPageProperty("title", $strTitle);
} else {
$APPLICATION->SetTitle($strTitle);
示例2: preg_replace
$CWiki->deleteImage($_imgID, $arResult['ELEMENT']['ID'], $arParams['IBLOCK_ID']);
$arFields['DETAIL_TEXT'] = preg_replace('/\\[?\\[(:)?(File|' . GetMessage('FILE_NAME') . '):(' . $_imgID . '|' . preg_quote($arFile['ORIGINAL_NAME'], '/') . ')\\]\\]?/iU' . BX_UTF_PCRE_MODIFIER, '', $arFields['DETAIL_TEXT']);
}
}
}
$CWikiParser = new CWikiParser();
$CWiki->Update($arParams['ELEMENT_ID'], $arFields);
//we should not post content of wiki page to feed if it redirects to another page
if (preg_match("/^\\#(REDIRECT|" . GetMessage('WIKI_REDIRECT') . ")\\s*\\[\\[(.*)\\]\\]/iU" . BX_UTF_PCRE_MODIFIER, $arFields['DETAIL_TEXT'])) {
$bPageRedirect = true;
} else {
$bPageRedirect = false;
}
if (CWikiSocnet::IsSocNet() && $arResult['POST_TO_FEED'] == "Y" && !$bPageRedirect) {
if (strlen($arParams['SOCNET_GROUP_ID']) > 0) {
CSocNetGroup::SetLastActivity(intval($arParams['SOCNET_GROUP_ID']));
}
$postUrl = str_replace(array('#group_id#', '#wiki_name#'), array(intval($arParams['SOCNET_GROUP_ID']), urlencode($arFields['NAME'])), $arParams['~PATH_TO_POST']);
$arCurImages = array();
$rsProperties = CIBlockElement::GetProperty($arParams['IBLOCK_ID'], $arParams['ELEMENT_ID'], 'value_id', 'asc', array('ACTIVE' => 'Y', 'CODE' => 'IMAGES'));
while ($arProperty = $rsProperties->Fetch()) {
if ($arProperty['CODE'] == 'IMAGES') {
$arCurImages[] = $arProperty['VALUE'];
}
}
$text4message = $CWikiParser->Parse($arFields['DETAIL_TEXT'], $arFields['DETAIL_TEXT_TYPE'], $arCurImages);
$text4message = CWikiSocnet::PrepareTextForFeed($text4message);
$text4message = $CWikiParser->Clear($text4message);
//while CSocNetTextParser::closetags closes <br> by </br> must be corrected soon. Then remove this.
$text4message = preg_replace("/<\\s*br\\s*>/ismU", "<br />", $text4message);
$bNew = true;
示例3: PostIntoBuzzAsBlog
//.........这里部分代码省略.........
// $DATE_PUBLISH = $_POST["DATE_PUBLISH_DEF"];
// elseif (strlen($_POST["DATE_PUBLISH"])<=0)
$DATE_PUBLISH = ConvertTimeStamp(time() + CTimeZone::GetOffset(), "FULL");
// else
// $DATE_PUBLISH = $_POST["DATE_PUBLISH"];
$arFields = array("DETAIL_TEXT" => $userTwit['text'], "DETAIL_TEXT_TYPE" => "text", "DATE_PUBLISH" => $DATE_PUBLISH, "PUBLISH_STATUS" => BLOG_PUBLISH_STATUS_PUBLISH, "PATH" => CComponentEngine::MakePathFromTemplate(htmlspecialcharsBack($arParams["PATH_TO_POST"]), array("post_id" => "#post_id#", "user_id" => $arBlog["OWNER_ID"])), "URL" => $arBlog["URL"], "SOURCE_TYPE" => "twitter");
$arFields["PERMS_POST"] = array();
$arFields["PERMS_COMMENT"] = array();
$arFields["MICRO"] = "N";
if (strlen($arFields["TITLE"]) <= 0) {
$arFields["MICRO"] = "Y";
$arFields["TITLE"] = trim(blogTextParser::killAllTags($arFields["DETAIL_TEXT"]));
if (strlen($arFields["TITLE"]) <= 0) {
$arFields["TITLE"] = GetMessage("BLOG_EMPTY_TITLE_PLACEHOLDER");
}
}
$arFields["SOCNET_RIGHTS"] = array();
if (!empty($userTwit['user_perms'])) {
$bOne = true;
foreach ($userTwit['user_perms'] as $v => $k) {
if (strlen($v) > 0 && is_array($k) && !empty($k)) {
foreach ($k as $vv) {
if (strlen($vv) > 0) {
$arFields["SOCNET_RIGHTS"][] = $vv;
if ($v != "SG") {
$bOne = false;
}
}
}
}
}
if ($bOne && !empty($userTwit['user_perms']["SG"])) {
$bOnesg = false;
$bFirst = true;
$oGrId = 0;
foreach ($userTwit['user_perms']["SG"] as $v) {
if (strlen($v) > 0) {
if ($bFirst) {
$bOnesg = true;
$bFirst = false;
$v = str_replace("SG", "", $v);
$oGrId = IntVal($v);
} else {
$bOnesg = false;
}
}
}
if ($bOnesg) {
if (!CSocNetFeaturesPerms::CanPerformOperation($arParams["USER_ID"], SONET_ENTITY_GROUP, $oGrId, "blog", "write_post") && !CSocNetFeaturesPerms::CanPerformOperation($arParams["USER_ID"], SONET_ENTITY_GROUP, $oGrId, "blog", "moderate_post") && !CSocNetFeaturesPerms::CanPerformOperation($arParams["USER_ID"], SONET_ENTITY_GROUP, $oGrId, "blog", "full_post")) {
$arFields["PUBLISH_STATUS"] = BLOG_PUBLISH_STATUS_READY;
}
}
}
}
$bError = false;
/* if (CModule::IncludeModule('extranet') && !CExtranet::IsIntranetUser())
{
if(empty($arFields["SOCNET_RIGHTS"]) || in_array("UA", $arFields["SOCNET_RIGHTS"]))
{
$bError = true;
$arResult["ERROR_MESSAGE"] = GetMessage("BLOG_BPE_EXTRANET_ERROR");
}
}*/
if (!$bError) {
preg_match_all("/\\[user\\s*=\\s*([^\\]]*)\\](.+?)\\[\\/user\\]/ies" . BX_UTF_PCRE_MODIFIER, $userTwit['text'], $arMention);
$arFields["=DATE_CREATE"] = $DB->GetNowFunction();
$arFields["AUTHOR_ID"] = $arParams["USER_ID"];
$arFields["BLOG_ID"] = $arBlog["ID"];
$newID = CBlogPost::Add($arFields);
$socnetRightsOld = array("U" => array());
$bAdd = true;
$bNeedMail = false;
if ($newID) {
$arFields["ID"] = $newID;
$arParamsNotify = array("bSoNet" => true, "UserID" => $arParams["USER_ID"], "allowVideo" => $arResult["allowVideo"], "PATH_TO_SMILE" => $arParams["PATH_TO_SMILE"], "PATH_TO_POST" => $arParams["PATH_TO_POST"], "SOCNET_GROUP_ID" => $arParams["GROUP_ID"], "user_id" => $arParams["USER_ID"], "NAME_TEMPLATE" => $arParams["NAME_TEMPLATE"], "SHOW_LOGIN" => $arParams["SHOW_LOGIN"]);
CBlogPost::Notify($arFields, $arBlog, $arParamsNotify);
}
}
if ($newID > 0 && strlen($arResult["ERROR_MESSAGE"]) <= 0 && $arFields["PUBLISH_STATUS"] == BLOG_PUBLISH_STATUS_PUBLISH) {
BXClearCache(true, "/" . SITE_ID . "/blog/last_messages_list/");
$arFieldsIM = array("TYPE" => "POST", "TITLE" => $arFields["TITLE"], "URL" => CComponentEngine::MakePathFromTemplate(htmlspecialcharsBack($arParams["PATH_TO_POST"]), array("post_id" => $newID, "user_id" => $arBlog["OWNER_ID"])), "ID" => $newID, "FROM_USER_ID" => $arParams["USER_ID"], "TO_USER_ID" => array(), "TO_SOCNET_RIGHTS" => $arFields["SOCNET_RIGHTS"], "TO_SOCNET_RIGHTS_OLD" => $socnetRightsOld["U"]);
if (!empty($arMentionOld)) {
$arFieldsIM["MENTION_ID_OLD"] = $arMentionOld[1];
}
if (!empty($arMention)) {
$arFieldsIM["MENTION_ID"] = $arMention[1];
}
CBlogPost::NotifyIm($arFieldsIM);
$arParams["ID"] = $newID;
if (!empty($_POST["SPERM"]["SG"])) {
foreach ($_POST["SPERM"]["SG"] as $v) {
$group_id_tmp = substr($v, 2);
if (IntVal($group_id_tmp) > 0) {
CSocNetGroup::SetLastActivity(IntVal($group_id_tmp));
}
}
}
}
}
}
示例4: substr
if ($arParams['AUTOSAVE']) {
$arParams['AUTOSAVE']->Reset();
}
/************** Socialnetwork notification *************************/
$workgroups_path = "";
if ($arParams["MODE"] == "GROUP" && IsModuleInstalled("extranet")) {
$workgroups_path = COption::GetOptionString("socialnetwork", "workgroups_page", false, SITE_ID);
$workgroups_path = "#GROUPS_PATH#" . substr($arParams["~URL_TEMPLATES_MESSAGE"], strlen($workgroups_path), strlen($arParams["~URL_TEMPLATES_MESSAGE"]) - strlen($workgroups_path));
}
$arSonetFields = array("ENTITY_TYPE" => $arParams["MODE"] == "GROUP" ? SONET_ENTITY_GROUP : SONET_ENTITY_USER, "ENTITY_ID" => $arParams["MODE"] == "GROUP" ? $arParams["SOCNET_GROUP_ID"] : $arParams["USER_ID"], "EVENT_ID" => "forum", "=LOG_DATE" => $GLOBALS["DB"]->CurrentTimeFunction(), "TITLE_TEMPLATE" => str_replace("#AUTHOR_NAME#", $arResult["MESSAGE"]["AUTHOR_NAME"], GetMessage("SONET_FORUM_LOG_TEMPLATE")), "TITLE" => $arFieldsG["TITLE"], "MESSAGE" => $sText, "TEXT_MESSAGE" => $parser->convert4mail($sText), "URL" => $sURL, "PARAMS" => serialize(array("PATH_TO_MESSAGE" => CComponentEngine::MakePathFromTemplate(!empty($workgroups_path) ? $workgroups_path : $arParams["~URL_TEMPLATES_MESSAGE"], array("TID" => $arParams["TID"])), "PARSED" => "N")), "MODULE_ID" => false, "CALLBACK_FUNC" => false, "SOURCE_ID" => $MID1, "RATING_TYPE_ID" => "FORUM_TOPIC", "RATING_ENTITY_ID" => intval($arParams["TID"]));
if (intVal($arResult["MESSAGE"]["AUTHOR_ID"]) > 0) {
$arSonetFields["USER_ID"] = $arResult["MESSAGE"]["AUTHOR_ID"];
}
if ($arParams["MESSAGE_TYPE"] == "NEW") {
if ($arParams["MODE"] == "GROUP") {
CSocNetGroup::SetLastActivity($arParams["SOCNET_GROUP_ID"]);
}
$logID = CSocNetLog::Add($arSonetFields, false);
if (intval($logID) > 0) {
CSocNetLog::Update($logID, array("TMP_ID" => $logID));
CSocNetLogRights::SetForSonet($logID, $arSonetFields["ENTITY_TYPE"], $arSonetFields["ENTITY_ID"], "forum", "view", true);
CSocNetLog::SendEvent($logID, "SONET_NEW_EVENT", $logID);
}
} elseif ($arParams["MESSAGE_TYPE"] == "EDIT") {
$dbRes = CSocNetLog::GetList(array(), array("EVENT_ID" => "forum", "SOURCE_ID" => $MID1), false, false, array("ID"));
if ($arRes = $dbRes->Fetch()) {
// topic
$arSonetFields = array_intersect_key($arSonetFields, array_flip(array("TITLE_TEMPLATE", "TITLE", "MESSAGE", "TEXT_MESSAGE", "PARAMS")));
CSocNetLog::Update($arRes["ID"], $arSonetFields);
CSocNetLogRights::SetForSonet($arRes["ID"], $arParams["MODE"] == "GROUP" ? SONET_ENTITY_GROUP : SONET_ENTITY_USER, $arParams["MODE"] == "GROUP" ? $arParams["SOCNET_GROUP_ID"] : $arParams["USER_ID"], "forum", "view");
} else {
示例5: Request
//.........这里部分代码省略.........
$Params['allowVideoMeeting'] = $this->allowVideoMeeting;
$Params['VMiblockId'] = $this->VMiblockId;
$check = CEventCalendar::CheckVR($Params);
} else {
$Params['allowResMeeting'] = $this->allowResMeeting;
$Params['RMiblockId'] = $this->RMiblockId;
$Params['mrid'] = $loc_new['mrid'];
$Params['mrevid_old'] = $loc_old ? $loc_old['mrevid'] : 0;
$check = CEventCalendar::CheckMR($Params);
}
?>
<script>window._bx_result = <?php
echo $check === true ? 'true' : '"' . $check . '"';
?>
</script><?php
break;
case 'connections_edit':
if ($this->bReadOnly || $this->ownerType != 'USER') {
return $this->ThrowError(GetMessage('EC_ACCESS_DENIED'));
}
if (CEventCalendar::IsCalDAVEnabled()) {
$i = 0;
$l = count($_POST['connections']);
for ($i = 0; $i < $l; $i++) {
$con = $_POST['connections'][$i];
if ($con['id'] <= 0) {
if ($con['del'] == 'Y') {
continue;
}
if (!CEventCalendar::CheckCalDavUrl($con['link'], $con['user_name'], $con['pass'])) {
return CEventCalendar::ThrowError(GetMessage("EC_CALDAV_URL_ERROR"));
}
$id = CDavConnection::Add(array("ENTITY_TYPE" => 'user', "ENTITY_ID" => $this->ownerId, "ACCOUNT_TYPE" => 'caldav', "NAME" => $con['name'], "SERVER" => $con['link'], "SERVER_USERNAME" => $con['user_name'], "SERVER_PASSWORD" => $con['pass']));
} elseif ($con['del'] != 'Y') {
$arFields = array("NAME" => $con['name'], "SERVER" => $con['link'], "SERVER_USERNAME" => $con['user_name']);
// TODO
//if (!CEventCalendar::CheckCalDavUrl($con['link'], $con['user_name'], $con['pass']))
// return CEventCalendar::ThrowError(GetMessage("EC_CALDAV_URL_ERROR", Array('#CALDAV_URL#' => $con['link'])));
if ($con['pass'] !== 'bxec_not_modify_pass') {
$arFields["SERVER_PASSWORD"] = $con['pass'];
}
CDavConnection::Update(intVal($con['id']), $arFields);
} else {
CDavConnection::Delete(intVal($con['id']));
$db_res = CUserTypeEntity::GetList(array('ID' => 'ASC'), array("ENTITY_ID" => "IBLOCK_" . $this->iblockId . "_SECTION", "FIELD_NAME" => "UF_BXDAVEX_CDAV_COL"));
if ($db_res && ($r = $db_res->GetNext())) {
$arSelectFields = array("IBLOCK_ID", "ID", "IBLOCK_SECTION_ID", "UF_BXDAVEX_CDAV_COL");
$rsData = CIBlockSection::GetList(array('ID' => 'ASC'), array("IBLOCK_ID" => $this->iblockId, "CHECK_PERMISSIONS" => 'N', "UF_BXDAVEX_CDAV_COL" => intVal($con['id']), "CREATED_BY" => $this->ownerId, "SECTION_ID" => $this->GetSectionIDByOwnerId($this->ownerId, 'USER', $this->iblockId)), false, $arSelectFields);
while ($arRes = $rsData->Fetch()) {
if ($con['del_calendars'] == 'Y') {
CIBlockSection::Delete($arRes['ID']);
} else {
$GLOBALS["USER_FIELD_MANAGER"]->Update("IBLOCK_" . $this->iblockId . "_SECTION", $arRes['ID'], array("UF_BXDAVEX_CDAV_COL" => ""));
}
}
}
}
}
if ($err = $APPLICATION->GetException()) {
CEventCalendar::ThrowError($err->GetString());
} else {
// Manually synchronize calendars
CDavGroupdavClientCalendar::DataSync("user", $this->ownerId);
// Clear cache
$this->ClearCache($this->cachePath . $this->iblockId . "/calendars/" . ($this->bOwner ? $this->ownerId : 0) . "/");
$this->ClearCache($this->cachePath . 'events/' . $this->iblockId . '/');
if ($this->ownerType == 'GROUP') {
$this->ClearCache($this->cachePath . 'sp_groups/');
} elseif ($this->ownerType == 'USER') {
$this->ClearCache($this->cachePath . 'sp_user/');
} else {
$this->ClearCache($this->cachePath . 'sp_common/');
}
}
}
break;
case 'exchange_sync':
if ($this->ownerType == 'USER' && CEventCalendar::IsExchangeEnabled()) {
$error = "";
$res = CDavExchangeCalendar::DoDataSync($this->ownerId, $error);
if ($res === true) {
?>
<script>window._bx_result_sync = true;</script>
<?php
} elseif ($res === false) {
?>
<script>window._bx_result_sync = false;</script>
<?php
} else {
CEventCalendar::ThrowError($error);
}
}
break;
}
if ($this->ownerType == 'GROUP' && $action != 'load_events' && class_exists('CSocNetGroup')) {
CSocNetGroup::SetLastActivity($this->ownerId);
}
}
return true;
}
示例6: CList
if ($arIBlock) {
$res = $ob->Update($arIBlock["ID"], $arFields);
if ($res) {
$res = $arIBlock["ID"];
}
} else {
$res = $ob->Add($arFields);
if ($res) {
$obList = new CList($res);
$obList->AddField(array("SORT" => 10, "NAME" => GetMessage("CC_BLLE_NAME_FIELD"), "IS_REQUIRED" => "Y", "MULTIPLE" => "N", "TYPE" => "NAME", "DEFAULT_VALUE" => ""));
$obList->Save();
}
}
if ($res) {
if (strlen($arFields["SOCNET_GROUP_ID"]) > 0 && CModule::IncludeModule('socialnetwork')) {
CSocNetGroup::SetLastActivity($arFields["SOCNET_GROUP_ID"]);
}
//Clear components cache
$CACHE_MANAGER->ClearByTag("lists_list_" . $res);
$CACHE_MANAGER->ClearByTag("lists_list_any");
$CACHE_MANAGER->CleanDir("menu");
$tab_name = $arResult["FORM_ID"] . "_active_tab";
//And go to proper page
if (isset($_POST["save"])) {
LocalRedirect($arResult["LISTS_URL"]);
} elseif ($arIBlock) {
LocalRedirect(CHTTP::urlAddParams($arResult["LIST_EDIT_URL"], array($tab_name => $_POST[$tab_name]), array("skip_empty" => true, "encode" => true)));
} else {
LocalRedirect(CHTTP::urlAddParams(str_replace(array("#list_id#", "#group_id#"), array($res, $arParams["SOCNET_GROUP_ID"]), $arParams["LIST_EDIT_URL"]), array($tab_name => $_POST[$tab_name]), array("skip_empty" => true, "encode" => true)));
}
} else {
示例7: Add
//.........这里部分代码省略.........
$this->_errors[] = $msg;
}
}
} else {
$this->_errors[] = array('text' => $e->getString(), 'id' => 'unknown');
}
}
if (empty($this->_errors)) {
$this->_errors[] = array("text" => GetMessage("TASKS_UNKNOWN_ADD_ERROR"), "id" => "ERROR_UNKNOWN_ADD_TASK_ERROR");
}
return false;
}
}
$oTaskList = CTaskCountersProcessor::getInstance();
$oTaskList->onBeforeTaskAdd($arFields, $effectiveUserId);
$ID = $DB->Add("b_tasks", $arFields, array("DESCRIPTION"), "tasks");
$arFields["ACCOMPLICES"] = (array) $arFields["ACCOMPLICES"];
$arFields["AUDITORS"] = (array) $arFields["AUDITORS"];
if ($ID) {
$rsTask = CTasks::GetByID($ID, false);
if ($arTask = $rsTask->Fetch()) {
CTasks::AddAccomplices($ID, $arFields["ACCOMPLICES"]);
CTasks::AddAuditors($ID, $arFields["AUDITORS"]);
CTasks::AddFiles($ID, $arFields["FILES"], array('USER_ID' => $effectiveUserId, 'CHECK_RIGHTS_ON_FILES' => $bCheckRightsOnFiles));
CTasks::AddTags($ID, $arTask["CREATED_BY"], $arFields["TAGS"], $effectiveUserId);
CTasks::AddPrevious($ID, $arFields["DEPENDS_ON"]);
$USER_FIELD_MANAGER->Update("TASKS_TASK", $ID, $arFields, $effectiveUserId);
$arFields["ID"] = $ID;
CTasks::__updateViewed($ID, $effectiveUserId, $onTaskAdd = true);
CTaskCountersProcessor::onAfterTaskAdd($arFields, $effectiveUserId);
CTaskComments::onAfterTaskAdd($ID, $arFields);
$occurAsUserId = CTasksTools::getOccurAsUserId();
if (!$occurAsUserId) {
$occurAsUserId = $effectiveUserId ? $effectiveUserId : 1;
}
CTaskNotifications::SendAddMessage(array_merge($arFields, array('CHANGED_BY' => $occurAsUserId)), array('SPAWNED_BY_AGENT' => $spawnedByAgent));
CTaskSync::AddItem($arFields);
// MS Exchange
// changes log
$arLogFields = array("TASK_ID" => $ID, "USER_ID" => $occurAsUserId, "CREATED_DATE" => $nowDateTimeString, "FIELD" => "NEW");
$log = new CTaskLog();
$log->Add($arLogFields);
try {
$lastEventName = '';
foreach (GetModuleEvents('tasks', 'OnTaskAdd', true) as $arEvent) {
$lastEventName = $arEvent['TO_CLASS'] . '::' . $arEvent['TO_METHOD'] . '()';
ExecuteModuleEventEx($arEvent, array($ID, &$arFields));
}
} catch (Exception $e) {
CTaskAssert::logWarning('[0x37eb64ae] exception in module event: ' . $lastEventName);
}
CTasks::Index($arTask, $arFields["TAGS"]);
// search index
// clear cache
if ($arFields["GROUP_ID"]) {
$CACHE_MANAGER->ClearByTag("tasks_group_" . $arFields["GROUP_ID"]);
}
$arParticipants = array_unique(array_merge(array($arFields["CREATED_BY"], $arFields["RESPONSIBLE_ID"]), $arFields["ACCOMPLICES"], $arFields["AUDITORS"]));
foreach ($arParticipants as $userId) {
$CACHE_MANAGER->ClearByTag("tasks_user_" . $userId);
}
// Emit pull event
try {
$arPullRecipients = array();
foreach ($arParticipants as $userId) {
$arPullRecipients[] = (int) $userId;
}
$taskGroupId = 0;
// no group
if (isset($arFields['GROUP_ID']) && $arFields['GROUP_ID'] > 0) {
$taskGroupId = (int) $arFields['GROUP_ID'];
}
$arPullData = array('TASK_ID' => (int) $ID, 'AFTER' => array('GROUP_ID' => $taskGroupId), 'TS' => time(), 'event_GUID' => $eventGUID);
self::EmitPullWithTagPrefix($arPullRecipients, 'TASKS_GENERAL_', 'task_add', $arPullData);
self::EmitPullWithTag($arPullRecipients, 'TASKS_TASK_' . (int) $ID, 'task_add', $arPullData);
} catch (Exception $e) {
$bWasFatalError = true;
$this->_errors[] = 'at line ' . $e->GetLine() . ', ' . $e->GetMessage();
}
if ($arFields['GROUP_ID'] && CModule::IncludeModule("socialnetwork")) {
CSocNetGroup::SetLastActivity($arFields['GROUP_ID']);
}
}
}
if ($bWasFatalError) {
soundex('push&pull: bWasFatalError === true');
}
return $ID;
} else {
$e = $APPLICATION->GetException();
foreach ($e->messages as $msg) {
$this->_errors[] = $msg;
}
}
}
if (empty($this->_errors)) {
$this->_errors[] = array("text" => GetMessage("TASKS_UNKNOWN_ADD_ERROR"), "id" => "ERROR_UNKNOWN_ADD_TASK_ERROR");
}
return false;
}