Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I10670 #10782

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

I10670 #10782

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions classes/mail/mailables/EditorialReminder.php
Original file line number Diff line number Diff line change
Expand Up @@ -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[] = '
Expand Down
2 changes: 1 addition & 1 deletion classes/mail/variables/ContextEmailVariable.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ protected function getSubmissionsUrl(): string
$this->request,
PKPApplication::ROUTE_PAGE,
$this->context->getPath(),
'submissions',
'dashboard',
);
}

Expand Down
14 changes: 8 additions & 6 deletions classes/mail/variables/SubmissionEmailVariable.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()]
);
}

Expand All @@ -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()]
);
}

Expand Down
2 changes: 1 addition & 1 deletion classes/notification/PKPNotificationManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -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!');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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!');
}
Expand Down
11 changes: 3 additions & 8 deletions classes/services/PKPNavigationMenuService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
16 changes: 9 additions & 7 deletions classes/submission/Repository.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()]
);
}

Expand Down Expand Up @@ -376,7 +377,7 @@ public function validateSubmit(Submission $submission, Context $context): array
Application::get()->getRequest(),
Application::ROUTE_PAGE,
$context->getData('path'),
'submissions'
'dashboard'
)
]
);
Expand Down Expand Up @@ -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]
);
}

Expand Down
2 changes: 1 addition & 1 deletion classes/template/PKPTemplateManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
8 changes: 8 additions & 0 deletions pages/authorDashboard/PKPAuthorDashboardHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);

Expand Down
13 changes: 8 additions & 5 deletions pages/dashboard/PKPDashboardHandlerNext.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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) {
Expand All @@ -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(
Expand All @@ -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);
}
Expand All @@ -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');
Expand Down
29 changes: 0 additions & 29 deletions pages/dashboard/index.php

This file was deleted.

20 changes: 11 additions & 9 deletions pages/decision/DecisionHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,10 @@ public function record($args, $request)
$request,
Application::ROUTE_PAGE,
$context->getData('urlPath'),
'workflow',
'access',
[$this->submission->getId()]
'dashboard',
'editorial',
null,
['workflowSubmissionId' => $this->submission->getId()]
),
'submissionApiUrl' => $dispatcher->url(
$request,
Expand Down Expand Up @@ -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'
),
],
[
Expand All @@ -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()]
),
],
[
Expand Down
9 changes: 9 additions & 0 deletions pages/workflow/PKPWorkflowHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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);

Expand Down
5 changes: 0 additions & 5 deletions templates/layouts/backend.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,6 @@
{/if}
<div class="pkpDropdown__section">
<ul>
<li v-if="backToDashboardLink">
<a :href="backToDashboardLink.url" class="pkpDropdown__action">
{{ backToDashboardLink.name }}
</a>
</li>
<li>
<a href="{url router=PKP\core\PKPApplication::ROUTE_PAGE page="user" op="profile"}" class="pkpDropdown__action">
{translate key="user.profile.editProfile"}
Expand Down