Hiding a field from a section editor
9 posts by 3 authors in: Forums > CMS Builder
Last Post: November 19, 2009 (RSS)
By gkornbluth - November 16, 2009 - edited: November 16, 2009
I have a (checkbox) field in a membership section editor that indicates if a member was a founding member of the organization.
Since this information will never change, and is only used for generating reports, my client would like to either:
A) Completely hide that field from the section editor, or
B) Make the field uneditable by anyone
Any insights?
Best,
Jerry Kornbluth
Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php
Re: [gkornbluth] Hiding a field from a section editor
By Damon - November 16, 2009
You can set the field to be:
- Admin Only - Field can only be modified by admin or editor user
Regular users won't see the field.
To do this, Admin > Section Editors > Membership - click modify for the field to hide.
Then in the bottom of the popup in the Advanced Options area, check Field Attributes box for:
- Admin Only - Field can only be modified by admin or editor user
Damon Edis - interactivetools.com
Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/
Re: [Damon] Hiding a field from a section editor
By gkornbluth - November 16, 2009 - edited: November 18, 2009
I already tried that, but since many of the folks that modify the section are classified as "editors" the field shows up for them and is editable.
Best,
Jerry
Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php
Re: [gkornbluth] Hiding a field from a section editor
By Dave - November 17, 2009
I could tell where to modify the code to make it some admin only fields weren't available to editors (who are kind of like section admins).
Would that work? If not we'd have to get more creative.
interactivetools.com
Re: [Dave] Hiding a field from a section editor
By gkornbluth - November 17, 2009 - edited: November 18, 2009
That would probably work, and might be a nice addition to the advanced options somewhere down the road. That would keep those well intentioned "editors" from getting into too much trouble.
Best,
Jerry
Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php
Re: [gkornbluth] Hiding a field from a section editor
By Dave - November 18, 2009
Here's some code changes you could make to make adminOnly fields not available to editors (who are section Admins)
Be sure to make backups and test any changes. Also remember to not upgrade without copying your custom changes over. One way to remember this is to create a file in /cmsAdmin/ called DO_NOT_UPGRADE.readme that lists your custom code changes so you'll remember. (That's what we do).
- Open /cmsAdmin/lib/menus/default/edit_functions.php
- Search for "!$CURRENT_USER['isAdmin'] && !$GLOBALS['hasEditorAccess']" and remove the crossed out code:
if (@$fieldHash['adminOnly'] && !$CURRENT_USER['isAdmin']
- Open /cmsAdmin/lib/menus/default/save.php
- Search for "!$CURRENT_USER['isAdmin'] && !$GLOBALS['hasEditorAccess']" and remove the crossed out code (two lines):
if (@$fieldSchema['adminOnly'] && !$CURRENT_USER['isAdmin']
if (@$fieldSchema['adminOnly'] && !$CURRENT_USER['isAdmin']
Hope that helps! Let me know if that works for you.
interactivetools.com
Re: [Dave] Hiding a field from a section editor
By gkornbluth - November 18, 2009 - edited: November 18, 2009
Seems like it will work. I'll try it in a bit.
Any chance that this could become another choice on the admin advanced options menu somewhere down the road?
Jerry
Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php
Re: [gkornbluth] Hiding a field from a section editor
By Dave - November 18, 2009
interactivetools.com
Re: [Dave] Hiding a field from a section editor
Thanks
Jerry
Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php