Last active
November 2, 2017 11:21
-
-
Save Feiron/e017d40dca021baa278cb21581e01533 to your computer and use it in GitHub Desktop.
Список тех кто отсутствует
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
$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