• Модуль: dav
  • Путь к файлу: ~/bitrix/modules/dav/classes/general/exchangeclient.php
  • Класс: CDavExchangeClient
  • Вызов: CDavExchangeClient::ConvertRecurrenceToArray
protected function ConvertRecurrenceToArray($recurrence)
{
	$arResultItem = array();

	$arAbsoluteMonthlyRecurrence = $recurrence->GetPath("/Recurrence/AbsoluteMonthlyRecurrence");
	if (!empty($arAbsoluteMonthlyRecurrence))
	{
		$arResultItem["RECURRING_TYPE"] = "MONTHLY_ABSOLUTE";
		$arAbsoluteMonthlyRecurrenceInterval = $recurrence->GetPath("/Recurrence/AbsoluteMonthlyRecurrence/Interval");
		if (!empty($arAbsoluteMonthlyRecurrenceInterval))
		{
			$arResultItem["RECURRING_INTERVAL"] = $arAbsoluteMonthlyRecurrenceInterval[0]->GetContent();
		}
		$arAbsoluteMonthlyRecurrenceDayOfMonth = $recurrence->GetPath("/Recurrence/AbsoluteMonthlyRecurrence/DayOfMonth");
		if (!empty($arAbsoluteMonthlyRecurrenceDayOfMonth))
		{
			$arResultItem["RECURRING_DAYOFMONTH"] = $arAbsoluteMonthlyRecurrenceDayOfMonth[0]->GetContent();
		}
	}

	$arRelativeMonthlyRecurrence = $recurrence->GetPath("/Recurrence/RelativeMonthlyRecurrence");
	if (!empty($arRelativeMonthlyRecurrence))
	{
		$arResultItem["RECURRING_TYPE"] = "MONTHLY_RELATIVE";
		$arRelativeMonthlyRecurrenceInterval = $recurrence->GetPath("/Recurrence/RelativeMonthlyRecurrence/Interval");
		if (!empty($arRelativeMonthlyRecurrenceInterval))
		{
			$arResultItem["RECURRING_INTERVAL"] = $arRelativeMonthlyRecurrenceInterval[0]->GetContent();
		}
		$arRelativeMonthlyRecurrenceDaysOfWeek = $recurrence->GetPath("/Recurrence/RelativeMonthlyRecurrence/DaysOfWeek");
		if (!empty($arRelativeMonthlyRecurrenceDaysOfWeek))
		{
			$arResultItem["RECURRING_DAYSOFWEEK"] = $arRelativeMonthlyRecurrenceDaysOfWeek[0]->GetContent();
		}
		$arRelativeMonthlyRecurrenceDayOfWeekIndex = $recurrence->GetPath("/Recurrence/RelativeMonthlyRecurrence/DayOfWeekIndex");
		if (!empty($arRelativeMonthlyRecurrenceDayOfWeekIndex))
		{
			$arResultItem["RECURRING_DAYOFWEEKINDEX"] = $arRelativeMonthlyRecurrenceDayOfWeekIndex[0]->GetContent();
		}
	}

	$arAbsoluteYearlyRecurrence = $recurrence->GetPath("/Recurrence/AbsoluteYearlyRecurrence");
	if (!empty($arAbsoluteYearlyRecurrence))
	{
		$arResultItem["RECURRING_TYPE"] = "YEARLY_ABSOLUTE";
		$arAbsoluteYearlyRecurrenceDayOfMonth = $recurrence->GetPath("/Recurrence/AbsoluteYearlyRecurrence/DayOfMonth");
		if (!empty($arAbsoluteYearlyRecurrenceDayOfMonth))
		{
			$arResultItem["RECURRING_DAYOFMONTH"] = $arAbsoluteYearlyRecurrenceDayOfMonth[0]->GetContent();
		}
		$arAbsoluteYearlyRecurrenceMonth = $recurrence->GetPath("/Recurrence/AbsoluteYearlyRecurrence/Month");
		if (!empty($arAbsoluteYearlyRecurrenceMonth))
		{
			$arResultItem["RECURRING_MONTH"] = $arAbsoluteYearlyRecurrenceMonth[0]->GetContent();
		}
	}

	$arRelativeYearlyRecurrence = $recurrence->GetPath("/Recurrence/RelativeYearlyRecurrence");
	if (!empty($arRelativeYearlyRecurrence))
	{
		$arResultItem["RECURRING_TYPE"] = "YEARLY_RELATIVE";
		$arRelativeYearlyRecurrenceDaysOfWeek = $recurrence->GetPath("/Recurrence/RelativeYearlyRecurrence/DaysOfWeek");
		if (!empty($arRelativeYearlyRecurrenceDaysOfWeek))
		{
			$arResultItem["RECURRING_DAYSOFWEEK"] = $arRelativeYearlyRecurrenceDaysOfWeek[0]->GetContent();
		}
		$arRelativeYearlyRecurrenceDayOfWeekIndex = $recurrence->GetPath("/Recurrence/RelativeYearlyRecurrence/DayOfWeekIndex");
		if (!empty($arRelativeYearlyRecurrenceDayOfWeekIndex))
		{
			$arResultItem["RECURRING_DAYOFWEEKINDEX"] = $arRelativeYearlyRecurrenceDayOfWeekIndex[0]->GetContent();
		}
		$arRelativeYearlyRecurrenceMonth = $recurrence->GetPath("/Recurrence/RelativeYearlyRecurrence/Month");
		if (!empty($arRelativeYearlyRecurrenceMonth))
		{
			$arResultItem["RECURRING_MONTH"] = $arRelativeYearlyRecurrenceMonth[0]->GetContent();
		}
	}

	$arWeeklyRecurrence = $recurrence->GetPath("/Recurrence/WeeklyRecurrence");
	if (!empty($arWeeklyRecurrence))
	{
		$arResultItem["RECURRING_TYPE"] = "WEEKLY";
		$arWeeklyRecurrenceInterval = $recurrence->GetPath("/Recurrence/WeeklyRecurrence/Interval");
		if (!empty($arWeeklyRecurrenceInterval))
		{
			$arResultItem["RECURRING_INTERVAL"] = $arWeeklyRecurrenceInterval[0]->GetContent();
		}
		$arWeeklyRecurrenceDaysOfWeek = $recurrence->GetPath("/Recurrence/WeeklyRecurrence/DaysOfWeek");
		if (!empty($arWeeklyRecurrenceDaysOfWeek))
		{
			$arResultItem["RECURRING_DAYSOFWEEK"] = $arWeeklyRecurrenceDaysOfWeek[0]->GetContent();
		}
	}

	$arDailyRecurrence = $recurrence->GetPath("/Recurrence/DailyRecurrence");
	if (!empty($arDailyRecurrence))
	{
		$arResultItem["RECURRING_TYPE"] = "DAILY";
		$arDailyRecurrenceInterval = $recurrence->GetPath("/Recurrence/DailyRecurrence/Interval");
		if (!empty($arDailyRecurrenceInterval))
		{
			$arResultItem["RECURRING_INTERVAL"] = $arDailyRecurrenceInterval[0]->GetContent();
		}
	}

	$arNumberedRecurrence = $recurrence->GetPath("/Recurrence/NumberedRecurrence");
	if (!empty($arNumberedRecurrence))
	{
		$arNumberedRecurrenceStartDate = $recurrence->GetPath("/Recurrence/NumberedRecurrence/StartDate");
		if (!empty($arNumberedRecurrenceStartDate))
		{
			$arResultItem["RECURRING_STARTDATE"] = CDavICalendarTimeZone::GetFormattedServerDate($arNumberedRecurrenceStartDate[0]->GetContent());
		}
		$arNumberedRecurrenceNumberOfOccurrences = $recurrence->GetPath("/Recurrence/NumberedRecurrence/NumberOfOccurrences");
		if (!empty($arNumberedRecurrenceNumberOfOccurrences))
		{
			$arResultItem["RECURRING_NUMBEROFOCCURRENCES"] = $arNumberedRecurrenceNumberOfOccurrences[0]->GetContent();
		}
	}

	$arNoEndRecurrence = $recurrence->GetPath("/Recurrence/NoEndRecurrence");
	if (!empty($arNoEndRecurrence))
	{
		$arNoEndRecurrenceStartDate = $recurrence->GetPath("/Recurrence/NoEndRecurrence/StartDate");
		if (!empty($arNoEndRecurrenceStartDate))
		{
			$arResultItem["RECURRING_STARTDATE"] = CDavICalendarTimeZone::GetFormattedServerDate($arNoEndRecurrenceStartDate[0]->GetContent());
		}
	}

	$arEndDateRecurrence = $recurrence->GetPath("/Recurrence/EndDateRecurrence");
	if (!empty($arEndDateRecurrence))
	{
		$arEndDateRecurrenceStartDate = $recurrence->GetPath("/Recurrence/EndDateRecurrence/StartDate");
		if (!empty($arEndDateRecurrenceStartDate))
		{
			$arResultItem["RECURRING_STARTDATE"] = CDavICalendarTimeZone::GetFormattedServerDate($arEndDateRecurrenceStartDate[0]->GetContent());
		}
		$arEndDateRecurrenceEndDate = $recurrence->GetPath("/Recurrence/EndDateRecurrence/EndDate");
		if (!empty($arEndDateRecurrenceEndDate))
		{
			$arResultItem["RECURRING_ENDDATE"] = CDavICalendarTimeZone::GetFormattedServerDate($arEndDateRecurrenceEndDate[0]->GetContent());
		}
	}

	return $arResultItem;
}