OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



Change Order of Genres in Dropdown for Submission Uploads

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

Moderators: jmacgreg, michael, asmecher

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

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 OMP Discussion subforum; if you have a development question, try the OMP Development subforum.

Change Order of Genres in Dropdown for Submission Uploads

Postby rootl » Fri Dec 13, 2013 5:57 am

Greetings,

We would like to be able to reorder genres as they appear in the "Content Types" dropdown in the Upload Submissions step1. Any custom genres we create appear at the bottom of the list, and we need for them to appear at the top.

I've looked through all the files that reference genre. I am wondering if there is a way to add an 'orderby genreID DESC' clause in classes\monograph\GenreDAO.inc.php or some method to control the order in \file\MonographFileManager.inc.php

It appears that the only other way would be to reorder the IDs of the rows in "genres" and "genre_settings" in the database.

Let me know if I am on the right track here. Please let me know the most ideal way to control the order of genres. Thank you.
rootl
 
Posts: 62
Joined: Wed Feb 20, 2013 7:17 am

Re: Change Order of Genres in Dropdown for Submission Upload

Postby asmecher » Fri Dec 13, 2013 11:42 am

Hi rootl,

I've just filed and implemented this for OMP 1.1, which will come out early in the new year. See http://pkp.sfu.ca/bugzilla/show_bug.cgi?id=8515. Meanwhile, the ordering change you suggest would make a good interim work-around; you can make the change in lib/pkp/classes/submission/GenreDAO.inc.php.

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

Re: Change Order of Genres in Dropdown for Submission Upload

Postby rootl » Mon Dec 16, 2013 7:00 am

Greetings.

Correction there is no file lib/pkp/classes/submission/GenreDAO.inc.php.

I made the change in omp/classes/monograph/GenreDAO.inc.php

From this (starting line 61):

function &getEnabledByPressId($pressId, $rangeInfo = null) {
$result =& $this->retrieveRange(
'SELECT * FROM genres WHERE enabled = ? AND press_id = ?', array(1, $pressId), $rangeInfo
);


To this :

function &getEnabledByPressId($pressId, $rangeInfo = null) {
$result =& $this->retrieveRange(
'SELECT * FROM genres WHERE enabled = ? AND press_id = ? ORDER BY genre_id DESC', array(1, $pressId), $rangeInfo
);


I hope this will help anyone else who needs this functionality.

As I figured, this affects the order of genres for all presses. It would be great in this bugfix if the sort order of each press genres could be controlled individually. Thanks!
rootl
 
Posts: 62
Joined: Wed Feb 20, 2013 7:17 am


Return to OMP Technical Support

Who is online

Users browsing this forum: No registered users and 1 guest