mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 05:34:06 -08:00
Added first-initial dot lastname format for usernames/email
Fixed [ch1379]
This commit is contained in:
parent
37b8029d04
commit
fe553aec02
|
@ -508,6 +508,9 @@ class User extends SnipeModel implements AuthenticatableContract, AuthorizableCo
|
|||
} elseif ($format=='lastnamefirstinitial') {
|
||||
$username = str_slug($last_name.substr($first_name, 0, 1));
|
||||
|
||||
} elseif ($format=='firstintial.lastname') {
|
||||
$username = substr($first_name, 0, 1).'.'.str_slug($last_name);
|
||||
|
||||
} elseif ($format=='firstname_lastname') {
|
||||
$username = str_slug($first_name).'_'.str_slug($last_name);
|
||||
|
||||
|
|
|
@ -89,6 +89,7 @@
|
|||
'firstname_lastname_format' => 'First Name Last Name (jane.smith@example.com)',
|
||||
'firstname_lastname_underscore_format' => 'First Name Last Name (jane_smith@example.com)',
|
||||
'lastnamefirstinitial_format' => 'Last Name First Initial (smithj@example.com)',
|
||||
'firstintial_dot_lastname_format' => 'First Initial Last Name (j.smith@example.com)',
|
||||
'first' => 'First',
|
||||
'first_name' => 'First Name',
|
||||
'first_name_format' => 'First Name (jane@example.com)',
|
||||
|
|
|
@ -463,11 +463,11 @@ Form::macro('username_format', function ($name = "username_format", $selected =
|
|||
|
||||
$formats = array(
|
||||
'firstname.lastname' => trans('general.firstname_lastname_format'),
|
||||
'firstname' => trans('general.first_name_format'),
|
||||
'filastname' => trans('general.filastname_format'),
|
||||
'lastnamefirstinitial' => trans('general.lastnamefirstinitial_format'),
|
||||
'firstname_lastname' => trans('general.firstname_lastname_underscore_format'),
|
||||
|
||||
'filastname' => trans('general.filastname_format'),
|
||||
'firstintial.lastname' => trans('general.firstintial_dot_lastname_format'),
|
||||
'firstname' => trans('general.first_name_format'),
|
||||
'lastnamefirstinitial' => trans('general.lastnamefirstinitial_format'),
|
||||
);
|
||||
|
||||
$select = '<select name="'.$name.'" class="'.$class.'" style="width: 100%">';
|
||||
|
|
Loading…
Reference in a new issue