From ff539362a6fdb47e4820453f7babb1c028e2f0f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20S=CC=8Ckoda?= Date: Sat, 20 Jul 2013 21:04:31 +0200 Subject: [PATCH] MDL-40796 do not require city and country when uploading users --- admin/tool/uploaduser/index.php | 3 --- admin/tool/uploaduser/user_form.php | 5 +++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/admin/tool/uploaduser/index.php b/admin/tool/uploaduser/index.php index 30a0dbf15e9..c052d1cfcbc 100644 --- a/admin/tool/uploaduser/index.php +++ b/admin/tool/uploaduser/index.php @@ -1110,9 +1110,6 @@ while ($linenum <= $previewrows and $fields = $cir->next()) { if (isset($rowcols['city'])) { $rowcols['city'] = trim($rowcols['city']); - if (empty($rowcols['city'])) { - $rowcols['status'][] = get_string('fieldrequired', 'error', 'city'); - } } // Check if rowcols have custom profile field with correct data and update error state. $noerror = uu_check_custom_profile_data($rowcols) && $noerror; diff --git a/admin/tool/uploaduser/user_form.php b/admin/tool/uploaduser/user_form.php index b8341bdf7f0..b377a9b2568 100644 --- a/admin/tool/uploaduser/user_form.php +++ b/admin/tool/uploaduser/user_form.php @@ -257,9 +257,10 @@ class admin_uploaduser_form2 extends moodleform { } else { $mform->setDefault('city', $CFG->defaultcity); } - $mform->addRule('city', get_string('required'), 'required'); - $mform->addElement('select', 'country', get_string('selectacountry'), get_string_manager()->get_list_of_countries()); + $choices = get_string_manager()->get_list_of_countries(); + $choices = array(''=>get_string('selectacountry').'...') + $choices; + $mform->addElement('select', 'country', get_string('selectacountry'), $choices); if (empty($CFG->country)) { $mform->setDefault('country', $templateuser->country); } else {