X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Fnotifs.inc.php;h=088c4a1d30e2b266e7cac1127fb2126a7a16348a;hb=3ccb060db98c00b4de687f0d262132e89293103c;hp=4d8013cb5574c3804718debeee1eef09fe97fecc;hpb=45ea6160465aeba0aa780e49c12272819dedffd1;p=platal.git diff --git a/include/notifs.inc.php b/include/notifs.inc.php index 4d8013c..088c4a1 100644 --- a/include/notifs.inc.php +++ b/include/notifs.inc.php @@ -130,7 +130,8 @@ class WatchRegistration extends WatchOperation { return new PFC_And(new UFC_Registered(false, '>', $watch->date()), new PFC_Or($watch->contactCondition(), - $watch->promoCondition())); + $watch->promoCondition(), + $watch->groupCondition())); } public function getOrder() @@ -158,7 +159,8 @@ class WatchDeath extends WatchOperation { return new PFC_And(new UFC_Dead('>', $watch->date(), true), new PFC_Or($watch->contactCondition(), - $watch->promoCondition())); + $watch->promoCondition(), + $watch->groupCondition())); } public function getOrder() @@ -205,7 +207,8 @@ class WatchBirthday extends WatchOperation $cond = new PFC_Or($cond, new PFC_And($watch->promoCondition(), new UFC_Promo('>=', $profile->mainGrade(), $profile->yearpromo() - 1), - new UFC_Promo('<=', $profile->mainGrade(), $profile->yearpromo() + 1))); + new UFC_Promo('<=', $profile->mainGrade(), $profile->yearpromo() + 1)), + $watch->groupCondition()); } return new PFC_And($select_date, $cond); } @@ -248,6 +251,7 @@ class Watch private $date = null; private $contactCond = null; private $promoCond = null; + private $groupCond = null; private $filters = array(); @@ -288,6 +292,14 @@ class Watch return $this->promoCond; } + public function groupCondition() + { + if (!$this->groupCond) { + $this->groupCond = new UFC_WatchGroup($this->user); + } + return $this->groupCond; + } + private function fetchEventWatch($class) { if (!isset(self::$events[$class])) { @@ -302,7 +314,7 @@ class Watch if (!isset($this->filters[$class])) { $event = $this->fetchEventWatch($class); $this->filters[$class] = new UserFilter($event->getCondition($this), - array($event->getOrder(), new UFO_Name(Profile::DN_SORT))); + array($event->getOrder(), new UFO_Name())); } return $this->filters[$class]; }