OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



How to have lists of users sorted by username?

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.

How to have lists of users sorted by username?

Postby rmichael » Mon Jun 18, 2007 10:20 am

I would like the various lists of usernames generated by OJS (either via "All Users" or after searching) to be sorted by (at least) username. (I presume they're just "sorted" by their entry order into the database at the moment, but I haven't really jumped into the source yet).

Should I modify the UserDAO and RoleDAO objects.. their getUsersBy(...) functions?

Related, why are the getUsersByRoleID and getUsersByJournalID functions in the RoleDAO? I understand they seem related to a "role", but they are functions that are returning an array of users, not an array of roles. This feels conceptually confused to me, what have I missed?

Has any work been done to abstract this a bit, and allow sorting of returned lists in general for OJS 2.2? For example, passing a sort parameter(s) to any of the getXYZByABC related functions.
rmichael
 
Posts: 113
Joined: Fri Mar 30, 2007 3:32 pm

Postby asmecher » Mon Jun 18, 2007 10:32 am

Hi Richard,

We'll eventually be adding clickable column headers so that users can choose what sort order they'd like, but it hasn't been a priority yet. (Requests for features in the forums do play into our prioritizations, though.) In the meantime, hard-coding ORDER BY clauses into classes/user/UserDAO.inc.php is the best approach.

The getUsersByRoleID and getUsersByJournalID functions appear in RoleDAO simply because they reference the roles table in addition to the users table; an argument could be made for these functions to be placed in either DAO. It might be conceptually clearer e.g. to have all functions returning Users moved into the UserDAO, in which case we might move these functions over at some point during a code review and cleanup.

Regards,
Alec Smecher
Public Knowledge Project Team
---
Don't miss the First International PKP Scholarly Publishing Conference
July 11 - 13, 2007, Vancouver, BC, Canada
http://ocs.sfu.ca/pkp2007/
asmecher
 
Posts: 8470
Joined: Wed Aug 10, 2005 12:56 pm

Postby rmichael » Mon Jun 18, 2007 10:38 am

Hi Alec,

Indeed, clickable column headers is what I've come to expect from most of these types of interfaces. Glad to hear it's in the works.

I suppose I should also 'ORDER BY' in getUsersBy(...) in the RoleDAO?

Thanks for the quick reply.
rmichael
 
Posts: 113
Joined: Fri Mar 30, 2007 3:32 pm

Postby asmecher » Mon Jun 18, 2007 11:08 am

Hi Richard,

Yes, best to add the ORDER BY in RoleDAO.inc.php as well for consistency.

Regards,
Alec Smecher
Public Knowledge Project Team
---
Don't miss the First International PKP Scholarly Publishing Conference
July 11 - 13, 2007, Vancouver, BC, Canada
http://ocs.sfu.ca/pkp2007/
asmecher
 
Posts: 8470
Joined: Wed Aug 10, 2005 12:56 pm

Sortable table headers

Postby ramon » Tue Aug 31, 2010 11:38 am

Hello all,

I'm glad to see that table headers are clickable in the upcoming version. However, inverting the list should be available.
Also, think about adding the actions to date headers as well (mostly for editors/section editors).
ramon
 
Posts: 928
Joined: Wed Oct 15, 2003 6:15 am
Location: Brasí­lia/DF - Brasil

Re: How to have lists of users sorted by username?

Postby jmacgreg » Fri Sep 03, 2010 10:35 am

Hi Ramon,

Thanks -- I've added this as a feature request here: http://pkp.sfu.ca/bugzilla/show_bug.cgi?id=5881. I'm not entirely sure I follow what you mean by date headers, though -- can you specify the queue you're talking about?

Cheers,
James
jmacgreg
 
Posts: 4186
Joined: Tue Feb 14, 2006 10:50 am

Re: How to have lists of users sorted by username?

Postby ramon » Mon Sep 06, 2010 5:46 am

Hello James,

I was referring to the table headers in the editor's pages (unassigned, in review and archives).
There we can list submissions by author, status, date submitted, etc.
However, alternating the listing order only works for author's page, not the editor.
ramon
 
Posts: 928
Joined: Wed Oct 15, 2003 6:15 am
Location: Brasí­lia/DF - Brasil

Re: How to have lists of users sorted by username?

Postby jmacgreg » Wed Sep 08, 2010 9:14 am

Hi Ramón,

Ahh, gotcha -- those should be fixed by Bug 5881 as well.

Cheers,
James
jmacgreg
 
Posts: 4186
Joined: Tue Feb 14, 2006 10:50 am


Return to OJS Technical Support

Who is online

Users browsing this forum: Bing [Bot], Jirrka and 2 guests