1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
calendar_request.php
См. документацию.
1<?
2
7
9{
10 private static
11 $request,
12 $reqId,
13 $calendar;
14
15 public static function Process(CCalendar $calendar, $action = '')
16 {
17 global $APPLICATION;
18
19 self::$request = \Bitrix\Main\Context::getCurrent()->getRequest()->toArray();
20
21 self::$calendar = $calendar;
22
23 // Export calendar
24 if ($action === 'export')
25 {
26 // We don't need to check access couse we will check security SIGN from the URL
27 $sectId = (int)$_GET['sec_id'];
28 if (($_GET['check'] ?? null) === 'Y') // Just for access check from calendar interface
29 {
30 $APPLICATION->RestartBuffer();
31 if (CCalendarSect::CheckSign($_GET['sign'], (int)$_GET['user'], $sectId > 0 ? $sectId : 'superposed_calendars'))
32 {
33 echo 'BEGIN:VCALENDAR';
34 }
35 CMain::FinalActions();
36 die();
37 }
38
39 if ($sectId > 0 && CCalendarSect::CheckAuthHash())
40 {
41 // We don't need any warning in .ics file
42 error_reporting(E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR|E_PARSE);
43 CCalendarSect::ReturnICal(array(
44 'sectId' => $sectId,
45 'userId' => (int)$_GET['user'],
46 'sign' => $_GET['sign'],
47 'type' => $_GET['type'],
48 'ownerId' => (int)$_GET['owner']
49 ));
50 }
51 else
52 {
53 $APPLICATION->RestartBuffer();
54 }
55 }
56 else
57 {
58 // Check the access
59 $accessController = new TypeAccessController(CCalendar::GetUserId());
60 $typeModel = TypeModel::createFromXmlId(CCalendar::GetType());
61 $action = ActionDictionary::ACTION_TYPE_VIEW;
62
63 if (!$accessController->check($action, $typeModel) || !check_bitrix_sessid())
64 {
65 $APPLICATION->ThrowException(Loc::getMessage("EC_ACCESS_DENIED"));
66 return false;
67 }
68
69 $APPLICATION->ShowAjaxHead();
70 $APPLICATION->RestartBuffer();
71 self::$reqId = (int)$_REQUEST['reqId'];
72
73 switch ($action)
74 {
75 case 'set_meeting_status':
77 break;
78 case 'get_planner':
80 break;
81 case 'update_planner':
83 break;
84 case 'get_destination_items':
86 break;
87 }
88 }
89
90 if($ex = $APPLICATION->GetException())
91 {
92 ShowError($ex->GetString());
93 }
94
95 CMain::FinalActions();
96 die();
97 }
98
99 public static function OutputJSRes($reqId = false, $res = false)
100 {
101 if ($res === false)
102 {
103 return;
104 }
105 if ($reqId === false)
106 {
107 $reqId = (int)($_REQUEST['reqId'] ?? null);
108 }
109 if (!$reqId)
110 {
111 return;
112 }
113 ?>
114 <script>top.BXCRES['<?= $reqId?>'] = <?= CUtil::PhpToJSObject($res)?>;</script>
115 <?
116 }
117
118 public static function SetStatus()
119 {
120 CCalendarEvent::SetMeetingStatusEx(array(
121 'attendeeId' => CCalendar::GetUserId(),
122 'eventId' => (int)$_REQUEST['event_id'],
123 'parentId' => (int)$_REQUEST['parent_id'],
124 'status' => in_array($_REQUEST['status'], array('Q', 'Y', 'N')) ? $_REQUEST['status'] : 'Q',
125 'reccurentMode' => in_array($_REQUEST['reccurent_mode'], array('this', 'next', 'all')) ? $_REQUEST['reccurent_mode'] : false,
126 'currentDateFrom' => CCalendar::Date(CCalendar::Timestamp($_REQUEST['current_date_from']), false)
127 ));
128
129 self::OutputJSRes(self::$reqId, true);
130 }
131
132 public static function GetPlanner()
133 {
134 global $APPLICATION;
135 $APPLICATION->ShowAjaxHead();
136
137 $plannerId = $_REQUEST['planner_id'];
138 ?><?CCalendarPlanner::Init(array('id' => $plannerId));?><?
139 }
140
141 public static function UpdatePlanner()
142 {
143 $curEventId = (int)self::$request['cur_event_id'];
144 $curUserId = CCalendar::GetCurUserId();
145 $codes = false;
146 if (isset(self::$request['codes']) && is_array(self::$request['codes']))
147 {
148 $codes = array();
149 foreach(self::$request['codes'] as $code)
150 {
151 if($code)
152 {
153 $codes[] = $code;
154 }
155 }
156
157 if(self::$request['add_cur_user_to_list'] === 'Y' || count($codes) <= 0)
158 {
159 $codes[] = 'U'.$curUserId;
160 }
161 }
162
163 $result = CCalendarPlanner::PrepareData(array(
164 'entry_id' => $curEventId,
165 'user_id' => $curUserId,
166 'codes' => $codes,
167 'entries' => self::$request['entries'],
168 'date_from' => CCalendar::Date(CCalendar::Timestamp(self::$request['date_from']), false),
169 'date_to' => CCalendar::Date(CCalendar::Timestamp(self::$request['date_to']), false),
170 'timezone' => self::$request['timezone'],
171 'location' => trim(self::$request['location']),
172 'roomEventId' => (int)self::$request['roomEventId']
173 ));
174
175 self::OutputJSRes(self::$reqId, $result);
176 }
177
178 public static function getDestinationItems()
179 {
180 self::OutputJSRes(self::$reqId,
181 array(
182 'result' => true,
183 'destinationItems' => CCalendar::GetSocNetDestination(false, self::$request['codes'])
184 )
185 );
186 }
187}
188
189?>
global $APPLICATION
Определения include.php:80
$accessController
Определения options.php:23
Определения calendar.php:50
static Init($config=[], $initialParams=false)
Определения calendar_planner.php:11
static SetStatus()
Определения calendar_request.php:118
static OutputJSRes($reqId=false, $res=false)
Определения calendar_request.php:99
static Process(CCalendar $calendar, $action='')
Определения calendar_request.php:15
static UpdatePlanner()
Определения calendar_request.php:141
static GetPlanner()
Определения calendar_request.php:132
static getDestinationItems()
Определения calendar_request.php:178
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
bx_acc_lim_group_list limitGroupList[] multiple<?=$group[ 'ID']?> ID selected margin top
Определения file_new.php:657
$res
Определения filter_act.php:7
$_REQUEST["admin_mnu_menu_id"]
Определения get_menu.php:8
$result
Определения get_property_values.php:14
if(!is_null($config))($config as $configItem)(! $configItem->isVisible()) $code
Определения options.php:195
check_bitrix_sessid($varname='sessid')
Определения tools.php:4686
ShowError($strError, $cls="errortext")
Определения tools.php:4499
die
Определения quickway.php:367
</p ></td >< td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0cm 2.0pt 0cm 2.0pt;height:9.0pt'>< p class=Normal align=center style='margin:0cm;margin-bottom:.0001pt;text-align:center;line-height:normal'>< a name=ТекстовоеПоле54 ></a ><?=($taxRate > count( $arTaxList) > 0) ? $taxRate."%"
Определения waybill.php:936
$action
Определения file_dialog.php:21