Skip to content
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

pkp/pkp-lib#10671 Review Report plugin compatibility and test for 3.5.0 #55

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
16 changes: 5 additions & 11 deletions ReviewReportDAO.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,12 @@
/**
* @file plugins/reports/reviewReport/ReviewReportDAO.php
*
* Copyright (c) 2014-2020 Simon Fraser University
* Copyright (c) 2003-2020 John Willinsky
* Copyright (c) 2014-2025 Simon Fraser University
* Copyright (c) 2003-2025 John Willinsky
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
*
* @class ReviewReportDAO
*
* @ingroup plugins_reports_review
*
* @see ReviewReportPlugin
*
* @brief Review report DAO
*/

Expand All @@ -28,12 +24,8 @@ class ReviewReportDAO extends DAO
{
/**
* Get the review report data.
*
* @param int $contextId Context ID
*
* @return array
*/
public function getReviewReport($contextId)
public function getReviewReport(int $contextId): array
{
$locale = Locale::getLocale();

Expand Down Expand Up @@ -118,6 +110,7 @@ public function getReviewReport($contextId)
ORDER BY r.reviewer_id',
[(int) $contextId]
);

$interests = [];
foreach ($assignedReviewerIds as $row) {
if (!array_key_exists($row->reviewer_id, $interests)) {
Expand All @@ -128,6 +121,7 @@ public function getReviewReport($contextId)
}
}
}

return [$commentsReturner, $reviewsReturner, $interests];
}
}
18 changes: 8 additions & 10 deletions ReviewReportPlugin.php
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
<?php

/**
* @file ReviewReportPlugin.php
* @file plugins/reports/reviewReport/ReviewReportPlugin.php
*
* Copyright (c) 2014-2020 Simon Fraser University
* Copyright (c) 2003-2020 John Willinsky
* Copyright (c) 2014-2025 Simon Fraser University
* Copyright (c) 2003-2025 John Willinsky
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
*
* @class ReviewReportPlugin
*
* @ingroup plugins_reports_review
*
* @see ReviewReportDAO
*
* @brief Review report plugin
*/

Expand All @@ -23,10 +19,12 @@
use PKP\db\DAORegistry;
use APP\facades\Repo;
use PKP\plugins\ReportPlugin;
use PKP\reviewForm\ReviewFormElement;
use PKP\reviewForm\ReviewFormElementDAO;
use PKP\reviewForm\ReviewFormResponseDAO;
use PKP\submission\reviewAssignment\ReviewAssignment;
use PKP\workflow\WorkflowStageDAO;
use stdClass;

class ReviewReportPlugin extends ReportPlugin
{
Expand Down Expand Up @@ -150,7 +148,7 @@ public function display($args, $request)
/** @var ReviewFormElementDAO */
$reviewFormElementDao = DAORegistry::getDAO('ReviewFormElementDAO');

foreach ($reviewsIterator as $row) {
foreach ($reviewsIterator as $row) { /** @var stdClass $row */
if (substr($row->date_response_due, 11) === '00:00:00') {
$row->date_response_due = substr($row->date_response_due, 0, 11) . '23:59:59';
}
Expand Down Expand Up @@ -183,7 +181,7 @@ public function display($args, $request)
if ($reviewAssignment->getDateCompleted() != null && ($reviewFormId = $reviewAssignment->getReviewFormId())) {
$reviewId = $reviewAssignment->getId();
$reviewFormElements = $reviewFormElementDao->getByReviewFormId($reviewFormId);
while ($reviewFormElement = $reviewFormElements->next()) {
while ($reviewFormElement = $reviewFormElements->next()) { /** @var ReviewFormElement $reviewFormElement */
if (!$reviewFormElement->getIncluded()) {
continue;
}
Expand Down Expand Up @@ -227,7 +225,7 @@ public function display($args, $request)
fclose($fp);
}

public function getOverdueDays($row)
public function getOverdueDays(stdClass $row): array
{
$responseDueTime = strtotime($row->date_response_due);
$reviewDueTime = strtotime($row->date_due);
Expand Down