Skip to content

Commit

Permalink
#10970 All reviews view should include completed assignments of unpub…
Browse files Browse the repository at this point in the history
…lished submissions
  • Loading branch information
Vitaliy-1 authored and jardakotesovec committed Feb 27, 2025
1 parent 0fdfc75 commit ba8ef58
Showing 1 changed file with 19 additions and 17 deletions.
36 changes: 19 additions & 17 deletions classes/submission/reviewAssignment/Collector.php
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ public function getQueryBuilder(): Builder
});

$q->when(
$this->actionRequiredByReviewer,
$this->actionRequiredByReviewer || $this->isActive,
fn (Builder $q) => $q
->whereNull('ra.date_completed')
->where('ra.declined', '<>', 1)
Expand All @@ -338,22 +338,24 @@ public function getQueryBuilder(): Builder
->select('s.submission_id')
->from('submissions AS s')
->whereColumn('s.submission_id', 'ra.submission_id')
->whereColumn('s.stage_id', 'ra.stage_id')
)
);

$q->when(
$this->isActive,
fn (Builder $q) => $q
->where('ra.declined', '<>', 1)
->where('ra.cancelled', '<>', 1)
->whereIn(
'ra.submission_id',
fn (Builder $q) => $q
->select('s.submission_id')
->from('submissions AS s')
->whereColumn('s.submission_id', 'ra.submission_id')
->where('s.status', '<>', PKPSubmission::STATUS_PUBLISHED)
->when(
$this->actionRequiredByReviewer,
fn (Builder $q) => $q
->whereColumn('s.stage_id', 'ra.stage_id')
)
->when(
$this->isActive,
fn (Builder $q) => $q
->where(
fn (Builder $q) => $q
->whereColumn('s.stage_id', 'ra.stage_id')
->orWhere(
fn (Builder $q) => $q
->where('s.status', '<>', PKPSubmission::STATUS_PUBLISHED)
->whereNotNull('ra.date_completed')
)
)
)
)
);

Expand Down

0 comments on commit ba8ef58

Please sign in to comment.