• Модуль: timeman
  • Путь к файлу: ~/bitrix/modules/timeman/lib/update/timemanversion19converter.php
  • Класс: BitrixTimemanUpdateTimemanVersion19Converter
  • Вызов: TimemanVersion19Converter::processDepartmentScheduleMigration
private function processDepartmentScheduleMigration($departmentInfo, $parentParams, $parentDepartmentIds)
{
	if ($this->isMaxExecutionSecondsExceeded())
	{
		throw new MaximumExecutionSecondsExceededException();
	}
	$depId = $departmentInfo['data']['ID'];
	$entityCode = 'DR' . $depId;
	$selfSettings = TimemanVersion18User::getSectionPersonalSettings($depId, true, $this->getTimemanSettingsNames());
	$filledSettings = $this->fillDefaultSettingsParams($selfSettings, $parentParams);
	if (!isset($this->processedEntitiesData[$entityCode]))
	{
		$this->processedEntitiesData[$entityCode] = true;
		if (!$this->isTimemanTurnedOff($selfSettings))
		{
			if ($this->hasPersonalViolationRules($selfSettings))
			{
				$this->buildViolationForm($filledSettings, $entityCode);
			}

			$this->assignEntityToSchedule($entityCode, $filledSettings, $parentDepartmentIds);
		}
	}
	$parentDepartmentIds = array_unique(array_merge($parentDepartmentIds, [(int)$departmentInfo['data']['ID']]));
	foreach ($departmentInfo['subDepartments'] as $subDepartmentData)
	{
		$this->processDepartmentScheduleMigration($subDepartmentData, $filledSettings, $parentDepartmentIds);
	}
	foreach ($departmentInfo['data']['EMPLOYEES'] as $userId)
	{
		$this->processUserScheduleMigration($userId, $filledSettings, $parentDepartmentIds);
	}
}