当前位置: 首页>>代码示例>>PHP>>正文


PHP ReviewAssignment::setReviewType方法代码示例

本文整理汇总了PHP中ReviewAssignment::setReviewType方法的典型用法代码示例。如果您正苦于以下问题:PHP ReviewAssignment::setReviewType方法的具体用法?PHP ReviewAssignment::setReviewType怎么用?PHP ReviewAssignment::setReviewType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ReviewAssignment的用法示例。


在下文中一共展示了ReviewAssignment::setReviewType方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: addReviewer

 /**
  * Assigns a reviewer to a submission.
  * @param $seriesEditorSubmission object
  * @param $reviewerId int
  */
 function addReviewer($seriesEditorSubmission, $reviewerId, $reviewType, $round = null, $reviewDueDate = null, $responseDueDate = null)
 {
     $seriesEditorSubmissionDao =& DAORegistry::getDAO('SeriesEditorSubmissionDAO');
     $reviewAssignmentDao =& DAORegistry::getDAO('ReviewAssignmentDAO');
     $userDao =& DAORegistry::getDAO('UserDAO');
     $user =& Request::getUser();
     $reviewer =& $userDao->getUser($reviewerId);
     // Check to see if the requested reviewer is not already
     // assigned to review this monograph.
     if ($round == null) {
         $round = $seriesEditorSubmission->getCurrentRound();
     }
     $assigned = $seriesEditorSubmissionDao->reviewerExists($seriesEditorSubmission->getId(), $reviewerId, $reviewType, $round);
     // Only add the reviewer if he has not already
     // been assigned to review this monograph.
     if (!$assigned && isset($reviewer) && !HookRegistry::call('SeriesEditorAction::addReviewer', array(&$seriesEditorSubmission, $reviewerId))) {
         $reviewAssignment = new ReviewAssignment();
         $reviewAssignment->setSubmissionId($seriesEditorSubmission->getId());
         $reviewAssignment->setReviewerId($reviewerId);
         $reviewAssignment->setDateAssigned(Core::getCurrentDate());
         $reviewAssignment->setReviewType($reviewType);
         $reviewAssignment->setRound($round);
         // Assign review form automatically if needed
         $pressId = $seriesEditorSubmission->getPressId();
         $seriesDao =& DAORegistry::getDAO('SeriesDAO');
         $reviewFormDao =& DAORegistry::getDAO('ReviewFormDAO');
         $submissionId = $seriesEditorSubmission->getId();
         $series =& $seriesDao->getById($submissionId, $pressId);
         $seriesEditorSubmission->addReviewAssignment($reviewAssignment, $reviewType, $round);
         $seriesEditorSubmissionDao->updateSeriesEditorSubmission($seriesEditorSubmission);
         $reviewAssignment = $reviewAssignmentDao->getReviewAssignment($seriesEditorSubmission->getId(), $reviewerId, $round, $reviewType);
         $press =& Request::getPress();
         $settingsDao =& DAORegistry::getDAO('PressSettingsDAO');
         $settings =& $settingsDao->getPressSettings($press->getId());
         if (isset($reviewDueDate)) {
             SeriesEditorAction::setDueDate($seriesEditorSubmission->getId(), $reviewAssignment->getId(), $reviewDueDate);
         }
         if (isset($responseDueDate)) {
             SeriesEditorAction::setResponseDueDate($seriesEditorSubmission->getId(), $reviewAssignment->getId(), $responseDueDate);
         }
         // Add log
         import('classes.monograph.log.MonographLog');
         import('classes.monograph.log.MonographEventLogEntry');
         MonographLog::logEvent($seriesEditorSubmission->getId(), MONOGRAPH_LOG_REVIEW_ASSIGN, MONOGRAPH_LOG_TYPE_REVIEW, $reviewAssignment->getId(), 'log.review.reviewerAssigned', array('reviewerName' => $reviewer->getFullName(), 'monographId' => $seriesEditorSubmission->getId(), 'reviewType' => $reviewType, 'round' => $round));
     }
 }
开发者ID:ramonsodoma,项目名称:omp,代码行数:51,代码来源:SeriesEditorAction.inc.php


注:本文中的ReviewAssignment::setReviewType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。