Skip to content

Instantly share code, notes, and snippets.

@Feiron
Created August 8, 2025 09:05
Show Gist options
  • Select an option

  • Save Feiron/d4071a97eecd3411bd08460d4405424e to your computer and use it in GitHub Desktop.

Select an option

Save Feiron/d4071a97eecd3411bd08460d4405424e to your computer and use it in GitHub Desktop.
[Найти по графику отпуска сотрудника] #bitrix
$iUserID = CBPHelper::StripUserPrefix("{{Кем создан}}");
$arAbsenceDates = \CIntranetUtils::GetAbsenceData(
array(
'USERS' => array($iUserID),
'DATE_START' => '01.01.' . date('Y'),
'DATE_FINISH' => ConvertTimeStamp(false, 'SHORT'),
'PER_USER' => false
),
$MODE = BX_INTRANET_ABSENCE_ALL
);
$strVocations = '';
foreach ($arAbsenceDates as $key => $arAbsenceDate) {
$strVocations .= $arAbsenceDate['DATE_FROM'] . ' - ' . $arAbsenceDate['DATE_TO'] . ' ';
if ($arAbsenceDate['ENTRY_TYPE'] == BX_INTRANET_ABSENCE_HR) {
// Плановый календарь
$strVocations .= "({$arAbsenceDate['PROPERTY_ABSENCE_TYPE_VALUE']})";
} else {
// Личный календарь
$strVocations .= "({$arAbsenceDate['NAME']})";
}
$strVocations .= PHP_EOL;
}
$this->SetVariable('VOCATIONS', $strVocations);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment