Skip to content

Commit

Permalink
Fixed issues with 3 to 3.1 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark committed Oct 16, 2018
1 parent f230f36 commit c92248a
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 32 deletions.
56 changes: 28 additions & 28 deletions publons/PublonsHandler.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 0 additions & 2 deletions publons/PublonsPlugin.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,6 @@ function step3SubmissionOutputFilter($output, &$templateMgr) {
* @return $string
*/
function completedSubmissionOutputFilter($output, &$templateMgr) {

$plugin =& PluginRegistry::getPlugin('generic', $this->getName());

$reviewerSubmissionDao =& DAORegistry::getDAO('ReviewerSubmissionDAO');
Expand All @@ -286,7 +285,6 @@ function completedSubmissionOutputFilter($output, &$templateMgr) {

$templateMgr =& TemplateManager::getManager();
$templateMgr->unregister_outputfilter(array(&$this, 'completedSubmissionOutputFilter'));

$request = Application::getRequest();
$router = $request->getRouter();

Expand Down
3 changes: 1 addition & 2 deletions publons/templates/publonsExportStep.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
*
*}

</div>
<div id="publons-export" class="section">
<h3>{translate key="plugins.generic.publons.notice.title"}</h3>

Expand Down Expand Up @@ -51,5 +52,3 @@
</span>
</button>
{/if}

</div>

0 comments on commit c92248a

Please sign in to comment.