- alter table mdl_user add province text not null; - http://tracker.moodle.org/browse/MDL-10504 diff --git a/admin/uploaduser.php b/admin/uploaduser.php index 111fa7c..a486dc0 100755 --- a/admin/uploaduser.php +++ b/admin/uploaduser.php @@ -72,7 +72,7 @@ $STD_FIELDS = array('id', 'firstname', 'lastname', 'username', 'email', 'mnethostid', 'institution', 'department', 'idnumber', 'skype', 'msn', 'aim', 'yahoo', 'icq', 'phone1', 'phone2', 'address', 'url', 'description', 'oldusername', 'emailstop', 'deleted', - 'password'); + 'password', 'province'); $PRF_FIELDS = array(); @@ -991,4 +991,4 @@ function uu_allowed_roles($shortname=false) { return $choices; } -?> \ No newline at end of file +?> diff --git a/lang/en_utf8/moodle.php b/lang/en_utf8/moodle.php index 5f76061..6d90139 100644 --- a/lang/en_utf8/moodle.php +++ b/lang/en_utf8/moodle.php @@ -1692,4 +1692,6 @@ $string['zippingbackup'] = 'Zipping backup'; $string['authenticationplugins'] = 'Authentication Plugins'; $string['chooseauthmethod'] = 'Choose authentication plugin'; +$string['missingprovince'] = 'Missing state/province'; +$string['province'] = 'State/Province'; ?> diff --git a/login/signup_form.php b/login/signup_form.php index 9abc3f8..16f96d2 100644 --- a/login/signup_form.php +++ b/login/signup_form.php @@ -51,6 +51,10 @@ class login_signup_form extends moodleform { $mform->setType('city', PARAM_TEXT); $mform->addRule('city', get_string('missingcity'), 'required', null, 'server'); + $mform->addElement('text', 'province', get_string('province'), 'maxlength="20" size="20"'); + $mform->setType('province', PARAM_TEXT); + $mform->addRule('province', get_string('missingprovince'), 'required', null, 'server'); + $country = get_list_of_countries(); $default_country[''] = get_string('selectacountry'); $country = array_merge($default_country, $country); diff --git a/user/editlib.php b/user/editlib.php index 9815cc6..314643a 100644 --- a/user/editlib.php +++ b/user/editlib.php @@ -197,6 +197,9 @@ function useredit_shared_definition(&$mform) { $mform->setType('city', PARAM_MULTILANG); $mform->addRule('city', $strrequired, 'required', null, 'client'); + $mform->addElement('text', 'province', get_string('province'), 'maxlength="20" size="21"'); + $mform->setType('province', PARAM_MULTILANG); + $mform->addRule('province', $strrequired, 'required', null, 'client'); $choices = get_list_of_countries(); $choices= array(''=>get_string('selectacountry').'...') + $choices; diff --git a/user/view.php b/user/view.php index e45c57f..40543b4 100644 --- a/user/view.php +++ b/user/view.php @@ -241,6 +241,10 @@ print_row(get_string('city') . ':', $user->city); } + if (! isset($hiddenfields['province']) && $user->province) { + print_row(get_string('province') . ':', $user->province); + } + if (has_capability('moodle/user:viewhiddendetails', $coursecontext)) { if ($user->address) { print_row(get_string("address").":", "$user->address");