Added first-initial dot lastname format for usernames/email

Fixed [ch1379]
This commit is contained in:
snipe 2019-04-02 18:21:54 -07:00
parent 37b8029d04
commit fe553aec02
3 changed files with 8 additions and 4 deletions

View file

@ -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);

View file

@ -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)',

View file

@ -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%">';