Created
August 8, 2025 09:05
-
-
Save Feiron/d4071a97eecd3411bd08460d4405424e to your computer and use it in GitHub Desktop.
[Найти по графику отпуска сотрудника] #bitrix
This file contains hidden or 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("{{Кем создан}}"); | |
| $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