예제 #1
0
                 if ($arRes) {
                     $checkedFileId = $arRes['FILE_ID'];
                 }
             }
         }
     } elseif ($itemId > 0) {
         $bHasAccess = false;
         $dbRes = CMeetingInstance::GetList(array('ID' => 'DESC'), array('ITEM_ID' => $itemId), false, false, array('MEETING_ID'));
         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'];
             }
         }
     }
 }
예제 #2
0
 // if ($arParams['COPY'] && $arRes['INSTANCE_TYPE'] == CMeetingInstance::TYPE_AGENDA)
 // continue;
 $arRes['RESPONSIBLE'] = CMeetingInstance::GetResponsible($arRes['ID']);
 $arRes['REPORTS'] = array();
 $dbReports = CMeetingReports::GetList(array('ID' => 'ASC'), array('INSTANCE_ID' => $arRes['ID']));
 while ($arReport = $dbReports->Fetch()) {
     $arFiles = array();
     $dbFiles = CMeetingReports::GetFiles($arReport['ID']);
     while ($arFile = $dbFiles->Fetch()) {
         $arFiles[$arFile['FILE_ID']] = $arFile;
     }
     $arRes['REPORTS'][] = array('ID' => $arReport['ID'], 'REPORT' => $arReport['REPORT'], 'USER_ID' => $arReport['USER_ID'], 'FILES' => CMeeting::GetFilesData($arFiles, array("REPORT" => $arReport['ID'])));
 }
 $arRes['FILES'] = array();
 if ($arRes['ITEM_ID'] > 0) {
     $dbFiles = CMeetingItem::GetFiles($arRes['ITEM_ID']);
     while ($arFile = $dbFiles->Fetch()) {
         $arRes['FILES'][$arFile['FILE_ID']] = $arFile['FILE_SRC'];
     }
     if (count($arRes['FILES']) > 0) {
         $arRes['FILES'] = CMeeting::GetFilesData($arRes['FILES'], array("ITEM" => $arRes['ITEM_ID']));
     }
 }
 $arRes['TASKS_COUNT'] = CMeetingItem::GetTasksCount($arRes['ITEM_ID'], $arRes['ID']);
 if (!$arParams['COPY']) {
     $arRes['EDITABLE'] = CMeetingItem::IsEditable($arRes['ITEM_ID']);
     if ($arRes['TASK_ID'] && CModule::IncludeModule('tasks')) {
         $dbTask = CTasks::GetByID($arRes['TASK_ID']);
         if ($arTask = $dbTask->Fetch()) {
             $arRes['TASK_ACCESS'] = true;
         }
예제 #3
0
    $arFields = array();
    if ($arResult['CAN_EDIT']) {
        if (isset($_REQUEST['ITEM_TITLE'])) {
            $arResult['ITEM']['TITLE'] = $arFields['TITLE'] = trim($_REQUEST['ITEM_TITLE']);
        }
        if (isset($_REQUEST['ITEM_DESCRIPTION'])) {
            $arResult['ITEM']['DESCRIPTION'] = $arFields['DESCRIPTION'] = trim($_REQUEST['ITEM_DESCRIPTION']);
        }
    }
    $arFields['FILES'] = is_array($_REQUEST['ITEM_FILES']) ? \Bitrix\Main\UI\FileInputUtility::instance()->checkFiles('MEETING_ITEM_FILES_' . $arParams['ITEM_ID'], $_REQUEST['ITEM_FILES']) : array();
    $arFields['TASKS'] = is_array($_REQUEST['ITEM_TASKS']) ? $_REQUEST['ITEM_TASKS'] : array();
    CMeetingItem::Update($arParams['ITEM_ID'], $arFields);
    $arParams['UPDATE'] = true;
}
$arResult['ITEM']['FILES'] = array();
$dbRes = CMeetingItem::GetFiles($arResult['ITEM']['ID']);
while ($arFile = $dbRes->Fetch()) {
    $arResult['ITEM']['FILES'][$arFile['FILE_ID']] = $arFile;
}
$arResult['ITEM']['TASKS'] = CMeetingItem::GetTasks($arResult['ITEM']['ID']);
$arResult['USERS'] = array();
if (count($arUserIDs) > 0) {
    $dbRes = CUser::GetList($by = 'ID', $order = 'ASC', array('ID' => implode('|', array_unique($arUserIDs))));
    while ($arUser = $dbRes->Fetch()) {
        $arResult['USERS'][$arUser['ID']] = $arUser;
    }
}
if ($arParams['EDIT'] && $arResult['CAN_EDIT']) {
    $APPLICATION->ShowAJaxHead();
    $arResult['INCLUDE_LANG'] = true;
    $this->IncludeComponentTemplate('edit');