本文整理汇总了PHP中SectionEditorAction::setDueDate方法的典型用法代码示例。如果您正苦于以下问题:PHP SectionEditorAction::setDueDate方法的具体用法?PHP SectionEditorAction::setDueDate怎么用?PHP SectionEditorAction::setDueDate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SectionEditorAction
的用法示例。
在下文中一共展示了SectionEditorAction::setDueDate方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setDueDate
function setDueDate($args)
{
$articleId = isset($args[0]) ? (int) $args[0] : 0;
list($journal, $submission) = SubmissionEditHandler::validate($articleId, SECTION_EDITOR_ACCESS_REVIEW);
$reviewId = isset($args[1]) ? $args[1] : 0;
$dueDate = Request::getUserVar('dueDate');
$numWeeks = Request::getUserVar('numWeeks');
if ($dueDate != null || $numWeeks != null) {
SectionEditorAction::setDueDate($articleId, $reviewId, $dueDate, $numWeeks);
Request::redirect(null, null, 'submissionReview', $articleId);
} else {
parent::setupTemplate(true, $articleId, 'review');
$journal =& Request::getJournal();
$reviewAssignmentDao =& DAORegistry::getDAO('ReviewAssignmentDAO');
$reviewAssignment = $reviewAssignmentDao->getReviewAssignmentById($reviewId);
$settingsDao =& DAORegistry::getDAO('JournalSettingsDAO');
$settings =& $settingsDao->getJournalSettings($journal->getJournalId());
$templateMgr =& TemplateManager::getManager();
if ($reviewAssignment->getDateDue() != null) {
$templateMgr->assign('dueDate', $reviewAssignment->getDateDue());
}
$numWeeksPerReview = $settings['numWeeksPerReview'] == null ? 0 : $settings['numWeeksPerReview'];
$templateMgr->assign('articleId', $articleId);
$templateMgr->assign('reviewId', $reviewId);
$templateMgr->assign('todaysDate', date('Y-m-d'));
$templateMgr->assign('numWeeksPerReview', $numWeeksPerReview);
$templateMgr->assign('actionHandler', 'setDueDate');
$templateMgr->display('sectionEditor/setDueDate.tpl');
}
}
示例2: addReviewer
/**
* Assigns a reviewer to a submission.
* @param $sectionEditorSubmission object
* @param $reviewerId int
*/
function addReviewer($sectionEditorSubmission, $reviewerId, $round = null)
{
$sectionEditorSubmissionDao =& DAORegistry::getDAO('SectionEditorSubmissionDAO');
$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 article.
if ($round == null) {
$round = $sectionEditorSubmission->getCurrentRound();
}
$assigned = $sectionEditorSubmissionDao->reviewerExists($sectionEditorSubmission->getArticleId(), $reviewerId, $round);
// Only add the reviewer if he has not already
// been assigned to review this article.
if (!$assigned && isset($reviewer) && !HookRegistry::call('SectionEditorAction::addReviewer', array(&$sectionEditorSubmission, $reviewerId))) {
$reviewAssignment = new ReviewAssignment();
$reviewAssignment->setReviewerId($reviewerId);
$reviewAssignment->setDateAssigned(Core::getCurrentDate());
$reviewAssignment->setRound($round);
// Assign review form automatically if needed
$journalId = $sectionEditorSubmission->getJournalId();
$sectionDao =& DAORegistry::getDAO('SectionDAO');
$reviewFormDao =& DAORegistry::getDAO('ReviewFormDAO');
$sectionId = $sectionEditorSubmission->getSectionId();
$section =& $sectionDao->getSection($sectionId, $journalId);
if ($section && ($reviewFormId = (int) $section->getReviewFormId())) {
if ($reviewFormDao->reviewFormExists($reviewFormId, ASSOC_TYPE_JOURNAL, $journalId)) {
$reviewAssignment->setReviewFormId($reviewFormId);
}
}
$sectionEditorSubmission->addReviewAssignment($reviewAssignment);
$sectionEditorSubmissionDao->updateSectionEditorSubmission($sectionEditorSubmission);
$reviewAssignment = $reviewAssignmentDao->getReviewAssignment($sectionEditorSubmission->getArticleId(), $reviewerId, $round);
$journal =& Request::getJournal();
$settingsDao =& DAORegistry::getDAO('JournalSettingsDAO');
$settings =& $settingsDao->getJournalSettings($journal->getId());
if (isset($settings['numWeeksPerReview'])) {
SectionEditorAction::setDueDate($sectionEditorSubmission->getArticleId(), $reviewAssignment->getId(), null, $settings['numWeeksPerReview'], false);
}
// Add log
import('article.log.ArticleLog');
import('article.log.ArticleEventLogEntry');
ArticleLog::logEvent($sectionEditorSubmission->getArticleId(), ARTICLE_LOG_REVIEW_ASSIGN, ARTICLE_LOG_TYPE_REVIEW, $reviewAssignment->getId(), 'log.review.reviewerAssigned', array('reviewerName' => $reviewer->getFullName(), 'articleId' => $sectionEditorSubmission->getArticleId(), 'round' => $round));
}
}
示例3: setDueDate
/**
* Set the review due date.
* @param $args array
* @param $request PKPRequest
*/
function setDueDate($args, &$request)
{
$articleId = (int) array_shift($args);
$reviewId = (int) array_shift($args);
$this->validate($articleId, SECTION_EDITOR_ACCESS_REVIEW);
$submission =& $this->submission;
$dueDate = $request->getUserVar('dueDate');
$numWeeks = $request->getUserVar('numWeeks');
if ($dueDate != null || $numWeeks != null) {
SectionEditorAction::setDueDate($articleId, $reviewId, $dueDate, $numWeeks, false, $request);
$request->redirect(null, null, 'submissionReview', $articleId);
} else {
$this->setupTemplate(true, $articleId, 'review');
$journal =& $request->getJournal();
$reviewAssignmentDao =& DAORegistry::getDAO('ReviewAssignmentDAO');
$reviewAssignment = $reviewAssignmentDao->getById($reviewId);
$settingsDao =& DAORegistry::getDAO('JournalSettingsDAO');
$settings =& $settingsDao->getJournalSettings($journal->getId());
$templateMgr =& TemplateManager::getManager();
if ($reviewAssignment->getDateDue() != null) {
$templateMgr->assign('dueDate', $reviewAssignment->getDateDue());
}
$numWeeksPerReview = $settings['numWeeksPerReview'] == null ? 0 : $settings['numWeeksPerReview'];
$templateMgr->assign('articleId', $articleId);
$templateMgr->assign('reviewId', $reviewId);
$templateMgr->assign('todaysDate', date('Y-m-d'));
$templateMgr->assign('numWeeksPerReview', $numWeeksPerReview);
$templateMgr->assign('actionHandler', 'setDueDate');
$templateMgr->display('sectionEditor/setDueDate.tpl');
}
}
示例4: setDueDate
function setDueDate($args)
{
$articleId = isset($args[0]) ? (int) $args[0] : 0;
$this->validate($articleId, SECTION_EDITOR_ACCESS_REVIEW);
$submission =& $this->submission;
$reviewId = isset($args[1]) ? $args[1] : 0;
$dueDate = Request::getUserVar('dueDate');
$numWeeks = Request::getUserVar('numWeeks');
// $meetingDate = Request::getUserVar('meetingDate');
if ($dueDate != null || $numWeeks != null) {
SectionEditorAction::setDueDate($articleId, $reviewId, $dueDate, $numWeeks);
Request::redirect(null, null, 'submissionReview', $articleId);
} else {
$this->setupTemplate(1, $articleId, 'review');
$journal =& Request::getJournal();
$reviewAssignmentDao =& DAORegistry::getDAO('ReviewAssignmentDAO');
$reviewAssignment = $reviewAssignmentDao->getById($reviewId);
$settingsDao =& DAORegistry::getDAO('JournalSettingsDAO');
$settings =& $settingsDao->getJournalSettings($journal->getId());
$templateMgr =& TemplateManager::getManager();
if ($reviewAssignment->getDateDue() != null) {
$templateMgr->assign('dueDate', $reviewAssignment->getDateDue());
}
// /** Added by ayveemallare 6/28/2011 */
// if ($reviewAssignment->getDateOfMeeting() !=null) {
// $templateMgr->assign('meetingDate', $reviewAssignment->getDateOfMeeting());
// }
// /*************************************/
$numWeeksPerReview = $settings['numWeeksPerReview'] == null ? 0 : $settings['numWeeksPerReview'];
$templateMgr->assign('articleId', $articleId);
$templateMgr->assign('reviewId', $reviewId);
$templateMgr->assign('todaysDate', date('Y-m-d'));
$templateMgr->assign('numWeeksPerReview', $numWeeksPerReview);
$templateMgr->assign('actionHandler', 'setDueDate');
$templateMgr->display('sectionEditor/setDueDate.tpl');
}
}