} } } } if (StrLen($arResult["FatalError"]) <= 0) { $arNavStartParams = array("nPageSize" => $arParams["ITEMS_COUNT"], "bShowAll" => false, "bDescPageNumbering" => false); $arNavigation = CDBResult::GetNavParams($arNavStartParams); $arSelectFields = array("IBLOCK_ID"); foreach ($arResult["ALLOWED_FIELDS"] as $key => $value) { $arSelectFields[] = $key; } $arResult["MEETINGS_LIST"] = array(); $dbMeetingsList = CIBlockSection::GetList($arOrderBy, $arFilter, false, $arSelectFields); while ($arMeeting = $dbMeetingsList->GetNext()) { $arMeeting["URI"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_MEETING"], array("meeting_id" => $arMeeting["ID"])); $arMeeting["ACTIONS"] = array(); $arMeeting["ACTIONS"][] = array("ICON" => "", "TITLE" => GetMessage("INTASK_C23_GRAPH"), "CONTENT" => "<b>" . GetMessage("INTASK_C23_GRAPH_DESCR") . "</b>", "ONCLICK" => "setTimeout(HideThisMenuS" . $arMeeting["ID"] . ", 900); jsUtils.Redirect([], '" . CUtil::JSEscape($arMeeting["URI"]) . "');"); if ($GLOBALS["USER"]->IsAuthorized() && ($GLOBALS["USER"]->IsAdmin() || Count(Array_Intersect($GLOBALS["USER"]->GetUserGroupArray(), $arParams["USERGROUPS_RESERVE"])) > 0)) { $arMeeting["ACTIONS"][] = array("ICON" => "", "TITLE" => GetMessage("INTASK_C23_RESERV"), "CONTENT" => GetMessage("INTASK_C23_RESERV_DESCR"), "ONCLICK" => "setTimeout(HideThisMenuS" . $arMeeting["ID"] . ", 900); jsUtils.Redirect([], '" . CUtil::JSEscape(CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_RESERVE_MEETING"], array("meeting_id" => $arMeeting["ID"], "item_id" => 0))) . "');"); } if ($GLOBALS["USER"]->IsAuthorized() && ($GLOBALS["USER"]->IsAdmin() || Count(Array_Intersect($GLOBALS["USER"]->GetUserGroupArray(), $arParams["USERGROUPS_MODIFY"])) > 0)) { $arMeeting["ACTIONS"][] = array("ICON" => "", "TITLE" => GetMessage("INTASK_C23_EDIT"), "CONTENT" => GetMessage("INTASK_C23_EDIT_DESCR"), "ONCLICK" => "setTimeout(HideThisMenuS" . $arMeeting["ID"] . ", 900); jsUtils.Redirect([], '" . CUtil::JSEscape(CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_MODIFY_MEETING"], array("meeting_id" => $arMeeting["ID"]))) . "');"); $p = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_MEETING_LIST"], array()); $p .= (StrPos($p, "?") === false ? "?" : "&") . "delete_meeting_id=" . $arMeeting["ID"] . "&" . bitrix_sessid_get(); $arMeeting["ACTIONS"][] = array("ICON" => "", "TITLE" => GetMessage("INTASK_C23_DELETE"), "CONTENT" => GetMessage("INTASK_C23_DELETE_DESCR"), "ONCLICK" => "if(confirm('" . CUtil::JSEscape(GetMessage("INTASK_C23_DELETE_CONF")) . "')){jsUtils.Redirect([], '" . CUtil::JSEscape($p) . "')};"); } $arResult["MEETINGS_LIST"][] = $arMeeting; } } //echo "<pre>".print_r($arResult, true)."</pre>"; $this->IncludeComponentTemplate();
continue; } } $fromTimeTmp = MkTime(Date("H", $fromTime), Date("i", $fromTime), Date("s", $fromTime), Date("n", $fromTime), Date("j", $fromTime), $arPeriod["year"]); $arDates[] = array("DATE_ACTIVE_FROM" => $fromTimeTmp, "DATE_ACTIVE_TO" => $fromTimeTmp + $arElement["PROPERTY_EVENT_LENGTH_VALUE"]); } $arElement["CREATED_BY_NAME"] = "-"; $dbUser = CUser::GetByID($arElement["CREATED_BY"]); if ($arUser = $dbUser->GetNext()) { $arElement["CREATED_BY_NAME"] = CUser::FormatName($arParams['NAME_TEMPLATE_WO_NOBR'], $arUser, $bUseLogin); $arElement["CREATED_BY_FIRST_NAME"] = $arUser["NAME"]; $arElement["CREATED_BY_LAST_NAME"] = $arUser["LAST_NAME"]; $arElement["CREATED_BY_SECOND_NAME"] = $arUser["SECOND_NAME"]; $arElement["CREATED_BY_LOGIN"] = $arUser["LOGIN"]; } if ($GLOBALS["USER"]->IsAuthorized() && ($GLOBALS["USER"]->IsAdmin() || Count(Array_Intersect($GLOBALS["USER"]->GetUserGroupArray(), $arParams["USERGROUPS_CLEAR"])) > 0 || $arElement["CREATED_BY"] == $GLOBALS["USER"]->GetID())) { $arElement["CLEAR_URI"] = $APPLICATION->GetCurPageParam("", array("clear_id")); $arElement["CLEAR_URI"] .= (StrPos($arElement["CLEAR_URI"], "?") === false ? "?" : "&") . "clear_id=" . $arElement["ID"] . "&" . bitrix_sessid_get(); } $arElement["VIEW_ITEM_URI"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_VIEW_ITEM"], array("meeting_id" => $arMeeting["ID"], "item_id" => $arElement["ID"])); $arElement["VIEW_ITEM_URI"] .= (StrPos($arElement["VIEW_ITEM_URI"], "?") === false ? "?" : "&") . "week_start=" . UrlEncode($arResult["WEEK_START"]); if ($GLOBALS["USER"]->IsAuthorized() && ($GLOBALS["USER"]->IsAdmin() || $arElement["CREATED_BY"] == $GLOBALS["USER"]->GetID())) { $arElement["EDIT_ITEM_URI"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_RESERVE_MEETING"], array("meeting_id" => $arMeeting["ID"], "item_id" => $arElement["ID"])); $arElement["EDIT_ITEM_URI"] .= (StrPos($arElement["EDIT_ITEM_URI"], "?") === false ? "?" : "&") . "week_start=" . UrlEncode($arResult["WEEK_START"]); } for ($counter = 0; $counter < Count($arDates); $counter++) { //echo Date("d.m.Y H:i:s", $arDates[$counter]["DATE_ACTIVE_FROM"])." - ".Date("d.m.Y H:i:s", $arDates[$counter]["DATE_ACTIVE_TO"])."<br>"; $arResult["ITEMS"][$arElement["ID"] . "-" . $counter] = $arElement; $arResult["ITEMS"][$arElement["ID"] . "-" . $counter]["DATE_ACTIVE_FROM_TIME"] = Date("H:i", $arDates[$counter]["DATE_ACTIVE_FROM"]); $arResult["ITEMS"][$arElement["ID"] . "-" . $counter]["DATE_ACTIVE_TO_TIME"] = Date("H:i", $arDates[$counter]["DATE_ACTIVE_TO"]); $from = __RM_PrepateDate($arDates[$counter]["DATE_ACTIVE_FROM"], $weekTimeStart, $weekTimeEnd);
if (IntVal($arParams["USERGROUPS_MODIFY"]) > 0) { $arParams["USERGROUPS_MODIFY"] = array($arParams["USERGROUPS_MODIFY"]); } else { $arParams["USERGROUPS_MODIFY"] = array(); } } if (!Is_Array($arParams["USERGROUPS_RESERVE"])) { if (IntVal($arParams["USERGROUPS_RESERVE"]) > 0) { $arParams["USERGROUPS_RESERVE"] = array($arParams["USERGROUPS_RESERVE"]); } else { $arParams["USERGROUPS_RESERVE"] = array(); } } $meetingId = IntVal($arParams["MEETING_ID"]); if ($meetingId <= 0) { $meetingId = IntVal($_REQUEST[$arParams["MEETING_VAR"]]); } $arResult["Page"] = Trim($arParams["PAGE_ID"]); if (StrLen($arResult["Page"]) <= 0) { $arResult["Page"] = Trim($_REQUEST[$arParams["PAGE_VAR"]]); } $arResult["Urls"]["MeetingList"] = $arParams["PATH_TO_MEETING_LIST"]; $arResult["Urls"]["ModifyMeeting"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_MODIFY_MEETING"], array("meeting_id" => $meetingId)); $arResult["Urls"]["CreateMeeting"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_MODIFY_MEETING"], array("meeting_id" => 0)); $arResult["Urls"]["Meeting"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_MEETING"], array("meeting_id" => $meetingId)); $arResult["Urls"]["Meeting"] .= (StrPos($arResult["Urls"]["Meeting"], "?") === false ? "?" : "&") . "week_start=" . UrlEncode($_REQUEST["week_start"]); $arResult["Urls"]["ReserveMeeting"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_RESERVE_MEETING"], array("meeting_id" => $meetingId, "item_id" => 0)); $arResult["Urls"]["Search"] = $arParams["PATH_TO_SEARCH"]; $arResult["Perms"]["CanModify"] = $GLOBALS["USER"]->IsAuthorized() && ($GLOBALS["USER"]->IsAdmin() || Count(Array_Intersect($GLOBALS["USER"]->GetUserGroupArray(), $arParams["USERGROUPS_MODIFY"])) > 0); $arResult["Perms"]["CanReserve"] = $GLOBALS["USER"]->IsAuthorized() && ($GLOBALS["USER"]->IsAdmin() || Count(Array_Intersect($GLOBALS["USER"]->GetUserGroupArray(), $arParams["USERGROUPS_RESERVE"])) > 0); $this->IncludeComponentTemplate();
} include_once $_SERVER['DOCUMENT_ROOT'] . "/bitrix/components/bitrix/intranet.reserve_meeting/init.php"; $ar = __IRM_InitReservation($iblockId); $arResult["ALLOWED_FIELDS"] = $ar["ALLOWED_FIELDS"]; $arResult["ALLOWED_ITEM_PROPERTIES"] = $ar["ALLOWED_ITEM_PROPERTIES"]; if ($arParams["SET_TITLE"] == "Y") { $APPLICATION->SetTitle(GetMessage("INTASK_C36_PAGE_TITLE")); } if ($arParams["SET_NAVCHAIN"] == "Y") { $APPLICATION->AddChainItem(GetMessage("INTASK_C36_PAGE_TITLE1"), CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_MEETING_LIST"], array())); } if (!$GLOBALS["USER"]->IsAuthorized()) { $arResult["FatalError"] = GetMessage("INTASK_C29_NEED_AUTH") . ". "; } if (StrLen($arResult["FatalError"]) <= 0) { if (!$GLOBALS["USER"]->IsAdmin() && Count(Array_Intersect($GLOBALS["USER"]->GetUserGroupArray(), $arParams["USERGROUPS_RESERVE"])) <= 0) { $arResult["FatalError"] = GetMessage("INTASK_C29_NO_RPERMS") . ". "; } } if (StrLen($arResult["FatalError"]) <= 0) { $arSelectFields = array("IBLOCK_ID"); foreach ($arResult["ALLOWED_FIELDS"] as $key => $value) { $arSelectFields[] = $key; } $dbMeeting = CIBlockSection::GetList(array(), array("ID" => $meetingId, "ACTIVE" => "Y", "IBLOCK_ID" => $iblockId), false, $arSelectFields); $arMeeting = $dbMeeting->GetNext(); if (!$arMeeting) { $arResult["FatalError"] = GetMessage("INAF_MEETING_NOT_FOUND") . " "; } } if (StrLen($arResult["FatalError"]) <= 0) {