diff --git a/classes/controllers/grid/users/reviewer/PKPReviewerGridHandler.php b/classes/controllers/grid/users/reviewer/PKPReviewerGridHandler.php index d9c0da20ed4..97ac7778562 100644 --- a/classes/controllers/grid/users/reviewer/PKPReviewerGridHandler.php +++ b/classes/controllers/grid/users/reviewer/PKPReviewerGridHandler.php @@ -689,7 +689,10 @@ public function unconsiderReview($args, $request) $user = $request->getUser(); $reviewAssignment = $this->getAuthorizedContextObject(Application::ASSOC_TYPE_REVIEW_ASSIGNMENT); - Repo::reviewAssignment()->edit($reviewAssignment, ['considered' => ReviewAssignment::REVIEW_ASSIGNMENT_UNCONSIDERED]); + Repo::reviewAssignment()->edit($reviewAssignment, [ + 'considered' => ReviewAssignment::REVIEW_ASSIGNMENT_UNCONSIDERED, + 'dateEditorConfirmed' => null + ]); // log the unconsider. $eventLog = Repo::eventLog()->newDataObject([ @@ -741,6 +744,9 @@ public function reviewRead($args, $request) ? ReviewAssignment::REVIEW_ASSIGNMENT_CONSIDERED : ReviewAssignment::REVIEW_ASSIGNMENT_RECONSIDERED; + // set the date when the editor confirms the review + $newReviewData['dateEditorConfirmed'] = Core::getCurrentDate(); + if (!$reviewAssignment->getDateCompleted()) { // Editor completes the review. $newReviewData['dateConfirmed'] = $newReviewData['dateCompleted'] = Core::getCurrentDate(); diff --git a/classes/submission/maps/Schema.php b/classes/submission/maps/Schema.php index 0924f1915f1..9317164e5d8 100644 --- a/classes/submission/maps/Schema.php +++ b/classes/submission/maps/Schema.php @@ -435,6 +435,8 @@ protected function getPropertyReviewAssignments(Enumerable $reviewAssignments, b $dateConfirmed = is_null($reviewAssignment->getDateConfirmed()) ? null : date('Y-m-d', strtotime($reviewAssignment->getDateConfirmed())); $dateCompleted = is_null($reviewAssignment->getDateCompleted()) ? null : date('Y-m-d', strtotime($reviewAssignment->getDateCompleted())); $dateAssigned = is_null($reviewAssignment->getDateAssigned()) ? null : date('Y-m-d', strtotime($reviewAssignment->getDateAssigned())); + $dateEditorConfirmed = is_null($reviewAssignment->getData('dateEditorConfirmed')) ? null : date('Y-m-d', strtotime($reviewAssignment->getData('dateEditorConfirmed'))); + $reviews[] = [ 'id' => (int) $reviewAssignment->getId(), @@ -445,6 +447,7 @@ protected function getPropertyReviewAssignments(Enumerable $reviewAssignments, b 'dateResponseDue' => $dateResponseDue, 'dateConfirmed' => $dateConfirmed, 'dateCompleted' => $dateCompleted, + 'dateEditorConfirmed' => $dateEditorConfirmed, 'dateAssigned' => $dateAssigned, 'competingInterests' => $reviewAssignment->getCompetingInterests(), 'round' => (int) $reviewAssignment->getRound(), diff --git a/classes/submission/reviewAssignment/DAO.php b/classes/submission/reviewAssignment/DAO.php index f252e547d12..c49be9c3b3f 100644 --- a/classes/submission/reviewAssignment/DAO.php +++ b/classes/submission/reviewAssignment/DAO.php @@ -65,6 +65,7 @@ class DAO extends EntityDAO 'step' => 'step', 'reviewFormId' => 'review_form_id', 'considered' => 'considered', + 'dateEditorConfirmed' => 'date_editor_confirmed', 'requestResent' => 'request_resent', ]; diff --git a/classes/submission/reviewAssignment/ReviewAssignment.php b/classes/submission/reviewAssignment/ReviewAssignment.php index d87ee2de57e..cfec8056ce2 100644 --- a/classes/submission/reviewAssignment/ReviewAssignment.php +++ b/classes/submission/reviewAssignment/ReviewAssignment.php @@ -269,6 +269,27 @@ public function setConsidered($considered) $this->setData('considered', $considered); } + /** + * Get the date the editor confirmed. + * + * @return string|null + */ + public function getDateEditorConfirmed(): ?string + { + return $this->getData('dateEditorConfirmed'); + } + + /** + * Set the date the editor confirmed. + * + * @param string|null $dateEditorConfirmed + * @return void + */ + public function setDateEditorConfirmed(?string $dateEditorConfirmed): void + { + $this->setData('dateEditorConfirmed', $dateEditorConfirmed); + } + /** * Get the date the reviewer was rated. * diff --git a/schemas/reviewAssignment.json b/schemas/reviewAssignment.json index 11c0dc2bbeb..1f68e5e26b0 100644 --- a/schemas/reviewAssignment.json +++ b/schemas/reviewAssignment.json @@ -43,6 +43,16 @@ "in:0,1,2,3" ] }, + "dateEditorConfirmed": { + "type": "string", + "description": "Date when the editor confirmed the review", + "format": "date-time", + "validation": [ + "date:Y-m-d H:i:s", + "nullable" + ], + "apiSummary": true + }, "dateAcknowledged": { "type": "string", "description": "Date editor was familiarized with the review",