diff --git a/backup/moodle2/backup_pdfannotator_stepslib.php b/backup/moodle2/backup_pdfannotator_stepslib.php
index 4877b395cffabe85cf24426e5d30780ece4b9187..0ae3352bedf3a00ddbdb9ccc19986df8b46055d5 100644
--- a/backup/moodle2/backup_pdfannotator_stepslib.php
+++ b/backup/moodle2/backup_pdfannotator_stepslib.php
@@ -62,10 +62,6 @@ class backup_pdfannotator_activity_structure_step extends backup_activity_struct
$subscriptions = new backup_nested_element('subscriptions');
$subscription = new backup_nested_element('subscription', array('id'), array('userid'));
- $commentsarchive = new backup_nested_element('commentsarchive');
- $ca = array('pdfannotatorid', 'userid', 'content', 'timecreated', 'timemodified', 'modifiedby', 'visibility', 'isquestion', 'isdeleted', 'seen');
- $commentarchive = new backup_nested_element('commentarchive', array('id'), $ca);
-
$comments = new backup_nested_element('comments');
$c = array('pdfannotatorid', 'userid', 'content', 'timecreated', 'timemodified', 'modifiedby', 'visibility', 'isquestion', 'isdeleted', 'seen');
$comment = new backup_nested_element('comment', array('id'), $c);
@@ -83,9 +79,6 @@ class backup_pdfannotator_activity_structure_step extends backup_activity_struct
$annotation->add_child($subscriptions);
$subscriptions->add_child($subscription);
- $annotation->add_child($commentsarchive);
- $commentsarchive->add_child($commentarchive);
-
$annotation->add_child($comments);
$comments->add_child($comment);
@@ -107,9 +100,6 @@ class backup_pdfannotator_activity_structure_step extends backup_activity_struct
// Add any subscriptions to this annotation.
$subscription->set_source_table('pdfannotator_subscriptions', array('annotationid' => backup::VAR_PARENTID));
- // Add any archived comments on the annotation.
- $commentarchive->set_source_table('pdfannotator_commentsarchive', array('annotationid' => backup::VAR_PARENTID));
-
// Add any comments of this annotation.
$comment->set_source_table('pdfannotator_comments', array('annotationid' => backup::VAR_PARENTID));
@@ -124,8 +114,6 @@ class backup_pdfannotator_activity_structure_step extends backup_activity_struct
// 5. Define id annotations (some attributes are foreign keys).
$annotation->annotate_ids('user', 'userid');
$subscription->annotate_ids('user', 'userid');
- $commentarchive->annotate_ids('user', 'userid');
- $commentarchive->annotate_ids('pdfannotator', 'pdfannotatorid');
$comment->annotate_ids('user', 'userid');
$comment->annotate_ids('pdfannotator', 'pdfannotatorid');
$vote->annotate_ids('user', 'userid');
diff --git a/backup/moodle2/restore_pdfannotator_stepslib.php b/backup/moodle2/restore_pdfannotator_stepslib.php
index 492a126b647ba0332d5d042555043bb69948dc89..45fcdabbd61d00be525a1cde5006b1f8f93619ba 100644
--- a/backup/moodle2/restore_pdfannotator_stepslib.php
+++ b/backup/moodle2/restore_pdfannotator_stepslib.php
@@ -50,7 +50,6 @@ class restore_pdfannotator_activity_structure_step extends restore_activity_stru
$paths[] = new restore_path_element('pdfannotator_annotation', '/activity/pdfannotator/annotations/annotation');
$paths[] = new restore_path_element('pdfannotator_subscription', '/activity/pdfannotator/annotations/annotation/subscriptions/subscription');
- $paths[] = new restore_path_element('pdfannotator_commentarchive', '/activity/pdfannotator/annotations/annotation/commentsarchive/commentarchive');
$paths[] = new restore_path_element('pdfannotator_comment', '/activity/pdfannotator/annotations/annotation/comments/comment');
$paths[] = new restore_path_element('pdfannotator_vote', '/activity/pdfannotator/annotations/annotation/comments/comment/votes/vote');
@@ -108,25 +107,6 @@ class restore_pdfannotator_activity_structure_step extends restore_activity_stru
}
- protected function process_pdfannotator_commentarchive($data) {
- global $DB;
-
- $data = (object)$data;
- $oldid = $data->id;
-
- $data->annotationid = $this->get_new_parentid('pdfannotator_annotation');
- $data->userid = $this->get_mappingid('user', $data->userid);
-
- $data->timecreated = $this->apply_date_offset($data->timecreated);
- $data->timemodified = $this->apply_date_offset($data->timemodified);
-
- $data->pdfannotatorid = $this->get_mappingid('pdfannotator', $data->pdfannotatorid);
-
- $newitemid = $DB->insert_record('pdfannotator_commentsarchive', $data);
- $this->set_mapping('pdfannotator_commentarchive', $oldid, $newitemid);
- }
-
-
protected function process_pdfannotator_comment($data) {
global $DB;
diff --git a/classes/privacy/provider.php b/classes/privacy/provider.php
index 4b49e1029f5847ca7a9e8aff9b435ea032293d15..0052c5e20684ca971cbf1affca70728bcdb514db 100644
--- a/classes/privacy/provider.php
+++ b/classes/privacy/provider.php
@@ -76,15 +76,7 @@ class provider implements \core_privacy\local\metadata\provider, \core_privacy\l
'content' => 'privacy:metadata:pdfannotator_comments:content',
], 'privacy:metadata:pdfannotator_comments'
);
- // 2.3 Comments which were reported and subsequently deleted are archived/stored.
- $collection->add_database_table(
- 'pdfannotator_commentsarchive', [
- 'userid' => 'privacy:metadata:pdfannotator_comments:userid',
- 'annotationid' => 'privacy:metadata:pdfannotator_comments:annotationid',
- 'content' => 'privacy:metadata:pdfannotator_comments:content',
- ], 'privacy:metadata:pdfannotator_commentsarchive'
- );
- // 2.4 Users can report other users' comments as inappropriate. These reports stored.
+ // 2.3 Users can report other users' comments as inappropriate. These reports stored.
$collection->add_database_table(
'pdfannotator_reports', [
'commentid' => 'privacy:metadata:pdfannotator_reports:commentid',
@@ -92,14 +84,14 @@ class provider implements \core_privacy\local\metadata\provider, \core_privacy\l
'userid' => 'privacy:metadata:pdfannotator_reports:userid',
], 'privacy:metadata:pdfannotator_reports'
);
- // 2.5 A user's subscriptions are stored.
+ // 2.4 A user's subscriptions are stored.
$collection->add_database_table(
'pdfannotator_subscriptions', [
'annotationid' => 'privacy:metadata:pdfannotator_subscriptions:annotationid',
'userid' => 'privacy:metadata:pdfannotator_subscriptions:userid',
], 'privacy:metadata:pdfannotator_subscriptions'
);
- // 2.6 Votes are stored.
+ // 2.5 Votes are stored.
$collection->add_database_table(
'pdfannotator_votes', [
'commentid' => 'privacy:metadata:pdfannotator_votes:commentid',
@@ -130,7 +122,6 @@ class provider implements \core_privacy\local\metadata\provider, \core_privacy\l
'userid1' => $userid,
'userid2' => $userid,
'userid3' => $userid,
- 'userid4' => $userid,
'userid5' => $userid,
'userid6' => $userid,
];
@@ -143,14 +134,12 @@ class provider implements \core_privacy\local\metadata\provider, \core_privacy\l
LEFT JOIN {pdfannotator_annotations} a ON a.pdfannotatorid = p.id
LEFT JOIN {pdfannotator_subscriptions} s ON s.annotationid = a.id
LEFT JOIN {pdfannotator_comments} k ON k.annotationid = a.id
- LEFT JOIN {pdfannotator_commentsarchive} ka ON ka.annotationid = a.id
LEFT JOIN {pdfannotator_reports} r ON r.commentid = k.id
LEFT JOIN {pdfannotator_votes} v ON v.commentid = k.id
WHERE (
a.userid = :userid1 OR
s.userid = :userid2 OR
k.userid = :userid3 OR
- ka.userid = :userid4 OR
r.userid = :userid5 OR
v.userid = :userid6
)
@@ -245,11 +234,6 @@ class provider implements \core_privacy\local\metadata\provider, \core_privacy\l
// WHERE v.userid = :userid AND a.pdfannotatorid = :pdfannotator";
$myvotes = $DB->get_records_sql($sql4, array('userid' => $userid, 'pdfannotator' => $pdfannotator->id));
- // Get all archived comments by this user
- // $sql5 = "SELECT c.*
- // FROM {pdfannotator_commentsarchive} c JOIN {pdfannotator_annotations} a ON c.annotationid = a.id
- // WHERE AND c.userid = :userid AND c.pdfannotatorid = :pdfannotator";
- // $myarchive = $DB->get_records_sql($sql5, array('userid' => $userid, 'pdfannotator' => $pdfannotator->id));
// Get all reports this user wrote.
$sql6 = "SELECT r.message
FROM {pdfannotator_reports} r JOIN {pdfannotator_comments} c ON c.id = r.commentid
@@ -272,7 +256,6 @@ class provider implements \core_privacy\local\metadata\provider, \core_privacy\l
$pdfannotator->myvotes = $myvotes;
$pdfannotator->myreportmessages = $myreportmessages;
$pdfannotator->mydrawingsandtextboxes = $mydrawingsandtextboxes;
- // $pdfannotator->myarchive = $myarchive;
writer::with_context($context)->export_data([], $pdfannotator);
}
@@ -335,17 +318,6 @@ class provider implements \core_privacy\local\metadata\provider, \core_privacy\l
// }
}
- // 5. Select the ID and isquestion attributes of every archived comment this user made in this annotator
- // $sql = "SELECT c.id, c.isquestion FROM {pdfannotator_commentsarchive} c "
- // . "WHERE c.annotationid IN (SELECT a.id FROM {pdfannotator_annotations} a WHERE a.pdfannotatorid = ?)";
- // $archivedcomments = $DB->get_records_sql($sql, array($instanceid));
- // foreach($archivedcomments as $archivedcomment) {
- // if ($archivedcomment->isquestion === 1) { // delete question comments, their underlying annotation as well as all answers and subscriptions
- // annotation::delete($archivedcomment->annotationid, null, true);
- // } else { // empty all other comments
- // $DB->update_record('pdfannotator_commentsarchive', array("id" => $archivedcomment->id, "userid" => -1, "content" => "", "isdeleted" => 1), $bulk=false);
- // }
- // }
// 6. Select the IDs of all annotations that were made by this user in this annotator. Then call the function to delete the annotation and any adjacent comments.
$annotations = $DB->get_fieldset_select('pdfannotator_annotations', 'id', "pdfannotatorid = ?", array($instanceid));
foreach ($annotations as $annotationid) {
@@ -412,17 +384,6 @@ class provider implements \core_privacy\local\metadata\provider, \core_privacy\l
self::empty_or_delete_comment($comment);
}
- // 5. Select the ID and isquestion attributes of every archived comment this user made in this annotator.
- $sql = "SELECT c.id, c.isquestion FROM {pdfannotator_commentsarchive} c WHERE c.annotationid IN "
- . "(SELECT a.id FROM {pdfannotator_annotations} a WHERE a.pdfannotatorid = ?) AND c.userid = ?";
- // $archivedcomments = $DB->get_records_sql($sql, array($instanceid, $userid));
- // foreach($archivedcomments as $archivedcomment) {
- // if ($archivedcomment->isquestion === 1) { // Delete question comments, their underlying annotation as well as all answers and subscriptions.
- // annotation::delete($archivedcomment->annotationid, null, true);
- // } else { // Empty all other comments.
- // $DB->update_record('pdfannotator_commentsarchive', array("id" => $archivedcomment->id, "userid" => -1, "content" => "", "isdeleted" => 1), $bulk=false);
- // }
- // }
// 6. Select the IDs of all annotations that were made by this user in this annotator. Then call the function to delete the annotation and any adjacent comments.
$annotations = $DB->get_fieldset_select('pdfannotator_annotations', 'id', "pdfannotatorid = ? AND userid = ?", array($instanceid, $userid));
foreach ($annotations as $annotationid) {
@@ -436,8 +397,7 @@ class provider implements \core_privacy\local\metadata\provider, \core_privacy\l
// Status quo:
// Deleting the initial or final comment of a 'thread' will remove it from the comments table.
// Deleting any other comment will merely set the field isdeleted of the comments table to 1, so that the comment will be displayed as deleted within the 'thread'.
- // When a reported comment is deleted, a copy is saved in the archive table (but no longer visible to users).
- // The archive tables field isdeleted should be set to 1 per default (is currently 0).
+
/**
* Function deletes an annotation and all comments and subscriptions attached to it.
*
@@ -457,14 +417,9 @@ class provider implements \core_privacy\local\metadata\provider, \core_privacy\l
// 1.2 Delete any votes for these comments.
$DB->delete_records('pdfannotator_votes', array("commentid" => $comment->id));
- // 1.3 Insert reported comments into the archive, unless they're already there.
- if ($comment->isdeleted == 0 && $DB->record_exists('pdfannotator_reports', ['commentid' => $comment->id])) {
- unset($comment->id);
- $DB->insert_record('pdfannotator_commentsarchive', $comment);
- }
}
- // 1.4 Now delete all comments.
+ // 1.3 Now delete all comments.
$DB->delete_records('pdfannotator_comments', array("annotationid" => $annotationid));
// 2. Delete subscriptions to the question.
@@ -478,7 +433,6 @@ class provider implements \core_privacy\local\metadata\provider, \core_privacy\l
global $DB;
- self::archive_comment_if_necessary($comment);
$select = "annotationid = ? AND timecreated > ? AND isdeleted = ?";
$wasanswered = $DB->record_exists_select('pdfannotator_comments', $select, array($comment->annotationid, $comment->timecreated, 0));
@@ -507,18 +461,4 @@ class provider implements \core_privacy\local\metadata\provider, \core_privacy\l
}
}
- public static function archive_comment_if_necessary($comment) {
-
- global $DB;
-
- $wasreported = $DB->record_exists('pdfannotator_reports', ['commentid' => $comment->id]);
-
- // Before updating, insert the comment into the archive, if it was reported. // TODO: Mit Datenschutzbeauftragtem klären!
- if ($wasreported) {
- $reportedcomment = clone $comment;
- unset($reportedcomment->id);
- $DB->insert_record('pdfannotator_commentsarchive', $reportedcomment);
- }
- }
-
-}
+}
\ No newline at end of file
diff --git a/db/install.xml b/db/install.xml
index de91720464dcb613a3857e4c0e764693107018ca..077ce1a41fc2c3659d654767b61f190e27770514 100644
--- a/db/install.xml
+++ b/db/install.xml
@@ -117,26 +117,6 @@ answer: marked as correct answer"/>
<INDEX NAME="userid" UNIQUE="false" FIELDS="userid" COMMENT="An index for userid."/>
</INDEXES>
</TABLE>
- <TABLE NAME="pdfannotator_commentsarchive" COMMENT="comments, which were deleted and reported">
- <FIELDS>
- <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true"/>
- <FIELD NAME="pdfannotatorid" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="-1" SEQUENCE="false"/>
- <FIELD NAME="annotationid" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false"/>
- <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false"/>
- <FIELD NAME="content" TYPE="text" NOTNULL="false" SEQUENCE="false"/>
- <FIELD NAME="timecreated" TYPE="int" LENGTH="11" NOTNULL="true" SEQUENCE="false"/>
- <FIELD NAME="timemodified" TYPE="int" LENGTH="11" NOTNULL="true" SEQUENCE="false"/>
- <FIELD NAME="modifiedby" TYPE="int" LENGTH="10" NOTNULL="false" SEQUENCE="false"/>
- <FIELD NAME="visibility" TYPE="char" LENGTH="45" NOTNULL="true" DEFAULT="public" SEQUENCE="false"/>
- <FIELD NAME="isquestion" TYPE="int" LENGTH="4" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
- <FIELD NAME="isdeleted" TYPE="int" LENGTH="4" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
- <FIELD NAME="seen" TYPE="int" LENGTH="4" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
- </FIELDS>
- <KEYS>
- <KEY NAME="primary" TYPE="primary" FIELDS="id"/>
- <KEY NAME="pdfannotatorid" TYPE="foreign" FIELDS="pdfannotatorid" REFTABLE="pdfannotator" REFFIELDS="id"/>
- </KEYS>
- </TABLE>
<TABLE NAME="pdfannotator_subscriptions" COMMENT="saves which users subscribed to which questions">
<FIELDS>
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true"/>
diff --git a/db/upgrade.php b/db/upgrade.php
index 304bc8a63bdc25b3e48ab4b45a8c2eee1289ae4d..34f38f7c0972501cdd227a6e49ca9b8e4473d489 100644
--- a/db/upgrade.php
+++ b/db/upgrade.php
@@ -546,5 +546,19 @@ function xmldb_pdfannotator_upgrade($oldversion) {
upgrade_mod_savepoint(true, 2019030100, 'pdfannotator');
}
+ if ($oldversion < 2019060300) {
+
+ // Define table pdfannotator_commentsarchive to be dropped.
+ $table = new xmldb_table('pdfannotator_commentsarchive');
+
+ // Conditionally launch drop table for pdfannotator_commentsarchive.
+ if ($dbman->table_exists($table)) {
+ $dbman->drop_table($table);
+ }
+
+ // Pdfannotator savepoint reached.
+ upgrade_mod_savepoint(true, 2019060300, 'pdfannotator');
+ }
+
return true;
}
diff --git a/forward_form.php b/forward_form.php
index adf592c434295eee4abaa051f8b374e529629cc0..88ea4da8aacc1642952aa41faaf87a4d903eef5d 100644
--- a/forward_form.php
+++ b/forward_form.php
@@ -63,12 +63,12 @@ class pdfannotator_forward_form extends moodleform {
$recipients = $this->_customdata['recipients'];
// 'selectgroups' instead of 'select' because the required-rule didn't work properly with a multi-select.
- $select = $mform->addElement('selectgroups', 'recipients', get_string('recipient', 'pdfannotator'));
+ $select = $mform->addElement('selectgroups', 'recipients', get_string('recipient', 'pdfannotator'));
$select->addOptGroup('', $recipients);
$select->setMultiple(true);
$mform->addHelpButton('recipients', 'recipient', 'pdfannotator');
$mform->addRule('recipients', get_string('recipientrequired', 'pdfannotator'), 'required', null, 'client');
-
+
// Textarea for message to the recipient.
$mform->addElement('textarea', 'message', get_string('messageforwardform', 'pdfannotator'), 'wrap="virtual" rows="5" cols="109"');
diff --git a/lang/de/pdfannotator.php b/lang/de/pdfannotator.php
index 37cb1bee3019e60f19ae1d272f36d03704ccf5ab..c65caea9b4de8ccc457cdf346ad295483a108e06 100644
--- a/lang/de/pdfannotator.php
+++ b/lang/de/pdfannotator.php
@@ -280,7 +280,6 @@ $string['deletedQuestion'] = 'gelöschte Frage';
$string['deletedComment'] = 'gelöschter Kommentar';
$string['hiddenComment'] = 'verborgener Beitrag';
$string['deleteComment'] = 'Kommentar löschen';
-$string['deleteAndArchiveComment'] = 'Kommentar archivieren und löschen';
$string['delete'] = 'Löschen';
$string['edit'] = 'Bearbeiten';
$string['editButton'] = 'Speichern';
@@ -599,9 +598,6 @@ $string['privacy:metadata:pdfannotator_comments:userid'] = 'Die ID des Nutzers,
$string['privacy:metadata:pdfannotator_comments:annotationid'] = 'Die ID der zugrunde liegenden Annotation.';
$string['privacy:metadata:pdfannotator_comments:content'] = 'Der Wortlaut des Kommentars.';
-// pdfannotator_commentsarchive-table
-$string['privacy:metadata:pdfannotator_commentsarchive'] = "Kommentare die gemeldet und anschließend gelöscht wurde, werden hier archiviert. Dabei werden dieselben Daten wie bei anderen Kommentaren gespeichert.";
-
// pdfannotator_reports-table
$string['privacy:metadata:pdfannotator_reports'] = "Nutzer können die Kommentare anderer Nutzer als unangemessen melden. Diese Meldung werden gespeichert. Folgende Informationen über Meldung werden gespeichert: Die ID des gemeldeten Kommentars sowie der Verfasser, Wortlaut und Zeitpunkt der Meldung.";
$string['privacy:metadata:pdfannotator_reports:commentid'] = 'Die ID des gemeldeten Kommentars.';
diff --git a/lang/en/pdfannotator.php b/lang/en/pdfannotator.php
index dd45bb8db5e1ea52a33fec01b8a5422be021df18..308540a27ae3617c44250ec256f25e7bfed1c108 100644
--- a/lang/en/pdfannotator.php
+++ b/lang/en/pdfannotator.php
@@ -305,7 +305,6 @@ $string['deletedQuestion'] = 'deleted question';
$string['deletedComment'] = 'deleted comment';
$string['hiddenComment'] = 'hidden comment';
$string['deleteComment'] = 'Delete comment';
-$string['deleteAndArchiveComment'] = 'Archive and delete comment';
$string['annotationDeleted'] = 'Annotation has been deleted';
$string['commentDeleted'] = 'Comment has been deleted';
@@ -585,9 +584,6 @@ $string['privacy:metadata:pdfannotator_comments:userid'] = "The ID of the commen
$string['privacy:metadata:pdfannotator_comments:annotationid'] = 'The ID of the underlying annotation.';
$string['privacy:metadata:pdfannotator_comments:content'] = 'The literal comment.';
-// pdfannotator_commentsarchive table
-$string['privacy:metadata:pdfannotator_commentsarchive'] = "Comments which were reported and subsequently deleted are archived here. The information stored is the same as for other comments.";
-
// pdfannotator_reports table
$string['privacy:metadata:pdfannotator_reports'] = "Users can report other users' comments as inappropriate. These reports stored. This includes the ID of the reported comment as well as the author, content and time of the report.";
$string['privacy:metadata:pdfannotator_reports:commentid'] = 'The ID of the reported comment.';
diff --git a/lib.php b/lib.php
index 399d93b1663a154dd2de56e57c30b3dc8fc0c4f7..a1dcaae652f0ea959782c246d010463d5f24bb46 100644
--- a/lib.php
+++ b/lib.php
@@ -204,12 +204,7 @@ function pdfannotator_delete_instance($id) {
return false;
}
- // 4. Delete all archived comments.
- if (!$DB->delete_records('pdfannotator_commentsarchive', ['pdfannotatorid' => $id]) == 1) {
- return false;
- }
-
- // 5. Delete the annotator itself.
+ // 4. Delete the annotator itself.
if (!$DB->delete_records('pdfannotator', array('id' => $id)) == 1) {
return false;
}
diff --git a/model/annotation.class.php b/model/annotation.class.php
index f998d645b271323fe5e898ee735e34d0179ce1ed..8ac2b2ab9f8332ef65a8c82ba1c372fb2b5c5a3d 100644
--- a/model/annotation.class.php
+++ b/model/annotation.class.php
@@ -116,14 +116,9 @@ class pdfannotator_annotation {
if ($deletionallowed[0] === true || $deleteanyway === true) {
// Delete all comments of this annotation.
- // But first insert reported comments into the archive.
$comments = $DB->get_records('pdfannotator_comments', array("annotationid" => $annotationid));
foreach ($comments as $commentdata) {
$DB->delete_records('pdfannotator_votes', array("commentid" => $commentdata->id));
- // If the comment was not deleted, but reported, then insert the record into the archive.
- if ($commentdata->isdeleted == 0 && $DB->record_exists('pdfannotator_reports', ['commentid' => $commentdata->id])) {
- $DB->insert_record('pdfannotator_commentsarchive', $commentdata);
- }
}
$success = $DB->delete_records('pdfannotator_comments', array("annotationid" => $annotationid));
diff --git a/model/comment.class.php b/model/comment.class.php
index 7baa0820adcf7e77eba979030d83bc6021ecfdcb..21679d9a687380e86bd057266960ddcff28cd9e4 100644
--- a/model/comment.class.php
+++ b/model/comment.class.php
@@ -315,7 +315,6 @@ class pdfannotator_comment {
/**
* Deletes a comment.
* If the comment is answered, it will be displayed as deleted comment.
- * If the comment was reported it is inserted to the commentsarchive table.
*/
public static function delete_comment($commentid, $cmid) {
global $DB, $USER;
@@ -340,17 +339,10 @@ class pdfannotator_comment {
$select = "annotationid = ? AND timecreated > ? AND isdeleted = ?";
$wasanswered = $DB->record_exists_select('pdfannotator_comments', $select, [$annotationid, $comment->timecreated, 0]);
- $wasreported = $DB->record_exists('pdfannotator_reports', ['commentid' => $commentid]);
$tobedeletedaswell = [];
$deleteannotation = 0;
- // Before deleting: If the comment was reported, it should be inserted into the archive.
- if ($wasreported) {
- $reportedcomment = clone $comment;
- $DB->insert_record('pdfannotator_commentsarchive', $reportedcomment);
- }
-
if ($wasanswered) { // If the comment was answered, mark it as deleted for a special display.
$params = array("id" => $commentid, "isdeleted" => 1);
$success = $DB->update_record('pdfannotator_comments', $params, $bulk = false);
diff --git a/version.php b/version.php
index dd28d00ab6018109bd93bbcacdc02c5b040cb0db..cee845bc5bd529bbee89c35793a3b5ef022ddc11 100644
--- a/version.php
+++ b/version.php
@@ -25,7 +25,7 @@
defined('MOODLE_INTERNAL') || die();
$plugin->component = 'mod_pdfannotator'; // Full name of the plugin (used for diagnostics).
-$plugin->version = 2019042500; // The current module version (Date: YYYYMMDDXX).
+$plugin->version = 2019060300; // The current module version (Date: YYYYMMDDXX).
$plugin->release = 'PDF Annotator v1.1 release 1';
$plugin->requires = 2016112900; // Requires this Moodle version.
$plugin->cron = 0; // Period for cron to check this module (secs).