Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
moodle-block_course_overview_campus
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
elc
moodle-block_course_overview_campus
Commits
ad3ae0f4
Commit
ad3ae0f4
authored
8 years ago
by
Davo Smith
Browse files
Options
Downloads
Patches
Plain Diff
UU-193 fix debug message about duplicate records
parent
ee4bf2ef
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
block_course_overview_campus.php
+17
-7
17 additions, 7 deletions
block_course_overview_campus.php
with
17 additions
and
7 deletions
block_course_overview_campus.php
+
17
−
7
View file @
ad3ae0f4
...
...
@@ -469,8 +469,10 @@ class block_course_overview_campus extends block_base {
// Get all user name fields for SQL query in a proper way
$allnames
=
get_all_user_name_fields
(
true
,
'u'
);
$teacherfields
=
'ra.id AS raid, u.id, '
.
$allnames
.
', r.sortorder'
;
// Check if we have to check for suspended teachers
$extrawhere
=
''
;
if
(
$coc_config
->
teacherroleshidesuspended
==
1
)
{
// Build extra where clause for SQL query
$now
=
round
(
time
(),
-
2
);
// improves db caching
...
...
@@ -482,35 +484,43 @@ class block_course_overview_campus extends block_base {
if
(
$coc_config
->
teacherrolesparent
==
1
)
{
// If we have to check for suspended teachers
if
(
$coc_config
->
teacherroleshidesuspended
==
1
)
{
$courseteachers
=
get_role_users
(
$teacherroles
,
$context
,
true
,
'ra.id, u.id, '
.
$allnames
.
', r.sortorder'
,
'u.lastname, u.firstname'
,
false
,
''
,
''
,
''
,
$extrawhere
);
$courseteachers
=
get_role_users
(
$teacherroles
,
$context
,
true
,
$teacherfields
,
'u.lastname, u.firstname'
,
false
,
''
,
''
,
''
,
$extrawhere
);
}
else
{
$courseteachers
=
get_role_users
(
$teacherroles
,
$context
,
true
,
'ra.id, u.id, '
.
$allnames
.
', r.sortorder'
,
'u.lastname, u.firstname'
);
$courseteachers
=
get_role_users
(
$teacherroles
,
$context
,
true
,
$teacherfields
,
'u.lastname, u.firstname'
);
}
}
// If no
else
if
(
$coc_config
->
teacherrolesparent
==
2
)
{
// If we have to check for suspended teachers
if
(
$coc_config
->
teacherroleshidesuspended
==
1
)
{
$courseteachers
=
get_role_users
(
$teacherroles
,
$context
,
false
,
'ra.id, u.id, '
.
$allnames
.
', r.sortorder'
,
'u.lastname, u.firstname'
,
false
,
''
,
''
,
''
,
$extrawhere
);
$courseteachers
=
get_role_users
(
$teacherroles
,
$context
,
false
,
$teacherfields
,
'u.lastname, u.firstname'
,
false
,
''
,
''
,
''
,
$extrawhere
);
}
else
{
$courseteachers
=
get_role_users
(
$teacherroles
,
$context
,
false
,
'ra.id, u.id, '
.
$allnames
.
', r.sortorder'
,
'u.lastname, u.firstname'
);
$courseteachers
=
get_role_users
(
$teacherroles
,
$context
,
false
,
$teacherfields
,
'u.lastname, u.firstname'
);
}
}
// If depending on moodle/course:reviewotherusers capability
else
if
(
$coc_config
->
teacherrolesparent
==
3
)
{
// If we have to check for suspended teachers
$reviewothers
=
has_capability
(
'moodle/course:reviewotherusers'
,
$context
);
if
(
$coc_config
->
teacherroleshidesuspended
==
1
)
{
$courseteachers
=
get_role_users
(
$teacherroles
,
$context
,
has_capability
(
'moodle/course:reviewotherusers'
,
$context
),
'ra.id, u.id, '
.
$allnames
.
', r.sortorder'
,
'u.lastname, u.firstname'
,
false
,
''
,
''
,
''
,
$extrawhere
);
$courseteachers
=
get_role_users
(
$teacherroles
,
$context
,
$reviewothers
,
$teacherfields
,
'u.lastname, u.firstname'
,
false
,
''
,
''
,
''
,
$extrawhere
);
}
else
{
$courseteachers
=
get_role_users
(
$teacherroles
,
$context
,
has_capability
(
'moodle/course:reviewotherusers'
,
$context
),
'ra.id, u.id, '
.
$allnames
.
', r.sortorder'
,
'u.lastname, u.firstname'
);
$courseteachers
=
get_role_users
(
$teacherroles
,
$context
,
$reviewothers
,
$teacherfields
,
'u.lastname, u.firstname'
);
}
}
// Should not happen
else
{
$courseteachers
=
get_role_users
(
$teacherroles
,
$context
,
true
,
'ra.id, u.id, '
.
$allnames
.
', r.sortorder'
,
'u.lastname, u.firstname'
);
$courseteachers
=
get_role_users
(
$teacherroles
,
$context
,
true
,
$teacherfields
,
'u.lastname, u.firstname'
);
}
}
else
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment