if ($oldversion < 2004011400) {
table_column("journal", "", "introformat", "integer", "2", "", "1", "not null", "intro");
}
+
+ if ($oldversion < 2004020500) {
+ if ($journals = get_records("journal")) {
+ foreach ($journals as $journal) {
+ if ($cm = get_coursemodule_from_instance("journal", $journal->id, $journal->course)) {
+ execute_sql("UPDATE {$CFG->prefix}log SET cmid = '$cm->id'
+ WHERE module = 'journal' AND url = 'report.php?id=$cm->id'");
+
+ execute_sql("UPDATE {$CFG->prefix}log SET cmid = '$cm->id'
+ WHERE module = 'journal' AND url = 'view.php?id=$cm->id'");
+ }
+ }
+ }
+ }
return $result;
}
table_column("journal", "", "introformat", "integer", "2", "", "1", "not null", "intro");
}
+ if ($oldversion < 2004020500) {
+ if ($journals = get_records("journal")) {
+ foreach ($journals as $journal) {
+ if ($cm = get_coursemodule_from_instance("journal", $journal->id, $journal->course)) {
+ execute_sql("UPDATE {$CFG->prefix}log SET cmid = '$cm->id'
+ WHERE module = 'journal' AND url = 'report.php?id=$cm->id'");
+
+ execute_sql("UPDATE {$CFG->prefix}log SET cmid = '$cm->id'
+ WHERE module = 'journal' AND url = 'view.php?id=$cm->id'");
+ }
+ }
+ }
+ }
+
return $result;
}
if (! update_record("journal_entries", $newentry)) {
error("Could not update your journal");
}
- add_to_log($course->id, "journal", "update entry", "view.php?id=$cm->id", "$newentry->id");
+ add_to_log($course->id, "journal", "update entry", "view.php?id=$cm->id", "$newentry->id", $cm->id);
} else {
$newentry->userid = $USER->id;
$newentry->journal = $journal->id;
if (! $newentry->id = insert_record("journal_entries", $newentry)) {
error("Could not insert a new journal entry");
}
- add_to_log($course->id, "journal", "add entry", "view.php?id=$cm->id", "$newentry->id");
+ add_to_log($course->id, "journal", "add entry", "view.php?id=$cm->id", "$newentry->id", $cm->id);
}
redirect("view.php?id=$cm->id");
$entrybyuser[$entry->userid]->timemarked = $timenow;
}
}
- add_to_log($course->id, "journal", "update feedback", "report.php?id=$cm->id", "$count users");
+ add_to_log($course->id, "journal", "update feedback", "report.php?id=$cm->id", "$count users", $cm->id);
notify(get_string("feedbackupdated", "journal", "$count"), "green");
} else {
- add_to_log($course->id, "journal", "view responses", "report.php?id=$cm->id", "$journal->id");
+ add_to_log($course->id, "journal", "view responses", "report.php?id=$cm->id", "$journal->id", $cm->id);
}
/// Print out the journal entries
// This fragment is called by /admin/index.php
////////////////////////////////////////////////////////////////////////////////
-$module->version = 2004013101;
+$module->version = 2004020500;
$module->requires = 2004013101; // Requires this Moodle version
$module->cron = 60;