/** * @see ContestNotificationInterface::getRecipients() */ public function getRecipients() { $ids = array(); switch ($this->state) { // tell contest owner that s.o. did apply case 'applied': require_once WCF_DIR . 'lib/data/contest/Contest.class.php'; $contest = Contest::getInstance($this->contestID); $ids = array_merge($ids, $contest->getOwner()->getUserIDs()); break; case 'invited': $ids = array_merge($ids, $this->getInstance()->getOwner()->getUserIDs()); break; // tell recipient that s.o. did moderator interaction // tell recipient that s.o. did moderator interaction case 'accepted': $ids = array_merge($ids, $this->getInstance()->getOwner()->getUserIDs()); // maybe the user applied himself, then tell the owners require_once WCF_DIR . 'lib/data/contest/Contest.class.php'; $contest = Contest::getInstance($this->contestID); if ($contest->enableSponsorCheck == false) { $ids = array_merge($ids, $contest->getOwner()->getUserIDs()); } break; } return array_unique($ids); }
/** * Returns true, if the active user can delete this entry. * * @return boolean */ public function isDeletable() { $contest = Contest::getInstance($this->contestID); if ($contest->isOwner()) { return true; } return false; }
/** * @see ContestNotificationInterface::getRecipients() */ public function getRecipients() { $ids = array(); // tell all jury members, that a new entry exists require_once WCF_DIR . 'lib/data/contest/Contest.class.php'; $contest = Contest::getInstance($this->contestID); foreach ($contest->getJurys() as $jury) { $ids = array_merge($ids, $jury->getOwner()->getUserIDs()); } return array_unique($ids); }
/** * @see ContestNotificationInterface::getRecipients() */ public function getRecipients() { $ids = array(); switch ($this->state) { // tell contest jury that a solution was commited case 'applied': require_once WCF_DIR . 'lib/data/contest/Contest.class.php'; $contest = Contest::getInstance($this->contestID); foreach ($contest->getJurys() as $jury) { $ids = array_merge($ids, $jury->getOwner()->getUserIDs()); } break; // tell solution member, that moderator did interaction // tell solution member, that moderator did interaction case 'accepted': case 'declined': $ids = array_merge($ids, $this->getInstance()->getOwner()->getUserIDs()); break; } return array_unique($ids); }
/** * Returns true, if the active user can edit this entry. * the owner of the entry can only change the contest, if it has not been published yet. * the jury can change the entry if the contest has not finished yet. * * @return boolean */ public function isEditable() { return $this->isOwner() && (in_array($this->state, array('private', 'applied')) || Contest::getInstance($this->contestID)->isJuryable() && Contest::getInstance($this->contestID)->isJury()); }
/** * Returns true, if the active user can edit this entry. * * @return boolean */ public function isEditable() { return $this->isOwner() || $this->isSponsor() || Contest::getInstance($this->contestID)->isOwner(); }