function display(){ // add this if function display doesn't exist
global $current_user;
// check if current user is in specific role
// code taken from thread
$IS_AM = in_array("<ROLE NAME>", ACLRole::getUserRoleNames($current_user->id));
if($IS_AM)
$this->ev->ss->assign('readOnly', 'readonly = "readonly"');
else
$this->ev->ss->assign('readOnly', '');
parent::display(); // add this if function display doesn't exist
} // add this if function display doesn't exist
Dropdown fields not accept readonly atribute in tag. And date & time field have a javascript onclick atribute in the calendar image, so the best way is hide the field. To make dropdown field “readonly” and hide the date field, include in the display() function:
function display(){ // add this if function display doesn't exist
global $current_user;
// check if current user is in specific role
// code taken from thread
$IS_AM = in_array("<ROLE NAME>", ACLRole::getUserRoleNames($current_user->id));
if($IS_AM){
$this->ev->ss->assign('readOnly', 'readonly = "readonly"');
$this->ev->ss->assign('readOnlyDropDown', 'disabled= "true"');
$this->ev->ss->assign('HideDateTime', 'style="display:none;"');
}else{
$this->ev->ss->assign('readOnly', '');
}
parent::display(); // add this if function display doesn't exist
} // add this if function display doesn't exist