- Модуль: timeman
- Путь к файлу: ~/bitrix/modules/timeman/lib/rest.php
- Класс: BitrixTimemanRest
- Вызов: Rest::getSettings
static function getSettings($query, $n, CRestServer $server)
{
global $USER;
$query = static::prepareQuery($query);
$tmUser = static::getUserInstance($query);
$currentSettings = $tmUser->getSettings();
// temporary fix timeman bug
if(mb_strpos($currentSettings['UF_TM_ALLOWED_DELTA'], ':') !== false)
{
$currentSettings['UF_TM_ALLOWED_DELTA'] = CTimeMan::MakeShortTS($currentSettings['UF_TM_ALLOWED_DELTA']);
}
$result = array(
'UF_TIMEMAN' => $currentSettings['UF_TIMEMAN'],
'UF_TM_FREE' => $currentSettings['UF_TM_FREE'],
'UF_TM_MAX_START' => static::formatTime($currentSettings['UF_TM_MAX_START']),
'UF_TM_MIN_FINISH' => static::formatTime($currentSettings['UF_TM_MIN_FINISH']),
'UF_TM_MIN_DURATION' => static::formatTime($currentSettings['UF_TM_MIN_DURATION']),
'UF_TM_ALLOWED_DELTA' => static::formatTime($currentSettings['UF_TM_ALLOWED_DELTA']),
);
if($USER->GetID() == $tmUser->GetID())
{
$result['ADMIN'] = CTimeMan::IsAdmin();
}
return $result;
}