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
e32c5c1d
Commit
e32c5c1d
authored
4 years ago
by
hendrik.donath
Browse files
Options
Downloads
Patches
Plain Diff
fixes for Postgresql
parent
aea06172
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
locallib.php
+1
-1
1 addition, 1 deletion
locallib.php
model/statistics.class.php
+14
-14
14 additions, 14 deletions
model/statistics.class.php
version.php
+1
-1
1 addition, 1 deletion
version.php
with
16 additions
and
16 deletions
locallib.php
+
1
−
1
View file @
e32c5c1d
...
...
@@ -516,7 +516,7 @@ function pdfannotator_get_datetime_of_last_modification($annotatorid) {
$timemodified
=
$timemodified
->
timemodified
;
// 2. When was the last time an annotation or a comment was added in the specified annotator?
$sql
=
"SELECT max(a.timecreated)
as '
last_annotation
'
, max(c.timemodified)
as '
last_comment
'
"
$sql
=
"SELECT max(a.timecreated)
AS
last_annotation, max(c.timemodified)
AS
last_comment "
.
"FROM
{
pdfannotator_annotations
}
a LEFT OUTER JOIN
{
pdfannotator_comments
}
c ON a.id = c.annotationid "
.
"WHERE a.pdfannotatorid = ?"
;
$newposts
=
$DB
->
get_records_sql
(
$sql
,
array
(
$annotatorid
));
...
...
This diff is collapsed.
Click to expand it.
model/statistics.class.php
+
14
−
14
View file @
e32c5c1d
...
...
@@ -66,8 +66,8 @@ class pdfannotator_statistics {
*/
public
function
get_comments_course
(
$isquestion
,
$user
=
false
)
{
global
$DB
;
$sql
=
'
SELECT COUNT(*) FROM {pdfannotator_comments} c JOIN {pdfannotator} a ON
'
.
'
a.course = ? AND a.id = c.pdfannotatorid WHERE c.isquestion = ? AND c.isdeleted = ?
'
;
$sql
=
"
SELECT COUNT(*) FROM
{
pdfannotator_comments
}
c JOIN
{
pdfannotator
}
a ON
"
.
"
a.course = ? AND a.id = c.pdfannotatorid WHERE c.isquestion = ? AND c.isdeleted = ?
"
;
if
(
$user
)
{
$sql
.
=
" AND c.userid = ?"
;
}
...
...
@@ -238,10 +238,10 @@ class pdfannotator_statistics {
$count
=
$DB
->
count_records
(
'pdfannotator_comments'
,
$params
);
}
else
{
// Count answers to private questions if they were saved as public in the database.
$sql
=
'
SELECT COUNT(*) FROM {pdfannotator_comments} answers
'
.
'
JOIN {pdfannotator_comments} questions
'
.
'
ON answers.annotationid = questions.annotationid
'
.
'
WHERE questions.visibility =
"
private
"
AND answers.visibility =
"
public
"
AND questions.pdfannotatorid = ? AND answers.isdeleted = ?
'
;
$sql
=
"
SELECT COUNT(*) FROM
{
pdfannotator_comments
}
answers
"
.
"
JOIN
{
pdfannotator_comments
}
questions
"
.
"
ON answers.annotationid = questions.annotationid
"
.
"
WHERE questions.visibility =
'
private
'
AND answers.visibility =
'
public
'
AND questions.pdfannotatorid = ? AND answers.isdeleted = ?
"
;
$params
=
[
$annotatorid
,
"0"
];
if
(
$userid
)
{
$sql
.
=
' AND answers.userid = ? AND questions.userid = ?'
;
...
...
@@ -262,10 +262,10 @@ class pdfannotator_statistics {
$count
=
$DB
->
count_records
(
'pdfannotator_comments'
,
$params
);
}
else
{
// Count answers to private questions if they were saved as public in the database.
$sql
=
'
SELECT COUNT(*) FROM {pdfannotator_comments} answers
'
.
'
JOIN {pdfannotator_comments} questions
'
.
'
ON answers.annotationid = questions.annotationid
'
.
'
WHERE questions.visibility =
"
protected
"
AND answers.visibility =
"
public
"
AND questions.pdfannotatorid = ? AND answers.isdeleted = ?
'
;
$sql
=
"
SELECT COUNT(*) FROM
{
pdfannotator_comments
}
answers
"
.
"
JOIN
{
pdfannotator_comments
}
questions
"
.
"
ON answers.annotationid = questions.annotationid
"
.
"
WHERE questions.visibility =
'
protected
'
AND answers.visibility =
'
public
'
AND questions.pdfannotatorid = ? AND answers.isdeleted = ?
"
;
$params
=
[
$annotatorid
,
"0"
];
if
(
$userid
)
{
$sql
.
=
' AND answers.userid = ? AND questions.userid = ?'
;
...
...
@@ -279,15 +279,15 @@ class pdfannotator_statistics {
public
function
count_private_comments_in_course
()
{
global
$DB
;
$sql
=
'
SELECT COUNT(*) FROM {pdfannotator_comments} c JOIN {pdfannotator} a ON
'
.
'
a.course = ? AND a.id = c.pdfannotatorid WHERE c.visibility = ? AND c.isdeleted = ?
'
;
$sql
=
"
SELECT COUNT(*) FROM
{
pdfannotator_comments
}
c JOIN
{
pdfannotator
}
a ON
"
.
"
a.course = ? AND a.id = c.pdfannotatorid WHERE c.visibility = ? AND c.isdeleted = ?
"
;
return
$DB
->
count_records_sql
(
$sql
,
array
(
$this
->
courseid
,
"private"
,
'0'
));
}
public
function
count_protected_comments_in_course
()
{
global
$DB
;
$sql
=
'
SELECT COUNT(*) FROM {pdfannotator_comments} c JOIN {pdfannotator} a ON
'
.
'
a.course = ? AND a.id = c.pdfannotatorid WHERE c.visibility = ? AND c.isdeleted = ?
'
;
$sql
=
"
SELECT COUNT(*) FROM
{
pdfannotator_comments
}
c JOIN
{
pdfannotator
}
a ON
"
.
"
a.course = ? AND a.id = c.pdfannotatorid WHERE c.visibility = ? AND c.isdeleted = ?
"
;
return
$DB
->
count_records_sql
(
$sql
,
array
(
$this
->
courseid
,
"protected"
,
'0'
));
}
...
...
This diff is collapsed.
Click to expand it.
version.php
+
1
−
1
View file @
e32c5c1d
...
...
@@ -25,7 +25,7 @@
defined
(
'MOODLE_INTERNAL'
)
||
die
();
$plugin
->
component
=
'mod_pdfannotator'
;
$plugin
->
version
=
20210
601
00
;
$plugin
->
version
=
20210
716
00
;
$plugin
->
release
=
'PDF Annotator v1.4 release 7'
;
$plugin
->
requires
=
2016112900
;
$plugin
->
maturity
=
MATURITY_STABLE
;
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