PMCORE-2147

This commit is contained in:
Paula Quispe
2022-02-11 11:40:22 -04:00
parent 985db58407
commit 840271a533
3 changed files with 7 additions and 12 deletions

View File

@@ -28154,8 +28154,8 @@ msgstr "User Name"
# TRANSLATION
# LABEL/ID_USER_NAME_ALREADY_EXISTS
#: LABEL/ID_USER_NAME_ALREADY_EXISTS
msgid "The User Name with {0}: \"{1}\" already exists."
msgstr "The User Name with {0}: \"{1}\" already exists."
msgid "The User Name '{0}' already exists."
msgstr "The User Name '{0}' already exists."
# TRANSLATION
# LABEL/ID_USER_NOT_ACTIVE

View File

@@ -61676,7 +61676,7 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE
( 'LABEL','ID_USER_LIST','en','User List','2014-01-15') ,
( 'LABEL','ID_USER_MUST_CHANGE_PASSWORD_AT_NEXT_LOGON','en','User must change password at next logon','2014-05-16') ,
( 'LABEL','ID_USER_NAME','en','User Name','2014-01-15') ,
( 'LABEL','ID_USER_NAME_ALREADY_EXISTS','en','The User Name with {0}: "{1}" already exists.','2015-03-23') ,
( 'LABEL','ID_USER_NAME_ALREADY_EXISTS','en','The User Name ''{0}'' already exists.','2022-02-11') ,
( 'LABEL','ID_USER_NOT_ACTIVE','en','The user is not active.','2015-09-08') ,
( 'LABEL','ID_USER_NOT_ACTIVITY','en','The usr_uid: {0} does not have an activity assigned','2014-05-21') ,
( 'LABEL','ID_USER_NOT_ASSIGNED_TASK','en','The user is not assigned to the task','2014-01-15') ,

View File

@@ -396,17 +396,15 @@ class User
* Verify if exists the Name of a User
*
* @param string $userName Name
* @param string $fieldNameForException Field name for the exception
* @param string $userUidToExclude Unique id of User to exclude
*
* @throws Exception if exists the title of a User
*/
public function throwExceptionIfExistsName($userName, $fieldNameForException, $userUidToExclude = "")
public function throwExceptionIfExistsName($userName, $userUidToExclude = "")
{
try {
if ($this->existsName($userName, $userUidToExclude)) {
throw new Exception(G::LoadTranslation("ID_USER_NAME_ALREADY_EXISTS",
array($fieldNameForException, $userName)));
throw new Exception(G::LoadTranslation("ID_USER_NAME_ALREADY_EXISTS", [$userName]));
}
} catch (Exception $e) {
throw $e;
@@ -446,7 +444,7 @@ class User
{
try {
//Set variables
$arrayUserData = ($userUid == "") ? array() : $this->getUser($userUid, true);
$arrayUserData = ($userUid == "") ? [] : $this->getUser($userUid, true);
$flagInsert = ($userUid == "") ? true : false;
$arrayFinalData = array_merge($arrayUserData, $arrayData);
@@ -459,8 +457,7 @@ class User
//Verify data
if (isset($arrayData["USR_USERNAME"])) {
$this->throwExceptionIfExistsName($arrayData["USR_USERNAME"],
$this->arrayFieldNameForException["usrUsername"], $userUid);
$this->throwExceptionIfExistsName($arrayData["USR_USERNAME"], $userUid);
}
if (isset($arrayData["USR_EMAIL"])) {
@@ -762,8 +759,6 @@ class User
public function create(array $arrayData)
{
try {
//Verify data
$validator = new Validator();