Search and NOEDIT [message #1121] |
Thu, 04 October 2007 11:37  |
danpoleary
Messages: 49 Registered: February 2007
|
Member |
|
|
Hi,
How do I allow a search on a field that has NOEDIT selected, I thought that only setting NOSEARCH would block searches.
Would I need to make all fields editable and then override that when update has been selected to protect fields?
Thanks,
Dan
|
|
|
Re: Search and NOEDIT [message #1122 is a reply to message #1121] |
Thu, 04 October 2007 12:14  |
AJM
Messages: 2382 Registered: April 2006 Location: Surrey, UK
|
Senior Member |
|
|
NOEDIT applies to every screen, NOSEARCH only applies to a search screen.
You can change the settings for any field at any time to override what was declared in the Data Dictionary. The best place is in the _cm_changeConfig() method, as in the following example:
function _cm_changeConfig ($where, $fieldarray)
{
if ($GLOBALS['mode'] == 'search') {
unset($this->fieldspec['field1']['noedit']);
} // if
return $fieldarray;
} // _cm_changeConfig
You can also add a setting instead of clearing it, as in:
$this->fieldspec['field1']['nodisplay'] = 'y';
$this->fieldspec['field2']['nosearch'] = 'y';
$this->fieldspec['field3']['noedit'] = 'y';
Tony Marston
http://www.tonymarston.net
http://www.radicore.org
|
|
|