예제 #1
0
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
    die;
}
if (!CModule::IncludeModule("meeting")) {
    return ShowError(GetMessage("ME_MODULE_NOT_INSTALLED"));
}
$arParams['MEETING_ID'] = intval($arParams['MEETING_ID']);
$arParams['COPY'] = $arParams['COPY'] == 'Y';
$arParams['GROUP_ID'] = intval($arParams['GROUP_ID']);
$arParams['NAME_TEMPLATE'] = empty($arParams['NAME_TEMPLATE']) ? CSite::GetNameFormat(false) : str_replace(array("#NOBR#", "#/NOBR#"), array("", ""), $arParams["NAME_TEMPLATE"]);
if ($arParams['MEETING_ID'] && !$arParams['COPY']) {
    $arParams['ITEM_URL'] .= '?from=' . $arParams['MEETING_ID'];
}
//$arParams['CALENDAR_ID'] = intval($arParams['CALENDAR_ID']);
$arParams['EDIT'] = $arParams['EDIT'] == 'Y' || $arParams['MEETING_ID'] <= 0 || $arParams['COPY'];
$arResult['IS_NEW_CALENDAR'] = CMeeting::IsNewCalendar();
$arResult['START_INDEX'] = 0;
if ($arParams['MEETING_ID'] > 0) {
    $arResult['ACCESS'] = CMeeting::GetUserRole($arParams['MEETING_ID']);
    if ($arResult['ACCESS']) {
        if ($_REQUEST['DELETE'] == 'Y' && $arResult['ACCESS'] == CMeeting::ROLE_OWNER && check_bitrix_sessid()) {
            CMeeting::Delete($arParams['MEETING_ID']);
            $APPLICATION->RestartBuffer();
            die;
        }
        $dbRes = CMeeting::GetList(array(), array('ID' => $arParams['MEETING_ID']), false, false, array('*'));
        if (!($arResult['MEETING'] = $dbRes->GetNext())) {
            return ShowError(GetMessage("ME_MEETING_NOT_FOUND"));
        }
        if (CMeeting::CheckPlace($arResult["MEETING"]["PLACE"])) {
            $arResult["MEETING"]["PLACE_ID"] = $arResult["MEETING"]["PLACE"];