Commit 2da0385c authored by Chris Graham's avatar Chris Graham
Browse files

Fixed MANTIS-4353 (Tidy up clubs feature)

parent ae82b550
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -91,16 +91,18 @@ When a usergroup application is made a notification is dispatched to the leader

[title="3"]Clubs[/title]

The [concept]Conversr[/concept] system provides a clubs feature (Content Management > Clubs). Clubs are special usergroups:
 - that can not have special permissions (they are not shown in permission editing interfaces)
 - that may be joined and left like ordinary usergroups (via secondary usergroup membership)
 - that come with their own forum (privileges to this are automatically assigned when the club and forum are created and cannot be revoked through the Composr permission editing interfaces)
 - may be added by ordinary members
The [concept]Conversr[/concept] system provides a clubs feature (Content Management > Clubs). Clubs are a feature written around usergroups. Clubs:
 - can not have special permissions (they are not shown in permission editing interfaces)
 - may be joined and left like ordinary usergroups (via secondary usergroup membership)
 - come with their own forum with the same name as the club (privileges to this are automatically assigned when the club and forum are created and cannot be revoked through the Composr permission editing interfaces)
 - may be added by ordinary members, depending on how you have configured permissions
Clubs are provided so that members may create their own subcommunities on the website. They are not given any special permissions so as to not overcomplicate the regular permission configuration process (as potentially you might have hundreds or even thousands of clubs).

The club forum has default permissions that only allow website staff and club members into it. The club functionality provides no special moderation controls -- so by default the forum would need to be moderated by the website staff, rather than self-moderated. As it is a regular forum, additional permission changes can be achieved manually (for example, creating a new usergroup for the club's management and assigning moderator permissions over the forum to members of that).

The parent forum and forum grouping for new club forums is configurable.

You can only add a club from the Clubs module. However, once added it can be edited as a usergroup by website staff and converted to a normal usergroup by removing the special "Private club" setting you see when editing it (this is a one-way operation and removes any special club behaviour).
[/surround]

[title="2"]Zones[/title]
+4 −10
Original line number Diff line number Diff line
@@ -658,25 +658,19 @@ class Module_groups
        }

        $edit_url = new Tempcode();
        if (has_actual_page_access(get_member(), 'admin_cns_groups', get_module_zone('admin_cns_groups'))) {
        if ((!$club) && (has_actual_page_access(get_member(), 'admin_cns_groups', get_module_zone('admin_cns_groups')))) {
            $edit_url = build_url(array('page' => 'admin_cns_groups', 'type' => '_edit', 'id' => $id), get_module_zone('admin_cns_groups'));
        } elseif (has_actual_page_access(get_member(), 'cms_cns_groups', get_module_zone('cms_cns_groups'))) {
            if (cns_may_control_group($id, get_member(), $group)) {
        } elseif (($club) && (has_actual_page_access(get_member(), 'cms_cns_groups', get_module_zone('cms_cns_groups'))) && (cns_may_control_group($id, get_member(), $group))) {
            $edit_url = build_url(array('page' => 'cms_cns_groups', 'type' => '_edit', 'id' => $id), get_module_zone('cms_cns_groups'));
        }
        }

        $club_forum = null;
        if ($group['g_is_private_club'] == 1) {
            $club_forum = $GLOBALS['FORUM_DB']->query_select_value_if_there('f_forums', 'id', array($GLOBALS['FORUM_DB']->translate_field_ref('f_description') => do_lang('FORUM_FOR_CLUB', $group_name)));
        }

        require_javascript('ajax');
        require_javascript('ajax_people_lists');

        $forum_id = null;
        if ($club) {
            $forum_id = $GLOBALS['FORUM_DB']->query_select_value_if_there('f_forums', 'id', array('f_name' => $group_name, 'f_forum_grouping_id' => intval(get_option('club_forum_parent_forum_grouping')), 'f_parent_forum' => intval(get_option('club_forum_parent_forum'))));
            $forum_where = array('f_name' => $group_name, 'f_forum_grouping_id' => intval(get_option('club_forum_parent_forum_grouping')), 'f_parent_forum' => intval(get_option('club_forum_parent_forum')));
            $forum_id = $GLOBALS['FORUM_DB']->query_select_value_if_there('f_forums', 'id', $forum_where);
        }

        $tpl = do_template('CNS_VIEW_GROUP_SCREEN', array(
+5 −4
Original line number Diff line number Diff line
@@ -408,13 +408,14 @@ class Hook_profiles_tabs_about
                    $club_row = $club_rows[$club_id];
                }

                $club_name = get_translated_text($club_row['g_name'], $GLOBALS['FORUM_DB']);
                $club_forum = $GLOBALS['FORUM_DB']->query_select_value_if_there('f_forums', 'id', array($GLOBALS['FORUM_DB']->translate_field_ref('f_description') => do_lang('FORUM_FOR_CLUB', $club_name)));
                $group_name = get_translated_text($club_row['g_name'], $GLOBALS['FORUM_DB']);
                $forum_where = array('f_name' => $group_name, 'f_forum_grouping_id' => intval(get_option('club_forum_parent_forum_grouping')), 'f_parent_forum' => intval(get_option('club_forum_parent_forum')));
                $forum_id = $GLOBALS['FORUM_DB']->query_select_value_if_there('f_forums', 'id', $forum_where);

                $clubs[] = array(
                    'CLUB_NAME' => $club_name,
                    'CLUB_NAME' => $group_name,
                    'CLUB_ID' => strval($club_row['id']),
                    'CLUB_FORUM' => is_null($club_forum) ? '' : strval($club_forum),
                    'CLUB_FORUM' => is_null($forum_id) ? '' : strval($forum_id),
                );
            }
        }