-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ORCID plugin 2.4.8 #14
base: ojs-dev-2_4
Are you sure you want to change the base?
Conversation
@atarix83, before I start on a code review, would you mind converting indentation to tabs instead of spaces? Thanks! |
@asmecher |
locale/en_US/locale.xml
Outdated
<message key="plugins.generic.orcidProfile.emailOrOrcid">Email address or ORCID iD:</message> | ||
<message key="plugins.generic.orcidProfile.submitAction">Submit</message> | ||
<message key="plugins.generic.orcidProfile.submitAction">Submit</message> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are still some space-based indents here.
locale/it_IT/locale.xml
Outdated
<message key="plugins.generic.orcidProfile.instructions"><![CDATA[È possibile precompilare il modulo con le informazioni da un profilo orcid. Inserire l'indirizzo email o ORCID iD associati al profilo ORCID, quindi fare clic su "Conferma".]]></message> | ||
<message key="plugins.generic.orcidProfile.noData">Nessuna informazione trovata dal registro di ORCID.</message> | ||
<message key="plugins.generic.orcidProfile.emailOrOrcid">Indirizzo Email o ORCID iD:</message> | ||
<message key="plugins.generic.orcidProfile.submitAction">Conferma</message> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some space-based indents
pages/OrcidHandler.inc.php
Outdated
@@ -79,7 +56,8 @@ function orcidAuthorize($args, &$request) { | |||
// Submission process: Pre-fill the first author's ORCiD from the ORCiD data | |||
echo '<html><body><script type="text/javascript"> | |||
opener.document.getElementById("authors-0-orcid").value = ' . json_encode('http://orcid.org/' . $response['orcid']). '; | |||
opener.document.getElementById("connect-orcid-button").style.display = "none"; | |||
opener.document.getElementById("connect-orcid-button").style.display = "none"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Space-based indents
templates/orcidProfile.tpl
Outdated
* ORCID Profile authorization form | ||
* | ||
*} | ||
<script type="text/javascript"> | ||
|
||
function openORCID() {ldelim} | ||
var oauthWindow = window.open("{$orcidProfileOauthPath|escape}authorize?client_id={$orcidClientId|urlencode}&response_type=code&scope=/authenticate&redirect_uri={url|urlencode page="orcidapi" op="orcidAuthorize" targetOp=$targetOp params=$params escape=false}", "_blank", "toolbar=no, scrollbars=yes, width=500, height=600, top=500, left=500"); | ||
console.log(self); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is a debugging leftover.
Sorry to be so picky about indentation -- it's my obsession :) |
Sorry for not having carefully checked, now It'd be ok |
css/orcidProfile.css
Outdated
@@ -9,17 +9,22 @@ | |||
font-weight: bold; | |||
font-size: .8em; | |||
line-height: 24px; | |||
margin: .3em; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, one more here :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
adjusted
css/orcidProfile.css
Outdated
display: block; | ||
margin: 0 .5em 0 0; | ||
padding: 0; | ||
float: left; | ||
} | ||
|
||
.search-content { | ||
padding: 10px !important; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
adjusted
@ctgraham, have you tinkered with any of this recently? |
@asmecher, I have not done any recent work on the orcidProfile plugin. |
Hi, Thanks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@atarix83 A first review round with few suggestions.
OrcidProfilePlugin.inc.php
Outdated
@@ -84,10 +92,10 @@ function setupCallbackHandler($hookName, $params) { | |||
function handleTemplateDisplay($hookName, $args) { | |||
$templateMgr =& $args[0]; | |||
$template =& $args[1]; | |||
$request =& PKPApplication::getRequest(); | |||
$request =& PKPApplication::getRequest(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indent here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it seems ok on my branch https://github.com/4Science/orcidProfile/blob/ojs-dev-2_4/OrcidProfilePlugin.inc.php
OrcidProfilePlugin.inc.php
Outdated
// Assign our private stylesheet. | ||
$templateMgr->addStylesheet($request->getBaseUrl() . '/' . $this->getStyleSheet()); | ||
// Assign our private stylesheet. | ||
$templateMgr->addStylesheet($request->getBaseUrl() . '/' . $this->getStyleSheet()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indent here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it seems ok on my branch https://github.com/4Science/orcidProfile/blob/ojs-dev-2_4/OrcidProfilePlugin.inc.php
OrcidProfilePlugin.inc.php
Outdated
@@ -97,6 +105,7 @@ function handleTemplateDisplay($hookName, $args) { | |||
$templateMgr->register_outputfilter(array(&$this, 'profileFilter')); | |||
break; | |||
case 'author/submit/step3.tpl': | |||
case 'submission/metadata/metadataEdit.tpl': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indent here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it seems ok on my branch https://github.com/4Science/orcidProfile/blob/ojs-dev-2_4/OrcidProfilePlugin.inc.php
OrcidProfilePlugin.inc.php
Outdated
});</script>'; | ||
$newOutput .= substr($output, $offset + strlen($match)); | ||
$output = $newOutput; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Several indentation issues at that function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure to what you are referring, maybe line 231?
locale/en_US/locale.xml
Outdated
<message key="plugins.generic.orcidProfile.searchResultsList">Choose and select the exact match from the list below:</message> | ||
<message key="plugins.generic.orcidProfile.searchResultsList">Choose and select the exact match from the list below:</message> | ||
<message key="plugins.generic.orcidProfile.privateEmail">Not viewable</message> | ||
<message key="plugins.generic.orcidProfile.noResults">No search results</message> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some indentation issues here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems ok in my branch
|
||
|
||
</body> | ||
<description>This email template is used to collect the ORCID id's from co-authors.</description> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this only for 'co-authors'?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes
locale/it_IT/locale.xml
Outdated
<!DOCTYPE locale SYSTEM "../../../../../lib/pkp/dtd/locale.dtd"> | ||
|
||
<!-- | ||
* plugins/generic/orcidPlugin/locale/en_US/locale.xml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
en_US -> it_IT
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
orcidPlugin -> orcidProfile?
templates/orcidProfile.tpl
Outdated
@@ -1,11 +1,13 @@ | |||
{** | |||
* plugins/generic/orcidProfile/orcidProfile.tpl |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix path
templates/orcidProfileSearch.tpl
Outdated
@@ -0,0 +1,23 @@ | |||
{** | |||
* plugins/generic/orcidProfile/orcidProfileSearch.tpl |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix path
@@ -0,0 +1,162 @@ | |||
{** | |||
* plugins/generic/orcidProfile/orcidProfileSearchResults.tpl |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix path
</tr> | ||
<tr class="heading" valign="top"> | ||
<td width="5%"> </td> | ||
<td width="25%">{translate key="plugins.generic.openAIRE.projectID"}</td> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix translation key
locale/it_IT/emailTemplates.xml
Outdated
* Localized email templates XML file. | ||
--> | ||
|
||
<email_texts locale="en_US"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change locale
<h3>{translate key='plugins.generic.orcidProfile.searchPageTitle'}</h3> | ||
<div id="content" class="search-content"> | ||
<p>{translate key='plugins.generic.orcidProfile.searchResultsList'}</p> | ||
<form action="{plugin_url path="process"}" method="post" id="issuesForm"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggest change the name of the form [id="issuesForm"]
templates/orcidProfileSearch.tpl
Outdated
{rdelim} | ||
</script> | ||
|
||
<button id="{$params.orcidButtonId}" onclick="return openSearchORCID{$params.authorIndex}();" {if !$params.orcidButtonVisible}style="display:none;" {/if}><img class="orcid-id-logo" src="http://orcid.org/sites/default/files/images/orcid_24x24.png" width="24" height="24" alt="{translate key='plugins.generic.orcidProfile.submitAction'}"/>Search the ORCID iD</button> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggest change "Search the ORCID iD" to {translate key='...'}
<link rel="stylesheet" href="{$baseUrl}/styles/comments.css" type="text/css" /> | ||
<link rel="stylesheet" href="{$baseUrl}/plugins/generic/orcidProfile/css/orcidProfile.css" type="text/css" /> | ||
|
||
{foreach from=$stylesheets item=cssUrl} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is orcidProfile.css declared twice? (also elsewhere)
$("#orcidSearchResultsSubmit").click(function(event) { | ||
event.preventDefault(); | ||
var profiles = {/literal}{$orcidSearchResults|@json_encode}{literal}; | ||
var authorIndex = {/literal}{$authorIndex}{literal}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The $authorIndex seems not to be filled after the user uses the searchResults pager [go from page1 to page2 for example]. That seems to result to a javascript error which "breaks" the javascript flow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resolved
var profileSelectedIndex = $("input[name=orcidProfile]:checked").val(); | ||
var profileSelected = profiles.theArray[profileSelectedIndex]; | ||
|
||
opener.document.getElementById("{/literal}{$orcidButtonId}{literal}").style.display = "none";; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extra ';' at the end of the line?
var profileSelected = profiles.theArray[profileSelectedIndex]; | ||
|
||
opener.document.getElementById("{/literal}{$orcidButtonId}{literal}").style.display = "none";; | ||
opener.document.getElementById("remove-orcid-button-" + authorIndex).style.display = "inline";; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extra ';' at the end of the line?
Hi @defstat thanks for reviewing. I've made changes in base of your suggestions and fixed the issues. |
@asmecher yes I would to upgrade to OJS 3.x but now I can't schedule an upgrade |
@atarix83 I have done some work for OMP if that could be of help - https://github.com/defstat/orcidProfile/tree/hirmeos_orcid |
@defstat, this is an old PR but I see a few commits sneaking into it more recently -- are you keeping an eye on it? |
@asmecher No but I can. |
Hi,
I proceeded to add some features to orcidProfile plugin for OJS 2.4.x and I'd like to commit to OJS codebase.
What we have changes is :
Thanks.
Giuseppe
4Science