ORCID plugin 2.4.8#14
Conversation
|
@atarix83, before I start on a code review, would you mind converting indentation to tabs instead of spaces? Thanks! |
|
@asmecher |
| <message key="plugins.generic.orcidProfile.noData">Couldn't find any data from ORCID.</message> | ||
| <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.
There are still some space-based indents here.
| <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> |
| 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"; |
|
|
||
| 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.
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 |
| font-weight: bold; | ||
| font-size: .8em; | ||
| line-height: 24px; | ||
| margin: .3em; |
| } | ||
|
|
||
| .search-content { | ||
| padding: 10px !important; |
|
@ctgraham, have you tinkered with any of this recently? |
|
@asmecher, I have not done any recent work on the orcidProfile plugin. |
|
Hi, Thanks. |
| $templateMgr =& $args[0]; | ||
| $template =& $args[1]; | ||
| $request =& PKPApplication::getRequest(); | ||
| $request =& PKPApplication::getRequest(); |
There was a problem hiding this comment.
it seems ok on my branch https://github.com/4Science/orcidProfile/blob/ojs-dev-2_4/OrcidProfilePlugin.inc.php
| // 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.
it seems ok on my branch https://github.com/4Science/orcidProfile/blob/ojs-dev-2_4/OrcidProfilePlugin.inc.php
| $templateMgr->register_outputfilter(array(&$this, 'profileFilter')); | ||
| break; | ||
| case 'author/submit/step3.tpl': | ||
| case 'submission/metadata/metadataEdit.tpl': |
There was a problem hiding this comment.
it seems ok on my branch https://github.com/4Science/orcidProfile/blob/ojs-dev-2_4/OrcidProfilePlugin.inc.php
| });</script>'; | ||
| $newOutput .= substr($output, $offset + strlen($match)); | ||
| $output = $newOutput; | ||
| } |
There was a problem hiding this comment.
Several indentation issues at that function.
There was a problem hiding this comment.
I'm not sure to what you are referring, maybe line 231?
| <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> |
|
|
||
|
|
||
| </body> | ||
| <description>This email template is used to collect the ORCID id's from co-authors.</description> |
| <!DOCTYPE locale SYSTEM "../../../../../lib/pkp/dtd/locale.dtd"> | ||
|
|
||
| <!-- | ||
| * plugins/generic/orcidPlugin/locale/en_US/locale.xml |
| @@ -1,11 +1,13 @@ | |||
| {** | |||
| * plugins/generic/orcidProfile/orcidProfile.tpl | |||
| @@ -0,0 +1,23 @@ | |||
| {** | |||
| * plugins/generic/orcidProfile/orcidProfileSearch.tpl | |||
| @@ -0,0 +1,162 @@ | |||
| {** | |||
| * plugins/generic/orcidProfile/orcidProfileSearchResults.tpl | |||
| </tr> | ||
| <tr class="heading" valign="top"> | ||
| <td width="5%"> </td> | ||
| <td width="25%">{translate key="plugins.generic.openAIRE.projectID"}</td> |
| * Localized email templates XML file. | ||
| --> | ||
|
|
||
| <email_texts locale="en_US"> |
| <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.
Suggest change the name of the form [id="issuesForm"]
| {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.
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.
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.
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.
| var profileSelectedIndex = $("input[name=orcidProfile]:checked").val(); | ||
| var profileSelected = profiles.theArray[profileSelectedIndex]; | ||
|
|
||
| opener.document.getElementById("{/literal}{$orcidButtonId}{literal}").style.display = "none";; |
| var profileSelected = profiles.theArray[profileSelectedIndex]; | ||
|
|
||
| opener.document.getElementById("{/literal}{$orcidButtonId}{literal}").style.display = "none";; | ||
| opener.document.getElementById("remove-orcid-button-" + authorIndex).style.display = "inline";; |
|
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