예제 #1
0
 /**
  * Save tiebreaker value
  *
  */
 private function _saveTieBreaker($subject)
 {
     $config = Zend_Registry::get('conference');
     $reviewModel = new Core_Model_Review();
     // get reviews of submission
     $reviews = $reviewModel->getReviews(null, null, array('submission_id' => $subject->submission_id), true);
     // trigger when user is wrong reviewer
     if ($subject->self_assessment == 1 && $reviews['rows']->count() <= 2) {
         $this->_mailTiebreakers($subject);
     } elseif ($reviews['rows']->count() == 2) {
         // store values
         $reviewModel->saveTiebreaker(array('submission_id' => $subject->submission_id, 'evalue' => $reviews['rows']->getEvalue()));
         // trigger when Level Of Disagreement is above threshold
         if ($reviews['rows']->getTieBreaker()) {
             $this->_mailTiebreakers($subject);
         }
     }
 }
예제 #2
0
 /**
  * Helper method to get submissions user should review
  *
  * @param	boolean	$tiebreak	true to get submissions that assigned user as tiebreaker
  *								null to get all submissions user should review (including
  *								tiebreakers)
  * @return	mixed	Array of submission_id or false
  */
 private function _personalReviewFilter($tiebreak = null)
 {
     if ($submissions = Zend_Auth::getInstance()->getIdentity()->getSubmissionsToReview()) {
         if ($tiebreak) {
             return array_keys(array_filter($submissions, function ($val) use($tiebreak) {
                 return $val === $tiebreak;
             }));
         }
         $reviewModel = new Core_Model_Review();
         return array_keys($reviewModel->getPersonalTiebreakers(null, false, true));
     }
     return false;
 }