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 c234b7dbc99..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()] ); } diff --git a/classes/submission/Repository.php b/classes/submission/Repository.php index 64219b7f9cf..55d105e82cc 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()] ); } @@ -376,7 +377,7 @@ public function validateSubmit(Submission $submission, Context $context): array Application::get()->getRequest(), Application::ROUTE_PAGE, $context->getData('path'), - 'submissions' + 'dashboard' ) ] ); @@ -770,9 +771,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] ); } 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/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 @@ - 'submissions', - 'name' => __('navigation.submissions'), + 'id' => 'dashboard', + 'name' => __('navigation.dashboard'), 'url' => $dispatcher->url( $request, Application::ROUTE_PAGE, $context->getData('urlPath'), - 'submissions' + 'dashboard' ), ], [