Skip to content

Instantly share code, notes, and snippets.

@Feiron
Last active November 2, 2017 11:21
Show Gist options
  • Save Feiron/e017d40dca021baa278cb21581e01533 to your computer and use it in GitHub Desktop.
Save Feiron/e017d40dca021baa278cb21581e01533 to your computer and use it in GitHub Desktop.
Список тех кто отсутствует
<?
$iUserID = CBPHelper::StripUserPrefix("{=Document:CREATED_BY}");
$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