• Модуль: calendar
  • Путь к файлу: ~/bitrix/modules/calendar/classes/general/calendar_webservice.php
  • Класс: CCalendarWebService
  • Вызов: CCalendarWebService::GetList
function GetList($listName)
{
	if (!$listName_original = CIntranetUtils::checkGUID($listName))
	{
		return new CSoapFault(
			'Data error',
			'Wrong GUID - '.$listName
		);
	}

	$listName = ToUpper(CIntranetUtils::makeGUID($listName_original));
	$arSections = CCalendarSect::GetList(
		array(
			'arFilter' => array('XML_ID' => mb_strtolower($listName_original))
		)
	);

	if (!$arSections || !is_array($arSections[0]))
		return new CSoapFault(
			'List not found',
			'List with '.$listName.' GUID not found'
		);
	$arSection = $arSections[0];

	$data = new CXMLCreator('List');
	$data->setAttribute('ID', $listName);
	$data->setAttribute('Name', $listName);
	$data->setAttribute('Title', $arSection['NAME']);

	$data->setAttribute('Direction', 'none'); // RTL, LTR
	$data->setAttribute('ReadSecurity', '2');
	$data->setAttribute('WriteSecurity', '2');

	$data->setAttribute('Author', $arSection['CREATED_BY'].';#'.CCalendar::GetUserName($arSection['CREATED_BY']));

	$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'));
	// TODO: replace following code with commented line below
	$obNode->addChild(CXMLCreator::createTagAttributed('TimeZone', -(intval(date('Z')) + CTimeZone::GetOffset(null, true))/60));
	//$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', '/timeman/'));

	return array('GetListResult' => $data);
}