From f435690c44b160561f3f4c124650b5ef039ec56e Mon Sep 17 00:00:00 2001 From: Jhon Date: Thu, 8 Feb 2024 16:20:58 -0400 Subject: [PATCH] Fix preprints listing in sections page Signed-off-by: Jhon --- pages/preprints/SectionsHandler.php | 6 +----- templates/frontend/pages/sections.tpl | 6 +++--- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/pages/preprints/SectionsHandler.php b/pages/preprints/SectionsHandler.php index d3710c441e..202ea0828d 100644 --- a/pages/preprints/SectionsHandler.php +++ b/pages/preprints/SectionsHandler.php @@ -105,11 +105,6 @@ public function section($args, $request) exit; } - $submissions = []; - foreach ($submissions as $submission) { - $submissions[] = $submission; - } - $showingStart = $collector->offset + 1; $showingEnd = min($collector->offset + $collector->count, $collector->offset + count($submissions)); $nextPage = $total > $showingEnd ? $page + 1 : null; @@ -120,6 +115,7 @@ public function section($args, $request) 'section' => $section, 'sectionPath' => $sectionPath, 'preprints' => $submissions, + 'authorUserGroups' => Repo::userGroup()->getCollector()->filterByRoleIds([\PKP\security\Role::ROLE_ID_AUTHOR])->filterByContextIds([$context->getId()])->getMany()->remember(), 'showingStart' => $showingStart, 'showingEnd' => $showingEnd, 'total' => $total, diff --git a/templates/frontend/pages/sections.tpl b/templates/frontend/pages/sections.tpl index e1361f86e7..68f1140d22 100644 --- a/templates/frontend/pages/sections.tpl +++ b/templates/frontend/pages/sections.tpl @@ -46,12 +46,12 @@ {* Pagination *} {if $prevPage > 1} - {capture assign="prevUrl"}{url router=PKPApplication::ROUTE_PAGE page="section" op="view" path=$sectionPath|to_array:$prevPage}{/capture} + {capture assign="prevUrl"}{url router=PKPApplication::ROUTE_PAGE page="preprints" op="section" path=$sectionPath|to_array:$prevPage}{/capture} {elseif $prevPage === 1} - {capture assign="prevUrl"}{url router=PKPApplication::ROUTE_PAGE page="section" op="view" path=$sectionPath}{/capture} + {capture assign="prevUrl"}{url router=PKPApplication::ROUTE_PAGE page="preprints" op="section" path=$sectionPath}{/capture} {/if} {if $nextPage} - {capture assign="nextUrl"}{url router=PKPApplication::ROUTE_PAGE page="section" op="view" path=$sectionPath|to_array:$nextPage}{/capture} + {capture assign="nextUrl"}{url router=PKPApplication::ROUTE_PAGE page="preprints" op="section" path=$sectionPath|to_array:$nextPage}{/capture} {/if} {include file="frontend/components/pagination.tpl"