From c92248a6a41784283610af3ea22e71380db681ad Mon Sep 17 00:00:00 2001 From: Mark Date: Tue, 16 Oct 2018 15:34:56 +1300 Subject: [PATCH] Fixed issues with 3 to 3.1 changes --- publons/PublonsHandler.inc.php | 56 ++++++++++++------------- publons/PublonsPlugin.inc.php | 2 - publons/templates/publonsExportStep.tpl | 3 +- 3 files changed, 29 insertions(+), 32 deletions(-) diff --git a/publons/PublonsHandler.inc.php b/publons/PublonsHandler.inc.php index 2c495f4..2cb705d 100644 --- a/publons/PublonsHandler.inc.php +++ b/publons/PublonsHandler.inc.php @@ -88,48 +88,48 @@ function exportReview($args, $request) { $reviewAssignment = $reviewAssignmentDao->getById($reviewId); $body = ''; - if (!$reviewAssignment->getCancelled()) { - // Get the comments associated with this review assignment - $submissionComments = $submissionCommentDao->getSubmissionComments($reviewSubmission->getId(), COMMENT_TYPE_PEER_REVIEW, $reviewAssignment->getId()); - - if($submissionComments) { - foreach ($submissionComments->toArray() as $comment) { - // If the comment is viewable by the author, then add the comment. - if ($comment->getViewable()) $body .= PKPString::html2text($comment->getComments()) . "\n"; - } + + // Get the comments associated with this review assignment + $submissionComments = $submissionCommentDao->getSubmissionComments($reviewSubmission->getId(), COMMENT_TYPE_PEER_REVIEW, $reviewAssignment->getId()); + + if($submissionComments) { + foreach ($submissionComments->toArray() as $comment) { + // If the comment is viewable by the author, then add the comment. + if ($comment->getViewable()) $body .= PKPString::html2text($comment->getComments()) . "\n"; } + } - if ($reviewFormId = $reviewAssignment->getReviewFormId()) { + if ($reviewFormId = $reviewAssignment->getReviewFormId()) { - $reviewId = $reviewAssignment->getId(); - $reviewFormResponseDao =& DAORegistry::getDAO('ReviewFormResponseDAO'); - $reviewFormElementDao =& DAORegistry::getDAO('ReviewFormElementDAO'); - $reviewFormElements = $reviewFormElementDao->getReviewFormElements($reviewFormId); + $reviewId = $reviewAssignment->getId(); + $reviewFormResponseDao =& DAORegistry::getDAO('ReviewFormResponseDAO'); + $reviewFormElementDao =& DAORegistry::getDAO('ReviewFormElementDAO'); + $reviewFormElements = $reviewFormElementDao->getReviewFormElements($reviewFormId); - foreach ($reviewFormElements as $reviewFormElement) if ($reviewFormElement->getIncluded()) { + foreach ($reviewFormElements as $reviewFormElement) if ($reviewFormElement->getIncluded()) { - $body .= PKPString::html2text($reviewFormElement->getLocalizedQuestion()) . ": \n"; - $reviewFormResponse = $reviewFormResponseDao->getReviewFormResponse($reviewId, $reviewFormElement->getId()); + $body .= PKPString::html2text($reviewFormElement->getLocalizedQuestion()) . ": \n"; + $reviewFormResponse = $reviewFormResponseDao->getReviewFormResponse($reviewId, $reviewFormElement->getId()); - if ($reviewFormResponse) { + if ($reviewFormResponse) { - $possibleResponses = $reviewFormElement->getLocalizedPossibleResponses(); - if (in_array($reviewFormElement->getElementType(), $reviewFormElement->getMultipleResponsesElementTypes())) { - if ($reviewFormElement->getElementType() == REVIEW_FORM_ELEMENT_TYPE_CHECKBOXES) { - foreach ($reviewFormResponse->getValue() as $value) { - $body .= "\t" . PKPString::html2text($possibleResponses[$value-1]['content']) . "\n"; - } - } else { - $body .= "\t" . PKPString::html2text($possibleResponses[$reviewFormResponse->getValue()-1]['content']) . "\n"; + $possibleResponses = $reviewFormElement->getLocalizedPossibleResponses(); + if (in_array($reviewFormElement->getElementType(), $reviewFormElement->getMultipleResponsesElementTypes())) { + if ($reviewFormElement->getElementType() == REVIEW_FORM_ELEMENT_TYPE_CHECKBOXES) { + foreach ($reviewFormResponse->getValue() as $value) { + $body .= "\t" . PKPString::html2text($possibleResponses[$value-1]['content']) . "\n"; } - $body .= "\n"; } else { - $body .= "\t" . $reviewFormResponse->getValue() . "\n\n"; + $body .= "\t" . PKPString::html2text($possibleResponses[$reviewFormResponse->getValue()-1]['content']) . "\n"; } + $body .= "\n"; + } else { + $body .= "\t" . $reviewFormResponse->getValue() . "\n\n"; } } } } + $body = str_replace("\r", '', $body); $body = str_replace("\n", '\r\n', $body); diff --git a/publons/PublonsPlugin.inc.php b/publons/PublonsPlugin.inc.php index c375540..186332a 100644 --- a/publons/PublonsPlugin.inc.php +++ b/publons/PublonsPlugin.inc.php @@ -268,7 +268,6 @@ function step3SubmissionOutputFilter($output, &$templateMgr) { * @return $string */ function completedSubmissionOutputFilter($output, &$templateMgr) { - $plugin =& PluginRegistry::getPlugin('generic', $this->getName()); $reviewerSubmissionDao =& DAORegistry::getDAO('ReviewerSubmissionDAO'); @@ -286,7 +285,6 @@ function completedSubmissionOutputFilter($output, &$templateMgr) { $templateMgr =& TemplateManager::getManager(); $templateMgr->unregister_outputfilter(array(&$this, 'completedSubmissionOutputFilter')); - $request = Application::getRequest(); $router = $request->getRouter(); diff --git a/publons/templates/publonsExportStep.tpl b/publons/templates/publonsExportStep.tpl index 447773a..6e9c6b6 100644 --- a/publons/templates/publonsExportStep.tpl +++ b/publons/templates/publonsExportStep.tpl @@ -8,6 +8,7 @@ * *} +

{translate key="plugins.generic.publons.notice.title"}

@@ -51,5 +52,3 @@ {/if} - -