diff --git a/ChangeLog b/ChangeLog index 7905186faaa6af1cffd0efae8e98c3fd44c83258..ed5daa0f8fd1175428a244eae03be23d5f70cc1c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -55,6 +55,7 @@ For users: For translators: - Qual: Normalized sort order of all languages files with english reference files. - New: Add language code files for South Africa. +- New: Translate the email to change password. For developers: - New: DolGraph can build graph with three lines. diff --git a/htdocs/langs/en_US/other.lang b/htdocs/langs/en_US/other.lang index 4ea725ca84f5871480b249333f1b4b6998a3cbfb..6f12f1ce4d16cb7d47cc933c6e66c7dcaad4854b 100644 --- a/htdocs/langs/en_US/other.lang +++ b/htdocs/langs/en_US/other.lang @@ -174,6 +174,12 @@ StartUpload=Start upload CancelUpload=Cancel upload FileIsTooBig=Files is too big PleaseBePatient=Please be patient... +RequestToResetPasswordReceived=A request to change your Dolibarr password has been received +NewKeyIs=This is your new keys to login +NewKeyWillBe=Your new key to login to software will be +ClickHereToGoTo=Click here to go to %s +YouMustClickToChange=You must however first click on the following link to validate this password change +ForgetIfNothing=If you didn't request this change, just forget this email. Your credentials are kept safe. ##### Calendar common ##### AddCalendarEntry=Add entry in calendar %s diff --git a/htdocs/langs/en_US/users.lang b/htdocs/langs/en_US/users.lang index 931eb13b05baff37ec30daf9f7c261a879ed85b5..e8abd699b9c883a7df4d723d03cda401d3c01040 100644 --- a/htdocs/langs/en_US/users.lang +++ b/htdocs/langs/en_US/users.lang @@ -116,4 +116,5 @@ NbOfUsers=Nb of users DontDowngradeSuperAdmin=Only a superadmin can downgrade a superadmin HierarchicalResponsible=Hierarchical responsible HierarchicView=Hierarchical view -UseTypeFieldToChange=Use field Type to change \ No newline at end of file +UseTypeFieldToChange=Use field Type to change + diff --git a/htdocs/langs/fr_FR/other.lang b/htdocs/langs/fr_FR/other.lang index a749069e99d82e32f88b4e91400fe4fb4f5031ba..516eafc4f52c0de38e99421bbb483d9830208cc5 100644 --- a/htdocs/langs/fr_FR/other.lang +++ b/htdocs/langs/fr_FR/other.lang @@ -174,6 +174,12 @@ StartUpload=Transférer CancelUpload=Annuler le transfert FileIsTooBig=Le fichier est trop volumineux PleaseBePatient=Merci de patienter quelques instants… +RequestToResetPasswordReceived=Une demande de modification de mot de passe a été reçue +NewKeyIs=Voici vos nouveaux identifiants pour vous connecter +NewKeyWillBe=Vos nouveaux identifiants pour vous connecter à l'application seront +ClickHereToGoTo=Cliquez ici pour aller sur %s +YouMustClickToChange=Vous devez toutefois auparavant cliquer sur le lien suivant, afin de valider ce changement de mot de passe +ForgetIfNothing=Si vous n'êtes pas à l'origine de la demande, ignorez simplement ce mail. Votre accès reste sécurisé. ##### Calendar common ##### AddCalendarEntry=Ajouter entrée dans le calendrier %s diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 39fc2132042304f91bc9539d12d67acd1a482666..65ea0dd73f15b0b4a2a067730083db3fc1159e43 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -96,7 +96,7 @@ class User extends CommonObject var $users; // To store all tree of users hierarchy var $parentof; // To store an array of all parents for all ids. - + var $accountancy_code; // Accountancy code in prevision of the complete accountancy module @@ -1457,7 +1457,6 @@ class User extends CommonObject require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; - $subject = $langs->trans("SubjectNewPassword"); $msgishtml=0; // Define $msg @@ -1474,35 +1473,41 @@ class User extends CommonObject $outputlangs=$langs; } + $outputlangs->load("main"); + $outputlangs->load("errors"); + $outputlangs->load("users"); + $outputlangs->load("other"); + + $subject = $outputlangs->trans("SubjectNewPassword"); + // Define $urlwithroot //$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root)); //$urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file $urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current - // TODO Use outputlangs to translate messages if (! $changelater) { - $mesg.= "A request to change your Dolibarr password has been received.\n"; - $mesg.= "This is your new keys to login:\n\n"; - $mesg.= $langs->trans("Login")." : $this->login\n"; - $mesg.= $langs->trans("Password")." : $password\n\n"; + $mesg.= $outputlangs->transnoentitiesnoconv("RequestToResetPasswordReceived").".\n"; + $mesg.= $outputlangs->transnoentitiesnoconv("NewKeyIs")." :\n\n"; + $mesg.= $outputlangs->transnoentitiesnoconv("Login")." = ".$this->login."\n"; + $mesg.= $outputlangs->transnoentitiesnoconv("Password")." = ".$password."\n\n"; $mesg.= "\n"; $url = $urlwithroot; - $mesg.= 'Click here to go to Dolibarr: '.$url."\n\n"; + $mesg.= $outputlangs->transnoentitiesnoconv("ClickHereToGoTo", $conf->global->MAIN_APPLICATION_TITLE).': '.$url."\n\n"; $mesg.= "--\n"; - $mesg.= $user->getFullName($langs); // Username that make then sending + $mesg.= $user->getFullName($outputlangs); // Username that make then sending } else { - $mesg.= "A request to change your Dolibarr password has been received.\n"; - $mesg.= "Your new key to login will be:\n\n"; - $mesg.= $langs->trans("Login")." : $this->login\n"; - $mesg.= $langs->trans("Password")." : $password\n\n"; + $mesg.= $outputlangs->transnoentitiesnoconv("RequestToResetPasswordReceived")."\n"; + $mesg.= $outputlangs->transnoentitiesnoconv("NewKeyWillBe")." :\n\n"; + $mesg.= $outputlangs->transnoentitiesnoconv("Login")." = ".$this->login."\n"; + $mesg.= $outputlangs->transnoentitiesnoconv("Password")." = ".$password."\n\n"; $mesg.= "\n"; - $mesg.= "You must click on the folowing link to validate its change.\n"; + $mesg.= $outputlangs->transnoentitiesnoconv("YouMustClickToChange")." :\n"; $url = $urlwithroot.'/user/passwordforgotten.php?action=validatenewpassword&username='.$this->login."&passwordmd5=".dol_hash($password); $mesg.= $url."\n\n"; - $mesg.= "If you didn't ask anything, just forget this email\n\n"; + $mesg.= $outputlangs->transnoentitiesnoconv("ForgetIfNothing")."\n\n"; dol_syslog(get_class($this)."::send_password url=".$url); } $mailfile = new CMailFile(