Alphabetically display the createdBy select user pull down

5 posts by 2 authors in: Forums > CMS Builder
Last Post: November 28, 2013   (RSS)

By gkornbluth - November 23, 2013

Hi All,

Is there a way to force the createdBy select user pull down in a record to display in alphabetical order?

 It would make re-assigning author access only listings that were originally created by admins much easier.

I think the closest related post on the forum is:

http://www.interactivetools.com/forum/forum-posts.php?postNum=2215513

But I don’t want to start messing around with the internal program code without some guidance.

Thanks,

Jerry Kornbluth

The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

By Dave - November 28, 2013

Hi Jerry, 

Yea, I think that would be a good feature.  I've made this update for the next release in /cmsAdmin/lib/common.php

I added the code in red:

// show pulldown when editor clicks "change" beside "Created By" on edit page in CMS
function ajaxGetUsersAsPulldown() {
global $TABLE_PREFIX, $hasEditorAccess, $tableName;
if (!$hasEditorAccess) { return ''; } // must have section admin access

// get users with access to this section
$query = "SELECT u.num, u.username
FROM {$TABLE_PREFIX}accounts u
JOIN {$TABLE_PREFIX}_accesslist a ON u.num = a.userNum
WHERE a.accessLevel > 1 AND a.tableName IN ('all','$tableName')
ORDER BY username";
$users = mysql_fetch($query);

Let me know if that works for you.

Dave Edis - Senior Developer
interactivetools.com

By gkornbluth - November 28, 2013

Hi Dave,

Thanks for this.

I think the code you wanted me to update might actually be in cmsAdmin/lib/menu/default/common.php

But when I add the code you suggested, I'm throwing this error at the top of the record list ...

: Cannot modify header information - headers already sent by (output started at /home/k9class/public_html/cmsAdmin/lib/menus/default/common.php:1065) in /home/k9class/public_html/cmsAdmin/lib/menus/header.php on line 2

Best,

Jerry

The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

By gkornbluth - November 28, 2013

Thanksgiving dinner's over and I'm stuffed.

Don't know why, but I revised a fresh copy of the file and it worked as planned.

Thanks for this and for including it in the next upgrade.

Best,

Jerry Kornbluth

The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php