Add "session_import_settings" configuration value see BT#15081

This option sets default parameters in the main/session/session_import.php
pull/2757/head
Julio Montoya 7 years ago
parent 99429a53cb
commit ba6bffcce7
  1. 9
      main/install/configuration.dist.php
  2. 11
      main/session/session_import.php

@ -1024,9 +1024,18 @@ VALUES (2, 13, 'session_courses_read_only_mode', 'Lock Course In Session', 1, 1,
// Allow my personal files link in the homepage
// $_configuration['allow_my_files_link_in_homepage'] = false;
// This option sets default parameters in the main/session/session_import.php
/*$_configuration['session_import_settings'] = [
'options' => [
'session_exists_default_option' => '1',
'send_mail_default_option' => '1',
]
];*/
// ------ Custom DB changes (keep this at the end)
// Add user activation by confirmation email
// This option prevents the new user to login in the platform if your account is not confirmed via email
// You need add a new option called "confirmation" to the registration settings
//INSERT INTO settings_options (variable, value, display_text) VALUES ('allow_registration', 'confirmation', 'MailConfirmation');
// ------ (End) Custom DB changes

@ -511,6 +511,17 @@ $form->addElement('checkbox', 'sendMail', null, get_lang('SendMailToUsers'));
$form->addButtonImport(get_lang('ImportSession'));
$defaults = ['sendMail' => 'true', 'file_type' => 'csv'];
$options = api_get_configuration_value('session_import_settings');
if (!empty($options) && isset($options['options'])) {
if (isset($options['options']['session_exists_default_option'])) {
$defaults['overwrite'] = $options['options']['session_exists_default_option'];
}
if (isset($options['options']['send_mail_default_option'])) {
$defaults['sendMail'] = $options['options']['send_mail_default_option'];
}
}
$form->setDefaults($defaults);
Display::return_message(get_lang('TheXMLImportLetYouAddMoreInfoAndCreateResources'));

Loading…
Cancel
Save