1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
livefeedindexcalendar.php
См. документацию.
1
<?
2
namespace
Bitrix\Calendar\Update;
3
4
use \Bitrix\Main\Update\Stepper;
5
use \Bitrix\Main\Localization\Loc;
6
use \Bitrix\Calendar\Integration;
7
use \Bitrix\Socialnetwork\Item\LogIndex;
8
use \Bitrix\Socialnetwork\LogTable;
9
use \Bitrix\Socialnetwork\LogIndexTable;
10
use \Bitrix\Main\Config\Option;
11
use \Bitrix\Main\Loader;
12
13
Loc::loadMessages(__FILE__);
14
15
final
class
LivefeedIndexCalendar
extends
Stepper
16
{
17
protected
static
$moduleId
=
"calendar"
;
18
19
public
function
execute
(
array
&
$result
)
20
{
21
if
(!(
22
Loader::includeModule(
"calendar"
)
23
&& Loader::includeModule(
"socialnetwork"
)
24
&& Option::get(
'calendar'
,
'needLivefeedIndex'
,
'Y'
) ==
'Y'
25
))
26
{
27
return
false
;
28
}
29
30
$return =
false
;
31
32
$result
[
"title"
] = Loc::getMessage(
"FUPD_LF_CALENDAR_EVENT_INDEX_TITLE"
);
33
$result
[
"progress"
] = 1;
34
$result
[
"steps"
] =
""
;
35
$result
[
"count"
] =
""
;
36
37
$params
= Option::get(
"calendar"
,
"livefeedindexcalendar"
,
""
);
38
39
$params
= (
$params
!==
""
? @unserialize(
$params
, [
'allowed_classes'
=>
false
]) :
array
());
40
$params
= (is_array(
$params
) ?
$params
:
array
());
41
if
(empty(
$params
))
42
{
43
$params
=
array
(
44
"lastId"
=> 0,
45
"number"
=> 0,
46
"count"
=> LogTable::getCount(
47
array
(
48
'@EVENT_ID'
=>
Integration
\
Socialnetwork
\Log::getEventIdList(),
49
'!SOURCE_ID'
=>
false
50
)
51
)
52
);
53
if
(
$params
[
"count"
] > 0)
54
{
55
Option::set(
"calendar"
,
"livefeedindexcalendar"
, serialize(
$params
));
56
}
57
else
58
{
59
return
$return;
60
}
61
}
62
63
if
(
64
isset(
$params
[
"finished"
])
65
&&
$params
[
"finished"
] ===
true
66
)
67
{
68
Option::delete(
"calendar"
,
array
(
"name"
=>
"livefeedindexcalendar"
));
69
Option::set(
'calendar'
,
'needLivefeedIndex'
,
'N'
);
70
return
false
;
71
}
72
else
73
{
74
$return =
true
;
75
}
76
77
$result
[
"progress"
] = intval(
$params
[
"number"
] * 100/
$params
[
"count"
]);
78
$result
[
"steps"
] =
$params
[
"number"
];
79
$result
[
"count"
] =
$params
[
"count"
];
80
81
if
(
$params
[
"count"
] > 0)
82
{
83
$tmpUser =
false
;
84
if
(!isset(
$GLOBALS
[
"USER"
]) || !is_object(
$GLOBALS
[
"USER"
]))
85
{
86
$tmpUser = True;
87
$GLOBALS
[
"USER"
] = new \CUser;
88
}
89
90
\Bitrix\Calendar\Update\LivefeedIndexCalendar::run
();
91
92
if
($tmpUser)
93
{
94
unset(
$GLOBALS
[
"USER"
]);
95
}
96
}
97
98
return
$return;
99
}
100
101
public
static
function
run
()
102
{
103
$params
= Option::get(
"calendar"
,
"livefeedindexcalendar"
,
false
);
104
$params
= (
$params
!==
""
? @unserialize(
$params
, [
'allowed_classes'
=>
false
]) :
array
());
105
106
$found =
false
;
107
108
if
(
109
is_array(
$params
)
110
&& intval(
$params
[
"lastId"
]) >= 0
111
)
112
{
113
$res
= LogTable::getList(
array
(
114
'order'
=>
array
(
'ID'
=>
'ASC'
),
115
'filter'
=>
array
(
116
'>ID'
=>
$params
[
"lastId"
],
117
'@EVENT_ID'
=>
Integration
\
Socialnetwork
\Log::getEventIdList(),
118
'!SOURCE_ID'
=>
false
119
),
120
'select'
=>
array
(
'ID'
,
'EVENT_ID'
,
'SOURCE_ID'
),
121
'offset'
=> 0,
122
'limit'
=> 100
123
));
124
125
while
($record =
$res
->fetch())
126
{
127
LogIndex::setIndex(
array
(
128
'itemType'
=> LogIndexTable::ITEM_TYPE_LOG,
129
'itemId'
=> $record[
'ID'
],
130
'fields'
=> $record
131
));
132
133
$params
[
"lastId"
] = $record[
'ID'
];
134
$params
[
"number"
]++;
135
$found =
true
;
136
}
137
}
138
139
if
(!$found)
140
{
141
$params
[
"finished"
] =
true
;
142
}
143
144
Option::set(
"calendar"
,
"livefeedindexcalendar"
, serialize(
$params
));
145
}
146
}
147
?>
Bitrix\Calendar\Update\LivefeedIndexCalendar
Определения
livefeedindexcalendar.php:16
Bitrix\Calendar\Update\LivefeedIndexCalendar\execute
execute(array &$result)
Определения
livefeedindexcalendar.php:19
Bitrix\Calendar\Update\LivefeedIndexCalendar\$moduleId
static $moduleId
Определения
livefeedindexcalendar.php:17
Bitrix\Calendar\Update\LivefeedIndexCalendar\run
static run()
Определения
livefeedindexcalendar.php:101
Bitrix\Main\Update\Stepper
Определения
stepper.php:29
array
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения
file_new.php:804
$res
$res
Определения
filter_act.php:7
$result
$result
Определения
get_property_values.php:14
Bitrix\Calendar\Integration
Bitrix\Main\$GLOBALS
$GLOBALS['____1690880296']
Определения
license.php:1
Bitrix\Socialnetwork
$params
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']
Определения
template.php:799
bitrix
modules
calendar
lib
update
livefeedindexcalendar.php
Создано системой
1.14.0