From 250309efaf61e00f3d03834516ec9a033439308c Mon Sep 17 00:00:00 2001
From: Kaitlin Newson
Date: Fri, 3 Jan 2025 15:40:42 -0400
Subject: [PATCH] UserGroup and deprecated function updates
---
PragmaThemePlugin.inc.php | 2 +-
.../components/registrationFormContexts.tpl | 12 ++++++------
templates/frontend/objects/article_details.tpl | 6 +++---
templates/frontend/objects/article_summary.tpl | 9 +++++----
templates/frontend/objects/galley_link.tpl | 13 +++++++++----
templates/frontend/pages/about.tpl | 4 ++--
templates/frontend/pages/article.tpl | 4 ++--
templates/frontend/pages/editorialHistory.tpl | 5 +++--
templates/frontend/pages/indexSite.tpl | 2 +-
templates/frontend/pages/orcidAbout.tpl | 2 +-
templates/frontend/pages/privacy.tpl | 2 +-
templates/frontend/pages/userRegister.tpl | 8 ++++----
12 files changed, 38 insertions(+), 31 deletions(-)
diff --git a/PragmaThemePlugin.inc.php b/PragmaThemePlugin.inc.php
index 9303acf..9183785 100644
--- a/PragmaThemePlugin.inc.php
+++ b/PragmaThemePlugin.inc.php
@@ -133,7 +133,7 @@ public function addSiteWideData($hookname, $args) {
$orcidImageUrl = $this->getPluginPath() . '/templates/images/orcid.png';
if ($request->getContext()) {
- $templateMgr->assign('pragmaHomepageImage', $journal->getLocalizedSetting('homepageImage'));
+ $templateMgr->assign('pragmaHomepageImage', $journal->getLocalizedData('homepageImage'));
}
$templateMgr->assign(array(
diff --git a/templates/frontend/components/registrationFormContexts.tpl b/templates/frontend/components/registrationFormContexts.tpl
index c552150..e7cc56d 100755
--- a/templates/frontend/components/registrationFormContexts.tpl
+++ b/templates/frontend/components/registrationFormContexts.tpl
@@ -43,11 +43,11 @@
{foreach from=$readerUserGroups[$contextId] item=userGroup}
- {if $userGroup->getPermitSelfRegistration()}
- {assign var="userGroupId" value=$userGroup->getId()}
+ {if $userGroup->permitSelfRegistration}
+ {assign var="userGroupId" value=$userGroup->id}
- {$userGroup->getLocalizedName()}
+ {$userGroup->getLocalizedData('name')|escape}
{if in_array($userGroupId, $userGroupIds)}
{assign var=isSelected value=true}
@@ -57,11 +57,11 @@
{/foreach}
{/if}
diff --git a/templates/frontend/objects/article_summary.tpl b/templates/frontend/objects/article_summary.tpl
index 2ed2eb5..a27da42 100755
--- a/templates/frontend/objects/article_summary.tpl
+++ b/templates/frontend/objects/article_summary.tpl
@@ -1,8 +1,8 @@
{**
* templates/frontend/objects/article_summary.tpl
*
- * Copyright (c) 2014-2020 Simon Fraser University
- * Copyright (c) 2003-2020 John Willinsky
+ * Copyright (c) 2014-2025 Simon Fraser University
+ * Copyright (c) 2003-2025 John Willinsky
* Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
*
* @brief View of an Article summary which is shown within a list of articles.
@@ -15,9 +15,10 @@
* @uses $hideGalleys bool Hide the article galleys for this article?
* @uses $primaryGenreIds array List of file genre ids for primary file types
*}
-{assign var=articlePath value=$article->getBestArticleId()}
{assign var="publication" value=$article->getCurrentPublication()}
+{assign var=articlePath value=$publication->getData('urlPath')|default:$article->getId()}
+
{if (!$section.hideAuthor && $publication->getData('hideAuthor') == \APP\submission\Submission::AUTHOR_TOC_DEFAULT) || $publication->getData('hideAuthor') == \APP\submission\Submission::AUTHOR_TOC_SHOW}
{assign var="showAuthor" value=true}
{/if}
@@ -39,7 +40,7 @@
{foreach from=$article->getGalleys() item=galley}
{if $primaryGenreIds}
{assign var="file" value=$galley->getFile()}
- {if !$galley->getRemoteUrl() && !($file && in_array($file->getGenreId(), $primaryGenreIds))}
+ {if !$galley->getData('urlRemote') && !($file && in_array($file->getGenreId(), $primaryGenreIds))}
{continue}
{/if}
{/if}
diff --git a/templates/frontend/objects/galley_link.tpl b/templates/frontend/objects/galley_link.tpl
index e5ed4d2..0e39453 100755
--- a/templates/frontend/objects/galley_link.tpl
+++ b/templates/frontend/objects/galley_link.tpl
@@ -39,11 +39,16 @@
{assign var="path" value=$parentId|to_array:$galley->getBestGalleyId()}
{else}
{assign var="page" value="article"}
- {assign var="parentId" value=$parent->getBestArticleId()}
- {if $publication && $publication->getId() !== $parent->getData('currentPublicationId')}
- {assign var="path" value=$parentId|to_array:"version":$publication->getId():$galley->getBestGalleyId()}
+ {if $publication}
+ {if $publication->getId() !== $parent->getData('currentPublicationId')}
+ {* Get a versioned link if we have an older publication *}
+ {assign var="path" value=$parent->getBestId()|to_array:"version":$publication->getId():$galley->getBestGalleyId()}
+ {else}
+ {assign var="parentId" value=$publication->getData('urlPath')|default:$article->getId()}
+ {assign var="path" value=$parentId|to_array:$galley->getBestGalleyId()}
+ {/if}
{else}
- {assign var="path" value=$parentId|to_array:$galley->getBestGalleyId()}
+ {assign var="path" value=$parent->getBestId()|to_array:$galley->getBestGalleyId()}
{/if}
{/if}
diff --git a/templates/frontend/pages/about.tpl b/templates/frontend/pages/about.tpl
index e93baf7..feb8b8c 100755
--- a/templates/frontend/pages/about.tpl
+++ b/templates/frontend/pages/about.tpl
@@ -20,9 +20,9 @@
{include file="frontend/components/editLink.tpl" page="management" op="settings" path="context" anchor="masthead" sectionTitleKey="about.aboutContext"}
- {$currentContext->getLocalizedSetting('description')}
+ {$currentContext->getLocalizedData('description')}
- {$currentContext->getLocalizedSetting('about')}
+ {$currentContext->getLocalizedData('about')}
diff --git a/templates/frontend/pages/article.tpl b/templates/frontend/pages/article.tpl
index a810c62..710eb50 100644
--- a/templates/frontend/pages/article.tpl
+++ b/templates/frontend/pages/article.tpl
@@ -7,7 +7,7 @@
*
* @brief Display the page to view an article with all of it's details.
*
- * @uses $article Article This article
+ * @uses $article Submission This article
* @uses $publication Publication The publication being displayed
* @uses $firstPublication Publication The first published version of this article
* @uses $currentPublication Publication The most recently published version of this article
@@ -17,7 +17,7 @@
* @uses $primaryGalleys array List of article galleys that are not supplementary or dependent
* @uses $supplementaryGalleys array List of article galleys that are supplementary
*}
- {include file="frontend/components/header.tpl" pageTitleTranslated=$article->getLocalizedTitle()|escape}
+ {include file="frontend/components/header.tpl" pageTitleTranslated=$article->getLocalizedData('title')|escape}
diff --git a/templates/frontend/pages/editorialHistory.tpl b/templates/frontend/pages/editorialHistory.tpl
index 88f8c8d..97eaa1a 100644
--- a/templates/frontend/pages/editorialHistory.tpl
+++ b/templates/frontend/pages/editorialHistory.tpl
@@ -52,10 +52,11 @@
{/if}
{/foreach}
+
+ {include file="frontend/components/editLink.tpl" page="management" op="settings" path="context" anchor="masthead" sectionTitleKey="common.editorialHistory"}
+ {$currentContext->getLocalizedData('editorialHistory')}
- {include file="frontend/components/editLink.tpl" page="management" op="settings" path="context" anchor="masthead" sectionTitleKey="common.editorialHistory"}
- {$currentContext->getLocalizedData('editorialHistory')}
{include file="frontend/components/footer.tpl"}
diff --git a/templates/frontend/pages/indexSite.tpl b/templates/frontend/pages/indexSite.tpl
index a7f443d..a947c29 100644
--- a/templates/frontend/pages/indexSite.tpl
+++ b/templates/frontend/pages/indexSite.tpl
@@ -33,7 +33,7 @@
{assign var="countItems" value=count($journals)}
{foreach from=$journals item=journal}
{capture assign="url"}{url journal=$journal->getPath()}{/capture}
- {assign var="thumb" value=$journal->getLocalizedSetting('journalThumbnail')}
+ {assign var="thumb" value=$journal->getLocalizedData('journalThumbnail')}
{assign var="description" value=$journal->getLocalizedDescription()}
{assign var="journalKey" value=$journalKey+1}
diff --git a/templates/frontend/pages/orcidAbout.tpl b/templates/frontend/pages/orcidAbout.tpl
index a796747..4aadeb4 100644
--- a/templates/frontend/pages/orcidAbout.tpl
+++ b/templates/frontend/pages/orcidAbout.tpl
@@ -29,7 +29,7 @@
{translate key="orcid.about.howAndWhyMemberAPI"}
{else}
-
+
{translate key="orcid.about.howAndWhyPublicAPI"}
{/if}
diff --git a/templates/frontend/pages/privacy.tpl b/templates/frontend/pages/privacy.tpl
index 475815b..456174c 100755
--- a/templates/frontend/pages/privacy.tpl
+++ b/templates/frontend/pages/privacy.tpl
@@ -20,7 +20,7 @@
- {$currentContext->getLocalizedSetting('privacyStatement')}
+ {$currentContext->getLocalizedData('privacyStatement')}
diff --git a/templates/frontend/pages/userRegister.tpl b/templates/frontend/pages/userRegister.tpl
index f16e84b..1bb3b7f 100755
--- a/templates/frontend/pages/userRegister.tpl
+++ b/templates/frontend/pages/userRegister.tpl
@@ -63,7 +63,7 @@
{assign var=contextId value=$currentContext->getId()}
{assign var=userCanRegisterReviewer value=0}
{foreach from=$reviewerUserGroups[$contextId] item=userGroup}
- {if $userGroup->getPermitSelfRegistration()}
+ {if $userGroup->permitSelfRegistration}
{assign var=userCanRegisterReviewer value=$userCanRegisterReviewer+1}
{/if}
{/foreach}
@@ -80,16 +80,16 @@