Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
userschedule.php
1
<?php
2
namespace
Bitrix\Bizproc\Service\Sub
;
3
4
use
Bitrix\Main
;
5
11
class
UserSchedule
12
{
13
protected
$userId
;
14
15
public
function
__construct
(
int
$userId
)
16
{
17
$this->userId =
$userId
;
18
}
19
20
public
function
isAbsent
(): bool
21
{
22
if
($this->canUseIntranet())
23
{
24
return \CIntranetUtils::isUserAbsent($this->userId);
25
}
26
27
return
false
;
28
}
29
30
public
function
isWorkDayClosed
(): bool
31
{
32
return
($this->
getWorkDayStatus
() ===
'CLOSED'
);
33
}
34
35
public
function
getWorkDayStatus
(): string
36
{
37
if
($this->canUseTimeman())
38
{
39
$tmUser = new \CTimeManUser($this->userId);
40
41
//speed up!
42
if
(method_exists($tmUser,
'getCurrentRecordStatus'
))
43
{
44
return
$tmUser->getCurrentRecordStatus();
45
}
46
47
return
$tmUser->state();
48
}
49
50
return
'UNDEFINED'
;
51
}
52
53
private
function
canUseIntranet()
54
{
55
return
Main\Loader::includeModule(
'intranet'
);
56
}
57
58
private
function
canUseTimeman()
59
{
60
return
Main\Loader::includeModule(
'timeman'
);
61
}
62
}
Bitrix\Bizproc\Service\Sub\UserSchedule
Definition
userschedule.php:12
Bitrix\Bizproc\Service\Sub\UserSchedule\isWorkDayClosed
isWorkDayClosed()
Definition
userschedule.php:30
Bitrix\Bizproc\Service\Sub\UserSchedule\getWorkDayStatus
getWorkDayStatus()
Definition
userschedule.php:35
Bitrix\Bizproc\Service\Sub\UserSchedule\isAbsent
isAbsent()
Definition
userschedule.php:20
Bitrix\Bizproc\Service\Sub\UserSchedule\$userId
$userId
Definition
userschedule.php:13
Bitrix\Bizproc\Service\Sub\UserSchedule\__construct
__construct(int $userId)
Definition
userschedule.php:15
Bitrix\Bizproc\Service\Sub
Definition
userschedule.php:2
Bitrix\Main
modules
bizproc
lib
service
sub
userschedule.php
Создано системой
1.10.0