Acceptance date of an article

Hi everyone.

is the acceptance date of an article stored? I found “DC.Date.created”, “DC.Date.dateSubmitted”, “DC.Date.issued” and “DC.Date.modified” but not the acceptance date. Can anyone help me?

Thanks.

Hi,

not an answer but maybe another hint:
When I export data for DataCite DOI registration (OJS 2.4.5), it also lists the ‘acceptance date’ field but the date in there is identical with the submission date and not the acceptance date as listed on the ‘review page’ of the manuscript. Since you can always see the acceptance date at this page (at the Editor decision) and in the history, it has to be stored somewhere.

Good luck with your search.

Hi all,

The acceptance date is stored in edit_decisions; look for entries with a decision of 2 (corresponding to the SUBMISSION_EDITOR_DECISION_ACCEPT constant in PHP).

Regards,
Alec Smecher
Public Knowledge Project Team

Hi Alec,
Does this still apply in OJS 3? If there is a constant in PHP do we have access to this in templates?

Such as {constant('SUBMISSION_EDITOR_DECISION_ACCEPT')} in Smarty syntax.

We’re looking for the best way to get an acceptance date into a template. We do know where the data lives in the database so if we had to query with a submission id for a decision of 2 that’s fine.

However, we don’t know how to to run database queries in our theme. I assume we do that in the Plugin.inc file of our template? Is there documentation for this?

I have used $templateMgr->assign() before. So this is what I’d like to accomplish (using some pseudocode):

$query = ‘SQL that returns the acceptance date from edit_decisions’;
$result = runQuery($query); //don’t know how OJS wants us to run queries in templates
$templateMgr->assign(‘dateAccepted’,$result);

We thought the acceptance date might have made into the new Health Sciences theme since these are the folks who usually want the accepted date.

Thanks for any help you can provide.
Sincerely,
John Barneson

1 Like

Hi @johnbarneson,

You’d need to use the EditDecisionDAO to fetch the latest editorial decision, then use the TemplateManager to assign it to a Smarty template variable. Then you could refer to that variable from inside the template.

Regards,
Alec Smecher
Public Knowledge Project Team

1 Like

This is a plugin I made that shows the submitted, accepted and published dates in the article landing page. Have not tested this on the lates version of OJS3 though. GitHub - ajnyga/dates

2 Likes

Very nice. Thanks for sharing. I did something similar but directly in our child theme’s Plugin.inc file.

public function loadTemplateData($hookName, $args) {
	// Retrieve the TemplateManager
	$templateMgr = $args[0];
	$submission = $templateMgr->get_template_vars('citationArgs');
	$submissionId = $submission['submissionId'];
	
	$dateAccepted = "";
	
	$editDecisionDao = DAORegistry::getDAO('EditDecisionDAO');
	$decisions = $editDecisionDao->getEditorDecisions($submissionId);
	
	foreach ($decisions as $decision) {
		if ($decision['stageId'] == '3' && $decision['decision'] == '1')
			$dateAccepted = $decision[dateDecided];			
	}		
	$templateMgr->assign('acceptanceDate',$dateAccepted); 
}

You have to hook in the loadTemplateData function inside of init()
		
HookRegistry::register ('TemplateManager::display', array($this, 'loadTemplateData'));

We just use $article->getDatePublished() and $article->getDateSubmitted() directly in the theme template.
2 Likes

Thanks @johnbarneson.
I copied these codes to my child theme and now I am able to get the accepted Date as well. Previously I could only fetch submitted and published dates.

I hope these codes would not compromise the security of the website.

Best regards

Nope, they look good! A couple of recommendations that @bozana brought up in a separate conversation:

Maybe just two notes:

  1. instead of using hard coded numbers he could use the constants WORKFLOW_STAGE_ID_EXTERNAL_REVIEW and SUBMISSION_EDITOR_DECISION_ACCEPT, and
  2. withe that function/algorithm he would get the last decision – it could be, for some reason, that the same decision is made several times (depending on their workflow), and in this case he would get the last date/the date of the last decision.
2 Likes

Hi ajnyga,

I’ve installed your plugin, but it doesn’t seem to work on our website. Any ideas?
Thanks!
Hernán.

are you getting any errors?

No. The Plugin is activated (and reinstalled several times, just in case), but it´s not showing the dates or performing any action at all…

Can you please post the code you add on the theme plugin.inc and article_detail.tpl,

i have try but not displayed.

here is the code in article_detail.tpl

  	{if $acceptanceDate}
  		<div class="item Accepted">
  			<div class="label">
  				{translate key="submissions.accepted"}
  			</div>
  			<div class="value">
  				{$acceptanceDate|date_format}
  			</div>
  		</div>
  	{/if}

Hello
This solved my problem in article_details.tpl

Now i want to put acceptance date in HTML using the plugin embedHtmlArticleGalley using also {$acceptanceDate|date_format:$dateFormatShort}.
https://rper.aper.pt/index.php/rper/article/view/172/300

But its not showing there.

How can i solve this?
Thanks

João

Hello João,
Did you update the template that the embedHtmlArticleGalley plugin uses? I’m not sure which template that is or if it even uses a template.

Right now the code above only works for a page that calls article_details.tpl.

~John

Hello John

This is the code that im using in the template, it’s called display.tpl

Thanks

<html>

<body>

  <head>
  <style>
  @import url("https://rper.aper.pt/plugins/generic/embedHtmlArticleGalley/templates/imprimir.css");
  </style>  
  </head>
  
  
  
  <div class="page-header">
  <div style="text-align: right; font-size: 10px; background-color: #DEEBF7; font-family:'Trebuchet MS'">
    <b><i>Revista Portuguesa de Enfermagem de Reabilitação, {$issue->getIssueSeries()|escape}</i></b> 
    </div><br/>
    
  <div style="text-align: center;">
  <meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
    <button type="button" onClick="window.print()" style="background: white">
      <i class="fa fa-print" style="font-size:15px"></i>
    </button>
  </div>
    </div>

  
  
  <div class="page-footer" style="text-align: center; font-size: 10px; background-color: #DEEBF7; font-family:'Trebuchet MS'; margin: 1%">
  
  <span style="float: right"><b>{$article->getPages()|escape}</b></span> 
  
  <span style="float: center"><b>© {$copyrightYear}, RPER, eISSN: 2184-3023 | pISSN: 2184-965X</b></span>
  
 

</div>
  

  

  <table>

    <thead>
      <tr>
        <td>
          <!--place holder for the fixed-position header-->
          <div class="page-header-space"></div>
        </td>
      </tr>
    </thead>

    
    
    
    
    <tbody>
      <tr>
        <td>
          <!--*** CONTENT GOES HERE ***-->
          
          
<div class="page" style="line-height: 1">
  
  
  		<div style="width: 25%; float: left;">
          <a href="https://rper.aper.pt/index.php/rper/index" target="_blank">
            <img src="https://rper.aper.pt/plugins/generic/embedHtmlArticleGalley/templates/rper.png" alt="rper" width="100" height="100">
          </a>
  		</div>
  
  		<div style="width: 75%; float: left;">
        <div style="text-align: right; font-size: 12px; font-family:'Trebuchet MS'; line-height: 0.5">
        <p><b>Revista Portuguesa de Enfermagem de Reabilitação</b></p>
        <p><b>eISSN: 2184-3023 | pISSN: 2184-965X</b></p>
        <p><b>{$issue->getIssueSeries()|escape} </b></p> 
          
        
        
        <div class="item published">
		<div class="label">
          <div style="text-align:center; font-size: 14px;">
            
            <p> <b>{translate key="submissions.submitted"}: </b> {$article->getDateSubmitted()|date_format:$dateFormatShort}; <b> {translate key="submission.accepted"}:</b>  {$acceptanceDate|date_format:$dateFormatShort}; <b> {translate key="submissions.published"}: </b> {$article->getDatePublished()|date_format:$dateFormatShort}</p>
             
            {$reviewdate}
            
            
            {$dateAccepted = $decision[dateDecided]|date_format:$dateFormatShort}
          </div>
		</div>
        </div>
         
      
       
        
        
      
          
          <div style="text-align:right; font-size: 12px; font-family:'Trebuchet MS'"> 
		<p> <b>Pag.:</b>  {$article->getPages()|escape}  </p>
  		</div>
          
          {* DOI only for large screens *}
			{foreach from=$pubIdPlugins item=pubIdPlugin}
				{if $pubIdPlugin->getPubIdType() != 'doi'}
					{continue}
				{/if}
				{assign var=pubId value=$article->getStoredPubId($pubIdPlugin->getPubIdType())}
				{if $pubId}
					{assign var="doiUrl" value=$pubIdPlugin->getResolvingURL($currentJournal->getId(), $pubId)|escape}
					
				{/if}
			{/foreach} 
          
          
          <div style="text-align:right; font-size: 12px;  font-family:'Trebuchet MS'">
						<div class="sub_item">
						{foreach from=$categories item=category}
						<div class="value">
                        <p><b>{$section->getLocalizedTitle()|escape}:</b> {$category->getLocalizedTitle()|escape}</p>							
                        </div>
                         {/foreach} 
                          
					    </div>	
          </div>  
          
          <p><b>DOI: </b>{$doiUrl} </p>  
           
		
        </div>  
          
  		</div>
  
  		<div style="clear: both;"></div>
  
  
  
  <p> &nbsp &nbsp
         </p>
  	
          <div style="text-align: center; font-size: 18px; font-family:'Trebuchet MS'">
           
            <p><b>{$publication->getLocalizedFullTitle(pt_PT)|escape}</b></p>
            <p><b>{$publication->getLocalizedFullTitle(en_US)|escape}</b></p>
            <p><b>{$publication->getLocalizedFullTitle(es_ES)|escape}</b></p>
            </div>
  
            
			
            <div style="text-align: center; font-size: 12px; font-family:'Trebuchet MS'">
            {assign var=count value=0}
        {foreach from=$article->getAuthors() item=author name=authorList}
		{assign var=fullname value=$author->getFullName()}
		{assign var="contact" value=$author->getData('primaryContact')}
		{assign var=count value=$count+1}
        {if $fullname||$count}{$fullname|escape}<sup>({if $contact eq 1}{$count|escape}*{else}{$count|escape}{/if})</sup>, {/if}
   {/foreach}
  </div>
  <p> </p> 
         <div style="text-align: center; font-size: 10px; font-family:'Trebuchet MS'">
{assign var=count value=0}
    {foreach from=$article->getAuthors() item=author name=authorList}
            {assign var=authorAffiliation value=$author->getLocalizedAffiliation()}
		{assign var=count value=$count+1}
		{if $authorAffiliation||$count} ({$count|escape})&nbsp{$authorAffiliation|escape}{/if};
   {/foreach}
    
          </div>
          <p> &nbsp &nbsp
         </p>  
             
        
        
        <div style="width: 100%; height: 1px; border-top: 1px solid white;"></div>

  
			<div style="width: 25%; float: left; ">
			<div style="margin-right: 1%;"> 
              
              
              <div style="text-align:left; font-size: 12px;  font-family:'Trebuchet MS'">
                
			{* Keywords *}
				{if !empty($publication->getLocalizedData('keywords'))}
					<p><b>Descritores</b></p>
                
						<div class="article-details-keywords-value">
							{foreach name=keywords from=$publication->getLocalizedData('keywords', pt_PT) item=keyword}
								<span>{$keyword|escape}</span>{if !$smarty.foreach.keywords.last}<br>{/if}
							{/foreach},
                      </div>
                   </div>
                 {/if}
              
                
              
					 
 
            </div>  
 			</div>    
  			
              
              
  			<div style="width: 75%; float: left; background-color: #DEEBF7;  ">			
 			<div style="height: auto; border-left: 1px solid #DEEBF7;">
 	 			{* Abstract *}
  
				{if $publication->getLocalizedData('abstract')}
    			<div style="margin-left: 1%; margin-right: 1%;"> 
     			<div style="text-align:justify; font-size: 12px;  font-family:'Trebuchet MS'">
						<p><b>Resumo</b></p>
						
                        {$publication->getLocalizedData('abstract', pt_PT)}
                        
				</div>
    		</div>
				{/if}
      
  			</div>
            </div>
  
            
  <div style="clear: both;"></div>	
  
  <div style="width: 100%; height: 1px; border-top: 1px solid white;"></div>
          
  
  <div style="width: 25%; float: left;">
  <div style="margin-right: 1%;"> 
  <div style="text-align:left; font-size: 12px;  font-family:'Trebuchet MS'">
                
			{* Keywords *}
				{if !empty($publication->getLocalizedData('keywords'))}
					<p><b>Descriptors</b></p>
                
						<div class="article-details-keywords-value">
							{foreach name=keywords from=$publication->getLocalizedData('keywords', en_US) item=keyword}
								<span>{$keyword|escape}</span>{if !$smarty.foreach.keywords.last}<br>{/if}
							{/foreach}
                      </div>
                   </div>
                 {/if}
              
              </div>
    
                 
			
  	
        
 		
            </div>
 			 
  			
              
              
  			<div style="width: 75%; float: left; background-color: #DEEBF7;">			
 			<div style="height: auto; border-left: 1px solid #DEEBF7;">
 	 			{* Abstract *}
                {if $publication->getLocalizedData('abstract')}
    			<div style="margin-left: 1%;margin-right: 1%;"> 
     			<div style="text-align:justify; font-size: 12px;  font-family:'Trebuchet MS'">
						<p><b>Abstract</b></p>
						
                        {$publication->getLocalizedData('abstract', en_US)}
                        
				</div>
    		</div>
				{/if}
				
  			</div>
            </div>       
          
  <div style="clear: both;"></div>	
  
  <div style="width: 100%; height: 1px; border-top: 1px solid white;"></div>
          
   <div style="width: 25%; float: left;">
			<div style="margin-right: 1%;"> 
              <div style="text-align:left; font-size: 12px;  font-family:'Trebuchet MS'">
                
			{* Keywords *}
				{if !empty($publication->getLocalizedData('keywords'))}
					<p><b>Descriptores</b>
                      
                </p>
						<div class="article-details-keywords-value">
							{foreach name=keywords from=$publication->getLocalizedData('keywords', es_ES) item=keyword}
								<span>{$keyword|escape}</span>{if !$smarty.foreach.keywords.last}<br>{/if}
							{/foreach}
                      </div>
                   </div>
                   
                   
				{/if}
              
              </div>
 
                  
    
                    
                      
                      
  	
        
 		
            </div>
 			   
  			
              
              
  			<div style="width: 75%; float: left; background-color: #DEEBF7; ">			
 			<div style="height: auto; border-left: 1px solid #DEEBF7;">
 	 			{* Abstract *}
  
				{if $publication->getLocalizedData('abstract')}
    			<div style="margin-left: 1%;margin-right: 1%;"> 
     			<div style="text-align:justify; font-size: 12px;  font-family:'Trebuchet MS'">
						<p><b>Resumen</b></p>
						
                     {$publication->getLocalizedData('abstract', es_ES)}   
				</div>
    			</div>
				{/if}
      
  			</div>
            </div>  
     <div style="clear: both;"></div>	     
         	
  <div style="width: 100%; height: 1px; border-top: 1px solid white;"></div>
          
           <div style="clear: both;"></div>
  <p> &nbsp &nbsp
  </p>
  
   
  
                      
                      
            
            
            
           
          
         <div id="full-article">
         <div style="text-align: justify; font-size: 12px; line-height: 1; font-family:'Trebuchet MS'"> 
           
	{$html}
          
</div>
          <p> &nbsp &nbsp
  </p>  
            {* References *}
				{if $parsedCitations || $publication->getData('citationsRaw')}
					<div style="text-align: justify; font-size: 12px; font-family:'Trebuchet MS'">
					<div class="article-details-block article-details-references">	
						<h3 class="article-details-heading">
							{translate key="submission.citations"}
						</h3>
						
							{if $parsedCitations}
								{foreach from=$parsedCitations item=parsedCitation}
									<p>{$parsedCitation->getCitationWithLinks()|strip_unsafe_html}</p>
								{/foreach}
							{else}
								{$publication->getData('citationsRaw')|escape|nl2br}
							{/if}
						</div>
					</div>
				{/if}
   </div>   
         
 <p> &nbsp &nbsp
  </p>
  
   
  {if $licenseTerms || $licenseUrl}
					<div style="text-align:left; font-size: 10px; font-family:'Trebuchet MS'">
						{if $licenseUrl}
							{if $ccLicenseBadge}
							{$ccLicenseBadge}	
                     
									{if $copyrightHolder}
										<p>{translate key="submission.copyrightStatement" copyrightHolder=$copyrightHolder copyrightYear=$copyrightYear}</p>
									{/if}
             
							{else}
								<a href="{$licenseUrl|escape}" class="copyright">
                               
                                   
									{if $copyrightHolder}
										{translate key="submission.copyrightStatement" copyrightHolder=$copyrightHolder copyrightYear=$copyrightYear}
									{else}
										{translate key="submission.license"}
									{/if}
								</a>
							{/if}
						{else}
							{$licenseTerms}
						{/if}
					</div>
				{/if}
         </div>
            
    
        </td>
      </tr>
    </tbody>

    <tfoot>
      <tr>
        <td>
          <!--place holder for the fixed-position footer-->
          <div class="page-footer-space"></div>
        </td>
      </tr>
    </tfoot>

  </table>

  
  {call_hook name="Templates::Common::Footer::PageFooter"}
	
</body>
          

</html>
			

Hmm. I wonder if the embedHtmlArticleGalley plugin does not hook into TemplateManager. The loadTemplateData hook is part of the child theme so it appears that the plugin doesn’t call this code. Thus the $acceptanceDate variable is not available to the plugins’ template (display.tpl).

Not sure what the best way around this is or if this is actually the problem. Does anyone else know if OJS plugins hook into the template system by default?

we solved it using this code

{translate key="submissions.submitted"}: {$article->getDateSubmitted()|date_format:$dateFormatShort}; {translate key="submission.accepted"}: {$acceptance|date_format:$dateFormatShort}; {translate key="submissions.published"}: {$article->getDatePublished()|date_format:$dateFormatShort}

This topic was automatically closed after 12 days. New replies are no longer allowed.