Skip to content

Commit

Permalink
Add missing phrases and fix Issue #5 where existing institutions in t…
Browse files Browse the repository at this point in the history
…he user's orcid.org profile were not being checked correctly.
  • Loading branch information
wfyson committed Jul 31, 2018
1 parent 13dac0e commit 376c7bb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
3 changes: 3 additions & 0 deletions lib/lang/en/phrases/z_orcid_support_advance.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
<epp:phrase id="user_fieldname_orcid_name">orcid.org Name</epp:phrase>
<epp:phrase id="user_fieldname_orcid_token_expires">ORCID Token Expiry</epp:phrase>

<epp:phrase id="eprint_fieldname_orcid_put_codes">ORCID Put Codes</epp:phrase>

<!-- Authenticate ORCID -->
<epp:phrase id="Plugin/Screen/AuthenticateOrcid:title"><img class="orcid-icon" src="/images/orcid_16x16.png"/>Create or Connect your ORCID iD</epp:phrase>

Expand Down Expand Up @@ -67,6 +69,7 @@ Upon allowing this permission, <epc:phrase ref="archive_name" /> will also attem
<epp:phrase id="Plugin/Screen/ManageOrcid:admin_disconnect_button">Disconnect from ORCID</epp:phrase>
<epp:phrase id="Plugin/Screen/ManageOrcid:local_user_connect_orcid_button">Create or Connect your ORCID iD</epp:phrase>
<epp:phrase id="Plugin/Screen/ManageOrcid:disconnected">You are not currently connected to ORCID</epp:phrase>
<epp:phrase id="Plugin/Screen/ManageOrcid:confirm_erase_dialog">Are you sure?\nOnce removed we will not be able to maintain the user&apos;s ORCID record until they reauthenticate with ORCID</epp:phrase>

<!-- Name Report -->
<epp:phrase id="Plugin/Screen/Report/Orcid/CheckName:title">orcid.org Name Mismatch</epp:phrase>
Expand Down
13 changes: 9 additions & 4 deletions lib/plugins/EPrints/Plugin/Event/OrcidSync.pm
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,15 @@ sub update_employment
my $add_institution = 1;
foreach my $employment ( @{$json_text->{"$affiliation-summary"}} )
{
if( $employment->{'organization'}->{'disambiguation-organization-identifier'} eq $institution->{'organization'}->{'disambiguation-organization-identifier'} )
{
$add_institution = 0;
}
my $orgid1 = $institution->{'organization'}->{'disambiguated-organization'}->{'disambiguated-organization-identifier'};
my $orgid2 = $employment->{'organization'}->{'disambiguated-organization'}->{'disambiguated-organization-identifier'};
print STDERR "id1.....$orgid1\n";
print STDERR "id2.....$orgid2\n";
if( $orgid1 eq $orgid2 )
{
print STDERR "don't add institution\n";
$add_institution = 0;
}
}

#add the insitution if we still need to
Expand Down

0 comments on commit 376c7bb

Please sign in to comment.