Skip to content

Commit

Permalink
If doi is valid, it will be displayed on the article page
Browse files Browse the repository at this point in the history
  • Loading branch information
yazbahar committed Jan 4, 2017
1 parent 4076f5d commit 1f5b7a6
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 8 deletions.
13 changes: 13 additions & 0 deletions src/Ojs/JournalBundle/Entity/Article.php
Original file line number Diff line number Diff line change
Expand Up @@ -1310,6 +1310,19 @@ public function getDoiStatus()
return $this->doiStatus;
}

/**
* @return boolean
*/
public function isDoiValid()
{
if ($this->getDoiStatus() == DoiStatuses::VALID)
{
return true;
}

return false;
}

/**
* @param int $doiStatus
* @return Article
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@

<hr/>

{% if article.doi is not empty %}
{% if article.doi is not empty and article.isDoiValid %}
<div id="doiInfo">
<p class="text-success">
<a href="http://dx.doi.org/{{ article.doi }}">{{ 'doi'|trans }}: {{ article.doi }}</a>
Expand Down Expand Up @@ -270,7 +270,7 @@
{{ bibtex_data.title }}.
{{ bibtex_data.journal }}, {% if article.issue %}{{ article.issue.volume }} ({{ article.issue.number }}){% endif %},
{% if article.firstPage is not null and article.lastPage is not null %}{{ article.firstPage }}-{{ article.lastPage }}{% endif %}.
{% if article.doi is not empty %}DOI: {{ article.doi }}{% else %}Retrieved from {{ app.request.schemeAndHttpHost ~ app.request.requestUri }}{% endif %}
{% if article.doi is not empty and article.isDoiValid %}DOI: {{ article.doi }}{% else %}Retrieved from {{ app.request.schemeAndHttpHost ~ app.request.requestUri }}{% endif %}
</td>
</tr>
<tr>
Expand Down Expand Up @@ -313,8 +313,8 @@
{% endif %}
Y1 - {{ article.pubDate|date("Y") }}
PY - {{ article.pubDate|date("Y") }}
N1 - doi: {{ article.doi }}
DO - {{ article.doi }}
N1 - {% if article.doi is not empty and article.isDoiValid %} doi: {{ article.doi }} {% endif %}
DO - {% if article.doi is not empty and article.isDoiValid %} {{ article.doi }} {% endif %}
T2 - {{ article.journal }}
JF - Journal
JO - JOR
Expand All @@ -323,8 +323,8 @@
VL - {{ article.issue.volume }}
IS - {{ article.issue.number }}
SN - {{ article.journal.issn }}-{{ article.journal.eissn }}
M3 - doi: {{ article.doi }}
UR - http://dx.doi.org/{{ article.doi }}
M3 - {% if article.doi is not empty and article.isDoiValid %} doi: {{ article.doi }} {% endif %}
UR - {% if article.doi is not empty and article.isDoiValid %} http://dx.doi.org/{{ article.doi }} {% endif %}
Y2 - {{ article.acceptanceDate|date("Y") }}
ER -

Expand All @@ -346,8 +346,8 @@
%P {{ article.journal.issn }}-{{ article.journal.eissn }}
%V {{ article.issue.volume }}
%N {{ article.issue.number }}
%R doi: {{ article.doi }}
%U {{ article.doi }}
%R {% if article.doi is not empty and article.isDoiValid %} doi: {{ article.doi }} {% endif %}
%U {% if article.doi is not empty and article.isDoiValid %} {{ article.doi }} {% endif %}
</td>
</tr>
</table>
Expand Down

0 comments on commit 1f5b7a6

Please sign in to comment.