Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
mahara
mahara
Commits
44b91057
Commit
44b91057
authored
Dec 13, 2019
by
Robert Lyon
Committed by
Gerrit Code Review
Dec 13, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge "Bug 1845133: "Delete" button visible on timeline for comments"
parents
5ecf5336
9a009bb1
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
+6
-3
htdocs/artefact/comment/blocktype/comment/lib.php
htdocs/artefact/comment/blocktype/comment/lib.php
+2
-1
htdocs/artefact/comment/lib.php
htdocs/artefact/comment/lib.php
+4
-2
No files found.
htdocs/artefact/comment/blocktype/comment/lib.php
View file @
44b91057
...
...
@@ -74,7 +74,7 @@ class PluginBlocktypeComment extends MaharaCoreBlocktype {
}
// If the view has comments turned off, tutors can still leave
// comments if the view is submitted to their group.
if
(
!
empty
(
$releaseform
)
||
(
$view
->
user_comments_allowed
(
$USER
)))
{
if
(
(
!
empty
(
$releaseform
)
||
(
$view
->
user_comments_allowed
(
$USER
)))
&&
!
$versioning
)
{
$addfeedbackpopup
=
true
;
}
safe_require
(
'artefact'
,
'comment'
);
...
...
@@ -82,6 +82,7 @@ class PluginBlocktypeComment extends MaharaCoreBlocktype {
$commentoptions
->
limit
=
$limit
;
$commentoptions
->
offset
=
$offset
;
$commentoptions
->
showcomment
=
$showcomment
;
$commentoptions
->
versioning
=
$versioning
;
$commentoptions
->
view
=
$instance
->
get_view
();
$feedback
=
ArtefactTypeComment
::
get_comments
(
$commentoptions
);
$smarty
=
smarty_core
();
...
...
htdocs/artefact/comment/lib.php
View file @
44b91057
...
...
@@ -356,6 +356,7 @@ class ArtefactTypeComment extends ArtefactType {
$options
->
sort
=
(
!
empty
(
$sortorder
))
?
$sortorder
:
'earliest'
;
$options
->
threaded
=
null
;
$options
->
blockid
=
null
;
$options
->
versioning
=
false
;
return
$options
;
}
...
...
@@ -418,6 +419,7 @@ class ArtefactTypeComment extends ArtefactType {
'sort'
=>
$sort
,
'threaded'
=>
$threaded
,
'data'
=>
array
(),
'versioning'
=>
$versioning
,
);
$where
=
'c.hidden = 0'
;
...
...
@@ -785,7 +787,7 @@ class ArtefactTypeComment extends ArtefactType {
$is_export_preview
=
param_integer
(
'export'
,
0
);
// Comment authors can edit recent comments if they're private or if no one has replied yet.
if
(
!
$item
->
deletedby
&&
$item
->
isauthor
&&
!
$is_export_preview
if
(
!
$item
->
deletedby
&&
$item
->
isauthor
&&
!
$is_export_preview
&&
!
$data
->
versioning
&&
(
$item
->
private
||
$item
->
id
==
$lastcomment
->
id
)
&&
$item
->
ts
>
$editableafter
)
{
$item
->
canedit
=
1
;
}
...
...
@@ -796,7 +798,7 @@ class ArtefactTypeComment extends ArtefactType {
if
(
$item
->
deletedby
)
{
$item
->
deletedmessage
=
$deletedmessage
[
$item
->
deletedby
];
}
else
if
((
$candelete
||
$item
->
isauthor
)
&&
!
$is_export_preview
)
{
else
if
((
$candelete
||
$item
->
isauthor
)
&&
!
$is_export_preview
&&
!
$data
->
versioning
)
{
$check
=
get_record_sql
(
'SELECT v.* FROM {view} v WHERE v.id = ?'
,
array
(
$data
->
view
),
ERROR_MULTIPLE
);
if
(
$check
->
submittedstatus
==
View
::
UNSUBMITTED
||
...
...
Write
Preview
Markdown
is supported
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