|
|
| 1875 |
if ($reviewAssignment->getDateCompleted() != null && !$reviewAssignment->getCancelled()) { |
1875 |
if ($reviewAssignment->getDateCompleted() != null && !$reviewAssignment->getCancelled()) { |
| 1876 |
// Get the comments associated with this review assignment |
1876 |
// Get the comments associated with this review assignment |
| 1877 |
$articleComments = &$articleCommentDao->getArticleComments($sectionEditorSubmission->getArticleId(), COMMENT_TYPE_PEER_REVIEW, $reviewAssignment->getReviewId()); |
1877 |
$articleComments = &$articleCommentDao->getArticleComments($sectionEditorSubmission->getArticleId(), COMMENT_TYPE_PEER_REVIEW, $reviewAssignment->getReviewId()); |
| 1878 |
$body .= "------------------------------------------------------\n"; |
1878 |
if($articleComments) { |
| 1879 |
$body .= Locale::translate('submission.comments.importPeerReviews.reviewerLetter', array('reviewerLetter' => chr(ord('A') + $reviewIndexes[$reviewAssignment->getReviewId()]))) . "\n"; |
1879 |
$body .= "------------------------------------------------------\n"; |
| 1880 |
if (is_array($articleComments)) { |
1880 |
$body .= Locale::translate('submission.comments.importPeerReviews.reviewerLetter', array('reviewerLetter' => chr(ord('A') + $reviewIndexes[$reviewAssignment->getReviewId()]))) . "\n"; |
| 1881 |
foreach ($articleComments as $comment) { |
1881 |
if (is_array($articleComments)) { |
| 1882 |
// If the comment is viewable by the author, then add the comment. |
1882 |
foreach ($articleComments as $comment) { |
| 1883 |
if ($comment->getViewable()) { |
1883 |
// If the comment is viewable by the author, then add the comment. |
| 1884 |
$body .= $comment->getComments() . "\n\n"; |
1884 |
if ($comment->getViewable()) { |
|
|
1885 |
$body .= $comment->getComments() . "\n\n"; |
| 1886 |
} |
| 1885 |
} |
1887 |
} |
| 1886 |
} |
1888 |
} |
|
|
1889 |
} |
| 1890 |
if ($reviewFormId = $reviewAssignment->getReviewFormId()) { |
| 1891 |
$reviewId = $reviewAssignment->getReviewId(); |
| 1892 |
|
| 1893 |
$reviewFormResponseDao =& DAORegistry::getDAO('ReviewFormResponseDAO'); |
| 1894 |
$reviewFormElementDao =& DAORegistry::getDAO('ReviewFormElementDAO'); |
| 1895 |
$reviewFormElements =& $reviewFormElementDao->getReviewFormElements($reviewFormId); |
| 1896 |
if(!$articleComments) { |
| 1897 |
$body .= "------------------------------------------------------\n"; |
| 1898 |
$body .= Locale::translate('submission.comments.importPeerReviews.reviewerLetter', array('reviewerLetter' => chr(ord('A') + $reviewIndexes[$reviewAssignment->getReviewId()]))) . "\n\n"; |
| 1899 |
} |
| 1900 |
foreach ($reviewFormElements as $reviewFormElement) { |
| 1901 |
$body .= $reviewFormElement->getReviewFormElementQuestion() . ": \n"; |
| 1902 |
$reviewFormResponse = $reviewFormResponseDao->getReviewFormResponse($reviewId, $reviewFormElement->getReviewFormElementId()); |
| 1903 |
|
| 1904 |
if ($reviewFormResponse) { |
| 1905 |
$possibleResponses = $reviewFormElement->getReviewFormElementPossibleResponses(); |
| 1906 |
if (in_array($reviewFormElement->getElementType(), $reviewFormElement->getMultipleResponsesElementTypes())) { |
| 1907 |
if ($reviewFormElement->getElementType() == REVIEW_FORM_ELEMENT_TYPE_CHECKBOXES) { |
| 1908 |
foreach ($reviewFormResponse->getValue() as $value) { |
| 1909 |
$body .= "\t" . String::html2utf(strip_tags($possibleResponses[$value-1]['content'])) . "\n"; |
| 1910 |
} |
| 1911 |
} else { |
| 1912 |
$body .= "\t" . String::html2utf(strip_tags($possibleResponses[$reviewFormResponse->getValue()-1]['content'])) . "\n"; |
| 1913 |
} |
| 1914 |
$body .= "\n"; |
| 1915 |
} else { |
| 1916 |
$body .= "\t" . String::html2utf(strip_tags($reviewFormResponse->getValue())) . "\n\n"; |
| 1917 |
} |
| 1918 |
} |
| 1919 |
} |
| 1887 |
} |
1920 |
} |
| 1888 |
$body .= "------------------------------------------------------\n\n"; |
1921 |
$body .= "------------------------------------------------------\n\n"; |
| 1889 |
} |
1922 |
} |