MDL-83226 customfield: set backup/restore configuration defaults.

This commit is contained in:
Paul Holden 2024-09-20 17:33:14 +01:00
parent d015c4c213
commit c60c6a5311
No known key found for this signature in database
GPG key ID: A81A96D6045F6164
4 changed files with 31 additions and 1 deletions

View file

@ -420,6 +420,12 @@ if ($hassiteconfig or has_any_capability($capabilities, $systemcontext)) {
new lang_string('generalgroups', 'backup'), new lang_string('configgeneralgroups', 'backup'), new lang_string('generalgroups', 'backup'), new lang_string('configgeneralgroups', 'backup'),
array('value' => 1, 'locked' => 0))); array('value' => 1, 'locked' => 0)));
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_competencies', new lang_string('generalcompetencies','backup'), new lang_string('configgeneralcompetencies','backup'), array('value'=>1, 'locked'=>0))); $temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_competencies', new lang_string('generalcompetencies','backup'), new lang_string('configgeneralcompetencies','backup'), array('value'=>1, 'locked'=>0)));
$temp->add(new admin_setting_configcheckbox_with_lock(
'backup/backup_general_customfield',
new lang_string('generalcustomfield', 'backup'),
new lang_string('configgeneralcustomfield', 'backup'),
['value' => 1, 'locked' => 0],
));
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_contentbankcontent', $temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_contentbankcontent',
new lang_string('generalcontentbankcontent', 'backup'), new lang_string('generalcontentbankcontent', 'backup'),
new lang_string('configgeneralcontentbankcontent', 'backup'), new lang_string('configgeneralcontentbankcontent', 'backup'),
@ -431,7 +437,6 @@ if ($hassiteconfig or has_any_capability($capabilities, $systemcontext)) {
['value' => 1, 'locked' => 0]) ['value' => 1, 'locked' => 0])
); );
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_legacyfiles', $temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_legacyfiles',
new lang_string('generallegacyfiles', 'backup'), new lang_string('generallegacyfiles', 'backup'),
new lang_string('configlegacyfiles', 'backup'), array('value' => 1, 'locked' => 0))); new lang_string('configlegacyfiles', 'backup'), array('value' => 1, 'locked' => 0)));
@ -460,6 +465,12 @@ if ($hassiteconfig or has_any_capability($capabilities, $systemcontext)) {
new lang_string('generalgroups', 'backup'), new lang_string('configgeneralgroups', 'backup'), new lang_string('generalgroups', 'backup'), new lang_string('configgeneralgroups', 'backup'),
array('value' => 1, 'locked' => 0))); array('value' => 1, 'locked' => 0)));
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_import_competencies', new lang_string('generalcompetencies','backup'), new lang_string('configgeneralcompetencies','backup'), array('value'=>1, 'locked'=>0))); $temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_import_competencies', new lang_string('generalcompetencies','backup'), new lang_string('configgeneralcompetencies','backup'), array('value'=>1, 'locked'=>0)));
$temp->add(new admin_setting_configcheckbox_with_lock(
'backup/backup_import_customfield',
new lang_string('generalcustomfield', 'backup'),
new lang_string('configgeneralcustomfield', 'backup'),
['value' => 1, 'locked' => 0],
));
$temp->add(new admin_setting_configcheckbox_with_lock( $temp->add(new admin_setting_configcheckbox_with_lock(
'backup/backup_import_contentbankcontent', 'backup/backup_import_contentbankcontent',
new lang_string('generalcontentbankcontent', 'backup'), new lang_string('generalcontentbankcontent', 'backup'),
@ -589,6 +600,12 @@ if ($hassiteconfig or has_any_capability($capabilities, $systemcontext)) {
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_groups', new lang_string('generalgroups', 'backup'), $temp->add(new admin_setting_configcheckbox('backup/backup_auto_groups', new lang_string('generalgroups', 'backup'),
new lang_string('configgeneralgroups', 'backup'), 1)); new lang_string('configgeneralgroups', 'backup'), 1));
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_competencies', new lang_string('generalcompetencies','backup'), new lang_string('configgeneralcompetencies','backup'), 1)); $temp->add(new admin_setting_configcheckbox('backup/backup_auto_competencies', new lang_string('generalcompetencies','backup'), new lang_string('configgeneralcompetencies','backup'), 1));
$temp->add(new admin_setting_configcheckbox(
'backup/backup_auto_customfield',
new lang_string('generalcustomfield', 'backup'),
new lang_string('configgeneralcustomfield', 'backup'),
1,
));
$temp->add(new admin_setting_configcheckbox( $temp->add(new admin_setting_configcheckbox(
'backup/backup_auto_contentbankcontent', 'backup/backup_auto_contentbankcontent',
new lang_string('generalcontentbankcontent', 'backup'), new lang_string('generalcontentbankcontent', 'backup'),
@ -668,6 +685,12 @@ if ($hassiteconfig or has_any_capability($capabilities, $systemcontext)) {
$temp->add(new admin_setting_configcheckbox_with_lock('restore/restore_general_competencies', $temp->add(new admin_setting_configcheckbox_with_lock('restore/restore_general_competencies',
new lang_string('generalcompetencies', 'backup'), new lang_string('generalcompetencies', 'backup'),
new lang_string('configrestorecompetencies', 'backup'), array('value' => 1, 'locked' => 0))); new lang_string('configrestorecompetencies', 'backup'), array('value' => 1, 'locked' => 0)));
$temp->add(new admin_setting_configcheckbox_with_lock(
'restore/restore_general_customfield',
new lang_string('generalcustomfield', 'backup'),
new lang_string('configrestorecustomfield', 'backup'),
['value' => 1, 'locked' => 0],
));
$temp->add(new admin_setting_configcheckbox_with_lock('restore/restore_general_contentbankcontent', $temp->add(new admin_setting_configcheckbox_with_lock('restore/restore_general_contentbankcontent',
new lang_string('generalcontentbankcontent', 'backup'), new lang_string('generalcontentbankcontent', 'backup'),
new lang_string('configrestorecontentbankcontent', 'backup'), array('value' => 1, 'locked' => 0))); new lang_string('configrestorecontentbankcontent', 'backup'), array('value' => 1, 'locked' => 0)));

View file

@ -572,6 +572,7 @@ abstract class backup_controller_dbops extends backup_dbops {
'backup_general_questionbank' => 'questionbank', 'backup_general_questionbank' => 'questionbank',
'backup_general_groups' => 'groups', 'backup_general_groups' => 'groups',
'backup_general_competencies' => 'competencies', 'backup_general_competencies' => 'competencies',
'backup_general_customfield' => 'customfield',
'backup_general_contentbankcontent' => 'contentbankcontent', 'backup_general_contentbankcontent' => 'contentbankcontent',
'backup_general_xapistate' => 'xapistate', 'backup_general_xapistate' => 'xapistate',
'backup_general_legacyfiles' => 'legacyfiles' 'backup_general_legacyfiles' => 'legacyfiles'
@ -589,6 +590,7 @@ abstract class backup_controller_dbops extends backup_dbops {
'backup_import_questionbank' => 'questionbank', 'backup_import_questionbank' => 'questionbank',
'backup_import_groups' => 'groups', 'backup_import_groups' => 'groups',
'backup_import_competencies' => 'competencies', 'backup_import_competencies' => 'competencies',
'backup_import_customfield' => 'customfield',
'backup_import_contentbankcontent' => 'contentbankcontent', 'backup_import_contentbankcontent' => 'contentbankcontent',
'backup_import_legacyfiles' => 'legacyfiles' 'backup_import_legacyfiles' => 'legacyfiles'
); );
@ -623,6 +625,7 @@ abstract class backup_controller_dbops extends backup_dbops {
'backup_auto_questionbank' => 'questionbank', 'backup_auto_questionbank' => 'questionbank',
'backup_auto_groups' => 'groups', 'backup_auto_groups' => 'groups',
'backup_auto_competencies' => 'competencies', 'backup_auto_competencies' => 'competencies',
'backup_auto_customfield' => 'customfield',
'backup_auto_contentbankcontent' => 'contentbankcontent', 'backup_auto_contentbankcontent' => 'contentbankcontent',
'backup_auto_xapistate' => 'xapistate', 'backup_auto_xapistate' => 'xapistate',
'backup_auto_legacyfiles' => 'legacyfiles' 'backup_auto_legacyfiles' => 'legacyfiles'

View file

@ -159,6 +159,7 @@ abstract class restore_controller_dbops extends restore_dbops {
'restore_general_questionbank' => 'questionbank', 'restore_general_questionbank' => 'questionbank',
'restore_general_groups' => 'groups', 'restore_general_groups' => 'groups',
'restore_general_competencies' => 'competencies', 'restore_general_competencies' => 'competencies',
'restore_general_customfield' => 'customfield',
'restore_general_contentbankcontent' => 'contentbankcontent', 'restore_general_contentbankcontent' => 'contentbankcontent',
'restore_general_xapistate' => 'xapistate', 'restore_general_xapistate' => 'xapistate',
'restore_general_legacyfiles' => 'legacyfiles' 'restore_general_legacyfiles' => 'legacyfiles'

View file

@ -130,6 +130,7 @@ $string['configgeneralcalendarevents'] = 'Sets the default for including calenda
$string['configgeneralcomments'] = 'Sets the default for including comments in a backup.'; $string['configgeneralcomments'] = 'Sets the default for including comments in a backup.';
$string['configgeneralcompetencies'] = 'Sets the default for including competencies in a backup.'; $string['configgeneralcompetencies'] = 'Sets the default for including competencies in a backup.';
$string['configgeneralcontentbankcontent'] = 'Sets the default for including content bank content in a backup.'; $string['configgeneralcontentbankcontent'] = 'Sets the default for including content bank content in a backup.';
$string['configgeneralcustomfield'] = 'Sets the default for including custom fields in a backup.';
$string['configgeneralfiles'] = 'Sets the default for including files in a backup. Please note: Disabling this setting will result in a backup which only includes references to files. This is not a problem if the backup is restored on the same site and the files have not been deleted according to the setting \'Clean up trash pool files\' (filescleanupperiod).'; $string['configgeneralfiles'] = 'Sets the default for including files in a backup. Please note: Disabling this setting will result in a backup which only includes references to files. This is not a problem if the backup is restored on the same site and the files have not been deleted according to the setting \'Clean up trash pool files\' (filescleanupperiod).';
$string['configgeneralfilters'] = 'Sets the default for including filters in a backup.'; $string['configgeneralfilters'] = 'Sets the default for including filters in a backup.';
$string['configgeneralhistories'] = 'Sets the default for including user history within a backup.'; $string['configgeneralhistories'] = 'Sets the default for including user history within a backup.';
@ -150,6 +151,7 @@ $string['configrestorecalendarevents'] = 'Sets the default for restoring calenda
$string['configrestorecomments'] = 'Sets the default for restoring comments.'; $string['configrestorecomments'] = 'Sets the default for restoring comments.';
$string['configrestorecompetencies'] = 'Sets the default for restoring competencies.'; $string['configrestorecompetencies'] = 'Sets the default for restoring competencies.';
$string['configrestorecontentbankcontent'] = 'Sets the default for restoring content bank content.'; $string['configrestorecontentbankcontent'] = 'Sets the default for restoring content bank content.';
$string['configrestorecustomfield'] = 'Sets the default for restoring custom fields.';
$string['configrestoreenrolments'] = 'Sets the default for restoring enrolment methods.'; $string['configrestoreenrolments'] = 'Sets the default for restoring enrolment methods.';
$string['configrestorefilters'] = 'Sets the default for restoring filters.'; $string['configrestorefilters'] = 'Sets the default for restoring filters.';
$string['configrestorehistories'] = 'Sets the default for restoring user history if it was included in the backup.'; $string['configrestorehistories'] = 'Sets the default for restoring user history if it was included in the backup.';
@ -229,6 +231,7 @@ $string['generalcalendarevents'] = 'Include calendar events';
$string['generalcomments'] = 'Include comments'; $string['generalcomments'] = 'Include comments';
$string['generalcompetencies'] = 'Include competencies'; $string['generalcompetencies'] = 'Include competencies';
$string['generalcontentbankcontent'] = 'Include content bank content'; $string['generalcontentbankcontent'] = 'Include content bank content';
$string['generalcustomfield'] = 'Include custom fields';
$string['generalenrolments'] = 'Include enrolment methods'; $string['generalenrolments'] = 'Include enrolment methods';
$string['generalfiles'] = 'Include files'; $string['generalfiles'] = 'Include files';
$string['generalfilters'] = 'Include filters'; $string['generalfilters'] = 'Include filters';