View | Details | Raw Unified | Return to bug 3669 | Differences between
and this patch

Collapse All | Expand All

(-)classes/submission/sectionEditor/SectionEditorAction.inc.php (-7 / +37 lines)
 Lines 1875-1889    Link Here 
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
							} else {
1890
								$reviewFormId = $reviewAssignment->getReviewFormId();
1891
								$reviewId = $reviewAssignment->getReviewId();
1892
								
1893
								$reviewFormResponseDao =& DAORegistry::getDAO('ReviewFormResponseDAO');
1894
								$reviewFormElementDao =& DAORegistry::getDAO('ReviewFormElementDAO');
1895
								$reviewFormElements =& $reviewFormElementDao->getReviewFormElements($reviewFormId);
1896
								$body .= "------------------------------------------------------\n";
1897
								$body .= Locale::translate('submission.comments.importPeerReviews.reviewerLetter', array('reviewerLetter' => chr(ord('A') + $reviewIndexes[$reviewAssignment->getReviewId()]))) . "\n\n";
1898
								foreach ($reviewFormElements as $reviewFormElement) {
1899
									$body .= $reviewFormElement->getReviewFormElementQuestion() . ": \n";
1900
									$reviewFormResponse = $reviewFormResponseDao->getReviewFormResponse($reviewId, $reviewFormElement->getReviewFormElementId());
1901
			
1902
									$possibleResponses = $reviewFormElement->getReviewFormElementPossibleResponses();
1903
									if (in_array($reviewFormElement->getElementType(), $reviewFormElement->getMultipleResponsesElementTypes())) {
1904
										if ($reviewFormElement->getElementType() == REVIEW_FORM_ELEMENT_TYPE_CHECKBOXES) {
1905
											foreach ($reviewFormResponse->getValue() as $value) {
1906
												$body .= "\t" . String::html2utf(strip_tags($possibleResponses[$value-1]['content'])) . "\n";
1907
											}
1908
										} else {
1909
											$body .= "\t" . String::html2utf(strip_tags($possibleResponses[$reviewFormResponse->getValue()-1]['content'])) . "\n";
1910
										}
1911
										$body .= "\n";
1912
									} else {
1913
										$body .= "\t" . String::html2utf(strip_tags($reviewFormResponse->getValue())) . "\n\n";
1914
									}
1915
								
1916
								}
1887
							}
1917
							}
1888
							$body .= "------------------------------------------------------\n\n";
1918
							$body .= "------------------------------------------------------\n\n";
1889
						}
1919
						}

Return to bug 3669