From: Marcel Werk Date: Fri, 8 May 2015 15:24:15 +0000 (+0200) Subject: Merge branch '2.0' X-Git-Tag: 2.1.4~26^2~2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=eafc7f0722c875bf79c808d4fdb1794585d7af96;p=GitHub%2FWoltLab%2FWCF.git Merge branch '2.0' Conflicts: wcfsetup/install/files/lib/data/user/UserBirthdayAction.class.php wcfsetup/install/files/lib/system/dashboard/box/TodaysBirthdaysDashboardBox.class.php --- eafc7f0722c875bf79c808d4fdb1794585d7af96 diff --cc wcfsetup/install/files/lib/data/user/UserBirthdayAction.class.php index 192e4fc625,d4c01e8feb..9536419d03 --- a/wcfsetup/install/files/lib/data/user/UserBirthdayAction.class.php +++ b/wcfsetup/install/files/lib/data/user/UserBirthdayAction.class.php @@@ -46,13 -47,21 +47,21 @@@ class UserBirthdayAction extends UserPr // get users $users = array(); - $userIDs = UserBirthdayCache::getInstance()->getBirthdays($month, $day); - $userList = new UserProfileList(); - $userList->setObjectIDs($userIDs); - $userList->readObjects(); - foreach ($userList->getObjects() as $user) { - if (!$user->isProtected() && $user->getAge($year) >= 0) { - $users[] = $user; + $userOptions = UserOptionCacheBuilder::getInstance()->getData(array(), 'options'); + if (isset($userOptions['birthday'])) { + $birthdayUserOption = $userOptions['birthday']; + + $userIDs = UserBirthdayCache::getInstance()->getBirthdays($month, $day); + $userList = new UserProfileList(); + $userList->setObjectIDs($userIDs); + $userList->readObjects(); - ++ + foreach ($userList->getObjects() as $user) { + $birthdayUserOption->setUser($user->getDecoratedObject()); - ++ + if (!$user->isProtected() && $birthdayUserOption->isVisible() && $user->getAge($year) >= 0) { - $users[] = $user; ++ $users[] = $user; + } } } diff --cc wcfsetup/install/files/lib/system/dashboard/box/TodaysBirthdaysDashboardBox.class.php index a94ed8e7f9,e4af20a845..fa1ae27e2a --- a/wcfsetup/install/files/lib/system/dashboard/box/TodaysBirthdaysDashboardBox.class.php +++ b/wcfsetup/install/files/lib/system/dashboard/box/TodaysBirthdaysDashboardBox.class.php @@@ -1,8 -1,9 +1,9 @@@ getBirthdays($date[1], $date[2]); if (!empty($userIDs)) { - $userProfileList = new UserProfileList(); - $userProfileList->setObjectIDs($userIDs); - $userProfileList->readObjects(); - $i = 0; - foreach ($userProfileList as $userProfile) { - if ($i == 10) break; + $userOptions = UserOptionCacheBuilder::getInstance()->getData(array(), 'options'); + if (isset($userOptions['birthday'])) { + $birthdayUserOption = $userOptions['birthday']; - if (!$userProfile->isProtected() && substr($userProfile->birthday, 5) == $currentDay) { - $this->userProfiles[] = $userProfile; - $i++; + $userProfileList = new UserProfileList(); + $userProfileList->setObjectIDs($userIDs); + $userProfileList->readObjects(); + $i = 0; + foreach ($userProfileList as $userProfile) { - if ($i == 5) break; ++ if ($i == 10) break; + + $birthdayUserOption->setUser($userProfile->getDecoratedObject()); - ++ + if (!$userProfile->isProtected() && $birthdayUserOption->isVisible() && substr($userProfile->birthday, 5) == $currentDay) { + $this->userProfiles[] = $userProfile; + $i++; + } } } }