Merge branch '2.0'
authorMarcel Werk <burntime@woltlab.com>
Fri, 8 May 2015 15:24:15 +0000 (17:24 +0200)
committerMarcel Werk <burntime@woltlab.com>
Fri, 8 May 2015 15:24:15 +0000 (17:24 +0200)
Conflicts:
wcfsetup/install/files/lib/data/user/UserBirthdayAction.class.php
wcfsetup/install/files/lib/system/dashboard/box/TodaysBirthdaysDashboardBox.class.php

1  2 
wcfsetup/install/files/lib/data/user/UserBirthdayAction.class.php
wcfsetup/install/files/lib/system/dashboard/box/TodaysBirthdaysDashboardBox.class.php

index 192e4fc625ab7d9755ef6a084b7da9f9eb07c44b,d4c01e8feb44358a22c93a4f4f8d2413f4dd894b..9536419d03f7f0f68798844e88916f50c53fc9ba
@@@ -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;
+                               }
                        }
                }
                
index a94ed8e7f9fbb3006e60a8a89a654f70a1450826,e4af20a8452e37a103e02e8d7ba6da04c5aa1c8a..fa1ae27e2aa7a171597c3a0f0a7e28389ea3cdae
@@@ -1,8 -1,9 +1,9 @@@
  <?php
  namespace wcf\system\dashboard\box;
 -use wcf\data\dashboard\box\DashboardBox; 
 +use wcf\data\dashboard\box\DashboardBox;
  use wcf\data\user\UserProfileList;
 -use wcf\page\IPage; 
 +use wcf\page\IPage;
+ use wcf\system\cache\builder\UserOptionCacheBuilder;
  use wcf\system\user\UserBirthdayCache;
  use wcf\system\WCF;
  use wcf\util\DateUtil;
@@@ -38,16 -39,23 +39,23 @@@ class TodaysBirthdaysDashboardBox exten
                $userIDs = UserBirthdayCache::getInstance()->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++;
+                                       }
                                }
                        }
                }