Commit 232d7fd0 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Don't export deleted comments


Signed-off-by: default avatarRichard Mansfield <richardm@catalyst.net.nz>
parent e444f0df
......@@ -76,7 +76,7 @@ class PluginArtefactComment extends PluginArtefact {
if (!$artefacts = get_column_sql("
SELECT artefact
FROM {artefact_comment_comment}
WHERE onview IN (" . join(',', $viewids) . ')', array())) {
WHERE deletedby IS NULL AND onview IN (" . join(',', $viewids) . ')', array())) {
return array();
}
if ($attachments = get_column_sql('
......@@ -92,7 +92,7 @@ class PluginArtefactComment extends PluginArtefact {
if (!$artefacts = get_column_sql("
SELECT artefact
FROM {artefact_comment_comment}
WHERE onartefact IN (" . join(',', $artefactids) . ')', array())) {
WHERE deletedby IS NULL AND onartefact IN (" . join(',', $artefactids) . ')', array())) {
return array();
}
if ($attachments = get_column_sql('
......@@ -535,6 +535,10 @@ class ArtefactTypeComment extends ArtefactType {
),
);
}
public function exportable() {
return empty($this->deletedby);
}
}
/* To make private comments public, both the author and the owner must agree. */
......
......@@ -1075,6 +1075,10 @@ abstract class ArtefactType {
public static function attached_id_list($attachmentid) {
return get_column('artefact_attachment', 'artefact', 'attachment', $attachmentid);
}
public function exportable() {
return true;
}
}
/**
......
......@@ -258,7 +258,9 @@ abstract class PluginExport extends Plugin {
//if (!$this->user->can_view_artefact($artefact)) {
// throw new SystemException("User $userid does not own artefact " . $artefact->get('id'));
//}
$this->artefacts[$artefact->get('id')] = $artefact;
if ($artefact->exportable()) {
$this->artefacts[$artefact->get('id')] = $artefact;
}
}
// Now set up the temporary export directories
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment