Ejemplo n.º 1
0
 public static function GetSuperposedForUsers($arUsers, $userId = false)
 {
     if ($userId === false) {
         $userId = self::$userId;
     }
     $arUserIds = self::TrackingUsers($userId);
     $arNewUsers = array();
     if (!is_array($arUsers)) {
         return false;
     }
     foreach ($arUsers as $id) {
         $id = intVal($id);
         if ($id <= 0 || in_array($id, $arUserIds) || $id == $userId) {
             continue;
         }
         $arNewUsers[] = $id;
         $arUserIds[] = $id;
     }
     // If we add some users for tracking
     if (count($arNewUsers) > 0) {
         $sections = CCalendarSect::GetSuperposedList(array('USERS' => $arNewUsers, 'userId' => self::$userId, 'checkPermissions' => true, 'checkSocnetPermissions' => true));
         // Save new tracking users
         self::TrackingUsers($userId, $arUserIds);
         if (count($sections)) {
             return $sections;
         }
     }
     return false;
 }