Skip to content

Commit

Permalink
Closes pkp#4834 Fixes after the code review.
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasraoni committed Feb 8, 2021
1 parent 90f1771 commit 4385384
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -233,14 +233,14 @@ function _sendReviewMailToAuthor($submission, $emailKey, $request) {
/** @var ReviewAssignment $reviewAssignment */
foreach ($reviewAssignments as $reviewAssignment) {
if (in_array($reviewAssignment->getStatus(), [REVIEW_ASSIGNMENT_STATUS_COMPLETE, REVIEW_ASSIGNMENT_STATUS_RECEIVED, REVIEW_ASSIGNMENT_STATUS_THANKED])) {
$reviewers[$reviewAssignment->getReviewerId()] = 0;
$reviewers[] = $reviewAssignment->getReviewerId();
}
}

$userDao = DAORegistry::getDAO('UserDAO'); /** @var UserDAO $userDao */
foreach (array_intersect(array_keys($reviewers), (array) $this->getData('bccReviewers')) as $reviewerId) {
foreach (array_intersect($reviewers, (array) $this->getData('bccReviewers')) as $reviewerId) {
$user = $userDao->getById($reviewerId);
if ($user) {
if ($user && !$user->getDisabled()) {
$email->addBcc($user->getEmail(), $user->getFullName());
}
}
Expand Down
21 changes: 21 additions & 0 deletions templates/controllers/modals/editorDecision/form/bccReviewers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{**
* templates/controllers/modals/editorDecision/form/bccReviewers.tpl
*
* Copyright (c) 2014-2021 Simon Fraser University
* Copyright (c) 2003-2021 John Willinsky
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
*
* Checkboxes to define which reviewer should receive a bcc copy of the message.
*
*}

{if count($reviewers)}
{fbvFormSection title="submission.comments.sendToReviewers"}
<span class="description">{translate key="submission.comments.sendCopyToReviewers"}</span>
<ul class="checkbox_and_radiobutton">
{foreach from=$reviewers item="name" key="id"}
{fbvElement type="checkbox" id="bccReviewers[]" value=$id checked=in_array($id, $selected) label=$name translate=false}
{/foreach}
</ul>
{/fbvFormSection}
{/if}
15 changes: 4 additions & 11 deletions templates/controllers/modals/editorDecision/form/promoteForm.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,10 @@
{/fbvFormSection}
{/if}

{* Button to send a copy of the email by BCC to the selected reviewers *}
{if count($reviewers)}
{fbvFormSection title="submission.comments.sendToReviewers"}
<span class="description">{translate key="submission.comments.sendCopyToReviewers"}</span>
<ul class="checkbox_and_radiobutton">
{foreach from=$reviewers item="name" key="id"}
{fbvElement type="checkbox" id="bccReviewers[]" value=$id checked=in_array($id, $bccReviewers) label=$name translate=false}
{/foreach}
</ul>
{/fbvFormSection}
{/if}
{include file="controllers/modals/editorDecision/form/bccReviewers.tpl"
reviewers=$reviewers
selected=$bccReviewers
}
</div>

{if $decisionData.paymentType}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,17 +81,10 @@
{/fbvFormSection}
{/if}

{* Button to send a copy of the email by BCC to the selected reviewers *}
{if count($reviewers)}
{fbvFormSection title="submission.comments.sendToReviewers"}
<span class="description">{translate key="submission.comments.sendCopyToReviewers"}</span>
<ul class="checkbox_and_radiobutton">
{foreach from=$reviewers item="name" key="id"}
{fbvElement type="checkbox" id="bccReviewers[]" value=$id checked=in_array($id, $bccReviewers) label=$name translate=false}
{/foreach}
</ul>
{/fbvFormSection}
{/if}
{include file="controllers/modals/editorDecision/form/bccReviewers.tpl"
reviewers=$reviewers
selected=$bccReviewers
}
</div>

{** Some decisions can be made before review is initiated (i.e. no attachments). **}
Expand Down

0 comments on commit 4385384

Please sign in to comment.