AnsweredAssumed Answered

How to set a checkbox's readonly to false if one of a user's teams is equal to a string value in 6.5.8?

Question asked by Richard Coleman on Dec 2, 2014
Latest reply on Dec 3, 2014 by Richard Coleman
I have a requirement to have a tickbox readonly, unless a user is in a specific team.

So for example "Technical Approval" is the tickbox. This should be read-only unless the current user is in the "Technical" team.

I've been trying a variety of searches, and tests, but none have proven conclusive.

My most recent attempt is on the controller:


class CampaignsController extends SugarController{

    function action_editview() { 
  global $current_user;
  $user_id = $current_user->id;
  $objTeams = new Team();
  $teams = $objTeams->get_teams_for_user($user_id);
  if (in_array("Technical",$teams))
  {
  $this->bean->description = "testing the controller";
  }
  $this->view = 'edit'; 
    }
}
?>

However, this doesn't enter the text in the description.

If I then get the logic right, how do I manipulate the checkbox's readonly status? Am I just doing this completely wrong, in the wrong area?

Outcomes