avatar Frederik (Dwarf) Pro Jun 22. 2009. 4:01 am
Ilija Studen:
You set default visibility when you create new projects. By default, Default Visibility is set to Private on New Project forms.


Hey Ilija,

I've tried to figure out where to change the Defaullt Visibility when creating a new project. The _project_form.tpl doesn't set it and the select_visibility helper function doesn't seem to give me any hints either, as the checked param isn't set for either of the 2 radio buttons. Have I missed something and if so, where should I look for changing this?
Best regards

Frederik Sauer
Dwarf A/S
avatar Ilija Studen Staff Jun 24. 2009. 7:28 am
Default value of Default Visibility field is controlled with following piece of code:

if(!is_array($project_data)) {
  $project_data = array(
    'leader_id' => $this->logged_user->getId(),
    'default_visibility' => VISIBILITY_PRIVATE,
  );
} // if


in ProjectController (/activecollab/application/modules/system/controllers). If you wish to have Normal visibility selected by default, change it to:

if(!is_array($project_data)) {
  $project_data = array(
    'leader_id' => $this->logged_user->getId(),
    'default_visibility' => VISIBILITY_NORMAL,
  );
} // if


PS: This is a hack and you know the story - hacks are not recommended because you need to manually re-apply them each time you upgrade to the latest version.
avatar Frederik (Dwarf) Pro Jun 24. 2009. 7:54 am
Thank you once again Ilija

It's always nice to get help from a developer, even with hacks :)
Best regards

Frederik Sauer
Dwarf A/S