1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
timemanreport.php
См. документацию.
1
<?php
2
3
namespace
Bitrix\Socialnetwork\Livefeed;
4
5
use Bitrix\Main\Config\Option;
6
use Bitrix\Main\Loader;
7
use Bitrix\Main\Localization\Loc;
8
9
Loc::loadMessages(__FILE__);
10
11
final
class
TimemanReport
extends
Provider
12
{
13
public
const
PROVIDER_ID
=
'TIMEMAN_REPORT'
;
14
public
const
CONTENT_TYPE_ID
=
'TIMEMAN_REPORT'
;
15
16
public
static
function
getId
(): string
17
{
18
return
static::PROVIDER_ID;
19
}
20
21
public
function
getEventId
():
array
22
{
23
return
[
'report'
];
24
}
25
26
public
function
getType
(): string
27
{
28
return
Provider::TYPE_POST
;
29
}
30
31
public
function
getCommentProvider
(): Provider
32
{
33
return
new
ForumPost
();
34
}
35
36
public
function
initSourceFields
()
37
{
38
static
$cache = [];
39
40
$timemanReportId =
$this->entityId
;
41
42
if
($timemanReportId <= 0)
43
{
44
return
;
45
}
46
47
if
(isset($cache[$timemanReportId]))
48
{
49
$timemanReport = $cache[$timemanReportId];
50
}
51
elseif
(Loader::includeModule(
'timeman'
))
52
{
53
$res
= \CTimeManReportFull::getById($timemanReportId);
54
$timemanReport =
$res
->fetch();
55
$cache[$timemanReportId] = $timemanReport;
56
}
57
58
if
(!empty($timemanReport))
59
{
60
$this->
setSourceFields
($timemanReport);
61
62
$userName
=
''
;
63
$res
= \CUser::getById($timemanReport[
'USER_ID'
]);
64
if
($userFields =
$res
->fetch())
65
{
66
$userName
= \CUser::formatName(
67
\CSite::getNameFormat(),
68
$userFields,
69
true
,
70
false
71
);
72
}
73
74
$this->
setSourceTitle
(Loc::getMessage(
'SONET_LIVEFEED_TIMEMAN_REPORT_TITLE'
,
array
(
75
'#USER_NAME#'
=>
$userName
,
76
'#DATE#'
=>
FormatDate
(
'j F'
,
MakeTimeStamp
($timemanReport[
'DATE_FROM'
])).
" - "
.
FormatDate
(
'j F'
,
MakeTimeStamp
($timemanReport[
'DATE_TO'
]))
77
)));
78
}
79
else
80
{
81
$this->
setSourceTitle
($this->
getUnavailableTitle
());
82
}
83
}
84
85
public
static
function
canRead
(
$params
): bool
86
{
87
return
true
;
88
}
89
90
protected
function
getPermissions
(
array
$post
): string
91
{
92
return
self::PERMISSION_READ;
93
}
94
95
public
function
getLiveFeedUrl
(): string
96
{
97
$pathToLogEntry =
''
;
98
99
$logId
= $this->
getLogId
();
100
if
(
$logId
)
101
{
102
$pathToLogEntry = Option::get(
'socialnetwork'
,
'log_entry_page'
,
''
, $this->
getSiteId
());
103
if
(!empty($pathToLogEntry))
104
{
105
$pathToLogEntry =
\CComponentEngine::makePathFromTemplate
($pathToLogEntry,
array
(
"log_id"
=>
$logId
));
106
}
107
}
108
return
$pathToLogEntry;
109
}
110
}
Bitrix\Socialnetwork\Livefeed\ForumPost
Определения
forumpost.php:22
Bitrix\Socialnetwork\Livefeed\Provider\$logId
$logId
Определения
provider.php:55
Bitrix\Socialnetwork\Livefeed\Provider\setSourceFields
setSourceFields(array $fields)
Определения
provider.php:639
Bitrix\Socialnetwork\Livefeed\Provider\getUnavailableTitle
getUnavailableTitle()
Определения
provider.php:1490
Bitrix\Socialnetwork\Livefeed\Provider\setSourceTitle
setSourceTitle($title)
Определения
provider.php:677
Bitrix\Socialnetwork\Livefeed\Provider\getSiteId
getSiteId()
Определения
provider.php:97
Bitrix\Socialnetwork\Livefeed\Provider\TYPE_POST
const TYPE_POST
Определения
provider.php:25
Bitrix\Socialnetwork\Livefeed\Provider\$entityId
$entityId
Определения
provider.php:53
Bitrix\Socialnetwork\Livefeed\Provider\getLogId
getLogId($params=[])
Определения
provider.php:336
Bitrix\Socialnetwork\Livefeed\TimemanReport
Определения
timemanreport.php:12
Bitrix\Socialnetwork\Livefeed\TimemanReport\initSourceFields
initSourceFields()
Определения
timemanreport.php:36
Bitrix\Socialnetwork\Livefeed\TimemanReport\getCommentProvider
getCommentProvider()
Определения
timemanreport.php:31
Bitrix\Socialnetwork\Livefeed\TimemanReport\CONTENT_TYPE_ID
const CONTENT_TYPE_ID
Определения
timemanreport.php:14
Bitrix\Socialnetwork\Livefeed\TimemanReport\getPermissions
getPermissions(array $post)
Определения
timemanreport.php:90
Bitrix\Socialnetwork\Livefeed\TimemanReport\getType
getType()
Определения
timemanreport.php:26
Bitrix\Socialnetwork\Livefeed\TimemanReport\getLiveFeedUrl
getLiveFeedUrl()
Определения
timemanreport.php:95
Bitrix\Socialnetwork\Livefeed\TimemanReport\getEventId
getEventId()
Определения
timemanreport.php:21
Bitrix\Socialnetwork\Livefeed\TimemanReport\canRead
static canRead($params)
Определения
timemanreport.php:85
Bitrix\Socialnetwork\Livefeed\TimemanReport\getId
static getId()
Определения
timemanreport.php:16
Bitrix\Socialnetwork\Livefeed\TimemanReport\PROVIDER_ID
const PROVIDER_ID
Определения
timemanreport.php:13
CComponentEngine\makePathFromTemplate
static makePathFromTemplate($template, $arParams=array())
Определения
component_engine.php:355
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
FormatDate
FormatDate($format="", $timestamp=false, $now=false, ?string $languageId=null)
Определения
tools.php:871
MakeTimeStamp
MakeTimeStamp($datetime, $format=false)
Определения
tools.php:538
elseif
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
Определения
prolog_main_admin.php:393
$userName
else $userName
Определения
order_form.php:75
$params
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']
Определения
template.php:799
$post
$post
Определения
template.php:8
bitrix
modules
socialnetwork
lib
livefeed
timemanreport.php
Создано системой
1.14.0