private function getMappedGroupPresenter(Project $project)
 {
     $group_mapper_presenters = array();
     $current_mapping = $this->mapper->getCurrentUserGroupMapping($project);
     $all_ugroups = $this->getIndexedUgroups($project);
     foreach (MediawikiUserGroupsMapper::$MEDIAWIKI_MODIFIABLE_GROUP_NAMES as $mw_group_name) {
         $group_mapper_presenters[] = $this->getGroupPresenters($mw_group_name, $current_mapping, $all_ugroups);
     }
     return $group_mapper_presenters;
 }
Exemplo n.º 2
0
 private function seedUGroupMappingFromTemplate(array $ugroup_mapping)
 {
     $template = ProjectManager::instance()->getProject($this->project->getTemplate());
     $mapper = new MediawikiUserGroupsMapper(new MediawikiDao(), new User_ForgeUserGroupPermissionsDao());
     $template_mapping = $mapper->getCurrentUserGroupMapping($template);
     $new_mapping = array();
     foreach ($template_mapping as $mw_group => $tuleap_groups) {
         foreach ($tuleap_groups as $grp) {
             if ($grp < ProjectUGroup::DYNAMIC_UPPER_BOUNDARY) {
                 $new_mapping[$mw_group][] = $grp;
             } elseif (isset($ugroup_mapping[$grp])) {
                 $new_mapping[$mw_group][] = $ugroup_mapping[$grp];
             }
         }
     }
     db_query($this->seedProjectUGroupMappings($this->project->getID(), $new_mapping));
 }