- Модуль: intranet
- Путь к файлу: ~/bitrix/modules/intranet/classes/general/ws_calendar.php
- Класс: CIntranetCalendarWS
- Вызов: CIntranetCalendarWS::GetList
function GetList($listName)
{
global $APPLICATION;
//todo: check read access for calendar
if (!$listName_original = CIntranetUtils::checkGUID($listName))
{
return new CSoapFault(
'Data error',
'Wrong GUID - '.$listName
);
}
$listName = ToUpper(CIntranetUtils::makeGUID($listName_original));
$obRes = CIBlockSection::GetList(array('SORT' => 'ASC'), array('XML_ID' => $listName_original));
if (!$arSection = $obRes->Fetch())
{
return new CSoapFault(
'List not found',
'List with '.$listName.' GUID not found'
);
}
$dbAuthor = CUser::GetByID($arSection['CREATED_BY']);
$arAuthor = $dbAuthor->Fetch();
$data = new CXMLCreator('List');
$data->setAttribute('ID', $listName);
$data->setAttribute('Name', $listName);
$data->setAttribute('Title', $arSection['NAME']);
$data->setAttribute('Created', date('Ymd H:i:s', MakeTimeStamp($arSection['DATE_CREATE'])));
$data->setAttribute('Modified', date('Ymd H:i:s', MakeTimeStamp($arSection['TIMESTAMP_X'])));
$data->setAttribute('Direction', 'none'); // RTL, LTR
$data->setAttribute('ReadSecurity', '2');
$data->setAttribute('WriteSecurity', '2');
$name = $arAuthor['NAME'];
if ($arAuthor['LAST_NAME'])
$name .= ' '.$arAuthor['LAST_NAME'];
if (!$name)
$name .= $arAuthor['LOGIN'];
$data->setAttribute('Author', $arAuthor['ID'].';#'.$name);
$data->addChild($this->__getFieldsDefinition());
$data->addChild($obNode = new CXMLCreator('RegionalSettings'));
$obNode->addChild(CXMLCreator::createTagAttributed('Language', '1049'));
$obNode->addChild(CXMLCreator::createTagAttributed('Locale', '1049'));
$obNode->addChild(CXMLCreator::createTagAttributed('SortOrder', '1026'));
$obNode->addChild(CXMLCreator::createTagAttributed('TimeZone', CIntranetUtils::getOutlookTimeZone()));
$obNode->addChild(CXMLCreator::createTagAttributed('AdvanceHijri', '0'));
$obNode->addChild(CXMLCreator::createTagAttributed('CalendarType', '1'));
$obNode->addChild(CXMLCreator::createTagAttributed('Time24', 'True'));
$obNode->addChild(CXMLCreator::createTagAttributed('Presence', 'True'));
$data->addChild($obNode = new CXMLCreator('ServerSettings'));
$obNode->addChild(CXMLCreator::createTagAttributed('ServerVersion', '12.0.0.6219'));
$obNode->addChild(CXMLCreator::createTagAttributed('RecycleBinEnabled', 'False'));
$obNode->addChild(CXMLCreator::createTagAttributed('ServerRelativeUrl', '/company/absence.php'));
return array('GetListResult' => $data);
}