Commit 509be6fe authored by Ruslan Kabalin's avatar Ruslan Kabalin Committed by Francois Marier
Browse files

Show group type and user role information notes on group-related pages



The pages affected are "My Groups", "Find Groups" and "View Group".
Signed-off-by: default avatarRuslan Kabalin <ruslan.kabalin@luns.net.uk>
Signed-off-by: default avatarFrancois Marier <francois@catalyst.net.nz>
parent 7c85159f
......@@ -87,9 +87,9 @@ if ($groups['data']) {
$groupids[] = $group->id;
}
$groups['data'] = get_records_sql_assoc(
"SELECT g1.id, g1.name, g1.description, g1.jointype, g1.membershiptype, g1.membercount, COUNT(gmr.member) AS requests
"SELECT g1.id, g1.name, g1.description, g1.jointype, g1.grouptype, g1.role, g1.membershiptype, g1.membercount, COUNT(gmr.member) AS requests
FROM (
SELECT g.id, g.name, g.description, g.jointype, t.membershiptype, COUNT(gm.member) AS membercount
SELECT g.id, g.name, g.description, g.jointype, g.grouptype, gm.role, t.membershiptype, COUNT(gm.member) AS membercount
FROM {group} g
LEFT JOIN {group_member} gm ON (gm.group = g.id)
LEFT JOIN (
......@@ -110,11 +110,11 @@ if ($groups['data']) {
INNER JOIN {group_member_request} gmr ON (gmr.group = g.id AND gmr.member = ?)
) t ON t.id = g.id
WHERE g.id IN (" . implode($groupids, ',') . ')
GROUP BY g.id, g.name, g.description, g.jointype, t.membershiptype
GROUP BY g.id, g.name, g.description, g.jointype, g.grouptype, gm.role, t.membershiptype
ORDER BY g.name
) g1
LEFT JOIN {group_member_request} gmr ON (gmr.group = g1.id)
GROUP BY g1.id, g1.name, g1.description, g1.jointype, g1.membershiptype, g1.membercount',
GROUP BY g1.id, g1.name, g1.description, g1.jointype, g1.grouptype, g1.role, g1.membershiptype, g1.membercount',
array($USER->get('id'), $USER->get('id'), $USER->get('id'), $USER->get('id'))
);
if ($groups['data']) {
......
......@@ -50,6 +50,7 @@ $group->admins = get_column_sql("SELECT member
AND role = 'admin'", array($group->id));
$role = group_user_access($group->id);
$group->role = $role;
if (is_logged_in()) {
$afterjoin = param_variable('next', 'view');
......@@ -77,6 +78,8 @@ if (is_logged_in()) {
}
}
$group->grouptypedescription = get_string('grouptypedescription', 'group', get_string('name', 'grouptype.' . $group->grouptype), get_string('membershiptype.'.$group->jointype, 'group'));
$filecounts = ArtefactTypeFileBase::count_user_files(null, $group->id, null);
// Latest forums posts
......
......@@ -64,11 +64,12 @@ $string['groupalreadyexists'] = 'A Group by this name already exists';
$string['Created'] = 'Created';
$string['groupadmins'] = 'Group admins';
$string['Admin'] = 'Admin';
$string['grouptype'] = 'Group Type';
$string['grouptype'] = 'Group type';
$string['publiclyviewablegroup'] = 'Publicly Viewable Group?';
$string['publiclyviewablegroupdescription'] = 'Allow anyone (including people who aren\'t members of this site) to view this group, including the forums?';
$string['usersautoadded'] = 'Users auto-added?';
$string['usersautoaddeddescription'] = 'Automatically put all new users into this group?';
$string['grouptypedescription'] = '%s > %s';
$string['hasrequestedmembership'] = 'has requested membership of this group';
$string['hasbeeninvitedtojoin'] = 'has been invited to join this group';
......@@ -145,7 +146,9 @@ $string['memberslist'] = 'Members: ';
$string['nogroups'] = 'No groups';
$string['deletespecifiedgroup'] = 'Delete group \'%s\'';
$string['requestjoinspecifiedgroup'] = 'Request to join group \'%s\'';
$string['youaregroupmember'] = 'You are a member of this group';
$string['youaregroupmember'] = 'You are a member of this group';
$string['youaregrouptutor'] = 'You are a tutor in this group';
$string['youaregroupadmin'] = 'You are an admin in this group';
$string['youowngroup'] = 'You own this group';
$string['groupsnotin'] = 'Groups I\'m not in';
$string['allgroups'] = 'All groups';
......
......@@ -773,6 +773,7 @@ function group_prepare_usergroups_for_display($groups, $returnto='mygroups') {
else if ($group->membershiptype == 'invite') {
$group->invite = group_get_accept_form('invite' . $i++, $group->id, $returnto);
}
$group->grouptypedescription = get_string('grouptypedescription', 'group', get_string('name', 'grouptype.' . $group->grouptype), get_string('membershiptype.'.$group->jointype, 'group'));
}
}
......
<h3><a href="{$WWWROOT}group/view.php?id={$group->id|escape}">{$group->name|escape}</a></h3>
<h6>{foreach name=admins from=$group->admins item=id}<a href="{$WWWROOT}user/view.php?id={$id|escape}">{$id|display_name|escape}</a>{if !$.foreach.admins.last}, {/if}{/foreach}</h6>
<div>{str tag="grouptype" section="group"}: {$group->grouptypedescription}</div>
{$group->description}
<div>{str tag="memberslist" section="group"}
{foreach name=members from=$group->members item=member}
......
<ul class="groupuserstatus">
{if $group->membershiptype == 'member'}
<li class="member">{str tag="youaregroupmember" section="group"}</li>
<li class="member">
{str tag="youaregroup$group->role" section="group"}
</li>
{if $group->canleave}
<li><a href = "{$WWWROOT}group/leave.php?id={$group->id|escape}&amp;returnto={$returnto}" class="btn-leavegroup">{str tag="leavegroup" section="group"}</a></li>
{/if}
......
......@@ -3,6 +3,7 @@
<img src="{$WWWROOT}thumb.php?type=profileicon&amp;maxsize=20&amp;id={$id|escape}" alt="">
<a href="{$WWWROOT}user/view.php?id={$id|escape}">{$id|display_name|escape}</a>{if !$.foreach.admins.last}, {/if}
{/foreach}</li>
<li><label>{str tag="grouptype" section="group"}:</label> {$group->grouptypedescription}</li>
<li><label>{str tag=Created section=group}:</label> {$group->ctime}</li>
<li><span><label>{str tag=Members section=group}:</label> {$membercount}&nbsp;</span>
<span><label>{str tag=Views section=view}:</label> {$viewcount}&nbsp;</span>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment