mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 00:12:56 +02:00
MDL-43274 Course: Remove ability to delete logs on a course during reset
This commit is contained in:
parent
3150271c22
commit
bb8d6e1a81
@ -875,7 +875,6 @@ class tool_uploadcourse_course {
|
||||
$resetdata = new stdClass();
|
||||
$resetdata->id = $course->id;
|
||||
$resetdata->reset_start_date = time();
|
||||
$resetdata->reset_logs = true;
|
||||
$resetdata->reset_events = true;
|
||||
$resetdata->reset_notes = true;
|
||||
$resetdata->delete_blog_associations = true;
|
||||
|
@ -16,7 +16,6 @@ class course_reset_form extends moodleform {
|
||||
$mform->addElement('date_selector', 'reset_start_date', get_string('startdate'), array('optional'=>true));
|
||||
$mform->addHelpButton('reset_start_date', 'startdate');
|
||||
$mform->addElement('checkbox', 'reset_events', get_string('deleteevents', 'calendar'));
|
||||
$mform->addElement('checkbox', 'reset_logs', get_string('deletelogs'));
|
||||
$mform->addElement('checkbox', 'reset_notes', get_string('deletenotes', 'notes'));
|
||||
$mform->addElement('checkbox', 'reset_comments', get_string('deleteallcomments', 'moodle'));
|
||||
$mform->addElement('checkbox', 'reset_completion', get_string('deletecompletiondata', 'completion'));
|
||||
@ -105,7 +104,7 @@ class course_reset_form extends moodleform {
|
||||
|
||||
$mform =& $this->_form;
|
||||
|
||||
$defaults = array ('reset_events'=>1, 'reset_logs'=>1, 'reset_roles_local'=>1, 'reset_gradebook_grades'=>1, 'reset_notes'=>1);
|
||||
$defaults = array ('reset_events'=>1, 'reset_roles_local'=>1, 'reset_gradebook_grades'=>1, 'reset_notes'=>1);
|
||||
|
||||
// Set student as default in unenrol user list, if role with student archetype exist.
|
||||
if ($studentrole = get_archetype_roles('student')) {
|
||||
|
@ -478,7 +478,6 @@ $string['deletechecktypename'] = 'Are you sure that you want to delete the {$a->
|
||||
$string['deletecheckfiles'] = 'Are you absolutely sure you want to delete these files?';
|
||||
$string['deletecheckfull'] = 'Are you absolutely sure you want to completely delete {$a} ?';
|
||||
$string['deletecheckwarning'] = 'You are about to delete these files';
|
||||
$string['deletelogs'] = 'Delete logs';
|
||||
$string['deleteselected'] = 'Delete selected';
|
||||
$string['deleteselectedkey'] = 'Delete selected key';
|
||||
$string['deletingcourse'] = 'Deleting {$a}';
|
||||
|
@ -5166,7 +5166,6 @@ function remove_course_contents($courseid, $showfeedback = true, array $options
|
||||
// This array stores the tables that need to be cleared, as
|
||||
// table_name => column_name that contains the course id.
|
||||
$tablestoclear = array(
|
||||
'log' => 'course', // Course logs (NOTE: this might be changed in the future).
|
||||
'backup_courses' => 'courseid', // Scheduled backup stuff.
|
||||
'user_lastaccess' => 'courseid', // User access info.
|
||||
);
|
||||
@ -5315,11 +5314,6 @@ function reset_course_userdata($data) {
|
||||
$status[] = array('component' => $componentstr, 'item' => get_string('datechanged'), 'error' => false);
|
||||
}
|
||||
|
||||
if (!empty($data->reset_logs)) {
|
||||
$DB->delete_records('log', array('course' => $data->courseid));
|
||||
$status[] = array('component' => $componentstr, 'item' => get_string('deletelogs'), 'error' => false);
|
||||
}
|
||||
|
||||
if (!empty($data->reset_events)) {
|
||||
$DB->delete_records('event', array('courseid' => $data->courseid));
|
||||
$status[] = array('component' => $componentstr, 'item' => get_string('deleteevents', 'calendar'), 'error' => false);
|
||||
|
@ -1,6 +1,10 @@
|
||||
This files describes API changes in core libraries and APIs,
|
||||
information provided here is intended especially for developers.
|
||||
|
||||
=== 2.7.1 ===
|
||||
|
||||
* The ability to delete logs when resetting a course has been removed.
|
||||
|
||||
=== 2.7 ===
|
||||
|
||||
* PHPUnit cannot be installed via PEAR any more, please use composer package manager instead.
|
||||
|
Loading…
x
Reference in New Issue
Block a user