Skip to content

Commit

Permalink
Merge pull request #6314 from NateWr/i4895_anonymous_review
Browse files Browse the repository at this point in the history
#4895 Replace use of blind/double-blind terminology
  • Loading branch information
NateWr authored Nov 4, 2020
2 parents bb97d43 + eea6c80 commit 712f0b3
Show file tree
Hide file tree
Showing 113 changed files with 416 additions and 250 deletions.
6 changes: 3 additions & 3 deletions classes/components/forms/FieldShowEnsuringLink.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*
* @brief An extension of the FieldOptions for the configuration setting which
* determines whether or not to show a link to reviewers about keeping reviews
* blind.
* anonymous.
*/
namespace PKP\components\forms;
class FieldShowEnsuringLink extends FieldOptions {
Expand All @@ -26,8 +26,8 @@ class FieldShowEnsuringLink extends FieldOptions {
*/
public function getConfig() {
$config = parent::getConfig();
$config['message'] = __('review.blindPeerReview');
$config['modalTitle'] = __('review.blindPeerReview.title');
$config['message'] = __('review.anonymousPeerReview');
$config['modalTitle'] = __('review.anonymousPeerReview.title');

return $config;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function __construct($action, $locales, $context) {
]))
->addField(new FieldShowEnsuringLink('showEnsuringLink', [
'options' => [
['value' => true, 'label' => __('manager.setup.reviewOptions.showBlindReviewLink')],
['value' => true, 'label' => __('manager.setup.reviewOptions.showAnonymousReviewLink')],
],
'value' => $context->getData('showEnsuringLink'),
]));
Expand Down
4 changes: 2 additions & 2 deletions classes/components/forms/context/PKPReviewSetupForm.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ public function __construct($action, $locales, $context) {
'type' => 'radio',
'value' => $context->getData('defaultReviewMode'),
'options' => [
['value' => SUBMISSION_REVIEW_METHOD_DOUBLEBLIND, 'label' => __('editor.submissionReview.doubleBlind')],
['value' => SUBMISSION_REVIEW_METHOD_BLIND, 'label' => __('editor.submissionReview.blind')],
['value' => SUBMISSION_REVIEW_METHOD_DOUBLEANONYMOUS, 'label' => __('editor.submissionReview.doubleAnonymous')],
['value' => SUBMISSION_REVIEW_METHOD_ANONYMOUS, 'label' => __('editor.submissionReview.anonymous')],
['value' => SUBMISSION_REVIEW_METHOD_OPEN, 'label' => __('editor.submissionReview.open')],
],
]))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class PKPSelectReviewerListPanel extends ListPanel {
/** @var string Name of the input field*/
public $selectorName = '';

/** @var array List of user IDs which may not be suitable for blind review because of existing access to author details */
/** @var array List of user IDs which may not be suitable for anonymous review because of existing access to author details */
public $warnOnAssignment = [];

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,9 @@ function authorize($request, &$args, $roleAssignments) {
return false;
}

if (in_array($operation, $this->_getAuthorDeniedBlindOps())) {
if (in_array($operation, $this->_getAuthorDeniedAnonymousOps())) {
$reviewAssignment = $this->getAuthorizedContextObject(ASSOC_TYPE_REVIEW_ASSIGNMENT);
if ($reviewAssignment && in_array($reviewAssignment->getReviewMethod(), array(SUBMISSION_REVIEW_METHOD_BLIND, SUBMISSION_REVIEW_METHOD_DOUBLEBLIND))) {
if ($reviewAssignment && in_array($reviewAssignment->getReviewMethod(), array(SUBMISSION_REVIEW_METHOD_ANONYMOUS, SUBMISSION_REVIEW_METHOD_DOUBLEANONYMOUS))) {
return false;
}
}
Expand Down Expand Up @@ -978,10 +978,10 @@ protected function _getAuthorDeniedOps() {

/**
* Get additional operations that an author is not allowed to access when the
* review type is blind or double-blind.
* review type is anonymous or double-anonymous.
* @return array
*/
protected function _getAuthorDeniedBlindOps() {
protected function _getAuthorDeniedAnonymousOps() {
return array(
'readReview',
'reviewHistory',
Expand Down
16 changes: 8 additions & 8 deletions classes/log/EventLogEntry.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,30 +157,30 @@ function getTranslatedMessage($locale = null, $hideReviewerName = false) {
$reviewAssignmentDao = DAORegistry::getDAO('ReviewAssignmentDAO'); /* @var $reviewAssignmentDao ReviewAssignmentDAO */
// Reviewer activity log entries (assigning, accepting, declining)
if (isset($params['reviewerName'])) {
$blindAuthor = true;
$anonymousAuthor = true;
if (isset($params['reviewAssignmentId'])) {
$reviewAssignment = $reviewAssignmentDao->getById($params['reviewAssignmentId']);
if ($reviewAssignment && !in_array($reviewAssignment->getReviewMethod(), array(SUBMISSION_REVIEW_METHOD_BLIND, SUBMISSION_REVIEW_METHOD_DOUBLEBLIND))) {
$blindAuthor = false;
if ($reviewAssignment && !in_array($reviewAssignment->getReviewMethod(), array(SUBMISSION_REVIEW_METHOD_ANONYMOUS, SUBMISSION_REVIEW_METHOD_DOUBLEANONYMOUS))) {
$anonymousAuthor = false;
}
}
if ($blindAuthor) {
if ($anonymousAuthor) {
$params['reviewerName'] = __('editor.review.anonymousReviewer');
}
}
// Files submitted by reviewers
if (isset($params['fileStage']) && $params['fileStage'] === SUBMISSION_FILE_REVIEW_ATTACHMENT) {
assert(isset($params['fileId']) && isset($params['submissionId']));
$blindAuthor = true;
$anonymousAuthor = true;
$submissionFileDao = DAORegistry::getDAO('SubmissionFileDAO'); /* @var $submissionFileDao SubmissionFileDAO */
$submissionFile = $submissionFileDao->getLatestRevision($params['fileId']);
if ($submissionFile && $submissionFile->getAssocType() === ASSOC_TYPE_REVIEW_ASSIGNMENT) {
$reviewAssignment = $reviewAssignmentDao->getById($submissionFile->getAssocId());
if ($reviewAssignment && !in_array($reviewAssignment->getReviewMethod(), array(SUBMISSION_REVIEW_METHOD_BLIND, SUBMISSION_REVIEW_METHOD_DOUBLEBLIND))) {
$blindAuthor = false;
if ($reviewAssignment && !in_array($reviewAssignment->getReviewMethod(), array(SUBMISSION_REVIEW_METHOD_ANONYMOUS, SUBMISSION_REVIEW_METHOD_DOUBLEANONYMOUS))) {
$anonymousAuthor = false;
}
}
if (isset($params['username']) && $blindAuthor) {
if (isset($params['username']) && $anonymousAuthor) {
if (isset($params['username'])) {
$params['username'] = __('editor.review.anonymousReviewer');
}
Expand Down
8 changes: 4 additions & 4 deletions classes/mail/Mail.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ function setCcs($ccs) {
}

/**
* Add a blind carbon copy (BCC) recipient to the message.
* Add a hidden carbon copy (BCC) recipient to the message.
* @param $email string
* @param $name optional
*/
Expand All @@ -166,15 +166,15 @@ function addBcc($email, $name = '') {
}

/**
* Get the blind carbon copy (BCC) recipients for the message
* Get the hidden carbon copy (BCC) recipients for the message
* @return array
*/
function getBccs() {
return $this->getData('bccs');
}

/**
* Set the blind carbon copy (BCC) recipients for the message.
* Set the hidden carbon copy (BCC) recipients for the message.
* @param $bccs array
*/
function setBccs($bccs) {
Expand Down Expand Up @@ -397,7 +397,7 @@ function getFromString($send = false) {
$from = $this->getFrom();
if ($from == null) {
return null;
}
}
return (self::encodeDisplayName($from['name'], $send) . ' <'.$from['email'].'>');
}

Expand Down
2 changes: 1 addition & 1 deletion classes/migration/ReviewsMigration.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function up() {
$table->smallInteger('stage_id');

import('lib.pkp.classes.submission.reviewAssignment.ReviewAssignment'); // for constant
$table->smallInteger('review_method')->default(SUBMISSION_REVIEW_METHOD_BLIND);
$table->smallInteger('review_method')->default(SUBMISSION_REVIEW_METHOD_ANONYMOUS);

$table->smallInteger('round')->default(1);
$table->smallInteger('step')->default(1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ function buildFileAccessPolicy($request, $args, $roleAssignments, $mode, $fileId
import('lib.pkp.classes.security.authorization.internal.SubmissionFileMatchesWorkflowStageIdPolicy');
$managerFileAccessPolicy->addPolicy(new SubmissionFileMatchesWorkflowStageIdPolicy($request, $fileIdAndRevision, $stageId));

// 3) ... and only if they are not also assigned as an author and this is not part of a blind review
// 3) ... and only if they are not also assigned as an author and this is not part of an anonymous review
import('lib.pkp.classes.security.authorization.internal.SubmissionFileAuthorEditorPolicy');
$subEditorFileAccessPolicy->addPolicy(new SubmissionFileAuthorEditorPolicy($request, $fileIdAndRevision));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* @ingroup security_authorization_internal
*
* @brief Submission file policy to ensure that an editor is denied access to
* blind review files when they are also assigned to the submission as an
* anonymous review files when they are also assigned to the submission as an
* author.
*/

Expand All @@ -31,7 +31,7 @@ public function effect() {
if ($submissionFile->getFileStage() != SUBMISSION_FILE_REVIEW_ATTACHMENT) return AUTHORIZATION_PERMIT;

// Deny if the user is assigned as an author to any stage, and this file is
// attached to a blind review
// attached to an anonymous review
$userRoles = $this->getAuthorizedContextObject(ASSOC_TYPE_ACCESSIBLE_WORKFLOW_STAGES);
foreach ($userRoles as $stageRoles) {
if (in_array(ROLE_ID_AUTHOR, $stageRoles)) {
Expand Down
8 changes: 4 additions & 4 deletions classes/services/PKPPublicationService.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ public function getProperties($publication, $props, $args = null) {
);
break;
case 'authors':
if ($currentUserReviewAssignment && $currentUserReviewAssignment->getReviewMethod() === SUBMISSION_REVIEW_METHOD_DOUBLEBLIND) {
if ($currentUserReviewAssignment && $currentUserReviewAssignment->getReviewMethod() === SUBMISSION_REVIEW_METHOD_DOUBLEANONYMOUS) {
$values[$prop] = [];
} else {
$values[$prop] = array_map(
Expand All @@ -174,13 +174,13 @@ function($author) use ($request) {
break;
case 'authorsString':
$values[$prop] = '';
if ((!$currentUserReviewAssignment || $currentUserReviewAssignment->getReviewMethod() !== SUBMISSION_REVIEW_METHOD_DOUBLEBLIND)
if ((!$currentUserReviewAssignment || $currentUserReviewAssignment->getReviewMethod() !== SUBMISSION_REVIEW_METHOD_DOUBLEANONYMOUS)
&& isset($args['userGroups'])) {
$values[$prop] = $publication->getAuthorString($args['userGroups']);
}
break;
case 'authorsStringShort':
if ($currentUserReviewAssignment && $currentUserReviewAssignment->getReviewMethod() === SUBMISSION_REVIEW_METHOD_DOUBLEBLIND) {
if ($currentUserReviewAssignment && $currentUserReviewAssignment->getReviewMethod() === SUBMISSION_REVIEW_METHOD_DOUBLEANONYMOUS) {
$values[$prop] = '';
} else {
$values[$prop] = $publication->getShortAuthorString();
Expand All @@ -199,7 +199,7 @@ function($citation) {
$values[$prop] = $publication->getFullTitles();
break;
case 'galleys':
if ($currentUserReviewAssignment && $currentUserReviewAssignment->getReviewMethod() === SUBMISSION_REVIEW_METHOD_DOUBLEBLIND) {
if ($currentUserReviewAssignment && $currentUserReviewAssignment->getReviewMethod() === SUBMISSION_REVIEW_METHOD_DOUBLEANONYMOUS) {
$values[$prop] = [];
} else {
$galleyArgs = array_merge($args, ['publication' => $publication]);
Expand Down
14 changes: 7 additions & 7 deletions classes/submission/reviewAssignment/ReviewAssignment.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
define('SUBMISSION_REVIEWER_RATING_POOR', 2);
define('SUBMISSION_REVIEWER_RATING_VERY_POOR', 1);

define('SUBMISSION_REVIEW_METHOD_BLIND', 1);
define('SUBMISSION_REVIEW_METHOD_DOUBLEBLIND', 2);
define('SUBMISSION_REVIEW_METHOD_ANONYMOUS', 1);
define('SUBMISSION_REVIEW_METHOD_DOUBLEANONYMOUS', 2);
define('SUBMISSION_REVIEW_METHOD_OPEN', 3);

// A review is "unconsidered" when it is confirmed by an editor and then that
Expand Down Expand Up @@ -150,7 +150,7 @@ function setStageId($stageId) {
}

/**
* Get the method of the review (open, blind, or double-blind).
* Get the method of the review (open, anonymous, or double-anonymous).
* @return int
*/
function getReviewMethod() {
Expand Down Expand Up @@ -625,10 +625,10 @@ public function getReviewMethodKey($method = null) {
switch ($method) {
case SUBMISSION_REVIEW_METHOD_OPEN:
return 'editor.submissionReview.open';
case SUBMISSION_REVIEW_METHOD_BLIND:
return 'editor.submissionReview.blind';
case SUBMISSION_REVIEW_METHOD_DOUBLEBLIND:
return 'editor.submissionReview.doubleBlind';
case SUBMISSION_REVIEW_METHOD_ANONYMOUS:
return 'editor.submissionReview.anonymous';
case SUBMISSION_REVIEW_METHOD_DOUBLEANONYMOUS:
return 'editor.submissionReview.doubleAnonymous';
}

assert(false, 'No review method key could be found for ' . get_class($this) . ' on ' . __LINE__);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -613,8 +613,8 @@ function getLastReviewRoundReviewAssignmentByReviewer($submissionId, $reviewerId
function getReviewMethodsTranslationKeys() {
AppLocale::requireComponents(LOCALE_COMPONENT_PKP_EDITOR);
return array(
SUBMISSION_REVIEW_METHOD_DOUBLEBLIND => 'editor.submissionReview.doubleBlind',
SUBMISSION_REVIEW_METHOD_BLIND => 'editor.submissionReview.blind',
SUBMISSION_REVIEW_METHOD_DOUBLEANONYMOUS => 'editor.submissionReview.doubleAnonymous',
SUBMISSION_REVIEW_METHOD_ANONYMOUS => 'editor.submissionReview.anonymous',
SUBMISSION_REVIEW_METHOD_OPEN => 'editor.submissionReview.open',
);
}
Expand Down
3 changes: 1 addition & 2 deletions controllers/grid/eventLog/EventLogGridCellProvider.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,11 @@ function getTemplateVarsFromRowColumn($row, $column) {
// Maybe anonymize files submitted by reviewers
if (isset($params['fileStage']) && $params['fileStage'] === SUBMISSION_FILE_REVIEW_ATTACHMENT) {
assert(isset($params['fileId']) && isset($params['submissionId']));
$blindAuthor = true;
$submissionFileDao = DAORegistry::getDAO('SubmissionFileDAO'); /* @var $submissionFileDao SubmissionFileDAO */
$submissionFile = $submissionFileDao->getLatestRevision($params['fileId']);
if ($submissionFile && $submissionFile->getAssocType() === ASSOC_TYPE_REVIEW_ASSIGNMENT) {
$reviewAssignment = $reviewAssignmentDao->getById($submissionFile->getAssocId());
if (!$reviewAssignment || in_array($reviewAssignment->getReviewMethod(), array(SUBMISSION_REVIEW_METHOD_BLIND, SUBMISSION_REVIEW_METHOD_DOUBLEBLIND))) {
if (!$reviewAssignment || in_array($reviewAssignment->getReviewMethod(), array(SUBMISSION_REVIEW_METHOD_ANONYMOUS, SUBMISSION_REVIEW_METHOD_DOUBLEANONYMOUS))) {
$userName = __('editor.review.anonymousReviewer');
}
}
Expand Down
12 changes: 6 additions & 6 deletions controllers/grid/eventLog/EventLogGridRow.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,16 @@ function initialize($request, $template = null) {
case SUBMISSION_LOG_FILE_UPLOAD:
$submissionFile = $submissionFileDao->getRevision($params['fileId'], $params['fileRevision']);
if ($submissionFile) {
$blindAuthor = false;
$maybeBlindAuthor = $this->_isCurrentUserAssignedAuthor && $submissionFile->getFileStage() === SUBMISSION_FILE_REVIEW_ATTACHMENT;
if ($maybeBlindAuthor && $submissionFile->getAssocType() === ASSOC_TYPE_REVIEW_ASSIGNMENT) {
$anonymousAuthor = false;
$maybeAnonymousAuthor = $this->_isCurrentUserAssignedAuthor && $submissionFile->getFileStage() === SUBMISSION_FILE_REVIEW_ATTACHMENT;
if ($maybeAnonymousAuthor && $submissionFile->getAssocType() === ASSOC_TYPE_REVIEW_ASSIGNMENT) {
$reviewAssignmentDao = DAORegistry::getDAO('ReviewAssignmentDAO'); /* @var $reviewAssignmentDao ReviewAssignmentDAO */
$reviewAssignment = $reviewAssignmentDao->getById($submissionFile->getAssocId());
if ($reviewAssignment && in_array($reviewAssignment->getReviewMethod(), array(SUBMISSION_REVIEW_METHOD_BLIND, SUBMISSION_REVIEW_METHOD_DOUBLEBLIND))) {
$blindAuthor = true;
if ($reviewAssignment && in_array($reviewAssignment->getReviewMethod(), array(SUBMISSION_REVIEW_METHOD_ANONYMOUS, SUBMISSION_REVIEW_METHOD_DOUBLEANONYMOUS))) {
$anonymousAuthor = true;
}
}
if (!$blindAuthor) {
if (!$anonymousAuthor) {
$workflowStageId = $submissionFileDao->getWorkflowStageId($submissionFile);
// If a submission file is attached to a query that has been deleted, we cannot
// determine its stage. Don't present a download link in this case.
Expand Down
2 changes: 1 addition & 1 deletion controllers/grid/queries/form/QueryForm.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ function fetch($request, $template = null, $display = false, $actionArgs = array
}
}

// if current user is blind reviewer, filter out authors
// if current user is an anonymous reviewer, filter out authors
foreach ($reviewAssignments as $reviewAssignment) {
if ($reviewAssignment->getReviewerId() == $user->getId() ){
if ($reviewAssignment->getReviewMethod() != SUBMISSION_REVIEW_METHOD_OPEN){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ function getTemplateVarsFromRowColumn($row, $column) {
assert(is_a($element, 'DataObject') && !empty($columnId));
switch ($columnId) {
case 'name':
$isReviewBlind = in_array($element->getReviewMethod(), array(SUBMISSION_REVIEW_METHOD_BLIND, SUBMISSION_REVIEW_METHOD_DOUBLEBLIND));
if ($this->_isCurrentUserAssignedAuthor && $isReviewBlind) {
$isReviewAnonymous = in_array($element->getReviewMethod(), array(SUBMISSION_REVIEW_METHOD_ANONYMOUS, SUBMISSION_REVIEW_METHOD_DOUBLEANONYMOUS));
if ($this->_isCurrentUserAssignedAuthor && $isReviewAnonymous) {
return array('label' => __('editor.review.anonymousReviewer'));
}
return array('label' => $element->getReviewerFullName());
Expand Down
6 changes: 3 additions & 3 deletions controllers/grid/users/reviewer/ReviewerGridRow.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ function initialize($request, $template = null) {
$stageId = (int) $request->getUserVar('stageId');
$round = (int) $request->getUserVar('round');

// Authors can't perform any actions on blind reviews
// Authors can't perform any actions on anonymous reviews
$reviewAssignment = $this->getData();
$isReviewBlind = in_array($reviewAssignment->getReviewMethod(), array(SUBMISSION_REVIEW_METHOD_BLIND, SUBMISSION_REVIEW_METHOD_DOUBLEBLIND));
if ($this->_isCurrentUserAssignedAuthor && $isReviewBlind) {
$isReviewAnonymous = in_array($reviewAssignment->getReviewMethod(), array(SUBMISSION_REVIEW_METHOD_ANONYMOUS, SUBMISSION_REVIEW_METHOD_DOUBLEANONYMOUS));
if ($this->_isCurrentUserAssignedAuthor && $isReviewAnonymous) {
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ function fetch($request, $template = null, $display = false) {

// Get user IDs already assigned to this submission, and admins and
// managers who may have access to author identities and can not guarantee
// blind reviews
// anonymous reviews
$warnOnAssignment = array();
$stageAssignmentDao = DAORegistry::getDAO('StageAssignmentDAO'); /* @var $stageAssignmentDao StageAssignmentDAO */
$stageAssignmentResults = $stageAssignmentDao->getBySubmissionAndStageId($this->getSubmissionId());
Expand Down
4 changes: 2 additions & 2 deletions controllers/grid/users/reviewer/form/ReviewerForm.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,14 +150,14 @@ function initData() {
$reviewAssignmentDao = DAORegistry::getDAO('ReviewAssignmentDAO'); /* @var $reviewAssignmentDao ReviewAssignmentDAO */
$reviewAssignment = $reviewAssignmentDao->getReviewAssignment($reviewRound->getId(), $reviewerId, $reviewRound->getRound());

// Get the review method (open, blind, or double-blind)
// Get the review method (open, anonymous, or double-anonymous)
if (isset($reviewAssignment) && $reviewAssignment->getReviewMethod() != false) {
$reviewMethod = $reviewAssignment->getReviewMethod();
$reviewFormId = $reviewAssignment->getReviewFormId();
} else {
// Set default review method.
$reviewMethod = $context->getData('defaultReviewMode');
if (!$reviewMethod) $reviewMethod = SUBMISSION_REVIEW_METHOD_DOUBLEBLIND;
if (!$reviewMethod) $reviewMethod = SUBMISSION_REVIEW_METHOD_DOUBLEANONYMOUS;

// If there is a section/series and it has a default
// review form designated, use it.
Expand Down
Loading

0 comments on commit 712f0b3

Please sign in to comment.