Skip to content

pkp/pkp-lib#1660 Customizable Reviewer Recommendations #1851

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions classes/core/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,14 @@ public static function getSectionIdPropName(): string
return 'seriesId';
}

/**
* Define if the application has customizable reviewer recommendation functionality
*/
public function hasCustomizableReviewerRecommendation(): bool
{
return true;
}

/**
* Get the help URL of this application
*/
Expand Down
42 changes: 42 additions & 0 deletions classes/migration/install/ReviewerRecommendationsMigration.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?php

/**
* @file classes/migration/install/ReviewerRecommendationsMigration.php
*
* Copyright (c) 2025 Simon Fraser University
* Copyright (c) 2025 John Willinsky
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
*
* @class ReviewerRecommendationsMigration
*
* @brief Describe database table structures .
*/

namespace APP\migration\install;

class ReviewerRecommendationsMigration extends \PKP\migration\install\ReviewerRecommendationsMigration
{
/**
* @copydoc \PKP\migration\install\ReviewerRecommendationsMigration::contextTable()
*/
public function contextTable(): string
{
return 'presses';
}

/**
* @copydoc \PKP\migration\install\ReviewerRecommendationsMigration::settingTable()
*/
public function settingTable(): string
{
return 'press_settings';
}

/**
* @copydoc \PKP\migration\install\ReviewerRecommendationsMigration::contextPrimaryKey()
*/
public function contextPrimaryKey(): string
{
return 'press_id';
}
}
52 changes: 52 additions & 0 deletions classes/migration/upgrade/v3_6_0/I1660_ReviewerRecommendations.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?php

/**
* @file classes/migration/upgrade/v3_6_0/I1660_ReviewerRecommendations.php
*
* Copyright (c) 2025 Simon Fraser University
* Copyright (c) 2025 John Willinsky
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
*
* @class I1660_ReviewerRecommendations.php
*
* @brief Upgrade migration to add recommendations
*
*/

namespace APP\migration\upgrade\v3_6_0;

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class I1660_ReviewerRecommendations extends \PKP\migration\Migration
{
/**
* Run the migration.
*/
public function up(): void
{
Schema::table('review_assignments', function (Blueprint $table) {
$table->bigInteger('reviewer_recommendation_id')->nullable()->after('reviewer_id');
$table
->foreign('reviewer_recommendation_id')
->references('reviewer_recommendation_id')
->on('reviewer_recommendations')
->onDelete('set null');
$table->index(['reviewer_recommendation_id'], 'review_assignments_recommendation_id');

$table->dropColumn('recommendation');
});
}

/**
* Reverse the migration
*/
public function down(): void
{
Schema::table('review_assignments', function (Blueprint $table) {
$table->dropForeign('review_assignments_reviewer_recommendation_id_foreign');
$table->dropColumn(['reviewer_recommendation_id']);
$table->smallInteger('recommendation')->nullable()->after('reviewer_id');
});
}
}
1 change: 1 addition & 0 deletions dbscripts/xml/install.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
<migration class="PKP\migration\install\SubmissionFilesMigration" />
<migration class="PKP\migration\install\ReviewFormsMigration" />
<migration class="PKP\migration\install\LibraryFilesMigration" />
<migration class="APP\migration\install\ReviewerRecommendationsMigration" />
<migration class="PKP\migration\install\ReviewsMigration" />
<migration class="PKP\migration\install\ReviewerSuggestionsMigration" />
<migration class="PKP\migration\install\TemporaryFilesMigration" />
Expand Down
2 changes: 2 additions & 0 deletions dbscripts/xml/upgrade.xml
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,8 @@
<upgrade minversion="3.5.0.0" maxversion="3.5.9.9">
<migration class="PKP\migration\upgrade\v3_6_0\PreflightCheckMigration" fallback="3.5.9.9" />
<migration class="PKP\migration\upgrade\v3_6_0\I10403_EmailTemplateUserGroupAccess"/>
<migration class="APP\migration\install\ReviewerRecommendationsMigration" />
<migration class="APP\migration\upgrade\v3_6_0\I1660_ReviewerRecommendations"/>
</upgrade>

<upgrade minversion="3.1.0.0" maxversion="3.5.9.9">
Expand Down
2 changes: 1 addition & 1 deletion lib/pkp
Submodule pkp updated 35 files
+11 −8 classes/controllers/grid/users/reviewer/PKPReviewerGridHandler.php
+2 −2 classes/core/PKPAppKey.php
+6 −1 classes/core/PKPApplication.php
+14 −0 classes/core/SettingsBuilder.php
+6 −0 classes/facades/Repo.php
+1 −1 classes/mail/traits/ReviewerComments.php
+9 −6 classes/mail/variables/ReviewAssignmentEmailVariable.php
+105 −0 classes/migration/install/ReviewerRecommendationsMigration.php
+9 −1 classes/migration/install/ReviewsMigration.php
+2 −3 classes/services/PKPContextService.php
+2 −2 classes/submission/maps/Schema.php
+16 −0 classes/submission/reviewAssignment/Collector.php
+1 −1 classes/submission/reviewAssignment/DAO.php
+18 −50 classes/submission/reviewAssignment/ReviewAssignment.php
+24 −13 classes/submission/reviewer/form/PKPReviewerReviewStep3Form.php
+31 −0 classes/submission/reviewer/recommendation/RecommendationOption.php
+168 −0 classes/submission/reviewer/recommendation/Repository.php
+181 −0 classes/submission/reviewer/recommendation/ReviewerRecommendation.php
+1 −1 controllers/grid/admin/languages/AdminLanguageGridHandler.php
+15 −3 controllers/grid/languages/LanguageGridHandler.php
+1 −1 controllers/grid/users/reviewer/AuthorReviewerGridCellProvider.php
+2 −2 controllers/grid/users/reviewer/AuthorReviewerGridHandler.php
+2 −2 controllers/grid/users/reviewer/ReviewerGridCellProvider.php
+1 −1 cypress/support/commands.js
+3 −0 locale/en/api.po
+7 −7 locale/en/common.po
+1 −8 pages/dashboard/PKPDashboardHandler.php
+1 −0 pages/management/ManagementHandler.php
+1 −0 pages/reviewer/PKPReviewerHandler.php
+2 −1 schemas/highlight.json
+2 −2 schemas/reviewAssignment.json
+2 −2 templates/controllers/grid/users/reviewer/authorReadReview.tpl
+2 −2 templates/controllers/grid/users/reviewer/readReview.tpl
+1 −1 templates/controllers/grid/users/reviewer/reviewDownload.tpl
+8 −0 templates/management/workflow.tpl
2 changes: 1 addition & 1 deletion plugins/reports/reviewReport