OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



Change Default Order of New Articles in Issue TOC

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.

Change Default Order of New Articles in Issue TOC

Postby uscguitarte » Tue Aug 13, 2013 4:29 pm

Hi,

We have a group of users that have used an older version of OJS prior to the change in 2.1.1 where new articles are posted to the bottom of an Article's section:
viewtopic.php?f=9&t=1433

Now that we have upgraded them to the latest version of OJS - they are finding a difficult time adapting to this because they have an assumption in their workflow to have the newest articles listed at the top instead of the bottom of an article's section. Each section is very long and contains many articles so using the manual ordering drag and drop interface is tedious and frustrating for them.

Is there a way for us to configure this for them or can you provide a patch to accommodate this?

Thank you,
Chris
uscguitarte
 
Posts: 14
Joined: Mon Apr 29, 2013 4:53 pm

Re: Change Default Order of New Articles in Issue TOC

Postby JasonNugent » Wed Aug 14, 2013 5:08 am

Hi Chris,

You don't mention what version of OJS you're using, but the easiest way to modify this is to change the SQL query in classes/article/PublishedArticleDAO.inc.php in the method 'getPublishedArticlesInSections'. There is an ORDER BY clause that finishes with pa.seq ASC. Changing ASC to DESC will sort the articles the other way.

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

Re: Change Default Order of New Articles in Issue TOC

Postby uscguitarte » Wed Aug 14, 2013 8:48 am

Hi Jason,

Thanks - we're using 2.4.2

-Chris
uscguitarte
 
Posts: 14
Joined: Mon Apr 29, 2013 4:53 pm

Re: Change Default Order of New Articles in Issue TOC

Postby uscguitarte » Wed Aug 14, 2013 9:43 am

Hi Jason,

There's one issue we found - if they had previously re-ordered all of the articles manually - can we maintain that order even with this query modification?

I've tried modifying the query and it looks like once you manually reorder the articles - that also becomes reversed.

There's over 30 articles in each section - I'm sure they would prefer to not reorder the articles again manually.

Thanks for your help!
-Chris
uscguitarte
 
Posts: 14
Joined: Mon Apr 29, 2013 4:53 pm

Re: Change Default Order of New Articles in Issue TOC

Postby asmecher » Wed Aug 14, 2013 10:31 am

Hi Chris,

An alternative: edit pages/sectionEditor/SubmissionEditHandler, find the following (near line 2555):
Code: Select all
                        // Schedule against an issue.
                        if ($publishedArticle) {
                                $publishedArticle->setIssueId($issueId);
                                $publishedArticle->setSeq(REALLY_BIG_NUMBER);
                                $publishedArticleDao->updatePublishedArticle($publishedArticle);

                                // Re-index the published article metadata.
                                $articleSearchIndex->articleMetadataChanged($publishedArticle);
                        } else {
...and change the line reading...
Code: Select all
$publishedArticle->setSeq(REALLY_BIG_NUMBER);
...to...
Code: Select all
$publishedArticle->setSeq(-1);
This should cause newly-scheduled submissions to be scheduled at the top of the issue.

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

Re: Change Default Order of New Articles in Issue TOC

Postby JasonNugent » Wed Aug 14, 2013 11:32 am

Hey Chris,

Unfortunately, once you start tweaking the sequences you'll need to order in a different way. It might be possible to modify the query and sort based on the publishing date, but then you're really locked in and won't be able to re-order anything based on a numerical sequence.

Regards,
Jason

uscguitarte wrote:Hi Jason,

There's one issue we found - if they had previously re-ordered all of the articles manually - can we maintain that order even with this query modification?

I've tried modifying the query and it looks like once you manually reorder the articles - that also becomes reversed.

There's over 30 articles in each section - I'm sure they would prefer to not reorder the articles again manually.

Thanks for your help!
-Chris
JasonNugent
Site Admin
 
Posts: 893
Joined: Tue Jan 10, 2006 6:20 am

Re: Change Default Order of New Articles in Issue TOC

Postby uscguitarte » Thu Aug 15, 2013 3:28 pm

Hi Alec,

Thanks for your alternative solution. I implemented as instructed and when an article is first published to an issue - it is still inserted at the bottom.

Our editor's workflow will usually have them log in the same day they intend to publish the article and modify the "Schedule for publication in" to the current issue, record, modify the Published date to todays date, record. Then the article still appears at the bottom of the queue with this modification.

However, it does work only when the article is reassigned to another section after it is published - where it automatically is placed at the top. Is there another place where I should modify the setSeq to be (-1) for the publishedArticle so that they are published to the top of the queue?

Your help is much appreciated,
Chris

asmecher wrote:Hi Chris,

An alternative: edit pages/sectionEditor/SubmissionEditHandler, find the following (near line 2555):
Code: Select all
                        // Schedule against an issue.
                        if ($publishedArticle) {
                                $publishedArticle->setIssueId($issueId);
                                $publishedArticle->setSeq(REALLY_BIG_NUMBER);
                                $publishedArticleDao->updatePublishedArticle($publishedArticle);

                                // Re-index the published article metadata.
                                $articleSearchIndex->articleMetadataChanged($publishedArticle);
                        } else {
...and change the line reading...
Code: Select all
$publishedArticle->setSeq(REALLY_BIG_NUMBER);
...to...
Code: Select all
$publishedArticle->setSeq(-1);
This should cause newly-scheduled submissions to be scheduled at the top of the issue.

Regards,
Alec Smecher
Public Knowledge Project Team
uscguitarte
 
Posts: 14
Joined: Mon Apr 29, 2013 4:53 pm

Re: Change Default Order of New Articles in Issue TOC

Postby asmecher » Fri Aug 16, 2013 10:12 am

Hi Chris,

There's an additional case of...
Code: Select all
$publishedArticle->setSeq(REALLY_BIG_NUMBER);
...just below the code I quoted. Try making a similar change there.

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


Return to OJS Technical Support

Who is online

Users browsing this forum: Bing [Bot], dallibs, Yahoo [Bot] and 8 guests