Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mahara
mahara
Commits
dd94611b
Commit
dd94611b
authored
Jul 14, 2008
by
Richard Mansfield
Browse files
Show user roles on group members tab
parent
86a0b2f9
Changes
4
Hide whitespace changes
Inline
Side-by-side
htdocs/group/members.php
View file @
dd94611b
...
...
@@ -38,11 +38,6 @@ if (!$group = get_record('group', 'id', $id, 'deleted', 0)) {
}
define
(
'TITLE'
,
$group
->
name
.
' - '
.
get_string
(
'Members'
,
'group'
));
$group
->
admins
=
get_column_sql
(
"SELECT member
FROM
{
group_member
}
WHERE
\"
group
\"
= ?
AND role = 'admin'"
,
array
(
$id
));
$role
=
group_user_access
(
$id
);
// Search related stuff for member pager
...
...
htdocs/lib/group.php
View file @
dd94611b
...
...
@@ -413,6 +413,16 @@ function group_invite_submit(Pieform $form, $values) {
}
}
function
group_get_role_info
(
$groupid
)
{
$roles
=
get_records_sql_assoc
(
'SELECT role, edit_views, see_submitted_views, gr.grouptype FROM {grouptype_roles} gr
INNER JOIN {group} g ON g.grouptype = gr.grouptype
WHERE g.id = ?'
,
array
(
$groupid
));
foreach
(
$roles
as
$role
)
{
$role
->
display
=
get_string
(
$role
->
role
,
'grouptype.'
.
$role
->
grouptype
);
}
return
$roles
;
}
function
group_get_membersearch_data
(
$group
,
$query
,
$offset
,
$limit
)
{
$results
=
get_group_user_search_results
(
$group
,
$query
,
$offset
,
$limit
);
...
...
@@ -422,7 +432,7 @@ function group_get_membersearch_data($group, $query, $offset, $limit) {
}
$params
[]
=
'limit='
.
$limit
;
$searchurl
=
get_config
(
'wwwroot'
)
.
'group/view.php?'
.
join
(
'&'
,
$params
);
$results
[
'roles'
]
=
group_get_role_info
(
$group
);
$smarty
=
smarty_core
();
$smarty
->
assign_by_ref
(
'results'
,
$results
);
$smarty
->
assign
(
'searchurl'
,
$searchurl
);
...
...
htdocs/search/internal/lib.php
View file @
dd94611b
...
...
@@ -424,11 +424,12 @@ class PluginSearchInternal extends PluginSearch {
if
(
$count
>
0
)
{
$data
=
get_records_sql_assoc
(
'
SELECT
u.id, u.firstname, u.lastname, u.username, u.email, u.staff, '
.
db_format_tsfield
(
'gm.ctime'
,
'jointime'
)
.
'
u.id, u.firstname, u.lastname, u.username, u.email, u.staff, '
.
db_format_tsfield
(
'gm.ctime'
,
'jointime'
)
.
',
gm.role
FROM
{usr} u
INNER JOIN {group_member} gm ON (gm.member = u.id) '
.
$where
.
'
ORDER BY gm.ctime, u.firstname, u.lastname, u.id'
,
ORDER BY
gm.role = \'admin\' DESC,
gm.ctime, u.firstname, u.lastname, u.id'
,
$values
,
$offset
,
$limit
);
...
...
htdocs/theme/default/templates/group/membersearchresults.tpl
View file @
dd94611b
...
...
@@ -2,10 +2,11 @@
{
foreach
from
=
$results.data
item
=
r
}
<tr
class=
"
{
cycle
values
=
"r0,r1"
}
"
>
<td>
<h4><a
href=
"
{
$WWWROOT
}
user/view.php?id=
{
$r.id
|
escape
}
"
>
{
$r.name
|
escape
}
</a></h4>
<div
class=
"fl"
><img
src=
"
{
$WWWROOT
}
thumb.php?type=profileicon&maxsize=40&id=
{
$r.id
|
escape
}
"
alt=
""
></div>
<p><strong>
Joined:
</strong>
{
$r.jointime
}
</p>
<p>
{
$r.introduction
|
str_shorten
:
80
:
true
}
</p>
<h4><a
href=
"
{
$WWWROOT
}
user/view.php?id=
{
$r.id
|
escape
}
"
>
{
$r.name
|
escape
}
</a></h4>
<p>
{
$results.roles
[
$r.role
]->
display
}
</p>
<p><strong>
Joined:
</strong>
{
$r.jointime
}
</p>
<p>
{
$r.introduction
|
str_shorten
:
80
:
true
}
</p>
</td>
</tr>
{/
foreach
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment