refactor: replace custom CRM with Monica fork
Some checks failed
Build & Push Monica Image to Gitea Registry / build-and-push (push) Failing after 9s
Some checks failed
Build & Push Monica Image to Gitea Registry / build-and-push (push) Failing after 9s
This commit is contained in:
31
app/Helpers/FormHelper.php
Normal file
31
app/Helpers/FormHelper.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace App\Helpers;
|
||||
|
||||
use App\Models\User\User;
|
||||
|
||||
class FormHelper
|
||||
{
|
||||
/**
|
||||
* Get the name order that will be used when rendered the Add/Edit forms
|
||||
* about contacts.
|
||||
*
|
||||
* @param User $user
|
||||
* @return string
|
||||
*/
|
||||
public static function getNameOrderForForms(User $user): string
|
||||
{
|
||||
$nameOrder = 'firstname';
|
||||
|
||||
switch ($user->name_order) {
|
||||
case 'lastname_firstname':
|
||||
case 'lastname_firstname_nickname':
|
||||
case 'lastname_nickname_firstname':
|
||||
case 'nickname_lastname_firstname':
|
||||
$nameOrder = 'lastname';
|
||||
break;
|
||||
}
|
||||
|
||||
return $nameOrder;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user