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

Collapse All | Expand All

(-)classes/submission/sectionEditor/SectionEditorAction.inc.php (-7 / +39 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
							} 
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
									$possibleResponses = $reviewFormElement->getReviewFormElementPossibleResponses();
1905
									if (in_array($reviewFormElement->getElementType(), $reviewFormElement->getMultipleResponsesElementTypes())) {
1906
										if ($reviewFormElement->getElementType() == REVIEW_FORM_ELEMENT_TYPE_CHECKBOXES) {
1907
											foreach ($reviewFormResponse->getValue() as $value) {
1908
												$body .= "\t" . String::html2utf(strip_tags($possibleResponses[$value-1]['content'])) . "\n";
1909
											}
1910
										} else {
1911
											$body .= "\t" . String::html2utf(strip_tags($possibleResponses[$reviewFormResponse->getValue()-1]['content'])) . "\n";
1912
										}
1913
										$body .= "\n";
1914
									} else {
1915
										$body .= "\t" . String::html2utf(strip_tags($reviewFormResponse->getValue())) . "\n\n";
1916
									}
1917
								
1918
								}
1887
							}
1919
							}
1888
							$body .= "------------------------------------------------------\n\n";
1920
							$body .= "------------------------------------------------------\n\n";
1889
						}
1921
						}

Return to bug 3669