[root@dywang moodle23]# diff -urN ../moodle/user/editlib.php user/editlib.php --- ../moodle/user/editlib.php 2012-06-26 01:15:38.000000000 +0800 +++ user/editlib.php 2015-03-05 10:39:39.612411949 +0800
@@ -225,18 +225,19 @@
$mform->addElement('text', 'city', get_string('city'), 'maxlength="120" size="21"');
$mform->setType('city', PARAM_MULTILANG);
- $mform->addRule('city', $strrequired, 'required', null, 'client');
- if (!empty($CFG->defaultcity)) {
- $mform->setDefault('city', $CFG->defaultcity);
- }
$choices = get_string_manager()->get_list_of_countries();
$choices= array(”=>get_string('selectacountry').'...') + $choices;
- $mform->addElement('select', 'country', get_string('selectacountry'), $choices);
- $mform->addRule('country', $strrequired, 'required', null, 'client');
- if (!empty($CFG->country)) {
- $mform->setDefault('country', $CFG->country);
- }
+ $mform->addElement('static', 'countryName', get_string('country'), $choices[$USER->country]);
$choices = get_list_of_timezones();
$choices['99'] = get_string('serverlocaltime');
@@ -321,6 +322,10 @@
$mform->addElement('text', 'department', get_string('department'), 'maxlength="30" size="25"');
$mform->setType('department', PARAM_MULTILANG);
+ $mform->addRule('department', $strrequired, 'required', null, 'client'); //dywang
+ if (!empty($CFG->department)) {
+ $mform->setDefault('department', $CFG->defaultdepartment);
+ }
$mform->addElement('text', 'phone1', get_string('phone'), 'maxlength="20" size="25"');
$mform->setType('phone1', PARAM_NOTAGS);