MDL-4325 ... fix the order of the name fields is lastname/firstname are reversed...
authormoodler <moodler>
Mon, 21 May 2007 07:37:55 +0000 (07:37 +0000)
committermoodler <moodler>
Mon, 21 May 2007 07:37:55 +0000 (07:37 +0000)
login/signup_form.php
user/editlib.php

index 51508d89297e13d199aec160c48d3111089fa9ed..218731e3c0631411a3860760762463700e3a7c06 100644 (file)
@@ -29,11 +29,19 @@ class login_signup_form extends moodleform {
         $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');
 
index dfb1f5b9bc004c80ef0d7a8a4d2e7cdb6ce92a30..54e0b078d6b6ec1a9cefbb0b15507247210ef48b 100644 (file)
@@ -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);
 
@@ -249,4 +257,4 @@ function useredit_shared_definition(&$mform) {
     $mform->setType('address', PARAM_MULTILANG);
 }
 
-?>
\ No newline at end of file
+?>