Skip to content

Commit

Permalink
UserGroup and deprecated function updates
Browse files Browse the repository at this point in the history
  • Loading branch information
kaitlinnewson committed Jan 7, 2025
1 parent ca2e0d7 commit 328dab9
Show file tree
Hide file tree
Showing 10 changed files with 41 additions and 30 deletions.
2 changes: 1 addition & 1 deletion ImmersionThemePlugin.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ public function addSiteWideData($hookname, $args)
$orcidImageUrl = $this->getPluginPath() . '/templates/images/orcid.png';

if ($request->getContext()) {
$templateMgr->assign('immersionHomepageImage', $journal->getLocalizedSetting('homepageImage'));
$templateMgr->assign('immersionHomepageImage', $journal->getLocalizedData('homepageImage'));
}

$templateMgr->assign(array(
Expand Down
10 changes: 10 additions & 0 deletions resources/less/objects/article_details.less
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,16 @@
margin-right: 1px;
}

.rorImage {
background: #fff;
padding-left: 0.2em;
padding-right: 0.2em;

&:after {
border-bottom: 0;
}
}

.author-symbol {
display: inline-block;
width: 9px;
Expand Down
12 changes: 6 additions & 6 deletions templates/frontend/components/registrationFormContexts.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@
</legend>
<div class="custom-control custom-checkbox context-checkbox">
{foreach from=$readerUserGroups[$contextId] item=userGroup}
{if $userGroup->getPermitSelfRegistration()}
{assign var="userGroupId" value=$userGroup->getId()}
{if $userGroup->permitSelfRegistration}
{assign var="userGroupId" value=$userGroup->id}
<input type="checkbox" class="custom-control-input" id="readerGroup[{$userGroupId}]" name="readerGroup[{$userGroupId}]"{if in_array($userGroupId, $userGroupIds)} checked="checked"{/if}>
<label for="readerGroup[{$userGroupId}]" class="custom-control-label">
{$userGroup->getLocalizedName()}
{$userGroup->getLocalizedData('name')}
</label>
{if in_array($userGroupId, $userGroupIds)}
{assign var=isSelected value=true}
Expand All @@ -57,11 +57,11 @@
</div>
<div class="custom-control custom-checkbox context-checkbox">
{foreach from=$reviewerUserGroups[$contextId] item=userGroup}
{if $userGroup->getPermitSelfRegistration()}
{assign var="userGroupId" value=$userGroup->getId()}
{if $userGroup->permitSelfRegistration}
{assign var="userGroupId" value=$userGroup->id}
<input type="checkbox" class="custom-control-input" id="reviewerGroup[{$userGroupId}]" name="reviewerGroup[{$userGroupId}]"{if in_array($userGroupId, $userGroupIds)} checked="checked"{/if}>
<label for="reviewerGroup[{$userGroupId}]" class="custom-control-label">
{$userGroup->getLocalizedName()}
{$userGroup->getLocalizedData('name')}
</label>
{if in_array($userGroupId, $userGroupIds)}
{assign var=isSelected value=true}
Expand Down
21 changes: 11 additions & 10 deletions templates/frontend/objects/article_details.tpl
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{**
* templates/frontend/objects/article_details.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 which displays all details about the article.
Expand Down Expand Up @@ -49,19 +49,20 @@
* Templates::Article::Main
* Templates::Article::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
* @uses $issue Issue The issue this article is assigned to
* @uses $section Section The journal section this article is assigned to
* @uses $categories Category The category this article is assigned to
* @uses $primaryGalleys array List of article galleys that are not supplementary or dependent
* @uses $supplementaryGalleys array List of article galleys that are supplementary
* @uses $keywords array List of keywords assigned to this article
* @uses $pubIdPlugins Array of pubId plugins which this article may be assigned
* @uses $licenseTerms string License terms.
* @uses $licenseUrl string URL to license. Only assigned if license should be
* included with published articles.
* included with published submissions.
* @uses $ccLicenseBadge string An image and text with details about the license
*}
<section class="col-md-8 article-page">
Expand Down Expand Up @@ -232,12 +233,12 @@
</dd>
{/if}
{/foreach}
{if $article->getDateSubmitted()}
{if $article->getData('dateSubmitted')}
<dt>
{translate key="submissions.submitted"}
</dt>
<dd>
{$article->getDateSubmitted()|escape|date_format:$dateFormatLong}
{$article->getData('dateSubmitted')|escape|date_format:$dateFormatLong}
</dd>
{/if}

Expand All @@ -248,10 +249,10 @@
<dd>
{* If this is the original version *}
{if $firstPublication->getID() === $publication->getId()}
{$firstPublication->getData('datePublished')|date_format:$dateFormatShort}
{$firstPublication->getData('datePublished')|date_format:$dateFormatLong}
{* If this is an updated version *}
{else}
{translate key="submission.updatedOn" datePublished=$firstPublication->getData('datePublished')|date_format:$dateFormatShort dateUpdated=$publication->getData('datePublished')|date_format:$dateFormatShort}
{translate key="submission.updatedOn" datePublished=$firstPublication->getData('datePublished')|date_format:$dateFormatLong dateUpdated=$publication->getData('datePublished')|date_format:$dateFormatLong}
{/if}
</dd>
{if count($article->getPublishedPublications()) > 1}
Expand All @@ -261,7 +262,7 @@
<dd>
<ul class="article-page__versions">
{foreach from=array_reverse($article->getPublishedPublications()) item=iPublication}
{capture assign="name"}{translate key="submission.versionIdentity" datePublished=$iPublication->getData('datePublished')|date_format:$dateFormatShort version=$iPublication->getData('version')}{/capture}
{capture assign="name"}{translate key="submission.versionIdentity" datePublished=$iPublication->getData('datePublished')|date_format:$dateFormatLong version=$iPublication->getData('version')}{/capture}
<li>
{if $iPublication->getId() === $publication->getId()}
{$name}
Expand Down Expand Up @@ -355,7 +356,7 @@
<h2 class="article-side__title">{translate key="submission.versions"}</h2>
<ul>
{foreach from=array_reverse($article->getPublishedPublications()) item=iPublication}
{capture assign="name"}{translate key="submission.versionIdentity" datePublished=$iPublication->getData('datePublished')|date_format:$dateFormatShort version=$iPublication->getData('version')}{/capture}
{capture assign="name"}{translate key="submission.versionIdentity" datePublished=$iPublication->getData('datePublished')|date_format:$dateFormatLong version=$iPublication->getData('version')}{/capture}
<li>
{if $iPublication->getId() === $publication->getId()}
{$name}
Expand Down
2 changes: 1 addition & 1 deletion templates/frontend/objects/article_summary.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,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}
Expand Down
2 changes: 1 addition & 1 deletion templates/frontend/pages/about.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
{include file="frontend/components/editLink.tpl" page="management" op="settings" path="context" anchor="masthead" sectionTitleKey="about.aboutContext"}
</header>
<div class="content-body">
{$currentContext->getLocalizedSetting('about')}
{$currentContext->getLocalizedData('about')}
</div>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions templates/frontend/pages/article.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}

<main class="container" id="immersion_content_main">
<div class="row">
Expand Down
8 changes: 4 additions & 4 deletions templates/frontend/pages/indexJournal.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@
<ul class="row announcement-section__toc">
{foreach from=$announcements item=announcement}
<li class="col-md-4">
<p class="announcement__date">{$announcement->getDatePosted()|date_format:$dateFormatShort|escape}</p>
<p class="announcement__date">{$announcement->datePosted|date_format:$dateFormatShort|escape}</p>
<h4 class="announcement__title">
<a href="{url router=$smarty.const.ROUTE_PAGE page="announcement" op="view" path=$announcement->getId()|escape}">
{$announcement->getLocalizedTitle()|escape}
<a href="{url router=$smarty.const.ROUTE_PAGE page="announcement" op="view" path=$announcement->id|escape}">
{$announcement->getLocalizedData('title')|escape}
</a>
</h4>
<p>{$announcement->getLocalizedDescriptionShort()|strip_unsafe_html}</p>
<p>{$announcement->getLocalizedData('descriptionShort')|strip_unsafe_html}</p>
</li>
{/foreach}
</ul>
Expand Down
2 changes: 1 addition & 1 deletion templates/frontend/pages/indexSite.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<ul class="index-site__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()}
<li{if $thumb} class="has_thumb"{/if}>
{if $thumb}
Expand Down
8 changes: 4 additions & 4 deletions templates/frontend/pages/userRegister.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,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}
Expand All @@ -76,12 +76,12 @@

<div id="reviewerOptinGroup" class="custom-control custom-checkbox optin">
{foreach from=$reviewerUserGroups[$contextId] item=userGroup}
{if $userGroup->getPermitSelfRegistration()}
{assign var="userGroupId" value=$userGroup->getId()}
{if $userGroup->permitSelfRegistration}
{assign var="userGroupId" value=$userGroup->id}
<input type="checkbox" class="custom-control-input" name="reviewerGroup[{$userGroupId}]" id="checkbox-reviewer-interests" value="1"{if in_array($userGroupId, $userGroupIds)} checked="checked"{/if}>

<label class="custom-control-label" for="checkbox-reviewer-interests">
{translate key=$checkboxLocaleKey userGroup=$userGroup->getLocalizedName()}
{translate key=$checkboxLocaleKey userGroup=$userGroup->getLocalizedData('name')}
</label>
{/if}
{/foreach}
Expand Down

0 comments on commit 328dab9

Please sign in to comment.