$APPLICATION->AddHeadScript('/bitrix/js/main/utils.js'); $APPLICATION->AddHeadScript('/bitrix/js/main/dd.js'); } if ($arParams['EDIT'] && $arResult['CAN_EDIT'] || isset($arResult["MEETING"]["PLACE_ID"])) { $arResult['MEETING_ROOMS_LIST'] = array(); if ($arParams['RESERVE_MEETING_IBLOCK_ID'] || $arParams['RESERVE_VMEETING_IBLOCK_ID']) { $dbMeetingsList = CIBlockSection::GetList(array('IBLOCK_ID' => 'ASC', 'NAME' => 'ASC', 'ID' => 'DESC'), array('IBLOCK_ID' => array(intval($arParams['RESERVE_MEETING_IBLOCK_ID']), intval($arParams['RESERVE_VMEETING_IBLOCK_ID']))), false, array('ID', 'IBLOCK_ID', 'NAME', 'DESCRIPTION')); while ($arRoom = $dbMeetingsList->Fetch()) { $arRoom["MEETING_ROOM_ID"] = CMeeting::MakePlace($arRoom["IBLOCK_ID"], $arRoom["ID"]); $arResult['MEETING_ROOMS_LIST'][] = $arRoom; if (isset($arResult["MEETING"]["PLACE_ID"]) && $arResult["MEETING"]["PLACE_ID"] == $arRoom["MEETING_ROOM_ID"]) { $arResult["MEETING"]["PLACE"] = htmlspecialcharsbx($arRoom["NAME"]); } } } } if ($arParams['EDIT'] && $arResult['CAN_EDIT']) { require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/tools/clock.php"; $this->IncludeComponentTemplate('tpl_edit'); } else { if (is_array($arResult['MEETING']['FILES']) && count($arResult['MEETING']['FILES']) > 0) { $arResult['MEETING']['FILES'] = CMeeting::GetFilesData($arResult['MEETING']['FILES'], array('MEETING' => $arResult['MEETING']['ID'])); } if ($arResult['MEETING']['GROUP_ID'] > 0 && CModule::IncludeModule('socialnetwork')) { if ($arGroup = CSocNetGroup::GetByID($arResult['MEETING']['GROUP_ID'])) { $arResult['MEETING']['GROUP_NAME'] = $arGroup['NAME']; $arResult['MEETING']['GROUP_URL'] = str_replace("#group_id#", $arGroup['ID'], COption::GetOptionString('socialnetwork', 'group_path_template', '/workgroups/group/#group_id#/', SITE_ID)); } } $this->IncludeComponentTemplate('tpl_view'); }
if (IsModuleInstalled('meeting') && CModule::IncludeModule('meeting')) { $forumId = COption::GetOptionInt('meeting', 'comments_forum_id', 0, SITE_ID); if ($arResult['FORUM']['ID'] == $forumId) { $meetingID = false; $xmlID = $arResult['MESSAGE']['FT_XML_ID']; preg_match('/MEETING_ITEM_([0-9]+)/', $xmlID, $matches); if (sizeof($matches) > 0) { $meetingItemID = $matches[1]; if (CMeetingItem::HasAccess($meetingItemID)) { $arParams['PERMISSION'] = 'M'; } } preg_match('/MEETING_([0-9]+)/', $xmlID, $matches); if (sizeof($matches) > 0) { $meetingID = $matches[1]; if (CMeeting::GetUserRole($meetingID) !== false) { $arParams['PERMISSION'] = 'M'; } } } } if (IsModuleInstalled('tasks') && CModule::IncludeModule('tasks')) { $tasksIsTasksJurisdiction = false; // Insurance for cross-modules version compatibility if (method_exists('CTasksTools', 'ListTasksForumsAsArray')) { try { $arTasksForums = CTasksTools::ListTasksForumsAsArray(); if (in_array((int) $arResult['FORUM']['ID'], $arTasksForums, true)) { $tasksIsTasksJurisdiction = true; } } catch (TasksException $e) {
CMeeting::AddEvent($MEETING_ID, $arMeeting); } Header('Content-Type: application/json'); echo "{id: '" . $MEETING_ID . "', state: '" . $arMeeting['CURRENT_STATE'] . "', date_start: '" . MakeTimeStamp($arMeeting['DATE_START']) . "000'}"; } } } elseif (isset($_REQUEST['PLACE_ID'])) { $arPlace = CMeeting::CheckPlace($_REQUEST['PLACE_ID']); if (is_array($arPlace) && $arPlace['ROOM_IBLOCK'] > 0 && $arPlace['ROOM_ID'] > 0) { $eventId = intval($_REQUEST['EVENT_ID']); $eventStart = CMeeting::MakeDateTime($_REQUEST['DATE_START_DATE'], $_REQUEST['DATE_START_TIME']); $eventFinish = CMeeting::MakeDateTime($_REQUEST['DATE_START_DATE'], $_REQUEST['DATE_START_TIME'], $_REQUEST['DURATION']); $arFilter = array("ACTIVE" => "Y", "IBLOCK_ID" => $arPlace['ROOM_IBLOCK'], "SECTION_ID" => $arPlace['ROOM_ID'], "<DATE_ACTIVE_FROM" => $eventFinish, ">DATE_ACTIVE_TO" => $eventStart, "PROPERTY_PERIOD_TYPE" => "NONE"); $reservationId = 0; if ($eventId > 0) { $arEvent = CMeeting::GetEvent($eventId); if (is_array($arEvent) && is_array($arEvent['LOCATION']) && $arEvent['LOCATION']['mrevid'] > 0) { $reservationId = $arEvent['LOCATION']['mrevid']; $arFilter["!=ID"] = $reservationId; } } $bReserved = false; $dbElements = CIBlockElement::GetList(array("DATE_ACTIVE_FROM" => "ASC"), $arFilter, false, false, array('ID')); if ($dbElements->Fetch()) { $bReserved = true; } else { // copy-paste sucks! include_once $_SERVER['DOCUMENT_ROOT'] . "/bitrix/components/bitrix/intranet.reserve_meeting/init.php"; $arPeriodicElements = __IRM_SearchPeriodic($eventStart, $eventFinish, $arPlace['ROOM_IBLOCK'], $arPlace['ROOM_ID']); for ($i = 0, $l = count($arPeriodicElements); $i < $l; $i++) { if (!$reservationId || $arPeriodicElements[$i]['ID'] != $reservationId) {
} $arResult['MEETING_ROOMS_LIST'] = array(); if ($arParams['RESERVE_MEETING_IBLOCK_ID'] || $arParams['RESERVE_VMEETING_IBLOCK_ID']) { $dbMeetingsList = CIBlockSection::GetList(array('IBLOCK_ID' => 'ASC', 'NAME' => 'ASC', 'ID' => 'DESC'), array('IBLOCK_ID' => array(intval($arParams['RESERVE_MEETING_IBLOCK_ID']), intval($arParams['RESERVE_VMEETING_IBLOCK_ID']))), false, array('ID', 'IBLOCK_ID', 'NAME', 'DESCRIPTION')); while ($arRoom = $dbMeetingsList->GetNext()) { $arResult['MEETING_ROOMS_LIST'][CMeeting::MakePlace($arRoom["IBLOCK_ID"], $arRoom["ID"])] = $arRoom; } } //echo '<pre>'; print_r($arFilter); echo '</pre>'; $dbRes = CMeeting::GetList(array("ID" => 'DESC'), $arFilter, false, $arNavParams, array('ID', 'TITLE', 'CURRENT_STATE', 'DATE_START', 'OWNER_ID', 'PLACE')); $arResult["NAV_STRING"] = $dbRes->GetPageNavStringEx($navComponentObject = null, $arParams["PAGER_TITLE"]); while ($arRes = $dbRes->GetNext()) { $arRes['URL'] = str_replace('#MEETING_ID#', $arRes['ID'], $arParams['MEETING_URL']); $arRes['URL_EDIT'] = str_replace('#MEETING_ID#', $arRes['ID'], $arParams['MEETING_EDIT_URL']); $arRes['URL_COPY'] = str_replace('#MEETING_ID#', $arRes['ID'], $arParams['MEETING_COPY_URL']); $arRes['USERS'] = CMeeting::GetUsers($arRes['ID']); foreach ($arRes['USERS'] as $u => $r) { if ($r == CMeeting::ROLE_OWNER) { $arRes['OWNER_ID'] = $u; } } $arUserIDs = array_merge($arUserIDs, array_keys($arRes['USERS'])); if (strlen($arRes['PLACE']) > 0 && array_key_exists($arRes['PLACE'], $arResult['MEETING_ROOMS_LIST'])) { $arRes['PLACE'] = $arResult['MEETING_ROOMS_LIST'][$arRes['PLACE']]['NAME']; } $arResult['MEETINGS'][] = $arRes; } $title = GetMessage('ML_LIST_TITLE' . ($arParams['USER_ID'] == $USER->GetID() ? '' : '_NOT_MINE')); $APPLICATION->SetTitle($title); if ($arParams['SET_NAVCHAIN'] !== 'N') { $APPLICATION->AddChainItem($title, $arParams['LIST_URL']);
die; } if (!CModule::IncludeModule("meeting") || !CModule::IncludeModule("iblock")) { return; } $arXMLID = array("meeting_rooms_" . WIZARD_SITE_ID => 'RESERVE_MEETING_IBLOCK_ID', "video-meeting_" . WIZARD_SITE_ID => 'RESERVE_VMEETING_IBLOCK_ID'); $rsIBlock = CIBlock::GetList(array(), array("XML_ID" => array_keys($arXMLID), "TYPE" => "events")); $arReplace = array(); while ($arIBlock = $rsIBlock->Fetch()) { $arReplace[$arXMLID[$arIBlock['XML_ID']]] = $arIBlock['ID']; } CWizardUtil::ReplaceMacros(WIZARD_SITE_PATH . "/services/meeting/index.php", $arReplace); CUrlRewriter::Add(array('CONDITION' => '#^' . WIZARD_SITE_DIR . 'services/meeting/#', 'RULE' => '', 'ID' => 'bitrix:meetings', 'PATH' => WIZARD_SITE_DIR . '/services/meeting/index.php')); if (!WIZARD_IS_RERUN) { $arFields = array('TITLE' => GetMessage('MEETING_TITLE'), 'DATE_START' => ConvertTimeStamp(time() + 86400), 'DURATION' => 3600, 'DESCRIPTION' => GetMessage('MEETING_DESCRIPTION'), 'PLACE' => GetMessage('MEETING_PLACE'), 'USERS' => array(1 => CMeeting::ROLE_OWNER, 477 => CMeeting::ROLE_KEEPER, 11 => CMeeting::ROLE_MEMBER, rand(12, 476) => CMeeting::ROLE_MEMBER, rand(12, 476) => CMeeting::ROLE_MEMBER, rand(12, 476) => CMeeting::ROLE_MEMBER, rand(12, 476) => CMeeting::ROLE_MEMBER, rand(12, 476) => CMeeting::ROLE_MEMBER, rand(12, 476) => CMeeting::ROLE_MEMBER)); $MEETING_ID = CMeeting::Add($arFields); $arResponsible = array(1 => 1, 11, $arFields['USERS'][rand(3, 9)]); for ($i = 1; $i <= 3; $i++) { CMeetingItem::Add(array('MEETING_ID' => $MEETING_ID, 'TITLE' => GetMessage('MEETING_ITEM_TITLE_' . $i), 'SORT' => 100 * $i, 'RESPONSIBLE' => $arResponsible[$i])); } /* $iblockCode = "calendar_employees"; $iblockType = "events"; $rsIBlock = CIBlock::GetList(array(), array("CODE" => $iblockCode, "TYPE" => $iblockType)); if ($arIBlock = $rsIBlock->Fetch()) { CMeeting::AddEvent($MEETING_ID, $arFields, array("CALENDAR_IBLOCK_ID" => $arIBlock['ID'])); } */ }
$APPLICATION->RestartBuffer(); $arResult['INCLUDE_LANG'] = true; $this->IncludeComponentTemplate('tasks'); die; } elseif ($arParams['COMMENTS']) { $APPLICATION->RestartBuffer(); $obForumConnector = new CMeetingItemForumHandlers($arParams['FORUM_ID'], $arResult['ITEM']); $arParams['FORUM_ID'] = $obForumConnector->GetForumID(); $arParams['MINIMAL'] = true; $this->IncludeComponentTemplate('comments'); die; } else { $title = GetMessage('ME_ITEM_TITLE', array('#ID#' => $arResult['ITEM']['ID'], '#TITLE#' => $arResult['ITEM']['TITLE'])); $APPLICATION->SetTitle($title); if ($arParams['SET_NAVCHAIN'] !== 'N') { $APPLICATION->AddChainItem($title, $arParams['ITEM_URL']); } if (is_array($arResult['ITEM']['FILES']) && count($arResult['ITEM']['FILES']) > 0) { $arResult['ITEM']['FILES'] = CMeeting::GetFilesData($arResult['ITEM']['FILES'], array('ITEM' => $arResult['ITEM']['ID'])); } if ($arParams['UPDATE']) { $APPLICATION->RestartBuffer(); $arResult['INCLUDE_LANG'] = true; $this->IncludeComponentTemplate('view'); die; } $obForumConnector = new CMeetingItemForumHandlers($arParams['FORUM_ID'], $arResult['ITEM']); $arParams['FORUM_ID'] = $obForumConnector->GetForumID(); CJSCore::Init(array('meeting', 'ajax')); $this->IncludeComponentTemplate(); }
public static function Delete($ID) { global $DB; $ID = intval($ID); if ($ID < 1) { return false; } $dbRes = CMeeting::GetByID($ID); if ($arMeeting = $dbRes->Fetch()) { foreach (GetModuleEvents("meeting", "OnBeforeMeetingDelete", true) as $arEvent) { if (false === ExecuteModuleEventEx($arEvent, array($ID, $arMeeting))) { return false; } } if ($arMeeting['EVENT_ID'] > 0) { self::DeleteEvent($arMeeting['EVENT_ID']); } self::SetUsers($ID); self::DeleteFiles($ID); CMeetingInstance::DeleteByMeetingID($ID); if ($DB->Query("DELETE FROM b_meeting WHERE ID='" . $ID . "'")) { $DB->Query("UPDATE b_meeting SET PARENT_ID=NULL WHERE PARENT_ID='" . $ID . "'"); foreach (GetModuleEvents("meeting", "OnAfterMeetingDelete", true) as $arEvent) { ExecuteModuleEventEx($arEvent, array($ID)); } return true; } } return false; }
function InstallService($serviceID, $serviceStage) { $wizard =& $this->GetWizard(); if (CModule::IncludeModule("iblock")) { $type = substr($serviceID, 0, -1); if ($type == "iblockElement") { $dbItem = CIBlockElement::GetList(array(), array("=IBLOCK_CODE" => $serviceStage), false, false, array("ID")); while ($arItem = $dbItem->Fetch()) { CIBlockElement::Delete($arItem["ID"]); } } elseif ($type == "iblockSectionElement") { $dbItem = CIBlockElement::GetList(array(), array("=IBLOCK_CODE" => $serviceStage), false, false, array("ID")); while ($arItem = $dbItem->Fetch()) { CIBlockElement::Delete($arItem["ID"]); } $dbItem = CIBlockSection::GetList(array(), array("=IBLOCK_CODE" => $serviceStage), false, array("ID")); while ($arItem = $dbItem->Fetch()) { CIBlockSection::Delete($arItem["ID"]); } } elseif ($serviceID == "iblockDepartmentsElement") { $dbItem = CIBlockSection::GetList(array(), array("=IBLOCK_CODE" => "departments")); while ($arItem = $dbItem->Fetch()) { if ($arItem["DEPTH_LEVEL"] > 2) { CIBlockSection::Delete($arItem["ID"]); } } } elseif ($serviceID == "tasks") { if (CModule::IncludeModule("tasks")) { $dbItem = CTasks::GetList(array(), array("SITE_ID" => $wizard->GetVar("siteID"))); while ($arItem = $dbItem->Fetch()) { CTasks::Delete($arItem["ID"]); } } } elseif ($serviceID == "calendar") { if (CModule::IncludeModule("calendar")) { $dbItem = CCalendarEvent::GetList(); foreach ($dbItem as $arItem) { CCalendarEvent::Delete(array("id" => $arItem["ID"])); } } } elseif ($serviceID == "meeting") { if (CModule::IncludeModule("meeting")) { $dbItem = CMeeting::GetList(array(), array()); while ($arItem = $dbItem->Fetch()) { if ($arItem["ID"]) { CMeeting::Delete($arItem["ID"]); } } } } elseif ($serviceID == "user") { if ($serviceStage == "user") { $dbUser = CUser::GetList($by = "ID", $order = "DESC", array(">ID" => 1)); while ($arUser = $dbUser->Fetch()) { CUser::Delete($arUser["ID"]); } } } elseif ($serviceID == "crm") { if ($serviceStage == "crm") { if (CModule::IncludeModule('crm')) { $CCrmLead = new CCrmLead(); $resLead = CCrmLead::GetList(array(), array(), array(), false); while ($rowLead = $resLead->Fetch()) { $CCrmLead->Delete($rowLead["ID"]); } $CCrmContact = new CCrmContact(); $resContact = CCrmContact::GetList(array(), array(), array(), false); while ($rowContact = $resContact->Fetch()) { $CCrmContact->Delete($rowContact["ID"]); } $CCrmCompany = new CCrmCompany(); $resCompany = CCrmCompany::GetList(array(), array(), array(), false); while ($rowCompany = $resCompany->Fetch()) { $CCrmCompany->Delete($rowCompany["ID"]); } $CCrmDeal = new CCrmDeal(); $resDeal = CCrmDeal::GetList(array(), array(), array(), false); while ($rowDeal = $resDeal->Fetch()) { $CCrmDeal->Delete($rowDeal["ID"]); } } } } elseif ($serviceID == "cache") { require_once $_SERVER["DOCUMENT_ROOT"] . BX_ROOT . "/modules/main/classes/general/cache_html.php"; if ($serviceStage == "cache1") { BXClearCache(true); } elseif ($serviceStage == "cache2") { $GLOBALS["CACHE_MANAGER"]->CleanAll(); } elseif ($serviceStage == "cache3") { $GLOBALS["stackCacheManager"]->CleanAll(); } elseif ($serviceStage == "cache4") { CHTMLPagesCache::CleanAll(); } COption::SetOptionString("main", "wizard_clear_exec", "Y", false, $wizard->GetVar("siteID")); } } }
public function onAfterMessageDelete($ID, $arPost) { if ($arPost['FORUM_ID'] == $this->forumId && $arPost['PARAM2'] == $this->arEntity['ID']) { CMeeting::DeleteFilesBySrc($arPost['ID']); } }
$arFilter['!ID'] = intval($skip); } if ($_REQUEST['mode'] == 'selector_search') { CUtil::JSPostUnEscape(); } if ($_REQUEST['FILTER']) { $arFilterValues = $_REQUEST['FILTER']; if (isset($arFilterValues['TITLE']) && strlen(trim($arFilterValues['TITLE'])) > 0) { $arFilter['~TITLE'] = '%' . trim($arFilterValues['TITLE']) . '%'; } if (isset($arFilterValues['CURRENT_STATE']) && strlen($arFilterValues['CURRENT_STATE']) == 1 && in_array($arFilterValues['CURRENT_STATE'], array(CMeeting::STATE_PREPARE, CMeeting::STATE_ACTION, CMeeting::STATE_CLOSED))) { $arFilter['CURRENT_STATE'] = $arFilterValues['CURRENT_STATE']; } if (isset($arFilterValues['OWNER_ID']) && intval($arFilterValues['OWNER_ID']) > 0) { $arFilter['OWNER_ID'] = intval($arFilterValues['OWNER_ID']); } } $dbRes = CMeeting::GetList($arOrder, $arFilter, false, array('nTopCount' => 10)); $arResult['MEETINGS'] = array(); while ($arMeeting = $dbRes->GetNext()) { $arMeeting['URL'] = str_replace(array('#MEETING_ID#', '#ID#'), $arMeeting['ID'], $arParams["MEETING_URL_TPL"]); $arResult['MEETINGS'][] = $arMeeting; } if ($_REQUEST['mode'] == 'selector_search') { $APPLICATION->RestartBuffer(); echo CUtil::PhpToJsObject($arResult['MEETINGS'], false, true); die; } else { CJSCore::Init(array('meeting')); $this->IncludeComponentTemplate(); }