diff --git a/classes/components/forms/context/PKPAppearanceMastheadForm.php b/classes/components/forms/context/PKPAppearanceMastheadForm.php index fc9fadc3855..4a4f1ec75ac 100644 --- a/classes/components/forms/context/PKPAppearanceMastheadForm.php +++ b/classes/components/forms/context/PKPAppearanceMastheadForm.php @@ -16,8 +16,10 @@ namespace PKP\components\forms\context; use APP\facades\Repo; +use PKP\components\forms\FieldHTML; use PKP\components\forms\FieldOptions; use PKP\components\forms\FormComponent; +use PKP\security\Role; define('FORM_APPEARANCE_MASTHEAD', 'appearanceMasthead'); @@ -48,6 +50,7 @@ public function __construct($action, $locales, $context) $allMastheadUserGroups = $collector ->filterByContextIds([$context->getId()]) ->filterByMasthead(true) + ->filterExcludeRoles([Role::ROLE_ID_REVIEWER]) ->orderBy($collector::ORDERBY_ROLE_ID) ->getMany() ->toArray(); @@ -69,6 +72,10 @@ public function __construct($action, $locales, $context) 'value' => array_column($mastheadOptions, 'value'), 'options' => $mastheadOptions, 'allowOnlySorting' => true - ])); + ])) + ->addField(new FieldHTML('reviewer', [ + 'label' => __('user.role.reviewers'), + 'description' => __('manager.setup.editorialMasthead.order.reviewers.description') + ])); } } diff --git a/classes/userGroup/Collector.php b/classes/userGroup/Collector.php index 946920e9e4e..7014583f28f 100644 --- a/classes/userGroup/Collector.php +++ b/classes/userGroup/Collector.php @@ -42,6 +42,8 @@ class Collector implements CollectorInterface public ?array $roleIds = null; + public ?array $excludeRoles = null; + public ?array $stageIds = null; // getUserGroupsByStage public ?array $publicationIds = null; @@ -131,6 +133,15 @@ public function filterByRoleIds(?array $roleIds): self return $this; } + /** + * Exclude roles + */ + public function filterExcludeRoles(?array $excludedRoles): self + { + $this->excludeRoles = $excludedRoles; + return $this; + } + /** * Filter by contexts */ @@ -301,6 +312,10 @@ public function getQueryBuilder(): Builder $q->whereIn('ug.role_id', $this->roleIds); } + if (isset($this->excludeRoles)) { + $q->whereNotIn('ug.role_id', $this->excludeRoles); + } + $q->when($this->isRecommendOnly !== null, function (Builder $q) { $q->whereIn('ug.user_group_id', function (Builder $q) { $q->select('user_group_id') diff --git a/locale/en/manager.po b/locale/en/manager.po index 4f79a4af4d2..91ed0ccc493 100644 --- a/locale/en/manager.po +++ b/locale/en/manager.po @@ -3555,5 +3555,8 @@ msgstr "Require submitting Authors to file a Competing Interest (CI) statement w msgid "manager.setup.masthead" msgstr "Masthead" +msgid "manager.setup.editorialMasthead.order.reviewers.description" +msgstr "Reviewers will be displayed in a standardized format to maintain uniformity and ensure easy discoverability in this section." + msgid "mailable.changeProfileEmailInvitationNotify.name" msgstr "Change Email Address Invitation" diff --git a/pages/about/AboutContextHandler.php b/pages/about/AboutContextHandler.php index 5af5783e869..5df5a7d16f6 100644 --- a/pages/about/AboutContextHandler.php +++ b/pages/about/AboutContextHandler.php @@ -76,6 +76,7 @@ public function editorialMasthead($args, $request) $allMastheadUserGroups = $collector ->filterByContextIds([$context->getId()]) ->filterByMasthead(true) + ->filterExcludeRoles([Role::ROLE_ID_REVIEWER]) ->orderBy($collector::ORDERBY_ROLE_ID) ->getMany() ->toArray(); @@ -87,9 +88,6 @@ public function editorialMasthead($args, $request) $mastheadUsers = []; foreach ($mastheadRoles as $mastheadUserGroup) { - if ($mastheadUserGroup->getRoleId() == Role::ROLE_ID_REVIEWER) { - continue; - } foreach ($allUsersIdsGroupedByUserGroupId[$mastheadUserGroup->getId()] ?? [] as $userId) { $user = Repo::user()->get($userId); $userUserGroup = UserUserGroup::withUserId($user->getId()) @@ -151,6 +149,7 @@ public function editorialHistory($args, $request) $allMastheadUserGroups = $collector ->filterByContextIds([$context->getId()]) ->filterByMasthead(true) + ->filterExcludeRoles([Role::ROLE_ID_REVIEWER]) ->orderBy($collector::ORDERBY_ROLE_ID) ->getMany() ->toArray(); @@ -162,9 +161,6 @@ public function editorialHistory($args, $request) $mastheadUsers = []; foreach ($mastheadRoles as $mastheadUserGroup) { - if ($mastheadUserGroup->getRoleId() == Role::ROLE_ID_REVIEWER) { - continue; - } foreach ($allUsersIdsGroupedByUserGroupId[$mastheadUserGroup->getId()] ?? [] as $userId) { $user = Repo::user()->get($userId); $userUserGroups = UserUserGroup::withUserId($user->getId())