Skip to content

Commit

Permalink
MDL-4325 ... fix the order of the name fields is lastname/firstname a…
Browse files Browse the repository at this point in the history
…re reversed - thanks Kita!
  • Loading branch information
moodler committed May 21, 2007
1 parent c8afa50 commit baacc97
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
12 changes: 10 additions & 2 deletions login/signup_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,19 @@ function definition() {
$mform->setType('email2', PARAM_NOTAGS);
$mform->addRule('email2', get_string('missingemail'), 'required', null, 'server');

$mform->addElement('text', 'firstname', get_string('firstname'), 'maxlength="100" size="25"');
$nameordercheck->firstname = 'a';
$nameordercheck->lastname = 'b';
if (fullname($nameordercheck) == 'b a' ) { // See MDL-4325
$mform->addElement('text', 'lastname', get_string('lastname'), 'maxlength="100" size="30"');
$mform->addElement('text', 'firstname', get_string('firstname'), 'maxlength="100" size="30"');
} else {
$mform->addElement('text', 'firstname', get_string('firstname'), 'maxlength="100" size="30"');
$mform->addElement('text', 'lastname', get_string('lastname'), 'maxlength="100" size="30"');
}

$mform->setType('firstname', PARAM_TEXT);
$mform->addRule('firstname', get_string('missingfirstname'), 'required', null, 'server');

$mform->addElement('text', 'lastname', get_string('lastname'), 'maxlength="100" size="25"');
$mform->setType('lastname', PARAM_TEXT);
$mform->addRule('lastname', get_string('missinglastname'), 'required', null, 'server');

Expand Down
14 changes: 11 additions & 3 deletions user/editlib.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,19 @@ function useredit_shared_definition(&$mform) {

$strrequired = get_string('required');

$mform->addElement('text', 'firstname', get_string('firstname'), 'maxlength="100" size="30"');
$nameordercheck->firstname = 'a';
$nameordercheck->lastname = 'b';
if (fullname($nameordercheck) == 'b a' ) { // See MDL-4325
$mform->addElement('text', 'lastname', get_string('lastname'), 'maxlength="100" size="30"');
$mform->addElement('text', 'firstname', get_string('firstname'), 'maxlength="100" size="30"');
} else {
$mform->addElement('text', 'firstname', get_string('firstname'), 'maxlength="100" size="30"');
$mform->addElement('text', 'lastname', get_string('lastname'), 'maxlength="100" size="30"');
}

$mform->addRule('firstname', $strrequired, 'required', null, 'client');
$mform->setType('firstname', PARAM_NOTAGS);

$mform->addElement('text', 'lastname', get_string('lastname'), 'maxlength="100" size="30"');
$mform->addRule('lastname', $strrequired, 'required', null, 'client');
$mform->setType('lastname', PARAM_NOTAGS);

Expand Down Expand Up @@ -249,4 +257,4 @@ function useredit_shared_definition(&$mform) {
$mform->setType('address', PARAM_MULTILANG);
}

?>
?>

0 comments on commit baacc97

Please sign in to comment.