Skip to content

Commit 99b51ba

Browse files
committed
pkp/pkp-lib#7135 Multiple author affiliations (ROR)
1 parent 8e5353d commit 99b51ba

File tree

10 files changed

+74
-30
lines changed

10 files changed

+74
-30
lines changed

cypress/tests/data/60-content/CmontgomerieSubmission.cy.js

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/**
22
* @file cypress/tests/data/60-content/CmontgomerieSubmission.cy.js
33
*
4-
* Copyright (c) 2014-2021 Simon Fraser University
5-
* Copyright (c) 2000-2021 John Willinsky
4+
* Copyright (c) 2014-2025 Simon Fraser University
5+
* Copyright (c) 2000-2025 John Willinsky
66
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
77
*
88
*/
@@ -29,7 +29,11 @@ describe('Data suite: Cmontgomerie', function() {
2929
givenName: {en: 'Mark'},
3030
familyName: {en: 'Irvine'},
3131
country: 'CA',
32-
affiliation: {en: 'University of Victoria'},
32+
affiliations: [
33+
{
34+
name: {en: 'University of Victoria'}
35+
}
36+
],
3337
3438
userGroupId: Cypress.env('authorUserGroupId')
3539
}

cypress/tests/data/60-content/EostromSubmission.cy.js

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/**
22
* @file cypress/tests/data/60-content/EostromSubmission.cy.js
33
*
4-
* Copyright (c) 2014-2021 Simon Fraser University
5-
* Copyright (c) 2000-2021 John Willinsky
4+
* Copyright (c) 2014-2025 Simon Fraser University
5+
* Copyright (c) 2000-2025 John Willinsky
66
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
77
*
88
*/
@@ -28,7 +28,11 @@ describe('Data suite: Eostrom', function() {
2828
givenName: {en: 'Frank'},
2929
familyName: {en: 'van Laerhoven'},
3030
country: 'US',
31-
affiliation: {en: 'Indiana University'},
31+
affiliations: [
32+
{
33+
name: {en: 'Indiana University'}
34+
}
35+
],
3236
3337
userGroupId: Cypress.env('authorUserGroupId')
3438
}

cypress/tests/data/60-content/KalkhafajiSubmission.cy.js

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/**
22
* @file cypress/tests/data/60-content/KalkhafajiSubmission.cy.js
33
*
4-
* Copyright (c) 2014-2021 Simon Fraser University
5-
* Copyright (c) 2000-2021 John Willinsky
4+
* Copyright (c) 2014-2025 Simon Fraser University
5+
* Copyright (c) 2000-2025 John Willinsky
66
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
77
*
88
*/
@@ -28,7 +28,11 @@ describe('Data suite: Kalkhafaji', function() {
2828
givenName: {en: 'Margaret'},
2929
familyName: {en: 'Morse'},
3030
country: 'US',
31-
affiliation: {en: 'Stanford University'},
31+
affiliations: [
32+
{
33+
name: {en: 'Stanford University'}
34+
}
35+
],
3236
3337
userGroupId: Cypress.env('authorUserGroupId')
3438
}

dbscripts/xml/install.xml

+5-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
<!--
44
* dbscripts/xml/install.xml
55
*
6-
* Copyright (c) 2014-2021 Simon Fraser University
7-
* Copyright (c) 2003-2021 John Willinsky
6+
* Copyright (c) 2014-2025 Simon Fraser University
7+
* Copyright (c) 2003-2025 John Willinsky
88
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
99
*
1010
* Installation descriptor file.
@@ -47,10 +47,13 @@
4747
<migration class="PKP\migration\install\HighlightsMigration" />
4848
<migration class="PKP\migration\install\InstitutionsMigration" />
4949
<migration class="APP\migration\install\MetricsMigration" />
50+
<migration class="PKP\migration\install\AffiliationsMigration" />
51+
<migration class="PKP\migration\install\RorsMigration" />
5052

5153
<!-- Other install tasks -->
5254
<code function="createData"/>
5355
<code function="createConfig"/>
5456
<code function="addPluginVersions"/>
5557
<code function="installDefaultNavigationMenus"/>
58+
<code function="updateRorRegistryDataset"/>
5659
</install>

dbscripts/xml/upgrade.xml

+4-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
<!--
44
* dbscripts/xml/upgrade.xml
55
*
6-
* Copyright (c) 2014-2021 Simon Fraser University
7-
* Copyright (c) 2003-2021 John Willinsky
6+
* Copyright (c) 2014-2025 Simon Fraser University
7+
* Copyright (c) 2003-2025 John Willinsky
88
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
99
*
1010
* Upgrade descriptor file.
@@ -141,6 +141,8 @@
141141
<migration class="PKP\migration\upgrade\v3_5_0\FilterClassNames"/>
142142
<migration class="APP\migration\upgrade\v3_5_0\I10620_EditorialBoardMemberRole"/>
143143
<migration class="APP\migration\upgrade\v3_5_0\I9707_WeblateUILocales"/>
144+
<migration class="PKP\migration\upgrade\v3_5_0\I7135_CreateAuthorAffiliationsTables"/>
145+
<migration class="PKP\migration\upgrade\v3_5_0\I7135_CreateNewRorRegistryCacheTables"/>
144146
<note file="docs/release-notes/README-3.5.0" />
145147
</upgrade>
146148

pages/preprint/PreprintHandler.php

+7-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
/**
44
* @file pages/preprint/PreprintHandler.php
55
*
6-
* Copyright (c) 2014-2021 Simon Fraser University
7-
* Copyright (c) 2003-2021 John Willinsky
6+
* Copyright (c) 2014-2025 Simon Fraser University
7+
* Copyright (c) 2003-2025 John Willinsky
88
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
99
*
1010
* @class PreprintHandler
@@ -27,6 +27,7 @@
2727
use Firebase\JWT\JWT;
2828
use PKP\citation\CitationDAO;
2929
use PKP\config\Config;
30+
use PKP\core\Core;
3031
use PKP\core\PKPApplication;
3132
use PKP\db\DAORegistry;
3233
use PKP\orcid\OrcidManager;
@@ -185,6 +186,9 @@ public function view($args, $request)
185186
return empty($a) || strtotime((string) $b->getData('datePublished')) < strtotime((string) $a->getData('datePublished')) ? $b : $a;
186187
}, 0);
187188

189+
$rorIconPath = Core::getBaseDir() . '/' . PKP_LIB_PATH . '/templates/images/ror.svg';
190+
$rorIdIcon = file_exists($rorIconPath) ? file_get_contents($rorIconPath) : '';
191+
188192
$templateMgr = TemplateManager::getManager($request);
189193
$templateMgr->assign([
190194
'preprint' => $preprint,
@@ -196,6 +200,7 @@ public function view($args, $request)
196200
'submissionFileId' => $this->submissionFileId,
197201
'orcidIcon' => OrcidManager::getIcon(),
198202
'orcidUnauthenticatedIcon' => OrcidManager::getUnauthenticatedIcon(),
203+
'rorIdIcon' => $rorIdIcon,
199204
]);
200205
$this->setupTemplate($request);
201206

plugins/importexport/native/README.md

+5
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,8 @@
44

55
See https://docs.pkp.sfu.ca/admin-guide/en/data-import-and-export#native-xml-plugin
66
for documentation.
7+
8+
## Sample XML
9+
10+
Sample XML can be found in https://github.com/pkp/datasets/blob/main/ops/[branch]/mysql/native-export-sample.xml,
11+
where [branch] indicates the GitHub repository branch name of your OPS version, e.g.: stable-3_3_0 for OJS 3.3.0-x, stable-3_4_0 for OJS 3.4.0-x.

plugins/oaiMetadataFormats/dc/tests/OAIMetadataFormat_DCTest.php

+10-3
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
/**
88
* @file plugins/oaiMetadataFormats/dc/tests/OAIMetadataFormat_DCTest.php
99
*
10-
* Copyright (c) 2014-2021 Simon Fraser University
11-
* Copyright (c) 2000-2021 John Willinsky
10+
* Copyright (c) 2014-2025 Simon Fraser University
11+
* Copyright (c) 2000-2025 John Willinsky
1212
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
1313
*
1414
* @class OAIMetadataFormat_DCTest
@@ -86,7 +86,14 @@ public function testToXml()
8686
$author = new Author();
8787
$author->setGivenName('author-firstname', 'en');
8888
$author->setFamilyName('author-lastname', 'en');
89-
$author->setAffiliation('author-affiliation', 'en');
89+
$author->setAffiliations([
90+
Repo::affiliation()->newDataObject([
91+
'id' => 1,
92+
'authorId' => 1,
93+
'ror' => 'https://ror.org/05ek4tb53',
94+
'name' => ['en' => 'author-affiliation']
95+
])
96+
]);
9097
$author->setEmail('[email protected]');
9198

9299
/** @var Publication|MockObject */

plugins/themes/default/styles/objects/preprint_details.less

+5-1
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,10 @@
102102
font-size: @font-sml;
103103
color: @text-light;
104104
}
105+
106+
.affiliation a {
107+
display: inline-block;
108+
}
105109
}
106110

107111
.author_bios {
@@ -128,7 +132,7 @@
128132
display: flex;
129133
flex-flow: row nowrap;
130134
justify-content: start;
131-
135+
132136
li {
133137
margin-inline-end: 1rem;
134138
}

templates/frontend/objects/preprint_details.tpl

+17-11
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{**
22
* templates/frontend/objects/preprint_details.tpl
33
*
4-
* Copyright (c) 2014-2021 Simon Fraser University
5-
* Copyright (c) 2003-2021 John Willinsky
4+
* Copyright (c) 2014-2025 Simon Fraser University
5+
* Copyright (c) 2003-2025 John Willinsky
66
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
77
*
88
* @brief View of an Preprint which displays all details about the preprint.
@@ -130,9 +130,13 @@
130130
<span class="name">
131131
{$author->getFullName()|escape}
132132
</span>
133-
{if $author->getLocalizedData('affiliation')}
133+
{if count($author->getAffiliations()) > 0}
134134
<span class="affiliation">
135-
{$author->getLocalizedData('affiliation')|escape}
135+
{foreach name="affiliations" from=$author->getAffiliations() item="affiliation"}
136+
{$affiliation->getLocalizedName()|escape}
137+
{if $affiliation->getRor()}<a href="{$affiliation->getRor()|escape}">{$rorIdIcon}</a>{/if}
138+
{if !$smarty.foreach.affiliations.last}{translate key="common.commaListSeparator"}{/if}
139+
{/foreach}
136140
</span>
137141
{/if}
138142
{if $author->getData('orcid')}
@@ -227,25 +231,27 @@
227231
{translate key="submission.authorBiography"}
228232
{/if}
229233
</h2>
234+
<ul class="authors">
230235
{foreach from=$publication->getData('authors') item=author}
231236
{if $author->getLocalizedData('biography')}
232-
<section class="sub_item">
233-
<h3 class="label">
234-
{if $author->getLocalizedData('affiliation')}
237+
<li class="sub_item">
238+
<div class="label">
239+
{if $author->getLocalizedAffiliationNamesAsString()}
235240
{capture assign="authorName"}{$author->getFullName()|escape}{/capture}
236-
{capture assign="authorAffiliation"}<span class="affiliation">{$author->getLocalizedData('affiliation')|escape}</span>{/capture}
237-
{translate key="submission.authorWithAffiliation" name=$authorName affiliation=$authorAffiliation}
241+
{capture assign="authorAffiliations"} {$author->getLocalizedAffiliationNamesAsString(null, ', ')|escape} {/capture}
242+
{translate key="submission.authorWithAffiliation" name=$authorName affiliation=$authorAffiliations}
238243
{else}
239244
{$author->getFullName()|escape}
240245
{/if}
241-
</h3>
246+
</div>
242247
<div class="value">
243248
{$author->getLocalizedData('biography')|strip_unsafe_html}
244249
</div>
245250
</section>
246251
{/if}
247252
{/foreach}
248-
</section>
253+
</ul>
254+
</section>
249255
{/if}
250256

251257
{* References *}

0 commit comments

Comments
 (0)