コード例 #1
0
ファイル: component.php プロジェクト: mrdeadmouse/u136006
 }
 $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"];
 }
 $arResult['MEETING']['USERS'] = CMeeting::GetUsers($arParams['MEETING_ID']);
 $arResult['MEETING']['CURRENT_RIGHTS'] = $arResult['ACCESS'];
 //$arResult['MEETING']['USERS'][$USER->GetID()]; // not arParams[USER_ID]!
 if (!$arResult['MEETING']['CURRENT_RIGHTS']) {
     return ShowError(GetMessage("ME_MEETING_ACCESS_DENIED"));
 }
 $arResult['MEETING']['FILES'] = array();
 $dbFiles = CMeeting::GetFiles($arParams['MEETING_ID']);
 while ($arFile = $dbFiles->Fetch()) {
     $arResult['MEETING']['FILES'][$arFile['FILE_ID']] = $arFile;
 }
 if (!$arParams['COPY'] && $arResult['MEETING']['EVENT_ID'] > 0) {
     if ($arResult['IS_NEW_CALENDAR']) {
         $arResult['MEETING']['EVENT'] = CMeeting::GetEvent($arResult['MEETING']['EVENT_ID']);
     }
     $arResult['MEETING']['USERS_EVENT'] = array();
     $arGuests = CMeeting::GetEventGuests($arResult['MEETING']['EVENT_ID'], $USER->GetID());
     foreach ($arGuests as $guest) {
         $arResult['MEETING']['USERS_EVENT'][$guest['id']] = $guest['status'];
     }
 }
 $arResult['CAN_EDIT'] = $arParams['COPY'] || $arResult['MEETING']['CURRENT_RIGHTS'] == CMeeting::ROLE_OWNER || $arResult['MEETING']['CURRENT_RIGHTS'] == CMeeting::ROLE_KEEPER;
 $arResult['MEETING']['AGENDA'] = array();
コード例 #2
0
ファイル: ajax_meeting.php プロジェクト: DarneoStudio/bitrix
            while ($arInstance = $dbRes->Fetch()) {
                if (CMeeting::GetUserRole($arInstance['MEETING_ID'])) {
                    $bHasAccess = true;
                    break;
                }
            }
            if ($bHasAccess) {
                $dbRes = CMeetingItem::GetFiles($itemId, $fileId);
                $arRes = $dbRes->Fetch();
                if ($arRes) {
                    $checkedFileId = $arRes['FILE_ID'];
                }
            }
        } elseif ($meetingId > 0) {
            if (CMeeting::GetUserRole($meetingId)) {
                $dbRes = CMeeting::GetFiles($meetingId, $fileId);
                $arRes = $dbRes->Fetch();
                if ($arRes) {
                    $checkedFileId = $arRes['FILE_ID'];
                }
            }
        }
    }
    if ($checkedFileId > 0) {
        $arFile = CFile::GetFileArray($checkedFileId);
        if (is_array($arFile)) {
            CFile::ViewByUser($arFile, array("force_download" => true));
        }
    }
    die;
}