Skip to content

Commit

Permalink
MDL-50602 - Automated backup: Remove old backups associated to courses
Browse files Browse the repository at this point in the history
Refactoring and renaming of settings.
  • Loading branch information
gaudreaj committed Sep 24, 2015
1 parent 694f195 commit 2b7c85d
Show file tree
Hide file tree
Showing 8 changed files with 301 additions and 174 deletions.
67 changes: 33 additions & 34 deletions admin/settings/courses.php
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,8 @@
);
$temp->add(new admin_setting_configselect('backup/backup_auto_storage', new lang_string('automatedstorage', 'backup'), new lang_string('automatedstoragehelp', 'backup'), 0, $storageoptions));
$temp->add(new admin_setting_special_backup_auto_destination());
$keepoptoins = array(

$maxkeptoptions = array(
0 => new lang_string('all'), 1 => '1',
2 => '2',
5 => '5',
Expand All @@ -240,34 +241,10 @@
300 => '300',
400 => '400',
500 => '500');
$temp->add(new admin_setting_configselect('backup/backup_auto_keep', new lang_string('keep'), new lang_string('backupkeephelp'), 1, $keepoptoins));
$temp->add(new admin_setting_configcheckbox('backup/backup_shortname', new lang_string('backup_shortname', 'admin'), new lang_string('backup_shortnamehelp', 'admin'), 0));
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_skip_hidden', new lang_string('skiphidden', 'backup'), new lang_string('skiphiddenhelp', 'backup'), 1));
$temp->add(new admin_setting_configselect('backup/backup_auto_skip_modif_days', new lang_string('skipmodifdays', 'backup'), new lang_string('skipmodifdayshelp', 'backup'), 30, array(
0 => new lang_string('never'),
1 => new lang_string('numdays', '', 1),
2 => new lang_string('numdays', '', 2),
3 => new lang_string('numdays', '', 3),
5 => new lang_string('numdays', '', 5),
7 => new lang_string('numdays', '', 7),
10 => new lang_string('numdays', '', 10),
14 => new lang_string('numdays', '', 14),
20 => new lang_string('numdays', '', 20),
30 => new lang_string('numdays', '', 30),
60 => new lang_string('numdays', '', 60),
90 => new lang_string('numdays', '', 90),
120 => new lang_string('numdays', '', 120),
180 => new lang_string('numdays', '', 180),
365 => new lang_string('numdays', '', 365)
)));
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_skip_modif_prev', new lang_string('skipmodifprev', 'backup'), new lang_string('skipmodifprevhelp', 'backup'), 0));
$temp->add(new admin_setting_configselect('backup/backup_auto_max_kept', new lang_string('automatedmaxkept', 'backup'),
new lang_string('automatedmaxkepthelp', 'backup'), 1, $maxkeptoptions));

// Automated backup removal section.
$temp->add(new admin_setting_heading('automatedbackupremovalsettings',
new lang_string('automatedbackupremovalsettings', 'backup'), ''));

$temp->add(new admin_setting_configselect('backup/backup_auto_keep_days', new lang_string('automatedbackupkeepdays', 'backup'),
new lang_string('automatedbackupkeepdayshelp', 'backup'), 0, array(
$automateddeletedaysoptions = array(
0 => new lang_string('never'),
1000 => new lang_string('numdays', '', 1000),
365 => new lang_string('numdays', '', 365),
Expand All @@ -280,11 +257,11 @@
10 => new lang_string('numdays', '', 10),
5 => new lang_string('numdays', '', 5),
2 => new lang_string('numdays', '', 2)
)));
);
$temp->add(new admin_setting_configselect('backup/backup_auto_delete_days', new lang_string('automateddeletedays', 'backup'),
'', 0, $automateddeletedaysoptions));

$temp->add(new admin_setting_configselect('backup/backup_auto_keep_copies',
new lang_string('automatedbackupkeepcopies', 'backup'), new lang_string('automatedbackupkeepcopieshelp', 'backup'),
0, array(
$minkeptoptions = array(
0 => new lang_string('none'),
1 => '1',
2 => '2',
Expand All @@ -297,9 +274,31 @@
100 => '100',
200 => '200',
300 => '300',
400 => '400',
500 => '500'
400 => '400'
);
$temp->add(new admin_setting_configselect('backup/backup_auto_min_kept', new lang_string('automatedminkept', 'backup'),
new lang_string('automatedminkepthelp', 'backup'), 0, $minkeptoptions));

$temp->add(new admin_setting_configcheckbox('backup/backup_shortname', new lang_string('backup_shortname', 'admin'), new lang_string('backup_shortnamehelp', 'admin'), 0));
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_skip_hidden', new lang_string('skiphidden', 'backup'), new lang_string('skiphiddenhelp', 'backup'), 1));
$temp->add(new admin_setting_configselect('backup/backup_auto_skip_modif_days', new lang_string('skipmodifdays', 'backup'), new lang_string('skipmodifdayshelp', 'backup'), 30, array(
0 => new lang_string('never'),
1 => new lang_string('numdays', '', 1),
2 => new lang_string('numdays', '', 2),
3 => new lang_string('numdays', '', 3),
5 => new lang_string('numdays', '', 5),
7 => new lang_string('numdays', '', 7),
10 => new lang_string('numdays', '', 10),
14 => new lang_string('numdays', '', 14),
20 => new lang_string('numdays', '', 20),
30 => new lang_string('numdays', '', 30),
60 => new lang_string('numdays', '', 60),
90 => new lang_string('numdays', '', 90),
120 => new lang_string('numdays', '', 120),
180 => new lang_string('numdays', '', 180),
365 => new lang_string('numdays', '', 365)
)));
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_skip_modif_prev', new lang_string('skipmodifprev', 'backup'), new lang_string('skipmodifprevhelp', 'backup'), 0));

// Automated defaults section.
$temp->add(new admin_setting_heading('automatedsettings', new lang_string('automatedsettings','backup'), ''));
Expand Down
5 changes: 5 additions & 0 deletions backup/upgrade.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
This files describes API changes in /backup/*,
information provided here is intended especially for developers.

=== 3.0 ===

* The backup_auto_keep setting, in automated backups configuration, is now
renamed to backup_auto_max_kept.

=== 2.6 ===

* The backup_controller_dbops::create_temptable_from_real_table()
Expand Down
Loading

0 comments on commit 2b7c85d

Please sign in to comment.