Skip to content

Commit

Permalink
pkp/pkp-lib#1660 migration to import existing recommendations
Browse files Browse the repository at this point in the history
  • Loading branch information
touhidurabir committed Jan 10, 2025
1 parent b13f6a8 commit 0abe490
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ public function contextTable(): string
return 'journals';
}

public function settingTable(): string
{
return 'journal_settings';
}

public function contextPrimaryKey(): string
{
return 'journal_id';
Expand Down
29 changes: 20 additions & 9 deletions classes/migration/upgrade/v3_6_0/I1660_ReviewerRecommendations.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,34 @@

namespace APP\migration\upgrade\v3_6_0;

use APP\migration\install\ReviewerRecommendationsMigration;

class I1660_ReviewerRecommendations extends \PKP\migration\Migration
class I1660_ReviewerRecommendations extends \PKP\migration\upgrade\v3_6_0\I1660_ReviewerRecommendations
{
public const SUBMISSION_REVIEWER_RECOMMENDATION_ACCEPT = 1;
public const SUBMISSION_REVIEWER_RECOMMENDATION_PENDING_REVISIONS = 2;
public const SUBMISSION_REVIEWER_RECOMMENDATION_RESUBMIT_HERE = 3;
public const SUBMISSION_REVIEWER_RECOMMENDATION_RESUBMIT_ELSEWHERE = 4;
public const SUBMISSION_REVIEWER_RECOMMENDATION_DECLINE = 5;
public const SUBMISSION_REVIEWER_RECOMMENDATION_SEE_COMMENTS = 6;

/**
* Run the migration.
*/
public function up(): void
{
(new ReviewerRecommendationsMigration($this->_installer, $this->_attributes))->up();
parent::up();

$this->seedNonRemovableRecommendations();
}

/**
* Reverse the migration
*/
public function down(): void
protected function systemDefineNonRemovableRecommendations(): array
{
(new ReviewerRecommendationsMigration($this->_installer, $this->_attributes))->down();
return [
static::SUBMISSION_REVIEWER_RECOMMENDATION_ACCEPT => 'reviewer.article.decision.accept',
static::SUBMISSION_REVIEWER_RECOMMENDATION_PENDING_REVISIONS => 'reviewer.article.decision.pendingRevisions',
static::SUBMISSION_REVIEWER_RECOMMENDATION_RESUBMIT_HERE => 'reviewer.article.decision.resubmitHere',
static::SUBMISSION_REVIEWER_RECOMMENDATION_RESUBMIT_ELSEWHERE => 'reviewer.article.decision.resubmitElsewhere',
static::SUBMISSION_REVIEWER_RECOMMENDATION_DECLINE => 'reviewer.article.decision.decline',
static::SUBMISSION_REVIEWER_RECOMMENDATION_SEE_COMMENTS => 'reviewer.article.decision.seeComments',
];
}
}
20 changes: 16 additions & 4 deletions templates/reviewer/review/reviewerRecommendations.tpl
Original file line number Diff line number Diff line change
@@ -1,13 +1,25 @@
{**
* templates/reviewer/review/reviewerRecommendations.tpl
*
* Copyright (c) 2014-2021 Simon Fraser University
* Copyright (c) 2003-2021 John Willinsky
* Copyright (c) 2014-2024 Simon Fraser University
* Copyright (c) 2003-2024 John Willinsky
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
*
* Include reviewer recommendations for OJS review assignment responses.
*}

{fbvFormSection label="reviewer.article.recommendation" description=$description|default:"reviewer.article.selectRecommendation"}
{fbvElement type="select" id="recommendation" from=$reviewerRecommendationOptions selected=$reviewAssignment->getRecommendation() size=$fbvStyles.size.MEDIUM required=$required|default:true disabled=$readOnly}
{fbvFormSection
label="reviewer.article.recommendation"
description=$description|default:"reviewer.article.selectRecommendation"
}
{fbvElement
type="select"
id="recommendation"
from=$reviewerRecommendationOptions
selected=$reviewAssignment->getRecommendation()
size=$fbvStyles.size.MEDIUM
required=$required|default:true
disabled=$readOnly
translate=false
}
{/fbvFormSection}

0 comments on commit 0abe490

Please sign in to comment.