Use a dropdown instead of checkbox to select the sex of a new account.
authorFlorent Bruneau <florent.bruneau@polytechnique.org>
Mon, 11 Oct 2010 13:44:03 +0000 (15:44 +0200)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Mon, 11 Oct 2010 13:44:03 +0000 (15:44 +0200)
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
modules/admin.php
templates/admin/accounts.tpl

index f203d78..633a683 100644 (file)
@@ -1207,7 +1207,7 @@ class AdminModule extends PLModule
             S::assert_xsrf_token();
             $firstname = Post::t('firstname');
             $lastname = strtoupper(Post::t('lastname'));
-            $sex = Post::b('sex') ? User::GENDER_FEMALE : User::GENDER_MALE;
+            $sex = Post::s('sex');
             $email = Post::t('email');
             $type = Post::s('type');
             $login = PlUser::makeHrid($firstname, $lastname, $type);
index 52af2e5..d7b1dd9 100644 (file)
@@ -92,7 +92,12 @@ function add_user_to_url(f) {
         </tr>
         <tr>
           <td class="titre">Sexe</td>
-          <td><input type="checkbox" name="sex" checked="checked" /></td>
+          <td>
+            <select name="sex">
+              <option value="female">Femme</option>
+              <option value="male">Homme</option>
+            </select>
+          </td>
         </tr>
         <tr>
           <td class="titre">Email</td>