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

Collapse All | Expand All

(-)classes/submission/sectionEditor/SectionEditorAction.inc.php (-8 / +45 lines)
 Lines 1875-1891    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
							
1879
							$body .= Locale::translate('submission.comments.importPeerReviews.reviewerLetter', array('reviewerLetter' => chr(ord('A') + $reviewIndexes[$reviewAssignment->getReviewId()]))) . "\n";
1879
							if($articleComments) { 
1880
							if (is_array($articleComments)) {
1880
								$body .= "------------------------------------------------------\n";
1881
								foreach ($articleComments as $comment) {
1881
								$body .= Locale::translate('submission.comments.importPeerReviews.reviewerLetter', array('reviewerLetter' => chr(ord('A') + $reviewIndexes[$reviewAssignment->getReviewId()]))) . "\n";
1882
									// If the comment is viewable by the author, then add the comment.
1882
								if (is_array($articleComments)) {
1883
									if ($comment->getViewable()) {
1883
									foreach ($articleComments as $comment) {
1884
										$body .= String::html2utf(strip_tags($comment->getComments())) . "\n\n";
1884
										// If the comment is viewable by the author, then add the comment.
1885
										if ($comment->getViewable()) {
1886
											$body .= String::html2utf(strip_tags($comment->getComments())) . "\n\n";
1887
										}
1885
									}
1888
									}
1886
								}
1889
								}
1890
								$body .= "------------------------------------------------------\n\n";
1891
							} 
1892
							if ($reviewFormId = $reviewAssignment->getReviewFormId()) {
1893
								$reviewId = $reviewAssignment->getReviewId();
1894
								
1895
								$reviewFormResponseDao =& DAORegistry::getDAO('ReviewFormResponseDAO');
1896
								$reviewFormElementDao =& DAORegistry::getDAO('ReviewFormElementDAO');
1897
								$reviewFormElements =& $reviewFormElementDao->getReviewFormElements($reviewFormId);
1898
								if(!$articleComments) {
1899
									$body .= "------------------------------------------------------\n";
1900
									$body .= Locale::translate('submission.comments.importPeerReviews.reviewerLetter', array('reviewerLetter' => chr(ord('A') + $reviewIndexes[$reviewAssignment->getReviewId()]))) . "\n\n";
1901
								}
1902
								foreach ($reviewFormElements as $reviewFormElement) {
1903
									$body .= $reviewFormElement->getReviewFormElementQuestion() . ": \n";
1904
									$reviewFormResponse = $reviewFormResponseDao->getReviewFormResponse($reviewId, $reviewFormElement->getReviewFormElementId());
1905
			
1906
									$possibleResponses = $reviewFormElement->getReviewFormElementPossibleResponses();
1907
									if (in_array($reviewFormElement->getElementType(), $reviewFormElement->getMultipleResponsesElementTypes())) {
1908
										if ($reviewFormElement->getElementType() == REVIEW_FORM_ELEMENT_TYPE_CHECKBOXES) {
1909
											foreach ($reviewFormResponse->getValue() as $value) {
1910
												$body .= "\t" . String::html2utf(strip_tags($possibleResponses[$value-1]['content'])) . "\n";
1911
											}
1912
										} else {
1913
											$body .= "\t" . String::html2utf(strip_tags($possibleResponses[$reviewFormResponse->getValue()-1]['content'])) . "\n";
1914
										}
1915
										$body .= "\n";
1916
									} else {
1917
										$body .= "\t" . String::html2utf(strip_tags($reviewFormResponse->getValue())) . "\n\n";
1918
									}
1919
								
1920
								}
1921
								$body .= "------------------------------------------------------\n\n";
1922
					
1887
							}
1923
							}
1888
							$body .= "------------------------------------------------------\n\n";
1924
							
1925
							
1889
						}
1926
						}
1890
					}
1927
					}
1891
					$oldBody = $email->getBody();
1928
					$oldBody = $email->getBody();

Return to bug 3669