diff --git a/app/views/admin/user/_results.php b/app/views/admin/user/_results.php index 8751436164cf4e0e87af5d68590498968d69a730..729e24ada4d72083a200de9b54e965b8e0ad9b1f 100644 --- a/app/views/admin/user/_results.php +++ b/app/views/admin/user/_results.php @@ -22,7 +22,11 @@ </a> </th> <th> </th> - <th><?= _('Matrikelnummer') ?></th> + <th <?= $sortby === 'matriculation_number' ? 'class="sort' . $order . '"' : '' ?>> + <a href="<?= $controller->link_for('admin/user', ['sortby' => 'matriculation_number', 'order' => $order, 'toggle' => $sortby === 'matriculation_number']) ?>"> + <?= _('Matrikelnummer') ?> + </a> + </th> <th <?= $sortby === 'perms' ? 'class="sort' . $order . '"' : '' ?>> <a href="<?= $controller->link_for('admin/user',['sortby' =>'perms', 'order'=> $order ,'toggle' => $sortby === 'perms']) ?>"> <?= _('Status') ?> diff --git a/lib/models/User.class.php b/lib/models/User.class.php index 21f8f873b1b14f2944e383b08dde3059d234fcf6..4f9ccb7b0b848d86435bca24436413a25fa85e0f 100644 --- a/lib/models/User.class.php +++ b/lib/models/User.class.php @@ -522,6 +522,9 @@ class User extends AuthUserMd5 implements Range, PrivacyObject case "Email": $query .= "ORDER BY au.`Email` {$attributes['order']}, au.`username`"; break; + case 'matriculation_number': + $query .= "ORDER BY au.`matriculation_number` {$attributes['order']}, au.`username`"; + break; case "changed": $query .= "ORDER BY uo.`last_lifesign` {$attributes['order']}, au.`username`"; break;