diff --git a/classes/mail/mailables/EditorialReminder.php b/classes/mail/mailables/EditorialReminder.php index 10411380e37..e2648760ccc 100644 --- a/classes/mail/mailables/EditorialReminder.php +++ b/classes/mail/mailables/EditorialReminder.php @@ -72,9 +72,10 @@ public function setOutstandingTasks(array $outstanding, array $submissions, int Application::get()->getRequest(), Application::ROUTE_PAGE, $this->context->getPath(), - 'workflow', - 'access', - [$submission->getId()] + 'dashboard', + 'editorial', + null, + ['workflowSubmissionId' => $submission->getId()] ); $outstandingTasks[] = ' diff --git a/classes/mail/variables/ContextEmailVariable.php b/classes/mail/variables/ContextEmailVariable.php index 0a63a94d885..b37b1d162d5 100644 --- a/classes/mail/variables/ContextEmailVariable.php +++ b/classes/mail/variables/ContextEmailVariable.php @@ -134,7 +134,7 @@ protected function getSubmissionsUrl(): string $this->request, PKPApplication::ROUTE_PAGE, $this->context->getPath(), - 'submissions', + 'dashboard', ); } diff --git a/classes/mail/variables/SubmissionEmailVariable.php b/classes/mail/variables/SubmissionEmailVariable.php index 9f1d11a1ca7..47efe5c951c 100644 --- a/classes/mail/variables/SubmissionEmailVariable.php +++ b/classes/mail/variables/SubmissionEmailVariable.php @@ -109,9 +109,10 @@ protected function getAuthorSubmissionUrl(Context $context): string $request, PKPApplication::ROUTE_PAGE, $context->getData('urlPath'), - 'authorDashboard', - 'submission', - [$this->submission->getId()] + 'dashboard', + 'mySubmissions', + null, + ['workflowSubmissionId' => $this->submission->getId()] ); } @@ -127,9 +128,10 @@ protected function getSubmissionUrl(Context $context): string $request, PKPApplication::ROUTE_PAGE, $context->getData('urlPath'), - 'workflow', - 'access', - [$this->submission->getId()] + 'dashboard', + 'editorial', + null, + ['workflowSubmissionId' => $this->submission->getId()] ); } diff --git a/classes/notification/PKPNotificationManager.php b/classes/notification/PKPNotificationManager.php index e5125c0fb97..cd0168c78bc 100644 --- a/classes/notification/PKPNotificationManager.php +++ b/classes/notification/PKPNotificationManager.php @@ -59,7 +59,7 @@ public function getNotificationUrl(PKPRequest $request, Notification $notificati if ($notification->assocType != Application::ASSOC_TYPE_SUBMISSION) { throw new \Exception('Unexpected assoc type!'); } - return $dispatcher->url($request, PKPApplication::ROUTE_PAGE, $context->getPath(), 'workflow', 'access', [$notification->assocId]); + return $dispatcher->url($request, PKPApplication::ROUTE_PAGE, $context->getPath(), 'dashboard', 'editorial', null, ['workflowSubmissionId' => $notification->assocId]); case Notification::NOTIFICATION_TYPE_REVIEWER_COMMENT: if ($notification->assocType != Application::ASSOC_TYPE_REVIEW_ASSIGNMENT) { throw new \Exception('Unexpected assoc type!'); diff --git a/classes/notification/managerDelegate/PKPApproveSubmissionNotificationManager.php b/classes/notification/managerDelegate/PKPApproveSubmissionNotificationManager.php index 81d7617c2c8..88925728653 100644 --- a/classes/notification/managerDelegate/PKPApproveSubmissionNotificationManager.php +++ b/classes/notification/managerDelegate/PKPApproveSubmissionNotificationManager.php @@ -32,7 +32,7 @@ public function getNotificationUrl(PKPRequest $request, Notification $notificati { $dispatcher = Application::get()->getDispatcher(); $context = $request->getContext(); - return $dispatcher->url($request, PKPApplication::ROUTE_PAGE, $context->getPath(), 'workflow', 'access', [$notification->assocId]); + return $dispatcher->url($request, PKPApplication::ROUTE_PAGE, $context->getPath(), 'dashboard', 'editorial', null, ['workflowSubmissionId' => $notification->assocId]); } /** diff --git a/classes/notification/managerDelegate/PKPEditingProductionStatusNotificationManager.php b/classes/notification/managerDelegate/PKPEditingProductionStatusNotificationManager.php index 31716876629..d3d4572de0c 100644 --- a/classes/notification/managerDelegate/PKPEditingProductionStatusNotificationManager.php +++ b/classes/notification/managerDelegate/PKPEditingProductionStatusNotificationManager.php @@ -60,7 +60,7 @@ public function getNotificationUrl(PKPRequest $request, Notification $notificati if ($notification->assocType != Application::ASSOC_TYPE_SUBMISSION) { throw new \Exception('Unexpected assoc type for notification!'); } - return $dispatcher->url($request, PKPApplication::ROUTE_PAGE, $context->getPath(), 'workflow', 'access', [$notification->assocId]); + return $dispatcher->url($request, PKPApplication::ROUTE_PAGE, $context->getPath(), 'dashboard', 'editorial', null, ['workflowSubmissionId' => $notification->assocId]); } throw new \Exception('Unmatched notification type!'); } diff --git a/classes/services/PKPNavigationMenuService.php b/classes/services/PKPNavigationMenuService.php index f5fd91b0561..c20e90ec927 100755 --- a/classes/services/PKPNavigationMenuService.php +++ b/classes/services/PKPNavigationMenuService.php @@ -300,14 +300,9 @@ public function getDisplayStatus(&$navigationMenuItem, &$navigationMenu) break; case NavigationMenuItem::NMI_TYPE_USER_DASHBOARD: if ($currentUser->hasRole([Role::ROLE_ID_MANAGER, Role::ROLE_ID_ASSISTANT, Role::ROLE_ID_REVIEWER, Role::ROLE_ID_AUTHOR], $contextId) || $currentUser->hasRole([Role::ROLE_ID_SITE_ADMIN], PKPApplication::SITE_CONTEXT_ID)) { - $navigationMenuItem->setUrl($dispatcher->url( - $request, - PKPApplication::ROUTE_PAGE, - null, - 'submissions', - null, - null - )); + $pkpPageRouter = $request->getRouter(); /** @var \PKP\core\PKPPageRouter $pkpPageRouter */ + + $navigationMenuItem->setUrl($pkpPageRouter->getHomeUrl($request)); } else { $navigationMenuItem->setUrl($dispatcher->url( $request, diff --git a/classes/submission/Repository.php b/classes/submission/Repository.php index 64219b7f9cf..06ea617b904 100644 --- a/classes/submission/Repository.php +++ b/classes/submission/Repository.php @@ -219,9 +219,10 @@ public function getWorkflowUrlByUserRoles(Submission $submission, ?int $userId = $request, Application::ROUTE_PAGE, $submissionContext->getPath(), - 'authorDashboard', - 'submission', - [$submission->getId()] + 'dashboard', + 'mySubmissions', + null, + ['workflowSubmissionId' => $submission->getId()] ); } @@ -250,9 +251,10 @@ public function getWorkflowUrlByUserRoles(Submission $submission, ?int $userId = $request, Application::ROUTE_PAGE, $submissionContext->getPath(), - 'workflow', - 'access', - [$submission->getId()] + 'dashboard', + 'editorial', + null, + ['workflowSubmissionId' => $submission->getId()] ); } @@ -376,7 +378,7 @@ public function validateSubmit(Submission $submission, Context $context): array Application::get()->getRequest(), Application::ROUTE_PAGE, $context->getData('path'), - 'submissions' + 'dashboard' ) ] ); @@ -770,9 +772,10 @@ public function getUrlAuthorWorkflow(Context $context, int $submissionId): strin Application::get()->getRequest(), Application::ROUTE_PAGE, $context->getData('urlPath'), - 'authorDashboard', - 'submission', - [$submissionId] + 'dashboard', + 'mySubmissions', + null, + ['workflowSubmissionId' => $submissionId] ); } @@ -785,9 +788,10 @@ public function getUrlEditorialWorkflow(Context $context, int $submissionId): st Application::get()->getRequest(), Application::ROUTE_PAGE, $context->getData('urlPath'), - 'workflow', - 'access', - [$submissionId] + 'dashboard', + 'editorial', + null, + ['workflowSubmissionId' => $submissionId] ); } diff --git a/classes/template/PKPTemplateManager.php b/classes/template/PKPTemplateManager.php index eb2cde579f0..529944a2601 100644 --- a/classes/template/PKPTemplateManager.php +++ b/classes/template/PKPTemplateManager.php @@ -970,7 +970,7 @@ public function setupBackendPage() // Admins should switch to the same page on another context where possible $requestedOp = $request->getRequestedOp() === 'index' ? null : $request->getRequestedOp(); $isSwitchable = $isAdmin && in_array($request->getRequestedPage(), [ - 'submissions', + 'dashboard', 'manageIssues', 'management', 'payment', diff --git a/controllers/grid/users/stageParticipant/StageParticipantGridHandler.php b/controllers/grid/users/stageParticipant/StageParticipantGridHandler.php index 71f6830f6ad..b351c5bbb68 100644 --- a/controllers/grid/users/stageParticipant/StageParticipantGridHandler.php +++ b/controllers/grid/users/stageParticipant/StageParticipantGridHandler.php @@ -147,9 +147,10 @@ public function initialize($request, $args = null) $request, PKPApplication::ROUTE_PAGE, null, - 'workflow', - 'access', - [$submissionId] + 'dashboard', + 'editorial', + null, + ['workflowSubmissionId' => $submissionId] ); $this->addAction( new LinkAction( diff --git a/pages/authorDashboard/PKPAuthorDashboardHandler.php b/pages/authorDashboard/PKPAuthorDashboardHandler.php index c65036023d9..93cc28b8713 100644 --- a/pages/authorDashboard/PKPAuthorDashboardHandler.php +++ b/pages/authorDashboard/PKPAuthorDashboardHandler.php @@ -29,6 +29,7 @@ use PKP\components\forms\publication\PKPMetadataForm; use PKP\components\forms\publication\TitleAbstractForm; use PKP\components\listPanels\ContributorsListPanel; +use PKP\config\Config; use PKP\context\Context; use PKP\core\JSONMessage; use PKP\core\PKPApplication; @@ -91,6 +92,13 @@ public function authorize($request, &$args, $roleAssignments) */ public function submission($args, $request) { + if (Config::getVar('features', 'enable_new_submission_listing')) { + $submission = $this->getAuthorizedContextObject(Application::ASSOC_TYPE_SUBMISSION); + $router = $request->getRouter(); + return $request->redirectUrl($router->url($request, null, 'dashboard', 'mySubmissions', null, ['workflowSubmissionId' => $submission->getId()])); + } + + // Pass the authorized submission on to the template. $this->setupTemplate($request); diff --git a/pages/dashboard/PKPDashboardHandlerNext.php b/pages/dashboard/PKPDashboardHandlerNext.php index 0d0a839db7f..bbac5f59b85 100644 --- a/pages/dashboard/PKPDashboardHandlerNext.php +++ b/pages/dashboard/PKPDashboardHandlerNext.php @@ -60,7 +60,7 @@ abstract class PKPDashboardHandlerNext extends Handler public int $perPage = 30; /** Identify in which context is looking at the submissions */ - public DashboardPage $dashboardPage; + public ?DashboardPage $dashboardPage; /** * editorial, review_assignments @@ -69,10 +69,9 @@ abstract class PKPDashboardHandlerNext extends Handler /** * Constructor */ - public function __construct(DashboardPage $dashboardPage) + public function __construct(?DashboardPage $dashboardPage = null) { parent::__construct(); - $this->dashboardPage = $dashboardPage; if($this->dashboardPage === DashboardPage::EditorialDashboard) { @@ -85,7 +84,7 @@ public function __construct(DashboardPage $dashboardPage) $this->addRoleAssignment( [Role::ROLE_ID_SITE_ADMIN, Role::ROLE_ID_MANAGER, Role::ROLE_ID_SUB_EDITOR, Role::ROLE_ID_ASSISTANT], - ['index', 'editorial'] + ['editorial'] ); $this->addRoleAssignment( @@ -104,6 +103,11 @@ public function __construct(DashboardPage $dashboardPage) */ public function authorize($request, &$args, $roleAssignments) { + if(!$this->dashboardPage) { + $pkpPageRouter = $request->getRouter(); /** @var \PKP\core\PKPPageRouter $pkpPageRouter */ + $pkpPageRouter->redirectHome($request); + } + $this->addPolicy(new PKPSiteAccessPolicy($request, null, $roleAssignments)); return parent::authorize($request, $args, $roleAssignments); } @@ -117,7 +121,6 @@ public function authorize($request, &$args, $roleAssignments) public function index($args, $request) { $context = $request->getContext(); - $dispatcher = $request->getDispatcher(); if (!$context) { $request->redirect(null, 'user'); diff --git a/pages/dashboard/index.php b/pages/dashboard/index.php deleted file mode 100644 index f591107206b..00000000000 --- a/pages/dashboard/index.php +++ /dev/null @@ -1,29 +0,0 @@ -getData('urlPath'), - 'workflow', - 'access', - [$this->submission->getId()] + 'dashboard', + 'editorial', + null, + ['workflowSubmissionId' => $this->submission->getId()] ), 'submissionApiUrl' => $dispatcher->url( $request, @@ -176,7 +177,7 @@ public function record($args, $request) $request, Application::ROUTE_PAGE, $context->getData('urlPath'), - 'submissions', + 'dashboard', ), 'viewAllSubmissionsLabel' => __('submission.list.viewAllSubmissions'), 'viewSubmissionLabel' => __('submission.list.viewSubmission'), @@ -220,13 +221,13 @@ protected function getBreadcrumb(Submission $submission, Context $context, Reque return [ [ - 'id' => 'submissions', - 'name' => __('navigation.submissions'), + 'id' => 'dashboard', + 'name' => __('navigation.dashboard'), 'url' => $dispatcher->url( $request, Application::ROUTE_PAGE, $context->getData('urlPath'), - 'submissions' + 'dashboard' ), ], [ @@ -237,9 +238,10 @@ protected function getBreadcrumb(Submission $submission, Context $context, Reque $request, Application::ROUTE_PAGE, $context->getData('urlPath'), - 'workflow', - 'access', - [$submission->getId()] + 'dashboard', + 'editorial', + null, + ['workflowSubmissionId' => $submission->getId()] ), ], [ diff --git a/pages/workflow/PKPWorkflowHandler.php b/pages/workflow/PKPWorkflowHandler.php index 61efd0f96b3..0ee6c7a9edc 100644 --- a/pages/workflow/PKPWorkflowHandler.php +++ b/pages/workflow/PKPWorkflowHandler.php @@ -106,6 +106,7 @@ public function authorize($request, &$args, $roleAssignments) */ public function access($args, $request) { + $submission = $this->getAuthorizedContextObject(Application::ASSOC_TYPE_SUBMISSION); $currentStageId = $submission->getData('stageId'); @@ -149,6 +150,14 @@ public function access($args, $request) */ public function index($args, $request) { + + if (Config::getVar('features', 'enable_new_submission_listing')) { + $submission = $this->getAuthorizedContextObject(Application::ASSOC_TYPE_SUBMISSION); + $router = $request->getRouter(); + return $request->redirectUrl($router->url($request, null, 'dashboard', 'editorial', null, ['workflowSubmissionId' => $submission->getId()])); + } + + $this->setupTemplate($request); $templateMgr = TemplateManager::getManager($request); diff --git a/templates/layouts/backend.tpl b/templates/layouts/backend.tpl index f916030adbf..17ee06a17ce 100644 --- a/templates/layouts/backend.tpl +++ b/templates/layouts/backend.tpl @@ -128,11 +128,6 @@ {/if}