Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
resourcebookingajax.php
1
<?php
2
namespace
Bitrix\Calendar\Controller
;
3
4
use
Bitrix\Calendar\UserField\ResourceBooking
;
5
use
Bitrix\Main\Engine\ActionFilter
;
6
use
Bitrix\Main\Text\Encoding
;
7
use
Bitrix\Main\Localization\Loc
;
8
use
Bitrix\Main\Web\Json
;
9
10
Loc::loadMessages
(__FILE__);
11
16
class
ResourceBookingAjax
extends
\Bitrix\Main\Engine\Controller
17
{
18
public
function
configureActions
()
19
{
20
return
[
21
'getFillFormData'
=> [
22
'-prefilters'
=> [
23
ActionFilter\Authentication::class,
24
ActionFilter\Csrf::class
25
],
26
'+postfilters'
=> [
27
new
ActionFilter\Cors()
28
],
29
],
30
];
31
}
32
33
public
function
getPlannerDataAction
()
34
{
35
$request
= $this->
getRequest
();
36
37
return \CCalendarPlanner::prepareData(array(
38
'user_id'
=> \CCalendar::getCurUserId(),
39
'codes'
=>
$request
->getPost(
'codes'
),
40
'resources'
=>
$request
->getPost(
'resources'
),
41
'date_from'
=> \CCalendar::date(\CCalendar::timestamp(
$request
->getPost(
'from'
)),
false
),
42
'date_to'
=> \CCalendar::date(\CCalendar::timestamp(
$request
->getPost(
'to'
)),
false
),
43
'timezone'
=> \CCalendar::getUserTimezoneName(\CCalendar::getCurUserId()),
44
'skipEntryList'
=>
$request
->getPost(
'currentEventList'
)
45
));
46
}
47
48
public
function
getDefaultUserfieldSettingsAction
()
49
{
50
return
ResourceBooking::prepareSettings
();
51
}
52
53
public
function
getBitrix24LimitationAction
()
54
{
55
return
ResourceBooking::getBitrx24Limitation
();
56
}
57
58
public
function
getUserSelectorDataAction
()
59
{
60
$request
= $this->
getRequest
();
61
62
$selectedUserList = [];
63
if
(!empty(
$request
[
'selectedUserList'
]) && is_array(
$request
[
'selectedUserList'
]))
64
{
65
$selectedUserList =
$request
[
'selectedUserList'
];
66
}
67
68
return \CCalendar::getSocNetDestination(
false
, array(), $selectedUserList);
69
}
70
71
public
function
getFieldParamsAction
()
72
{
73
$request
= $this->
getRequest
();
74
return
ResourceBooking::getUserFieldByFieldName
(
$request
[
'fieldname'
],
$request
[
'selectedUsers'
]);
75
}
76
77
public
function
getFillFormDataAction
()
78
{
79
$request
= $this->
getRequest
();
80
$settingsData =
$request
[
'settingsData'
];
81
82
if
(is_string($settingsData) && $settingsData)
83
{
84
$settingsData = Encoding::convertEncoding($settingsData, SITE_CHARSET,
'UTF-8'
);
85
$settingsData = Json::decode($settingsData);
86
}
87
88
return
ResourceBooking::getFillFormData
(
89
$settingsData,
90
[
91
'fieldName'
=>
$request
[
'fieldName'
],
92
'from'
=>
$request
[
'from'
],
93
'to'
=>
$request
[
'to'
]
94
]
95
);
96
}
97
}
Bitrix\Calendar\Controller\ResourceBookingAjax
Definition
resourcebookingajax.php:17
Bitrix\Calendar\Controller\ResourceBookingAjax\getPlannerDataAction
getPlannerDataAction()
Definition
resourcebookingajax.php:33
Bitrix\Calendar\Controller\ResourceBookingAjax\getDefaultUserfieldSettingsAction
getDefaultUserfieldSettingsAction()
Definition
resourcebookingajax.php:48
Bitrix\Calendar\Controller\ResourceBookingAjax\getFillFormDataAction
getFillFormDataAction()
Definition
resourcebookingajax.php:77
Bitrix\Calendar\Controller\ResourceBookingAjax\getFieldParamsAction
getFieldParamsAction()
Definition
resourcebookingajax.php:71
Bitrix\Calendar\Controller\ResourceBookingAjax\configureActions
configureActions()
Definition
resourcebookingajax.php:18
Bitrix\Calendar\Controller\ResourceBookingAjax\getUserSelectorDataAction
getUserSelectorDataAction()
Definition
resourcebookingajax.php:58
Bitrix\Calendar\Controller\ResourceBookingAjax\getBitrix24LimitationAction
getBitrix24LimitationAction()
Definition
resourcebookingajax.php:53
Bitrix\Calendar\UserField\ResourceBooking
Definition
resourcebooking.php:18
Bitrix\Calendar\UserField\ResourceBooking\getUserFieldByFieldName
static getUserFieldByFieldName($fieldName='', $selectedUsers=[])
Definition
resourcebooking.php:1169
Bitrix\Calendar\UserField\ResourceBooking\getFillFormData
static getFillFormData($data=[], $params=[])
Definition
resourcebooking.php:1216
Bitrix\Calendar\UserField\ResourceBooking\getBitrx24Limitation
static getBitrx24Limitation()
Definition
resourcebooking.php:1119
Bitrix\Calendar\UserField\ResourceBooking\prepareSettings
static prepareSettings($userField=[])
Definition
resourcebooking.php:44
Bitrix\Main\Engine\Controller
Definition
controller.php:32
Bitrix\Main\Engine\Controller\$request
$request
Definition
controller.php:48
Bitrix\Main\Engine\Controller\getRequest
getRequest()
Definition
controller.php:351
Bitrix\Main\Localization\Loc
Definition
loc.php:11
Bitrix\Main\Localization\Loc\loadMessages
static loadMessages($file)
Definition
loc.php:64
Bitrix\Main\Text\Encoding
Definition
encoding.php:8
Bitrix\Main\Web\Json
Definition
json.php:11
Bitrix\Calendar\Controller
Definition
calendarajax.php:2
Bitrix\Main\Engine\ActionFilter
Definition
authentication.php:4
modules
calendar
lib
controller
resourcebookingajax.php
Создано системой
1.10.0