function GetForumsList() { $arGroup = array(); $arForum = array(); $db_res = CForumGroup::GetListEx(array(), array("LID" => LANG)); if ($db_res && ($res = $db_res->GetNext())) { do { $arGroup[intVal($res["ID"])] = $res["~NAME"]; } while ($res = $db_res->GetNext()); } $db_res = CForumNew::GetListEx(array("FORUM_GROUP_SORT" => "ASC", "FORUM_GROUP_ID" => "ASC", "SORT" => "ASC", "NAME" => "ASC"), array()); if ($db_res && ($res = $db_res->GetNext())) { do { $arForum[intVal($res["ID"])] = $res["~NAME"]; if (intVal($res["FORUM_GROUP_ID"]) > 0 && array_key_exists($res["FORUM_GROUP_ID"], $arGroup)) { $arForum[intVal($res["ID"])] .= " [" . $arGroup[$res["FORUM_GROUP_ID"]] . "]"; } if ($res["ACTIVE"] != "Y") { $arForum[intVal($res["ID"])] .= " N/A"; } } while ($res = $db_res->GetNext()); } return $arForum; }
} if (!$bSonetError) { foreach ($arGroupsId as $ind => $val) { CSocNetUserToGroup::Add(array("USER_ID" => 1, "GROUP_ID" => $val, "ROLE" => "A", "=DATE_CREATE" => $GLOBALS["DB"]->CurrentTimeFunction(), "=DATE_UPDATE" => $GLOBALS["DB"]->CurrentTimeFunction(), "INITIATED_BY_TYPE" => SONET_INITIATED_BY_USER, "INITIATED_BY_USER_ID" => 1, "MESSAGE" => false)); } foreach ($arGroupsId as $ind => $val) { CSocNetFeatures::Add(array("ENTITY_TYPE" => SONET_ENTITY_GROUP, "ENTITY_ID" => $val, "FEATURE" => "forum", "FEATURE_NAME" => GetSocNetMessageLocal("SONET_I_FEATURE_FORUM", $arSite["LANGUAGE_ID"]), "ACTIVE" => "Y", "=DATE_UPDATE" => $GLOBALS["DB"]->CurrentTimeFunction(), "=DATE_CREATE" => $GLOBALS["DB"]->CurrentTimeFunction())); CSocNetFeatures::Add(array("ENTITY_TYPE" => SONET_ENTITY_GROUP, "ENTITY_ID" => $val, "FEATURE" => "blog", "FEATURE_NAME" => GetSocNetMessageLocal("SONET_I_FEATURE_BLOG", $arSite["LANGUAGE_ID"]), "ACTIVE" => "Y", "=DATE_UPDATE" => $GLOBALS["DB"]->CurrentTimeFunction(), "=DATE_CREATE" => $GLOBALS["DB"]->CurrentTimeFunction())); } } } } // ------------------ FORUM ------------------------------- $forumID = 0; if (CModule::IncludeModule("forum")) { $dbResult = CForumNew::GetListEx(array(), array("SITE_ID" => $arSite["SITE_ID"], "XML_ID" => "car_forum_demo")); if ($arResult = $dbResult->Fetch()) { $forumID = $arResult["ID"]; } else { $arFields = array("NAME" => GetSocNetMessageLocal("SONET_I_FORUM_NAME", $arSite["LANGUAGE_ID"]), "ACTIVE" => "Y", "XML_ID" => "car_forum_demo", "MODERATION" => "N", "SITES" => array($arSite["SITE_ID"] => StrLen($arSite["DIR"]) > 0 ? $arSite["DIR"] : "/")); $forumID = CForumNew::Add($arFields); } } // ------------------ BLOG ------------------------------- $blogGroupID = 0; if (CModule::IncludeModule("blog")) { $dbResult = CBlogGroup::GetList(array("ID" => "ASC"), array("SITE_ID" => $arSite["SITE_ID"])); if ($arResult = $dbResult->Fetch()) { $blogGroupID = $arResult["ID"]; } else { $blogGroupID = CBlogGroup::Add(array("SITE_ID" => $arSite["SITE_ID"], "NAME" => GetSocNetMessageLocal("SONET_I_BLOG_NAME", $arSite["LANGUAGE_ID"])));
<?php /******************************************************************** Topics **************************************!*****************************/ require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_admin_before.php"; require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/forum/include.php"; $forumModulePermissions = $APPLICATION->GetGroupRight("forum"); if ($forumModulePermissions == "D") { $APPLICATION->AuthForm(GetMessage("ACCESS_DENIED")); } IncludeModuleLangFile(__FILE__); require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/forum/prolog.php"; /*******************************************************************/ $db_Forum = CForumNew::GetListEx(array("SORT" => "ASC", "NAME" => "ASC")); $arr = array(); $arr["reference_id"][] = ""; $arr["reference"][] = ""; $arrForum = array(); $arrSelect = ""; while ($dbForum = $db_Forum->Fetch()) { $arrForum[$dbForum["ID"]] = $dbForum["NAME"]; $arrSelect .= "<option value='" . $dbForum["ID"] . "'>" . htmlspecialcharsex($dbForum["NAME"]) . "</option>"; $arr["reference_id"][] = $dbForum["ID"]; $arr["reference"][] = $dbForum["NAME"]; } /*******************************************************************/ $sTableID = "tbl_topic"; $oSort = new CAdminSorting($sTableID, "ID", "asc"); $lAdmin = new CAdminList($sTableID, $oSort); $lAdmin->InitFilter(array("FORUM_ID", "TITLE", "DESCRIPTION", "USER_START_ID", "ACTIVE", "PINNED", "OPENED", "DATE_FROM", "DATE_TO", "CREATE_DATE_FROM", "CREATE_DATE_TO"));
public static function GetSettings($Params = array()) { if (isset(self::$settings) && count(self::$settings) > 0 && $Params['request'] === false) { return self::$settings; } $pathes_for_sites = COption::GetOptionString('calendar', 'pathes_for_sites', true); if ($Params['forseGetSitePathes'] || !$pathes_for_sites) { $pathes = self::GetPathes(); } else { $pathes = array(); } if (!isset($Params['getDefaultForEmpty']) || $Params['getDefaultForEmpty'] !== false) { $Params['getDefaultForEmpty'] = true; } self::$settings = array('work_time_start' => COption::GetOptionString('calendar', 'work_time_start', 9), 'work_time_end' => COption::GetOptionString('calendar', 'work_time_end', 19), 'year_holidays' => COption::GetOptionString('calendar', 'year_holidays', '1.01,2.01,7.01,23.02,8.03,1.05,9.05,12.06,4.11,12.12'), 'year_workdays' => COption::GetOptionString('calendar', 'year_workdays', ''), 'week_holidays' => explode('|', COption::GetOptionString('calendar', 'week_holidays', 'SA|SU')), 'week_start' => COption::GetOptionString('calendar', 'week_start', 'MO'), 'user_name_template' => self::GetUserNameTemplate($Params['getDefaultForEmpty']), 'user_show_login' => COption::GetOptionString('calendar', 'user_show_login', true), 'path_to_user' => COption::GetOptionString('calendar', 'path_to_user', "/company/personal/user/#user_id#/"), 'path_to_user_calendar' => COption::GetOptionString('calendar', 'path_to_user_calendar', "/company/personal/user/#user_id#/calendar/"), 'path_to_group' => COption::GetOptionString('calendar', 'path_to_group', "/workgroups/group/#group_id#/"), 'path_to_group_calendar' => COption::GetOptionString('calendar', 'path_to_group_calendar', "/workgroups/group/#group_id#/calendar/"), 'path_to_vr' => COption::GetOptionString('calendar', 'path_to_vr', ""), 'path_to_rm' => COption::GetOptionString('calendar', 'path_to_rm', ""), 'rm_iblock_type' => COption::GetOptionString('calendar', 'rm_iblock_type', ""), 'rm_iblock_id' => COption::GetOptionString('calendar', 'rm_iblock_id', ""), 'vr_iblock_id' => COption::GetOptionString('calendar', 'vr_iblock_id', ""), 'dep_manager_sub' => COption::GetOptionString('calendar', 'dep_manager_sub', true), 'denied_superpose_types' => unserialize(COption::GetOptionString('calendar', 'denied_superpose_types', serialize(array()))), 'pathes_for_sites' => $pathes_for_sites, 'pathes' => $pathes, 'forum_id' => COption::GetOptionString('calendar', 'forum_id', "")); if (self::$settings['work_time_start'] > 23) { self::$settings['work_time_start'] = 23; } if (self::$settings['work_time_end'] <= self::$settings['work_time_start']) { self::$settings['work_time_end'] = self::$settings['work_time_start'] + 1; } if (self::$settings['work_time_end'] > 23.3) { self::$settings['work_time_end'] = 23.3; } if (self::$settings['forum_id'] == "") { self::$settings['forum_id'] = COption::GetOptionString("tasks", "task_forum_id", ""); if (self::$settings['forum_id'] == "" && CModule::IncludeModule("forum")) { $db = CForumNew::GetListEx(); if ($ar = $db->GetNext()) { self::$settings['forum_id'] = $ar["ID"]; } } COption::SetOptionString("calendar", "forum_id", self::$settings['forum_id']); } return self::$settings; }
} if ($user_id > 0 && ($arParams["ENTITY_TYPE"] != SONET_ENTITY_GROUP || (CSocNetFeaturesPerms::CanPerformOperation($user_id, SONET_ENTITY_GROUP, $arParams["GROUP_ID"], "blog", "full_post", CSocNetUser::IsCurrentUserModuleAdmin()) || $APPLICATION->GetGroupRight("blog") >= "W" || CSocNetFeaturesPerms::CanPerformOperation($user_id, SONET_ENTITY_GROUP, $arParams["GROUP_ID"], "blog", "write_post") || CSocNetFeaturesPerms::CanPerformOperation($user_id, SONET_ENTITY_GROUP, $arParams["GROUP_ID"], "blog", "moderate_post") || CSocNetFeaturesPerms::CanPerformOperation($user_id, SONET_ENTITY_GROUP, $arParams["GROUP_ID"], "blog", "premoderate_post")))) { $arResult["MICROBLOG_USER_ID"] = $user_id; } if (IsModuleInstalled("photogallery")) { if (strlen($arParams["PHOTO_USER_IBLOCK_TYPE"]) <= 0) { $arParams["PHOTO_USER_IBLOCK_TYPE"] = "photos"; } if (intval($arParams["PHOTO_USER_IBLOCK_ID"]) <= 0 && CModule::IncludeModule("iblock")) { $dbRes = CIBlock::GetList(array(), array("SITE_ID" => SITE_ID, "CODE" => "user_photogallery")); if ($arRes = $dbRes->Fetch()) { $arParams["PHOTO_USER_IBLOCK_ID"] = $arRes["ID"]; } } if (intval($arParams["PHOTO_FORUM_ID"]) <= 0 && CModule::IncludeModule("forum")) { $dbRes = CForumNew::GetListEx(array(), array("SITE_ID" => SITE_ID, "XML_ID" => "PHOTOGALLERY_COMMENTS")); if ($arRes = $dbRes->Fetch()) { $arParams["PHOTO_FORUM_ID"] = $arRes["ID"]; } } $arParams["PATH_TO_USER_PHOTO"] = strlen($arParams["PATH_TO_USER_PHOTO"]) > 0 ? $arParams["PATH_TO_USER_PHOTO"] : $folderUsers . "user/#user_id#/photo/"; $arParams["PATH_TO_GROUP_PHOTO"] = strlen($arParams["PATH_TO_GROUP_PHOTO"]) > 0 ? $arParams["PATH_TO_GROUP_PHOTO"] : $folderWorkgroups . "group/#group_id#/photo/"; $arParams["PATH_TO_USER_PHOTO_SECTION"] = strlen($arParams["PATH_TO_USER_PHOTO_SECTION"]) > 0 ? $arParams["PATH_TO_USER_PHOTO_SECTION"] : $folderUsers . "user/#user_id#/photo/album/#section_id#/"; $arParams["PATH_TO_GROUP_PHOTO_SECTION"] = strlen($arParams["PATH_TO_GROUP_PHOTO_SECTION"]) > 0 ? $arParams["PATH_TO_GROUP_PHOTO_SECTION"] : $folderWorkgroups . "group/#group_id#/photo/album/#section_id#/"; $arParams["PATH_TO_USER_PHOTO_ELEMENT"] = strlen($arParams["PATH_TO_USER_PHOTO_ELEMENT"]) > 0 ? $arParams["PATH_TO_USER_PHOTO_ELEMENT"] : $folderUsers . "user/#user_id#/photo/photo/#section_id#/#element_id#/"; $arParams["PATH_TO_GROUP_PHOTO_ELEMENT"] = strlen($arParams["PATH_TO_GROUP_PHOTO_ELEMENT"]) > 0 ? $arParams["PATH_TO_GROUP_PHOTO_ELEMENT"] : $folderWorkgroups . "group/#group_id#/photo/#section_id#/#element_id#/"; } $bCurrentUserIsAdmin = CSocNetUser::IsCurrentUserModuleAdmin(); $arResult["TZ_OFFSET"] = CTimeZone::GetOffset(); CSocNetTools::InitGlobalExtranetArrays(); if ($GLOBALS["USER"]->IsAuthorized() || $arParams["AUTH"] == "Y") {
</b></font></td> </tr> <tr> <td class="forumbody" align="right" width="40%"><font class="forumheadtext"><?php echo GetMessage("FM_MOVE_TOPIC"); ?> </font></td> <td class="forumbody" align="left" width="60%"><font class="forumbodytext"><?php $arFilter = array(); if (!$USER->IsAdmin()) { $arFilter["!ID"] = intVal($FID); $arFilter["PERMS"] = array($USER->GetGroups(), "ALLOW_MOVE_TOPIC"); $arFilter["ACTIVE"] = "Y"; $arFilter["SITE_ID"] = SITE_ID; } $db_Forum = CForumNew::GetListEx(array("NAME" => "ASC"), $arFilter); if ($db_Forum && ($ar_Forum = $db_Forum->Fetch())) { ?> <select name="newFID" class="inputselect"><?php do { if ($FID != $ar_Forum["ID"]) { ?> <option value="<?php echo $ar_Forum["ID"]; ?> " <?php if ($newFID == IntVal($ar_Forum["ID"])) { echo "selected"; } ?> ><?php
$DocsSharedForumID = 0; $dbRes = CForumNew::GetListEx(array(), array("SITE_ID" => WIZARD_SITE_ID, "XML_ID" => "DOCS_SHARED_COMMENTS")); if ($arRes = $dbRes->Fetch()) { $DocsSharedForumID = $arRes["ID"]; } CWizardUtil::ReplaceMacros(WIZARD_SITE_PATH . "/docs/shared/index.php", array("SHARED_FILES_FORUM_ID" => $DocsSharedForumID)); $DocsSalesForumID = 0; $dbRes = CForumNew::GetListEx(array(), array("SITE_ID" => WIZARD_SITE_ID, "XML_ID" => "DOCS_SALES_COMMENTS")); if ($arRes = $dbRes->Fetch()) { $DocsSalesForumID = $arRes["ID"]; } CWizardUtil::ReplaceMacros(WIZARD_SITE_PATH . "/docs/sale/index.php", array("SALE_FILES_FORUM_ID" => $DocsSalesForumID)); $DocsDirectorsForumID = 0; $dbRes = CForumNew::GetListEx(array(), array("SITE_ID" => WIZARD_SITE_ID, "XML_ID" => "DOCS_DIRECTORS_COMMENTS")); if ($arRes = $dbRes->Fetch()) { $DocsDirectorsForumID = $arRes["ID"]; } CWizardUtil::ReplaceMacros(WIZARD_SITE_PATH . "/docs/manage/index.php", array("DIRECTORS_FILES_FORUM_ID" => $DocsDirectorsForumID)); $DocsSocnetCommentsForumID = 0; $dbRes = CForumNew::GetListEx(array(), array("SITE_ID" => WIZARD_SITE_ID, "XML_ID" => "GROUPS_AND_USERS_FILES_COMMENTS")); if ($arRes = $dbRes->Fetch()) { $DocsSocnetCommentsForumID = $arRes["ID"]; } CWizardUtil::ReplaceMacros(WIZARD_SITE_PATH . "/company/personal.php", array("FILES_FORUM_ID" => $DocsSocnetCommentsForumID)); CWizardUtil::ReplaceMacros(WIZARD_SITE_PATH . "/index_b24.php", array("FILES_FORUM_ID" => $DocsSocnetCommentsForumID)); CWizardUtil::ReplaceMacros(WIZARD_SITE_PATH . "/workgroups/index.php", array("FILES_FORUM_ID" => $DocsSocnetCommentsForumID)); if (!WIZARD_IS_RERUN) { $APPLICATION->SetGroupRight("forum", WIZARD_PORTAL_ADMINISTRATION_GROUP, "W"); COption::SetOptionString("forum", "SHOW_VOTES", "N"); COption::SetOptionString("forum", "file_max_size", 10485760); }
<?php if (!$USER->IsAdmin()) { return; } IncludeModuleLangFile(__FILE__); \Bitrix\Main\Loader::includeModule('tasks'); $arDefaultValues = array('paths_task_user' => '/company/personal/user/#user_id#/tasks/', 'paths_task_user_entry' => '/company/personal/user/#user_id#/tasks/task/view/#task_id#/', 'paths_task_user_edit' => '/company/personal/user/#user_id#/tasks/task/edit/#task_id#/', 'paths_task_user_action' => '/company/personal/user/#user_id#/tasks/task/#action#/#task_id#/', 'paths_task_group' => '/workgroups/group/#group_id#/tasks/', 'paths_task_group_entry' => '/workgroups/group/#group_id#/tasks/task/view/#task_id#/', 'paths_task_group_edit' => '/workgroups/group/#group_id#/tasks/task/edit/#task_id#/', 'paths_task_group_action' => '/workgroups/group/#group_id#/tasks/task/#action#/#task_id#/', 'MAX_UPLOAD_FILES_IN_COMMENTS' => 10); $arForums = array(); if (CModule::IncludeModule("forum")) { $db = CForumNew::GetListEx(); while ($ar = $db->GetNext()) { $arForums[$ar["ID"]] = "[" . $ar["ID"] . "] " . $ar["NAME"]; } } $dbSites = CSite::GetList($b = "", $o = "", array("ACTIVE" => "Y")); $arSites = array(); $aSubTabs = array(); while ($site = $dbSites->Fetch()) { $arSites[] = $site; $aSubTabs[] = array("DIV" => "opt_site_" . $site["ID"], "TAB" => "(" . htmlspecialcharsbx($site["ID"]) . ") " . htmlspecialcharsbx($site["NAME"]), 'TITLE' => GetMessage('TASKS_SUBTAB_TITLE_SITE') . ' ' . htmlspecialcharsbx($site["ID"])); } $subTabControl = new CAdminViewTabControl("subTabControl", $aSubTabs); $aTabs = array(array("DIV" => "edit1", "TAB" => GetMessage("TASKS_SETTINGS"), "ICON" => "tasks_settings", "TITLE" => GetMessage("TASKS_SETTINGS_TITLE"))); $tabControl = new CAdminTabControl("tabControl", $aTabs); if ($REQUEST_METHOD == "POST" && strlen($Update . $Apply . $RestoreDefaults) > 0 && check_bitrix_sessid()) { if (strlen($RestoreDefaults) > 0) { COption::RemoveOption("tasks"); COption::SetOptionString("tasks", "task_comment_allow_edit", true); COption::SetOptionString("tasks", "task_comment_allow_remove", true); } else {
$arParams["CACHE_TIME"] = 0; } /******************************************************************** /Input params ********************************************************************/ if (empty($arParams["TYPE_RANGE"])) { ShowError(GetMessage("F_EMPTY_TYPE")); return 0; } else { $arFilter = !empty($arParams["FID_RANGE"]) ? array("@ID" => $arParams["FID_RANGE"]) : array(); $arFilter["LID"] = SITE_ID; if (!CForumUser::IsAdmin()) { $arFilter["PERMS"] = array($USER->GetGroups(), 'A'); } $arFilter["ACTIVE"] = "Y"; $db_res = CForumNew::GetListEx(array("FORUM_GROUP_SORT" => "ASC", "FORUM_GROUP_ID" => "ASC", "SORT" => "ASC", "NAME" => "ASC"), $arFilter, false, 0, array("sNameTemplate" => $arParams["NAME_TEMPLATE"])); if ($db_res && ($res = $db_res->Fetch())) { do { foreach ($res as $key => $val) { $res["~" . $key] = $val; $res[$key] = htmlspecialcharsbx($val); } $res["ALLOW"] = forumTextParser::GetFeatures($res); $res["~FORUM_DESCRIPTION"] = $res["~DESCRIPTION"]; $res["FORUM_DESCRIPTION"] = $res["DESCRIPTION"]; $res["~FORUM_LINK"] = CComponentEngine::MakePathFromTemplate($arParams["~URL_TEMPLATES_LIST"], array("FID" => $res["ID"])); $res["FORUM_LINK"] = CComponentEngine::MakePathFromTemplate($arParams["URL_TEMPLATES_LIST"], array("FID" => $res["ID"])); $res["~URL"] = "http://" . $arResult["SERVER_NAME"] . $res["~FORUM_LINK"]; $res["URL"] = "http://" . htmlspecialcharsEx($arResult["SERVER_NAME"]) . $res["FORUM_LINK"]; $arResult["FORUMS"][$res["ID"]] = $res; } while ($res = $db_res->Fetch());
if (strLen($res["START_DATE"]) > 0) { $res["START_DATE"] = CForumFormat::DateFormat($arParams["DATE_TIME_FORMAT"], MakeTimeStamp($res["START_DATE"], CSite::GetDateFormat())); } $res["SUBSCRIBE_TYPE"] = intVal($res["TOPIC_ID"]) > 0 ? "TOPIC" : ($res["NEW_TOPIC_ONLY"] == "Y" ? "NEW_TOPIC_ONLY" : "ALL_MESSAGES"); $res["LAST_SEND"] = intVal($res["LAST_SEND"]); $res["read"] = CComponentEngine::MakePathFromTemplate($arParams["URL_TEMPLATES_READ"], array("FID" => $res["FORUM_ID"], "TID" => $res["TOPIC_ID"], "TITLE_SEO" => $res["TITLE_SEO"], "MID" => "s")); $res["list"] = CComponentEngine::MakePathFromTemplate($arParams["URL_TEMPLATES_LIST"], array("FID" => $res["FORUM_ID"])); $res["read_last_send"] = CComponentEngine::MakePathFromTemplate($arParams["URL_TEMPLATES_MESSAGE"], array("FID" => $res["FORUM_ID"], "TID" => $res["TOPIC_ID"], "TITLE_SEO" => $res["TITLE_SEO"], "MID" => intVal($res["LAST_SEND"]))) . "#message" . intVal($res["LAST_SEND"]); $res["subscr_delete"] = ForumAddPageParams($arResult["CURRENT_PAGE"], array("SID" => $res["ID"], "ACTION" => "DEL")) . "&" . bitrix_sessid_get(); $res["URL"] = array("TOPIC" => $res["read"], "FORUM" => $res["list"], "LAST_MESSAGE" => $res["read_last_send"], "DELETE" => $res["subscr_delete"]); $arResult["SUBSCRIBE_LIST"][] = $res; } while ($res = $db_res->GetNext()); } if (!empty($arResult["~FORUMS"])) { $arResult["~FORUMS"] = array_unique($arResult["~FORUMS"]); $db_res = CForumNew::GetListEx(array("SORT" => "ASC"), array("@ID" => $arResult["~FORUMS"])); if ($db_res && ($res = $db_res->GetNext())) { do { $arResult["FORUMS"][$res["ID"]] = $res; } while ($res = $db_res->GetNext()); } } if (!empty($arResult["~TOPICS"])) { $arResult["~TOPICS"] = array_unique(array_diff($arResult["~TOPICS"], array(0, ""))); $db_res = CForumTopic::GetListEx(array("SORT" => "ASC"), array("@ID" => $arResult["~TOPICS"])); if ($db_res && ($res = $db_res->GetNext())) { do { $arResult["TOPICS"][$res["ID"]] = $res; } while ($res = $db_res->GetNext()); } }
<tr class="adm-detail-required-field"> <td width="40%"><?php echo Loc::getMessage("SITEMAP_FILENAME_FORUM"); ?> :</td> <td width="60%"><input type="text" name="FILENAME_FORUM" value="<?php echo Converter::getHtmlConverter()->encode($arSitemap['SETTINGS']["FILENAME_FORUM"]); ?> " style="width:70%"></td> </tr> <tr> <td colspan="2" align="center"> <? $dbRes = CForumNew::GetListEx(array("ID" => "ASC"), array('SITE_ID' => $SITE_ID)); $bFound = false; while (!!$dbRes && ($arRes = $dbRes->Fetch())) { if(!$bFound) { ?> <script type="text/javascript"> function setForumActive(check, cont) { var row = check.parentNode.parentNode; if(!check.checked) { row.cells[0].style.textDecoration = 'line-through';
'PROCESSED' => SitemapRuntimeTable::UNPROCESSED, ), 'limit' => 1 )); $currentForum = $dbRes->fetch(); if($currentForum) { $forumId = intval($currentForum['ITEM_ID']); $db_res = CForumNew::GetListEx( array(), array( 'ID' => $forumId, "ACTIVE" => "Y", "SITE_ID" => $arSitemap['SITE_ID'], "!TOPICS" => 0 ) ); $arCurrentForum = $db_res->Fetch(); if(!$arCurrentForum) { SitemapRuntimeTable::update($currentForum['ID'], array( 'PROCESSED' => SitemapRuntimeTable::PROCESSED )); } else { $fileName = str_replace('#FORUM_ID#', $forumId, $arSitemap['SETTINGS']['FILENAME_FORUM']); $sitemapFile = new SitemapRuntime($PID, $fileName, $arSitemapSettings);
} $arGroupID[$xmlID] = CForumGroup::Add($arNewGroup); } $rsUser = CUser::GetByID(1); if ($arUser = $rsUser->Fetch()) { $userName = $arUser["NAME"] . (strlen($arUser["NAME"]) <= 0 || strlen($arUser["LAST_NAME"]) <= 0 ? "" : " ") . $arUser["LAST_NAME"]; $authorName = strlen(trim($userName)) > 0 ? $userName : $arUser["LOGIN"]; } else { $authorName = "admin"; } $arForums = array(array("XML_ID" => "ESHOP_REVIEWS", "NAME" => GetMessage("ESHOP_REVIEWS_FORUM_NAME"), "DESCRIPTION" => GetMessage("ESHOP_REVIEWS_FORUM_DESCRIPTION"), "SORT" => 2, "ACTIVE" => "Y", "ALLOW_HTML" => "N", "ALLOW_ANCHOR" => "Y", "ALLOW_BIU" => "Y", "ALLOW_IMG" => "Y", "ALLOW_LIST" => "Y", "ALLOW_QUOTE" => "Y", "ALLOW_CODE" => "Y", "ALLOW_FONT" => "Y", "ALLOW_SMILES" => "Y", "ALLOW_UPLOAD" => "Y", "ALLOW_NL2BR" => "N", "MODERATION" => "N", "ALLOW_MOVE_TOPIC" => "Y", "ORDER_BY" => "P", "ORDER_DIRECTION" => "DESC", "LID" => LANGUAGE_ID, "PATH2FORUM_MESSAGE" => "", "ALLOW_UPLOAD_EXT" => "", "FORUM_GROUP_ID" => $arGroupID["COMMENTS"], "ASK_GUEST_EMAIL" => "N", "USE_CAPTCHA" => "N", "SITES" => array(WIZARD_SITE_ID => WIZARD_SITE_DIR . "/forum/#FORUM_ID#/#TOPIC_ID#/"), "EVENT1" => "forum", "EVENT2" => "message", "EVENT3" => "", "GROUP_ID" => array("2" => "M"))); foreach ($arForums as $arForum) { $dbForum = CForumNew::GetList(array(), array("SITE_ID" => WIZARD_SITE_ID, "XML_ID" => $arForum["XML_ID"])); if ($dbForum->Fetch()) { continue; } $forumID = CForumNew::Add($arForum); } $reviewsForumID = 0; $dbRes = CForumNew::GetListEx(array(), array("SITE_ID" => WIZARD_SITE_ID, "XML_ID" => "ESHOP_REVIEWS")); if ($arRes = $dbRes->Fetch()) { $reviewsForumID = $arRes["ID"]; } CWizardUtil::ReplaceMacros(WIZARD_SITE_PATH . "/catalog/index.php", array("FORUM_ID" => $reviewsForumID)); /* if (!WIZARD_IS_RERUN) { $APPLICATION->SetGroupRight("forum", WIZARD_PORTAL_ADMINISTRATION_GROUP, "W"); COption::SetOptionString("forum", "SHOW_VOTES", "N"); COption::SetOptionString("forum", "file_max_size", 10485760); } */
} } $fidParameter = rtrim($fidParameter, ","); /************** Forum Replace Data *********************************/ $iForumIDPhoto = 0; $dbRes = CForumNew::GetListEx(array(), array("SITE_ID" => WIZARD_SITE_ID, "XML_ID" => "COMMUNITY_PHOTO_COMMENTS")); if ($arRes = $dbRes->Fetch()) { $iForumIDPhoto = $arRes["ID"]; } $iForumIDForum = 0; $dbRes = CForumNew::GetListEx(array(), array("SITE_ID" => WIZARD_SITE_ID, "XML_ID" => "COMMUNITY_USERS_AND_GROUPS")); if ($arRes = $dbRes->Fetch()) { $iForumIDForum = $arRes["ID"]; } CWizardUtil::ReplaceMacros(WIZARD_SITE_PATH . "/people/user.php", array("PHOTO_FORUM_ID" => $iForumIDPhoto, "PHOTO_USE_COMMENTS" => "Y", "FORUM_ID" => $iForumIDForum)); CWizardUtil::ReplaceMacros(WIZARD_SITE_PATH . "/photo/index.php", array("FORUM_ID" => $iForumIDPhoto)); CWizardUtil::ReplaceMacros(WIZARD_SITE_PATH . "/groups/group.php", array("PHOTO_FORUM_ID" => $iForumIDPhoto, "PHOTO_USE_COMMENTS" => "Y", "FORUM_ID" => $iForumIDForum)); $arForumsID = array(); $dbRes = CForumNew::GetListEx(array(), array("SITE_ID" => WIZARD_SITE_ID, "!FORUM_GROUP_ID" => $arGroupID["HIDDEN"])); if ($arRes = $dbRes->Fetch()) { do { $arForumsID[] = $arRes["ID"]; } while ($arRes = $dbRes->Fetch()); } CWizardUtil::ReplaceMacros(WIZARD_SITE_PATH . "/sect_inc.php", array("FORUM_ID" => 'array(' . implode(", ", $arForumsID) . ')')); CWizardUtil::ReplaceMacros(WIZARD_SITE_PATH . "/forum/index.php", array("FORUM_ID" => 'array(' . implode(", ", $arForumsID) . ')')); if (!WIZARD_IS_RERUN) { $APPLICATION->SetGroupRight("forum", WIZARD_PORTAL_ADMINISTRATION_GROUP, "W"); COption::SetOptionString("forum", "SHOW_VOTES", "N"); COption::SetOptionString("forum", "file_max_size", 10485760); }
/******************************************************************** Default values ********************************************************************/ $arResult["TOPIC"] = array(); $arResult["FORUM"] = array(); $arResult["FORUMS"] = array(); $arResult["TOPICS"] = array(); $arForums = array(); $arTopics = array(); /******************************************************************** /Default values ********************************************************************/ /******************************************************************** Data ********************************************************************/ $db_res = CForumNew::GetListEx(array(), $arFilter); if ($db_res && ($res = $db_res->GetNext())) { do { $res["URL"] = array("LIST" => CComponentEngine::MakePathFromTemplate($arParams["URL_TEMPLATES_LIST"], array("FID" => $res["ID"])), "~LIST" => CComponentEngine::MakePathFromTemplate($arParams["~URL_TEMPLATES_LIST"], array("FID" => $res["ID"]))); $res["list"] = $res["URL"]["list"]; // for custom $arForums[$res["ID"]] = $res; } while ($res = $db_res->GetNext()); } if (!empty($arForums)) { // it need for custom components foreach (array("TITLE", "USER_START_NAME", "POSTS", "VIEWS", "LAST_POST_DATE") as $res) { $arResult["SortingEx"][$res] = SortingEx($res, false, "by" . $orderIndex, "order" . $orderIndex); } // /it need for custom components $db_res = CForumTopic::GetListEx($arSort, array("@FORUM_ID" => array_keys($arForums), "APPROVED" => "Y"), false, false, $arNavParams);
} elseif (!array_key_exists("CACHE_PATH", $arComponentDescription)) { continue; } foreach ($arSites as $res) { $path = $componentRelativePath; if ($arComponentDescription["CACHE_PATH"] == "Y") { $path = "/" . $res["LID"] . $path; } if (!empty($path)) { BXClearCache(true, $path); } } } } } $dbResultList = CForumNew::GetListEx(array($by => $order), $arFilter); $dbResultList = new CAdminResult($dbResultList, $sTableID); $dbResultList->NavStart(); $lAdmin->NavText($dbResultList->GetNavPrint(GetMessage("NAV"))); $lAdmin->AddHeaders(array(array("id" => "ID", "content" => "ID", "sort" => "ID", "default" => false), array("id" => "FORUM_GROUP_ID", "content" => GetMessage("FORUM_GROUP_ID"), "sort" => "FORUM_GROUP_LEFT_MARGIN", "default" => true), array("id" => "NAME", "content" => GetMessage("NAME"), "sort" => "NAME", "default" => true), array("id" => "ACTIVE", "content" => GetMessage("ACTIVE"), "sort" => "ACTIVE", "default" => true), array("id" => "LAND", "content" => GetMessage('LAND'), "default" => true), array("id" => "SORT", "content" => GetMessage("SORT"), "sort" => "SORT", "align" => "right"), array("id" => "MODERATION", "content" => GetMessage("MODERATION"), "sort" => "MODERATION"), array("id" => "INDEXATION", "content" => GetMessage("INDEXATION"), "sort" => "INDEXATION"), array("id" => "ORDER_BY", "content" => GetMessage("ORDER_BY"), "sort" => "ORDER_BY"), array("id" => "ORDER_DIRECTION", "content" => GetMessage("ORDER_DIRECTION"), "sort" => "ORDER_DIRECTION"))); $arVisibleColumns = $lAdmin->GetVisibleHeaderColumns(); while ($arForum = $dbResultList->NavNext(true, "f_")) { $row =& $lAdmin->AddRow($f_ID, $arForum); $bCanUpdateForum = CForumNew::CanUserUpdateForum($f_ID, $USER->GetUserGroupArray(), $USER->GetID()); $bCanDeleteForum = CForumNew::CanUserDeleteForum($f_ID, $USER->GetUserGroupArray(), $USER->GetID()); $row->bReadOnly = $bCanUpdateForum ? false : true; $row->AddField("ID", $f_ID); $row->AddViewField("NAME", '<a title="' . GetMessage("FORUM_EDIT") . '" href="forum_edit.php?ID=' . $f_ID . '&lang=' . LANG . GetFilterParams("filter_") . '">' . $f_NAME . '</a>'); $row->AddInputField("NAME", $bCanUpdateForum ? array("size" => "30") : false); $row->AddCheckField("ACTIVE", $bCanUpdateForum ? array() : false); $res = array();
?> <tr class="adm-detail-required-field"> <td width="40%"><?php echo Loc::getMessage("SITEMAP_FILENAME_FORUM"); ?> :</td> <td width="60%"><input type="text" name="FILENAME_FORUM" value="<?php echo Converter::getHtmlConverter()->encode($arSitemap['SETTINGS']["FILENAME_FORUM"]); ?> " style="width:70%"></td> </tr> <tr> <td colspan="2" align="center"> <?php $dbRes = CForumNew::GetListEx(array("ID" => "ASC"), array('PERMS' => array(2, 'A'), 'ACTIVE' => 'Y', 'SITE_ID' => $SITE_ID)); $bFound = false; while (!!$dbRes && ($arRes = $dbRes->Fetch())) { if (!$bFound) { ?> <script type="text/javascript"> function setForumActive(check, cont) { var row = check.parentNode.parentNode; if(!check.checked) { row.cells[0].style.textDecoration = 'line-through'; } else {
} else { $arSites = array(); $db_res = CIBlock::GetSite($tasksIblockId); while ($res = $db_res->Fetch()) { $arSites[] = $res["LID"]; } if (!in_array(WIZARD_SITE_ID, $arSites)) { $arSites[] = WIZARD_SITE_ID; $iblock = new CIBlock(); $iblock->Update($tasksIblockId, array("LID" => $arSites)); } } } if (CModule::IncludeModule("forum")) { $forumCode = "intranet_tasks"; $dbRes = CForumNew::GetListEx(array(), array("SITE_ID" => WIZARD_SITE_ID, "XML_ID" => $forumCode)); if ($arRes = $dbRes->Fetch()) { $tasksForumId = $arRes["ID"]; } else { $arGroupID = array("GENERAL" => 0, "COMMENTS" => 0, "HIDDEN" => 0); $dbExistsGroup = CForumGroup::GetListEx(array(), array("LID" => LANGUAGE_ID)); while ($arExistsGroup = $dbExistsGroup->Fetch()) { foreach ($arGroupID as $xmlID => $ID) { if ($arExistsGroup["NAME"] == GetMessage($xmlID . "_GROUP_NAME")) { $arGroupID[$xmlID] = $arExistsGroup["ID"]; } } } $arFields = array("XML_ID" => $forumCode, "NAME" => "Intranet Tasks", "DESCRIPTION" => false, "SORT" => 1, "ACTIVE" => "Y", "ALLOW_HTML" => "N", "ALLOW_ANCHOR" => "Y", "ALLOW_BIU" => "Y", "ALLOW_IMG" => "Y", "ALLOW_LIST" => "Y", "ALLOW_QUOTE" => "Y", "ALLOW_CODE" => "Y", "ALLOW_FONT" => "Y", "ALLOW_SMILES" => "Y", "ALLOW_UPLOAD" => "A", "ALLOW_NL2BR" => "N", "MODERATION" => "N", "ALLOW_MOVE_TOPIC" => "Y", "ORDER_BY" => "P", "DEDUPLICATION" => "N", "ORDER_DIRECTION" => "DESC", "LID" => LANGUAGE_ID, "PATH2FORUM_MESSAGE" => "", "ALLOW_UPLOAD_EXT" => "", "ASK_GUEST_EMAIL" => "N", "USE_CAPTCHA" => "N", "SITES" => array(WIZARD_SITE_ID => WIZARD_SITE_DIR . "community/forum/messages/forum#FORUM_ID#/topic#TOPIC_ID#/message#MESSAGE_ID#/#message#MESSAGE_ID#"), "EVENT1" => "forum", "EVENT2" => "message", "EVENT3" => "", "GROUP_ID" => array("2" => "E", WIZARD_PORTAL_ADMINISTRATION_GROUP => "Y", WIZARD_EMPLOYEES_GROUP => "M", WIZARD_PERSONNEL_DEPARTMENT_GROUP => "M"), "FORUM_GROUP_ID" => $arGroupID["HIDDEN"]); $tasksForumId = CForumNew::Add($arFields); }
/******************************************************************** /Default params ********************************************************************/ /******************************************************************** Data ********************************************************************/ $cache_id = "forum_forums_listex_" . (($tzOffset = CTimeZone::GetOffset()) != 0 ? "_" . $tzOffset : ""); $cache_path = $cache_path_main . "forums"; if ($arParams["CACHE_TIME"] > 0 && $cache->InitCache($arParams["CACHE_TIME"], $cache_id, $cache_path)) { $res = $cache->GetVars(); if (is_array($res["arForums"])) { $arForums = CForumCacheManager::Expand($res["arForums"]); } } if (!is_array($arForums) || empty($arForums)) { $db_res = CForumNew::GetListEx(); while ($res = $db_res->GetNext()) { $arForums[$res["ID"]] = array("ID" => $res["ID"], "NAME" => $res["NAME"]); } if ($arParams["CACHE_TIME"] > 0) { $cache->StartDataCache($arParams["CACHE_TIME"], $cache_id, $cache_path); $cache->EndDataCache(array("arForums" => CForumCacheManager::Compress($arForums))); } } /******************************************************************/ $arFilter = array("SHOW_ABC" => ""); if (!$USER->IsAdmin()) { $arFilter["ACTIVE"] = "Y"; } if (strLen($_REQUEST["del_filter"]) <= 0 && strLen($_REQUEST["set_filter"]) > 0) { if (strlen($_REQUEST["date_last_visit1"]) > 0 && !$GLOBALS["DB"]->IsDate($_REQUEST["date_last_visit1"])) {
if ($GLOBALS["APPLICATION"]->GetGroupRight("forum") < "W") { $arFilter["PERMS"] = array($GLOBALS["USER"]->GetGroups(), 'A'); $arFilter["ACTIVE"] = "Y"; } $cache_id = "forum_forums_" . serialize($arFilter); if (($tzOffset = CTimeZone::GetOffset()) != 0) { $cache_id .= "_" . $tzOffset; } $cache_path = $cache_path_main . "forums"; if ($arParams["CACHE_TIME"] > 0 && $cache->InitCache($arParams["CACHE_TIME"], $cache_id, $cache_path)) { $res = $cache->GetVars(); $arForums = CForumCacheManager::Expand($res["arForums"]); } $arForums = is_array($arForums) ? $arForums : array(); if (empty($arForums)) { $db_res = CForumNew::GetListEx(array("FORUM_GROUP_SORT" => "ASC", "FORUM_GROUP_ID" => "ASC", "SORT" => "ASC", "NAME" => "ASC"), $arFilter); if ($db_res && ($res = $db_res->GetNext())) { do { $arForums[$res["ID"]] = $res; } while ($res = $db_res->GetNext()); } if ($arParams["CACHE_TIME"] > 0) { $cache->StartDataCache($arParams["CACHE_TIME"], $cache_id, $cache_path); $cache->EndDataCache(array("arForums" => CForumCacheManager::Compress($arForums))); } } $arResult["FORUMS"] = $arForums; $arGroupsForums = array(); $arGroups = array(); foreach ($arResult["FORUMS"] as $key => $res) { $arGroupsForums[$res["FORUM_GROUP_ID"]][$key] = $res;
public static function GetPropertiesDialog($documentType, $activityName, $arWorkflowTemplate, $arWorkflowParameters, $arWorkflowVariables, $arCurrentValues = null, $formName = "") { $runtime = CBPRuntime::GetRuntime(); if (!CModule::IncludeModule("socialnetwork")) { return; } $arMap = array("TaskType" => "task_type", "TaskOwnerId" => "task_owner_id", "TaskCreatedBy" => "task_created_by", "TaskActiveFrom" => "task_active_from", "TaskActiveTo" => "task_active_to", "TaskName" => "task_name", "TaskDetailText" => "task_detail_text", "TaskPriority" => "task_priority", "TaskAssignedTo" => "task_assigned_to", "TaskTrackers" => "task_trackers", "TaskForumId" => "task_forum_id"); if (!is_array($arWorkflowParameters)) { $arWorkflowParameters = array(); } if (!is_array($arWorkflowVariables)) { $arWorkflowVariables = array(); } if (!is_array($arCurrentValues)) { $arCurrentActivity =& CBPWorkflowTemplateLoader::FindActivityByName($arWorkflowTemplate, $activityName); if (is_array($arCurrentActivity["Properties"])) { foreach ($arMap as $k => $v) { if (array_key_exists($k, $arCurrentActivity["Properties"])) { if ($k == "TaskCreatedBy" || $k == "TaskAssignedTo" || $k == "TaskTrackers") { $arCurrentValues[$arMap[$k]] = CBPHelper::UsersArrayToString($arCurrentActivity["Properties"][$k], $arWorkflowTemplate, $documentType); } else { $arCurrentValues[$arMap[$k]] = $arCurrentActivity["Properties"][$k]; } } else { $arCurrentValues[$arMap[$k]] = ""; } } } else { foreach ($arMap as $k => $v) { $arCurrentValues[$arMap[$k]] = ""; } } } $arGroups = array(); $db = CSocNetGroup::GetList(array("NAME" => "ASC"), array("ACTIVE" => "Y"), false, false, array("ID", "NAME")); while ($ar = $db->GetNext()) { $arGroups[$ar["ID"]] = $ar["NAME"]; } $arTaskPriority = array(); $db = CIBlockProperty::GetPropertyEnum("TaskPriority"); while ($ar = $db->GetNext()) { $arTaskPriority[$ar["ID"]] = $ar["VALUE"]; } $arForums = array(); if (CModule::IncludeModule("forum")) { $db = CForumNew::GetListEx(); while ($ar = $db->GetNext()) { $arForums[$ar["ID"]] = "[" . $ar["ID"] . "] " . $ar["NAME"]; } } return $runtime->ExecuteResourceFile(__FILE__, "properties_dialog.php", array("arCurrentValues" => $arCurrentValues, "formName" => $formName, "arGroups" => $arGroups, "arTaskPriority" => $arTaskPriority, "arForums" => $arForums)); }