Skip to content

Commit ff9f8db

Browse files
authored
Merge pull request #1851 from touhidurabir/i1660_main
pkp/pkp-lib#1660 Customizable Reviewer Recommendations
2 parents 2a91b3e + bbdcb4a commit ff9f8db

File tree

8 files changed

+108
-3
lines changed

8 files changed

+108
-3
lines changed

classes/core/Application.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,14 @@ public static function getSectionIdPropName(): string
245245
return 'seriesId';
246246
}
247247

248+
/**
249+
* Define if the application has customizable reviewer recommendation functionality
250+
*/
251+
public function hasCustomizableReviewerRecommendation(): bool
252+
{
253+
return true;
254+
}
255+
248256
/**
249257
* Get the help URL of this application
250258
*/
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?php
2+
3+
/**
4+
* @file classes/migration/install/ReviewerRecommendationsMigration.php
5+
*
6+
* Copyright (c) 2025 Simon Fraser University
7+
* Copyright (c) 2025 John Willinsky
8+
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
9+
*
10+
* @class ReviewerRecommendationsMigration
11+
*
12+
* @brief Describe database table structures .
13+
*/
14+
15+
namespace APP\migration\install;
16+
17+
class ReviewerRecommendationsMigration extends \PKP\migration\install\ReviewerRecommendationsMigration
18+
{
19+
/**
20+
* @copydoc \PKP\migration\install\ReviewerRecommendationsMigration::contextTable()
21+
*/
22+
public function contextTable(): string
23+
{
24+
return 'presses';
25+
}
26+
27+
/**
28+
* @copydoc \PKP\migration\install\ReviewerRecommendationsMigration::settingTable()
29+
*/
30+
public function settingTable(): string
31+
{
32+
return 'press_settings';
33+
}
34+
35+
/**
36+
* @copydoc \PKP\migration\install\ReviewerRecommendationsMigration::contextPrimaryKey()
37+
*/
38+
public function contextPrimaryKey(): string
39+
{
40+
return 'press_id';
41+
}
42+
}
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<?php
2+
3+
/**
4+
* @file classes/migration/upgrade/v3_6_0/I1660_ReviewerRecommendations.php
5+
*
6+
* Copyright (c) 2025 Simon Fraser University
7+
* Copyright (c) 2025 John Willinsky
8+
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
9+
*
10+
* @class I1660_ReviewerRecommendations.php
11+
*
12+
* @brief Upgrade migration to add recommendations
13+
*
14+
*/
15+
16+
namespace APP\migration\upgrade\v3_6_0;
17+
18+
use Illuminate\Database\Schema\Blueprint;
19+
use Illuminate\Support\Facades\Schema;
20+
21+
class I1660_ReviewerRecommendations extends \PKP\migration\Migration
22+
{
23+
/**
24+
* Run the migration.
25+
*/
26+
public function up(): void
27+
{
28+
Schema::table('review_assignments', function (Blueprint $table) {
29+
$table->bigInteger('reviewer_recommendation_id')->nullable()->after('reviewer_id');
30+
$table
31+
->foreign('reviewer_recommendation_id')
32+
->references('reviewer_recommendation_id')
33+
->on('reviewer_recommendations')
34+
->onDelete('set null');
35+
$table->index(['reviewer_recommendation_id'], 'review_assignments_recommendation_id');
36+
37+
$table->dropColumn('recommendation');
38+
});
39+
}
40+
41+
/**
42+
* Reverse the migration
43+
*/
44+
public function down(): void
45+
{
46+
Schema::table('review_assignments', function (Blueprint $table) {
47+
$table->dropForeign('review_assignments_reviewer_recommendation_id_foreign');
48+
$table->dropColumn(['reviewer_recommendation_id']);
49+
$table->smallInteger('recommendation')->nullable()->after('reviewer_id');
50+
});
51+
}
52+
}

dbscripts/xml/install.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
<migration class="PKP\migration\install\SubmissionFilesMigration" />
3535
<migration class="PKP\migration\install\ReviewFormsMigration" />
3636
<migration class="PKP\migration\install\LibraryFilesMigration" />
37+
<migration class="APP\migration\install\ReviewerRecommendationsMigration" />
3738
<migration class="PKP\migration\install\ReviewsMigration" />
3839
<migration class="PKP\migration\install\ReviewerSuggestionsMigration" />
3940
<migration class="PKP\migration\install\TemporaryFilesMigration" />

dbscripts/xml/upgrade.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,8 @@
167167
<upgrade minversion="3.5.0.0" maxversion="3.5.9.9">
168168
<migration class="PKP\migration\upgrade\v3_6_0\PreflightCheckMigration" fallback="3.5.9.9" />
169169
<migration class="PKP\migration\upgrade\v3_6_0\I10403_EmailTemplateUserGroupAccess"/>
170+
<migration class="APP\migration\install\ReviewerRecommendationsMigration" />
171+
<migration class="APP\migration\upgrade\v3_6_0\I1660_ReviewerRecommendations"/>
170172
</upgrade>
171173

172174
<upgrade minversion="3.1.0.0" maxversion="3.5.9.9">

lib/pkp

Submodule pkp updated 35 files

0 commit comments

Comments
 (0)