OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



Highlight items in submissionsInReview page based on editor

Are you responsible for making OJS work -- installing, upgrading, migrating or troubleshooting? Do you think you've found a bug? Post in this forum.

Moderators: jmacgreg, btbell, michael, bdgregg, barbarah, asmecher

Forum rules
What to do if you have a technical problem with OJS:

1. Search the forum. You can do this from the Advanced Search Page or from our Google Custom Search, which will search the entire PKP site. If you are encountering an error, we especially recommend searching the forum for said error.

2. Check the FAQ to see if your question or error has already been resolved.

3. Post a question, but please, only after trying the above two solutions. If it's a workflow or usability question you should probably post to the OJS Editorial Support and Discussion subforum; if you have a development question, try the OJS Development subforum.

Highlight items in submissionsInReview page based on editor

Postby kennymatthew » Sat Jun 08, 2013 11:12 pm

Hi,

Just wanted to know if it is possible to highlight items in submissionsInReview page depending on the editors decision. Like Red if the editor says Reject. etc ?

Best Regards,
Kenny Mathew
kennymatthew
 
Posts: 127
Joined: Wed Jan 09, 2013 11:49 pm

Re: Highlight items in submissionsInReview page based on edi

Postby JasonNugent » Mon Jun 10, 2013 9:27 am

Hi Kenny,

Just as the original poster in your other thread in the OJS Development forum suggested, you'll need to wrap the submission status cell in some sort of div element or apply a CSS class that you can style in a style sheet. I think the code example that James posted in that thread is pretty helpful.

Regards,
Jason
JasonNugent
Site Admin
 
Posts: 872
Joined: Tue Jan 10, 2006 6:20 am

Re: Highlight items in submissionsInReview page based on edi

Postby kennymatthew » Mon Jun 10, 2013 9:40 pm

Hi Jason,

The other topic was for the Reviewers decision in the page submissionreview. I want to know about highlight a submission depending on the editors decision in the page SubmissionInReview. Where there is usually a yellow highlight if there is any work pending from our side.
kennymatthew
 
Posts: 127
Joined: Wed Jan 09, 2013 11:49 pm

Re: Highlight items in submissionsInReview page based on edi

Postby JasonNugent » Thu Jun 13, 2013 4:04 am

Hi Kenny,

It's still the same thing. Look in the templates/sectionEditor/submissionsInReview.tpl template. You'll see this:

Code: Select all
        {assign var="highlightClass" value=$submission->getHighlightClass()}
        <tr valign="top"{if $highlightClass} class="{$highlightClass|escape}"{/if}>


The "getHighlightClass" method is defined in ./submission/sectionEditor/SectionEditorSubmission.inc.php. You'd just need to make adjustments there and create the necessary CSS classes.

Jason
JasonNugent
Site Admin
 
Posts: 872
Joined: Tue Jan 10, 2006 6:20 am

Re: Highlight items in submissionsInReview page based on edi

Postby kennymatthew » Sun Jun 16, 2013 2:09 am

Hi ,

Please help me out in testing if this will work and not cause any problems. As of now it seems like it works,

In ojs/styles/common.css
Code: Select all
table.listing tr.authorrevised {
   background: #F79A57;
}




In classes/submission/sectionEditor/SectionEditorSubmission.inc.php line:483

Code: Select all
function getHighlightClass() {
      $signoffDao =& DAORegistry::getDAO('SignoffDAO');
      $highlightClass = 'highlight';
      $authorRevised = 'authorrevised';


In ojs/templates/sectioneditor/submissionsInReview.tpl ---line:37

Code: Select all
{assign var="highlightClass" value=$submission->getHighlightClass()}
   <tr valign="top"{if $highlightClass|$authorRevised} class="{$highlightClass|$authorRevised|escape}"{/if}>
   


In classes/submission/sectionEditor/SectionEditorSubmission.inc.php line:740 (towards the end)

Code: Select all
            if (is_array($authorFileRevisions) && !empty($authorFileRevisions)) {
               $authorFile = array_pop($authorFileRevisions);
               $authorFileDate = strtotime($authorFile->getDateUploaded());
            }
            //The submission will be highlighted till the author submits a revised paper Kenny
           if (($latestDecision['decision'] == SUBMISSION_EDITOR_DECISION_PENDING_REVISIONS) && ($lastDecisionDate > $authorFileDate))             
               return $authorRevised;
         else
            return null;
           
            if (   ($lastDecisionDate || $commentDate) &&
               $authorFileDate &&
               $authorFileDate > max($lastDecisionDate, $commentDate)
            ) return $highlightClass;
         }
      }
      return null;
   }
}

?>
kennymatthew
 
Posts: 127
Joined: Wed Jan 09, 2013 11:49 pm

Re: Highlight items in submissionsInReview page based on edi

Postby kennymatthew » Mon Jun 17, 2013 11:59 pm

JasonNugent wrote:Hi Kenny,

It's still the same thing. Look in the templates/sectionEditor/submissionsInReview.tpl template. You'll see this:

Code: Select all
        {assign var="highlightClass" value=$submission->getHighlightClass()}
        <tr valign="top"{if $highlightClass} class="{$highlightClass|escape}"{/if}>


The "getHighlightClass" method is defined in ./submission/sectionEditor/SectionEditorSubmission.inc.php. You'd just need to make adjustments there and create the necessary CSS classes.

Jason


Hi Jason,

Culd you please explain how the syntax is for the statement above. i tried adding 2 conditions and it works. I tried adding 3 and it doesnt work
Code: Select all
{assign var="highlightClass" value=$submission->getHighlightClass()}
   <tr valign="top"{if $highlightClass|$authorRevised|$third} class="{$highlightClass|$authorRevised|$third|escape}"{/if}>
what can be done if i want to add $third ?
kennymatthew
 
Posts: 127
Joined: Wed Jan 09, 2013 11:49 pm

Re: Highlight items in submissionsInReview page based on edi

Postby JasonNugent » Tue Jun 18, 2013 4:06 am

Hi Kenny,

What is getHighlightClass() returning? It should return a single string. Smarty uses the | character to pipe variable content through modifiers, which is what the |escape normally does. In your case, "$highlightClass|$authorRevised|$third" is trying to pipe the contents of $highlightClass through two other modifiers which is probably why it isn't working. Smarty uses the same syntax as PHP for conditionals, e.g. {if $foo or $bar or $baz} ... {/if}

Regards,
Jason
JasonNugent
Site Admin
 
Posts: 872
Joined: Tue Jan 10, 2006 6:20 am

Re: Highlight items in submissionsInReview page based on edi

Postby kennymatthew » Tue Jun 18, 2013 9:38 pm

Hi Jason,

Thanks alot for your valuble input. SincegetHighlightClass() is returing a string i just changed the value instead of makin another variable. and make a css class for each string it returns. it is working perfectly, sadly I just realised today that the new OJS already has all these features included :cry: Anyway..... Thanks again ....
kennymatthew
 
Posts: 127
Joined: Wed Jan 09, 2013 11:49 pm

Re: Highlight items in submissionsInReview page based on edi

Postby kennymatthew » Mon Aug 12, 2013 12:19 am

Hi,

The changes I made are working fine for editors, the right submissions are highlighted. But for section editors its completely different. Any ideas why ?
kennymatthew
 
Posts: 127
Joined: Wed Jan 09, 2013 11:49 pm

Re: Highlight items in submissionsInReview page based on edi

Postby asmecher » Mon Aug 12, 2013 10:37 am

Hi kennymatthew,

Hmm, I'm not sure why that would be the case -- both Editor and Section Editor interfaces use the same getHighlightClass implementation. Can you describe what you're seeing in more detail?

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8581
Joined: Wed Aug 10, 2005 12:56 pm

Re: Highlight items in submissionsInReview page based on edi

Postby kennymatthew » Mon Aug 12, 2013 10:10 pm

Code: Select all
   // If all reviews are complete but no decision is recorded, highlight.
            if ($allReviewsComplete && $decisionsEmpty) return $highlightClass;

            // If the author's last file upload hasn't been taken into account in
            // the most recent decision or author/editor correspondence, highlight.
            $comment = $this->getMostRecentEditorDecisionComment();
            $commentDate = $comment ? strtotime($comment->getDatePosted()) : 0;
            $authorFileRevisions = $this->getAuthorFileRevisions($this->getCurrentRound());
            $authorFileDate = null;
            if (is_array($authorFileRevisions) && !empty($authorFileRevisions)) {
               $authorFile = array_pop($authorFileRevisions);
               $authorFileDate = strtotime($authorFile->getDateUploaded());
            }
               
                            //The submission will be highlighted when editor decision is for author to resubmit a revised paper till the author submits a revised paper

                if (($latestDecision['decision'] == SUBMISSION_EDITOR_DECISION_PENDING_REVISIONS) && ($lastDecisionDate > $authorFileDate))             
                      return $highlightClass ='highlightAuthorRevisedCopyPending'; (color--purple)
               
               
            if (   ($lastDecisionDate || $commentDate) &&
               $authorFileDate &&
               $authorFileDate > max($lastDecisionDate, $commentDate))
                    return $highlightClass='highlightAuthorRevisedCopyUploaded'; // this will make the submission blink when author has submitted a revised copy(color-->blinks purple made a toggle function).
         }
      }
      return null;
   }
}

?>


this is the change I made in .... classes / submission / sectionEditor / SectionEditorSubmission.inc.php. And it works perfectly if you login as a editor. but when I login as a section editor random entries are highlighted as -->highlightAuthorRevisedCopyUploaded. Trying to recreate different scenarios to see whats the condition but cant.
Attachments
highlight2.jpg
This is how it looks when the section editor logs in . But different items are highlighted.
highlight2.jpg (150.41 KiB) Viewed 1011 times
highlight1.jpg
this is how it looks as an editor and the highlight is correct
highlight1.jpg (138.54 KiB) Viewed 1011 times
kennymatthew
 
Posts: 127
Joined: Wed Jan 09, 2013 11:49 pm

Re: Highlight items in submissionsInReview page based on edi

Postby asmecher » Fri Aug 16, 2013 2:00 pm

Hi kennymatthew,

I'd suggest trying to narrow down your conditionals to identify the specific case that's not working; I can't make sense of it from here, unfortunately.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8581
Joined: Wed Aug 10, 2005 12:56 pm

Re: Highlight items in submissionsInReview page based on edi

Postby kennymatthew » Thu Sep 19, 2013 12:16 am

Hi,

Is there anyway I can make only the editors and not the section editors see the additional color highlight? like when author submits his revised paper.
kennymatthew
 
Posts: 127
Joined: Wed Jan 09, 2013 11:49 pm

Re: Highlight items in submissionsInReview page based on edi

Postby asmecher » Thu Sep 19, 2013 9:13 am

Hi kennymatthew,

Yes -- by removing references to highlighting from templates/sectionEditor/submissionsInEditing.tpl and templates/sectionEditor/submissionsInReview.tpl.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8581
Joined: Wed Aug 10, 2005 12:56 pm


Return to OJS Technical Support

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 3 guests