diff --git a/dev/translation/dynamic_translation_keys.lst b/dev/translation/dynamic_translation_keys.lst index dee58f40a5e..1cfafb46181 100644 --- a/dev/translation/dynamic_translation_keys.lst +++ b/dev/translation/dynamic_translation_keys.lst @@ -1029,7 +1029,6 @@ ErrorLanguageOfTranslatedPageIsSameThanThisPage ErrorLoginDisabled ErrorLoginDoesNotExists ErrorLoginHasNoEmail -ErrorMandatoryParametersNotProvided ErrorMaxNumberReachForThisMask ErrorNewRefIsAlreadyUsed ErrorNoImagickReadimage @@ -2993,7 +2992,6 @@ UserHideExternal UserHideNonEmployee UserID UserLogged -UserLoginFailed UserLogoff UserMargins UserModif diff --git a/dev/translation/ignore_translation_keys.lst b/dev/translation/ignore_translation_keys.lst index 85935caec43..646c4b4fab9 100644 --- a/dev/translation/ignore_translation_keys.lst +++ b/dev/translation/ignore_translation_keys.lst @@ -963,8 +963,8 @@ Collation Config Creation CronLib -CronModuleNotEnabledInThisEntity DateInitialBalance +CronModuleNotEnabledInThisEntity Dimension Don ECM @@ -974,7 +974,6 @@ ErrorLDAPFunctionsAreDisabledOnThisPHP ErrorUpdating Extra FailedToConnectToSFTPAfterSSHAuthentication -FailedToLogin First GroupCreate GroupUpdate diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index e32b4f833fb..4ce695ccda3 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -732,16 +732,19 @@ class Account extends CommonObject // Check parameters if (empty($this->country_id)) { + $langs->load('errors'); $this->error = $langs->transnoentitiesnoconv("ErrorFieldRequired", $langs->transnoentitiesnoconv("Country")); dol_syslog(get_class($this)."::create ".$this->error, LOG_ERR); return -1; } if (empty($this->ref)) { + $langs->load('errors'); $this->error = $langs->transnoentitiesnoconv("ErrorFieldRequired", $langs->transnoentitiesnoconv("Ref")); dol_syslog(get_class($this)."::create ".$this->error, LOG_ERR); return -1; } if (empty($this->date_solde)) { + $langs->load('errors'); $this->error = $langs->transnoentitiesnoconv("ErrorFieldRequired", $langs->transnoentitiesnoconv("DateInitialBalance")); dol_syslog(get_class($this)."::create ".$this->error, LOG_ERR); return -1; @@ -750,6 +753,7 @@ class Account extends CommonObject // Load libraries to check BAN $balance = $this->balance; if (empty($balance) && !empty($this->solde)) { + dol_syslog(get_class($this)."::create solde is deprecated use balance", LOG_NOTICE); $balance = $this->solde; } if (empty($balance)) { @@ -853,8 +857,7 @@ class Account extends CommonObject if ($accline->insert() < 0) { $error++; - $this->error = $accline->error; - $this->errors = $accline->errors; + $this->setErrorsFromObject($accline); } if (!$error) { diff --git a/htdocs/core/login/functions_empty.php b/htdocs/core/login/functions_empty.php index 66688ee52ec..aefe671009a 100644 --- a/htdocs/core/login/functions_empty.php +++ b/htdocs/core/login/functions_empty.php @@ -1,5 +1,6 @@ + * Copyright (C) 2025 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -38,7 +39,8 @@ function check_user_password_empty($usertotest, $passwordtotest, $entitytotest) dol_syslog("functions_empty::check_user_password_empty usertotest=".$usertotest); $login = ''; - $_SESSION["dol_loginmesg"] = $langs->transnoentitiesnoconv("FailedToLogin"); + $langs->load('users'); + $_SESSION["dol_loginmesg"] = $langs->transnoentitiesnoconv("UserLoginFailed"); return $login; } diff --git a/htdocs/expedition/class/expeditionligne.class.php b/htdocs/expedition/class/expeditionligne.class.php index 2fee97e8d0a..ec409c4f6e6 100644 --- a/htdocs/expedition/class/expeditionligne.class.php +++ b/htdocs/expedition/class/expeditionligne.class.php @@ -11,7 +11,7 @@ * Copyright (C) 2015 Claudio Aschieri * Copyright (C) 2016-2024 Ferran Marcet * Copyright (C) 2018 Nicolas ZABOURI - * Copyright (C) 2018-2024 Frédéric France + * Copyright (C) 2018-2025 Frédéric France * Copyright (C) 2020 Lenin Rivas * Copyright (C) 2024-2025 MDW * @@ -369,6 +369,7 @@ class ExpeditionLigne extends CommonObjectLine */ public function insert($user, $notrigger = 0) { + global $langs; $error = 0; // Check parameters @@ -376,7 +377,8 @@ class ExpeditionLigne extends CommonObjectLine || empty($this->fk_product) // product id is mandatory || (empty($this->fk_elementdet) && empty($this->fk_parent)) // at least origin line id of parent line id is set || !is_numeric($this->qty)) { - $this->error = 'ErrorMandatoryParametersNotProvided'; + $langs->load('errors'); + $this->errors[] = $langs->trans('ErrorMandatoryParametersNotProvided'); return -1; } @@ -629,6 +631,7 @@ class ExpeditionLigne extends CommonObjectLine */ public function update($user = null, $notrigger = 0) { + global $langs; $error = 0; dol_syslog(get_class($this)."::update id=$this->id, entrepot_id=$this->entrepot_id, product_id=$this->fk_product, qty=$this->qty"); @@ -675,7 +678,8 @@ class ExpeditionLigne extends CommonObjectLine // check parameters if (!isset($this->id) || !isset($this->entrepot_id)) { dol_syslog(get_class($this).'::update missing line id and/or warehouse id', LOG_ERR); - $this->errors[] = 'ErrorMandatoryParametersNotProvided'; + $langs->load('errors'); + $this->errors[] = $langs->trans('ErrorMandatoryParametersNotProvided'); $error++; return -1; } @@ -688,7 +692,8 @@ class ExpeditionLigne extends CommonObjectLine if (empty($batch_id) || empty($this->fk_product)) { dol_syslog(get_class($this).'::update missing fk_origin_stock (batch_id) and/or fk_product', LOG_ERR); - $this->errors[] = 'ErrorMandatoryParametersNotProvided'; + $langs->load('errors'); + $this->errors[] = $langs->trans('ErrorMandatoryParametersNotProvided'); $error++; } diff --git a/htdocs/langs/en_US/banks.lang b/htdocs/langs/en_US/banks.lang index b89ae8375e7..f70eb824b55 100644 --- a/htdocs/langs/en_US/banks.lang +++ b/htdocs/langs/en_US/banks.lang @@ -23,6 +23,7 @@ BankBalanceAfter=Balance after BalanceMinimalAllowed=Minimum allowed balance BalanceMinimalDesired=Minimum desired balance InitialBankBalance=Initial balance +DateInitialBalance=Date of initial balance EndBankBalance=End balance CurrentBalance=Current balance FutureBalance=Future balance diff --git a/htdocs/langs/en_US/cron.lang b/htdocs/langs/en_US/cron.lang index 3125357cf62..5306196d4f3 100644 --- a/htdocs/langs/en_US/cron.lang +++ b/htdocs/langs/en_US/cron.lang @@ -77,6 +77,7 @@ CronType=Job type CronType_method=Call method of a PHP Class CronType_command=Shell command CronCannotLoadClass=Cannot load class file %s (to use class %s) +CronModuleNotEnabledInThisEntity=Cron module not enabled in this entity (to use %s method of %s object) CronCannotLoadObject=Class file %s was loaded, but object %s was not found into it UseMenuModuleToolsToAddCronJobs=Go into menu "Home - Admin tools - Scheduled jobs" to see and edit scheduled jobs. JobDisabled=Job disabled diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index f9a1b54ae62..ebb36bee3dc 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -1050,7 +1050,8 @@ class Product extends CommonObject $this->mandatory_period = empty($this->mandatory_period) ? 0 : $this->mandatory_period; // Check parameters if (empty($this->label)) { - $this->error = 'ErrorMandatoryParametersNotProvided'; + $langs->load('errors'); + $this->errors[] = $langs->trans('ErrorMandatoryParametersNotProvided'); return -1; }