diff --git a/htdocs/admin/perms.php b/htdocs/admin/perms.php
index d0a00dcbe51..4368d955457 100644
--- a/htdocs/admin/perms.php
+++ b/htdocs/admin/perms.php
@@ -78,7 +78,7 @@ if ($result)
print '
';
print '
';
- print ''.img_edit_removed().'';
+ print ''.img_edit_remove().'';
}
else
{
diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang
index 4afce836ad7..c919560dd8b 100644
--- a/htdocs/langs/en_US/main.lang
+++ b/htdocs/langs/en_US/main.lang
@@ -1,7 +1,9 @@
# Dolibarr language file - en_US - main
charset="iso-8859-1"
yes=yes
+Yes=Yes
no=no
+No=No
Home=Home
Help=Help
Activate=Activate
@@ -31,6 +33,7 @@ Parameters=Parameters
Value=Value
Type=Type
Note=Note
+Description=Description
Action=Action
About=About
WelcomeString=We are %s, and you are connected with name %s
@@ -59,3 +62,5 @@ Total=Total
TotalHT=Total HT
TotalTTC=Total TTC
Delta=Delta
+Module=Module
+Option=Option
\ No newline at end of file
diff --git a/htdocs/langs/en_US/other.lang b/htdocs/langs/en_US/other.lang
index 45a21923f46..5dc14d717f3 100644
--- a/htdocs/langs/en_US/other.lang
+++ b/htdocs/langs/en_US/other.lang
@@ -1,2 +1,3 @@
# Dolibarr language file - en_US - other
-Calendar=Calendar
\ No newline at end of file
+Calendar=Calendar
+LoginWebcal=Login for Webcalendar
\ No newline at end of file
diff --git a/htdocs/langs/en_US/users.lang b/htdocs/langs/en_US/users.lang
new file mode 100755
index 00000000000..f873d431942
--- /dev/null
+++ b/htdocs/langs/en_US/users.lang
@@ -0,0 +1,11 @@
+# Dolibarr language file - en_US - users
+UserCard=User card
+Permission=Permission
+Permissions=Permissions
+SendNewPassword=Send new password
+AvailableRights=Available permissions
+OwnedRights=Owned permissions
+DisableUser=Disable user
+NewUser=New user
+CreateUser=Create user
+LoginAlreadyExists=This login already exists
\ No newline at end of file
diff --git a/htdocs/langs/fr_FR/main.lang b/htdocs/langs/fr_FR/main.lang
index 313be4466ea..f469ebfa225 100644
--- a/htdocs/langs/fr_FR/main.lang
+++ b/htdocs/langs/fr_FR/main.lang
@@ -1,7 +1,9 @@
# Dolibarr language file - fr_FR - main
charset="iso-8859-1"
yes=oui
+Yes=Oui
no=non
+No=Non
Home=Accueil
Help=Aide
Activate=Activer
@@ -31,6 +33,7 @@ Parameters=Param
Value=Valeur
Type=Type
Note=Note
+Description=Description
Action=Action
About=A propos
WelcomeString=Nous sommes le %s, et vous êtes connectés sous le user %s
@@ -58,4 +61,6 @@ Amount=Amount
Total=Total
TotalHT=Total HT
TotalTTC=Total TTC
-Delta=Ecart
\ No newline at end of file
+Delta=Ecart
+Module=Module
+Option=Option
\ No newline at end of file
diff --git a/htdocs/langs/fr_FR/other.lang b/htdocs/langs/fr_FR/other.lang
index 1dcfb4aaab7..d6e13f246dd 100644
--- a/htdocs/langs/fr_FR/other.lang
+++ b/htdocs/langs/fr_FR/other.lang
@@ -1,2 +1,3 @@
# Dolibarr language file - fr_FR - other
-Calendar=Calendrier
\ No newline at end of file
+Calendar=Calendrier
+LoginWebcal=Login Webcalendar
\ No newline at end of file
diff --git a/htdocs/langs/fr_FR/users.lang b/htdocs/langs/fr_FR/users.lang
new file mode 100755
index 00000000000..ca2dbbe3b6c
--- /dev/null
+++ b/htdocs/langs/fr_FR/users.lang
@@ -0,0 +1,11 @@
+# Dolibarr language file - fr_FR - users
+UserCard=Fiche utilisateur
+Permission=Droit
+Permissions=Droits
+SendNewPassword=Envoyer nouveau mot de passe
+AvailableRights=Permissions disponibles
+OwnedRights=Permissions détendues
+DisableUser=Désactiver utilisateur
+NewUser=Nouvel utilisateur
+CreateUser=Créer l'utilisateur
+LoginAlreadyExists=Ce login existe déjà
\ No newline at end of file
diff --git a/htdocs/lib/functions.inc.php b/htdocs/lib/functions.inc.php
index f8d3bd81ee7..4e620a0143d 100644
--- a/htdocs/lib/functions.inc.php
+++ b/htdocs/lib/functions.inc.php
@@ -33,8 +33,6 @@
Ensemble de fonctions de base de dolibarr sous forme d'include
*/
-$yn[0] = "non";
-$yn[1] = "oui";
/*!
\brief envoi des messages dolibarr dans syslog
@@ -297,7 +295,7 @@ function img_edit_add($alt = "default")
/*!
\brief Affiche logo -
*/
-function img_edit_removed($alt = "default")
+function img_edit_remove($alt = "default")
{
if ($alt="default") {
global $langs;
@@ -527,7 +525,8 @@ function accessforbidden()
function dolibarr_print_error($db='',$msg='')
{
- print "Dolibarr a détectée une erreur technique. \n";
+ global $langs;
+ print "Dolibarr a détecté une erreur technique. \n";
print "Voici les informations qui pourront aider au diagnostique:
\n";
print "Serveur:".$_SERVER["SERVER_SOFTWARE"]." \n";;
@@ -1236,12 +1235,25 @@ function tva($euros, $taux=19.6)
\param euros somme en euro
\param taux taux de tva
*/
-
function inctva($euros, $taux=1.196)
{
return sprintf("%01.2f",($euros * $taux));
}
+/*!
+ \brief Renvoie oui ou non dans la langue choisie
+ \param yesno variable pour test si oui ou non
+ \param case Oui/Non ou oui/non
+*/
+function yn($yesno, $case=1) {
+ global $langs;
+ if ($yesno == 0 || $yesno == 'no' || $yesno == 'false')
+ return $case?$langs->trans("No"):$langs->trans("no");
+ if ($yesno == 1 || $yesno == 'yes' || $yesno == 'true')
+ return $case?$langs->trans("Yes"):$langs->trans("yes");
+ return "unknown";
+}
+
/*!
\brief fonction qui affiche des statistiques
\param basename
@@ -1250,8 +1262,6 @@ function inctva($euros, $taux=1.196)
\param ftc
\param jour
*/
-
-
function stat_print($basename,$bc1,$bc2,$ftc, $jour) {
$db = pg_Connect("","","","","$basename");
diff --git a/htdocs/user/fiche.php b/htdocs/user/fiche.php
index 33a44147665..c088dfcb64e 100644
--- a/htdocs/user/fiche.php
+++ b/htdocs/user/fiche.php
@@ -23,6 +23,9 @@
require("./pre.inc.php");
+$langs->load("users");
+
+
$form = new Form($db);
$action=isset($_GET["action"])?$_GET["action"]:$_POST["action"];
@@ -64,13 +67,19 @@ if ($_POST["action"] == 'add' && $user->admin)
$id = $edituser->create();
- if (isset($_POST['password']) && $_POST['password']!='' )
- {
- $edituser->password($_POST['password'],$conf->password_encrypted);
+ if ($id) {
+ if (isset($_POST['password']) && $_POST['password']!='' )
+ {
+ $edituser->password($_POST['password'],$conf->password_encrypted);
+ }
+
+ Header("Location: fiche.php?id=$id");
+ }
+ else {
+ //dolibarr_print_error($db,$edituser->error());
+ $message=$langs->trans("LoginAlreadyExists");
+ $action="create"; // Go back to create page
}
-
- Header("Location: fiche.php?id=$id");
-
}
if ($_POST["action"] == 'update' && $user->admin)
@@ -120,26 +129,28 @@ llxHeader();
if ($action == 'create')
{
- print_titre('Nouvel utilisateur');
+ print_titre($langs->trans("NewUser"));
+
+ if ($message) { print $message." "; }
print ' |