Skip to content

Commit

Permalink
pkp#10670 Use new url for workflow page
Browse files Browse the repository at this point in the history
  • Loading branch information
jardakotesovec committed Jan 8, 2025
1 parent d15e998 commit 2762150
Show file tree
Hide file tree
Showing 11 changed files with 45 additions and 31 deletions.
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
7 changes: 4 additions & 3 deletions classes/mail/variables/SubmissionEmailVariable.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,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
13 changes: 5 additions & 8 deletions classes/services/PKPNavigationMenuService.php
Original file line number Diff line number Diff line change
Expand Up @@ -300,14 +300,11 @@ 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 */
$pkpPageRouter->getHomeUrl($request);


$navigationMenuItem->setUrl($pkpPageRouter->getHomeUrl($request));
} else {
$navigationMenuItem->setUrl($dispatcher->url(
$request,
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
14 changes: 8 additions & 6 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 @@ -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

0 comments on commit 2762150

Please sign in to comment.