| Server IP : 195.130.67.5 / Your IP : 216.73.217.154 Web Server : Microsoft-IIS/10.0 System : Windows NT WEBSERVER1 10.0 build 17763 (Windows Server 2016) i586 User : IUSR ( 0) PHP Version : 7.4.19 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /inetpub/wwwroot/Topogeo/ojs/classes/submission/form/comment/ |
Upload File : |
<?php
/**
* @file classes/submission/form/comment/PeerReviewCommentForm.inc.php
*
* Copyright (c) 2003-2012 John Willinsky
* Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
*
* @class PeerReviewCommentForm
* @ingroup submission_form
*
* @brief Comment form.
*/
// $Id$
import('classes.submission.form.comment.CommentForm');
class PeerReviewCommentForm extends CommentForm {
/** @var int the ID of the review assignment */
var $reviewId;
/** @var array the IDs of the inserted comments */
var $insertedComments;
/**
* Constructor.
* @param $article object
*/
function PeerReviewCommentForm($article, $reviewId, $roleId) {
parent::CommentForm($article, COMMENT_TYPE_PEER_REVIEW, $roleId, $reviewId);
$this->reviewId = $reviewId;
}
/**
* Display the form.
*/
function display() {
$reviewAssignmentDao =& DAORegistry::getDAO('ReviewAssignmentDAO');
$reviewAssignment =& $reviewAssignmentDao->getById($this->reviewId);
$reviewLetters =& $reviewAssignmentDao->getReviewIndexesForRound($this->article->getArticleId(), $this->article->getCurrentRound());
$templateMgr =& TemplateManager::getManager();
$templateMgr->assign('commentType', 'peerReview');
$templateMgr->assign('pageTitle', 'submission.comments.review');
$templateMgr->assign('commentAction', 'postPeerReviewComment');
$templateMgr->assign('commentTitle', strip_tags($this->article->getLocalizedTitle()));
$templateMgr->assign('isLocked', isset($reviewAssignment) && $reviewAssignment->getDateCompleted() != null);
$templateMgr->assign('canEmail', false); // Previously, editors could always email.
$templateMgr->assign('showReviewLetters', ($this->roleId == ROLE_ID_EDITOR || $this->roleId == ROLE_ID_SECTION_EDITOR) ? true : false);
$templateMgr->assign('reviewLetters', $reviewLetters);
$templateMgr->assign('reviewer', ROLE_ID_REVIEWER);
$templateMgr->assign('hiddenFormParams',
array(
'articleId' => $this->article->getArticleId(),
'reviewId' => $this->reviewId
)
);
parent::display();
}
/**
* Assign form data to user-submitted data.
*/
function readInputData() {
$this->readUserVars(
array(
'commentTitle',
'authorComments',
'comments'
)
);
}
/**
* Add the comment.
*/
function execute() {
// Personalized execute() method since now there are possibly two comments contained within each form submission.
$commentDao =& DAORegistry::getDAO('ArticleCommentDAO');
$this->insertedComments = array();
// Assign all common information
$comment = new ArticleComment();
$comment->setCommentType($this->commentType);
$comment->setRoleId($this->roleId);
$comment->setArticleId($this->article->getArticleId());
$comment->setAssocId($this->assocId);
$comment->setAuthorId($this->user->getId());
$comment->setCommentTitle($this->getData('commentTitle'));
$comment->setDatePosted(Core::getCurrentDate());
// If comments "For authors and editor" submitted
if ($this->getData('authorComments') != null) {
$comment->setComments($this->getData('authorComments'));
$comment->setViewable(1);
array_push($this->insertedComments, $commentDao->insertArticleComment($comment));
}
// If comments "For editor" submitted
if ($this->getData('comments') != null) {
$comment->setComments($this->getData('comments'));
$comment->setViewable(null);
array_push($this->insertedComments, $commentDao->insertArticleComment($comment));
}
}
}
?>