8namespace Bitrix\Socialnetwork\Item;
10use Bitrix\Main\Loader;
11use Bitrix\Socialnetwork\UserWelltoryTable;
28 $value = \CUserOptions::getOption(
30 self::getAccessOptionName(),
35 return ($value ==
'Y' ?
'Y' :
'N');
54 return (\CUserOptions::setOption(
56 self::getAccessOptionName(),
82 $intranetInstalled = Loader::includeModule(
'intranet');
84 $res = UserWelltoryTable::getList([
89 'DATE_MEASURE' =>
'desc'
91 'select' => [
'ID',
'DATE_MEASURE',
'STRESS',
'STRESS_TYPE',
'STRESS_COMMENT',
'HASH' ],
94 while ($dataFields =
$res->fetch())
97 'id' => $dataFields[
'ID'],
98 'date' => $dataFields[
'DATE_MEASURE'],
99 'value' => intval($dataFields[
'STRESS']),
100 'type' => ($dataFields[
'STRESS_TYPE'] <>
'' ? $dataFields[
'STRESS_TYPE'] :
''),
101 'typeDescription' => ($intranetInstalled ? :
''),
102 'comment' => ($dataFields[
'STRESS_COMMENT'] <>
'' ? $dataFields[
'STRESS_COMMENT'] :
''),
103 'hash' => ($dataFields[
'HASH'] <>
'' ? $dataFields[
'HASH'] :
'')
105 $item[
'typeDescription'] = ($intranetInstalled ? \Bitrix\Intranet\Component\UserProfile\StressLevel::getTypeDescription($item[
'type'], $item[
'value']) :
'');
112 private static function getAccessOptionName()
114 return "welltory_access";
if(!is_object($USER)||! $USER->IsAuthorized()) $userId
static setAccess(array $fields=[])
static getHistoricData(array $fields=[])
static getAccess(array $fields=[])
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)