当前位置: 首页>>代码示例>>PHP>>正文


PHP CIntranetUtils::getAbsenceData方法代码示例

本文整理汇总了PHP中CIntranetUtils::getAbsenceData方法的典型用法代码示例。如果您正苦于以下问题:PHP CIntranetUtils::getAbsenceData方法的具体用法?PHP CIntranetUtils::getAbsenceData怎么用?PHP CIntranetUtils::getAbsenceData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CIntranetUtils的用法示例。


在下文中一共展示了CIntranetUtils::getAbsenceData方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getActivityInfo

 protected static function getActivityInfo()
 {
     // real active users
     $allTodayActiveUsers = array();
     $result = UserDayTable::getList(array('filter' => array('=DAY' => \ConvertTimeStamp(time(), "SHORT"))));
     while ($row = $result->fetch()) {
         $allTodayActiveUsers[$row['USER_ID']] = true;
     }
     // absence data from calendar
     $allAbsenceData = \CIntranetUtils::getAbsenceData(array('DATE_START' => ConvertTimeStamp(mktime(0, 0, 0), 'FULL'), 'DATE_FINISH' => ConvertTimeStamp(mktime(23, 59, 59), 'FULL'), 'PER_USER' => true));
     // departments and its' employees
     $allDepartments = array();
     // userid -> true (working) | false (absent)
     $allUsers = array();
     $companyStructure = \CIntranetUtils::getStructure();
     foreach ($companyStructure['DATA'] as $departmentData) {
         // base structure
         $department = array('EMPLOYEES' => array_filter(array_unique(array_merge($departmentData['EMPLOYEES'], array($departmentData['UF_HEAD'])))), 'ACTIVE_USERS' => 0);
         foreach ($department['EMPLOYEES'] as $employeeId) {
             $allUsers[$employeeId]['DEPARTMENTS'][] = $departmentData['ID'];
             // skip absentee
             if (isset($allUsers[$employeeId]['ABSENT']) && $allUsers[$employeeId]['ABSENT'] === true) {
                 continue;
             }
             if (!isset($allUsers[$employeeId]['ABSENT']) && isset($allAbsenceData[$employeeId]) && static::checkTodayAbsence($allAbsenceData[$employeeId])) {
                 // but only if they are really not active today
                 if (!isset($allTodayActiveUsers[$employeeId])) {
                     $allUsers[$employeeId]['ABSENT'] = true;
                     continue;
                 }
             }
             // remember supposed & really active users
             ++$department['ACTIVE_USERS'];
             $allUsers[$employeeId]['ABSENT'] = false;
         }
         $allDepartments[$departmentData['ID']] = $department;
     }
     return array($allDepartments, $allUsers);
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:39,代码来源:ustat.php


注:本文中的CIntranetUtils::getAbsenceData方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。