Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
moodle-mod_pdfannotator
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
Show more breadcrumbs
elc
moodle-mod_pdfannotator
Commits
c2d39622
Commit
c2d39622
authored
4 years ago
by
Friederike Schwager
Browse files
Options
Downloads
Patches
Plain Diff
handle private comments on course/recent.php
parent
6417c47d
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
lib.php
+8
-3
8 additions, 3 deletions
lib.php
with
8 additions
and
3 deletions
lib.php
+
8
−
3
View file @
c2d39622
...
...
@@ -562,6 +562,7 @@ function mod_pdfannotator_core_calendar_provide_event_action(calendar_event $eve
*/
function
pdfannotator_get_recent_mod_activity
(
&
$activities
,
&
$index
,
$timestart
,
$courseid
,
$cmid
,
$userid
=
0
,
$groupid
=
0
)
{
global
$CFG
,
$COURSE
,
$USER
,
$DB
;
require_once
(
$CFG
->
dirroot
.
'/mod/pdfannotator/locallib.php'
);
if
(
$COURSE
->
id
==
$courseid
)
{
$course
=
$COURSE
;
}
else
{
...
...
@@ -586,7 +587,7 @@ function pdfannotator_get_recent_mod_activity(&$activities, &$index, $timestart,
$groupselect
=
""
;
}
$allnames
=
get_all_user_name_fields
(
true
,
'u'
);
if
(
!
$posts
=
$DB
->
get_records_sql
(
"SELECT p.*,c.id, c.userid AS
d
userid, c.visibility, c.content, c.timecreated, c.annotationid, c.isquestion,
if
(
!
$posts
=
$DB
->
get_records_sql
(
"SELECT p.*,c.id, c.userid AS userid, c.visibility, c.content, c.timecreated, c.annotationid, c.isquestion,
$allnames
, u.email, u.picture, u.imagealt, u.email, a.page
FROM
{
pdfannotator
}
p
JOIN
{
pdfannotator_annotations
}
a ON a.pdfannotatorid=p.id
...
...
@@ -598,7 +599,11 @@ function pdfannotator_get_recent_mod_activity(&$activities, &$index, $timestart,
return
;
}
$printposts
=
array
();
$context
=
context_course
::
instance
(
$courseid
);
foreach
(
$posts
as
$post
)
{
if
(
!
pdfannotator_can_see_comment
(
$post
,
$context
))
{
continue
;
}
$printposts
[]
=
$post
;
}
if
(
!
$printposts
)
{
...
...
@@ -627,7 +632,7 @@ function pdfannotator_get_recent_mod_activity(&$activities, &$index, $timestart,
// $additionalfields = array('id' => 'userid', 'picture', 'imagealt', 'email');
$additionalfields
=
explode
(
','
,
user_picture
::
fields
());
$tmpactivity
->
user
=
username_load_fields_from_object
(
$tmpactivity
->
user
,
$post
,
null
,
$additionalfields
);
$tmpactivity
->
user
->
id
=
$post
->
d
userid
;
$tmpactivity
->
user
->
id
=
$post
->
userid
;
$activities
[
$index
++
]
=
$tmpactivity
;
}
...
...
@@ -660,7 +665,7 @@ function pdfannotator_print_recent_mod_activity($activity, $courseid, $detail, $
$output
=
html_writer
::
start_tag
(
'table'
,
$tableoptions
);
$output
.
=
html_writer
::
start_tag
(
'tr'
);
$authorhidden
=
(
$activity
->
visible
==
'
public
'
)
?
0
:
1
;
$authorhidden
=
(
$activity
->
visible
==
'
anonymous
'
)
?
1
:
0
;
// Show user picture if author should not be hidden.
$pictureoptions
=
[
...
...
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