Skip to content

Commit

Permalink
pkp#10874 Omit WORKFLOW_STAGE_ID_SUBMISSION stage for OPS
Browse files Browse the repository at this point in the history
  • Loading branch information
Vitaliy-1 committed Feb 11, 2025
1 parent 3b1c010 commit ecf81ba
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion controllers/grid/settings/sections/form/PKPSectionForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,14 @@ public function setSection(Section $section): void
*/
public function fetch($request, $template = null, $display = false)
{
$stages = Application::getApplicationStages();
$assignableUserGroups = UserGroup::query()
->withContextIds([$request->getContext()->getId()])
->withRoleIds($this->assignableRoles)
->withStageIds([WORKFLOW_STAGE_ID_SUBMISSION])
->withStageIds([
// WORKFLOW_STAGE_ID_SUBMISSION for OJS/OMP and WORKFLOW_STAGE_ID_PRODUCTION for OPS, see pkp/pkp-lib#10874
array_shift($stages)
])
->get()
->map(function (UserGroup $userGroup) use ($request) {
return [
Expand Down
6 changes: 5 additions & 1 deletion pages/submission/PKPSubmissionHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -854,11 +854,15 @@ protected function showErrorPage(string $titleLocaleKey, string $message): void
protected function getWorkflowUrl(Submission $submission, User $user): string
{
$request = Application::get()->getRequest();
$stages = Application::getApplicationStages();

// Replaces StageAssignmentDAO::getBySubmissionAndRoleIds
$hasStageAssignments = StageAssignment::withSubmissionIds([$submission->getId()])
->withRoleIds([Role::ROLE_ID_AUTHOR])
->withStageIds([WORKFLOW_STAGE_ID_SUBMISSION])
->withStageIds([
// WORKFLOW_STAGE_ID_SUBMISSION for OJS/OMP and WORKFLOW_STAGE_ID_PRODUCTION for OPS, see pkp/pkp-lib#10874
array_shift($stages)
])
->withUserId($user->getId())
->exists();

Expand Down

0 comments on commit ecf81ba

Please sign in to comment.