forked from Wavyzz/dolibarr
Trad: Traduction de la page de cration des users et permissions.
New: Mise en onglet des 2 pages creation user et gestion permission user New: Ajout de la fonction yn() pour remplacer le tableau yn[] car le tableau ne peut pas grer le multilangue.
This commit is contained in:
@@ -78,7 +78,7 @@ if ($result)
|
|||||||
|
|
||||||
print '<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/tick.png" border="0">';
|
print '<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/tick.png" border="0">';
|
||||||
print '</td><td>';
|
print '</td><td>';
|
||||||
print '<a href="perms.php?pid='.$obj->id.'&action=remove">'.img_edit_removed().'</a>';
|
print '<a href="perms.php?pid='.$obj->id.'&action=remove">'.img_edit_remove().'</a>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
# Dolibarr language file - en_US - main
|
# Dolibarr language file - en_US - main
|
||||||
charset="iso-8859-1"
|
charset="iso-8859-1"
|
||||||
yes=yes
|
yes=yes
|
||||||
|
Yes=Yes
|
||||||
no=no
|
no=no
|
||||||
|
No=No
|
||||||
Home=Home
|
Home=Home
|
||||||
Help=Help
|
Help=Help
|
||||||
Activate=Activate
|
Activate=Activate
|
||||||
@@ -31,6 +33,7 @@ Parameters=Parameters
|
|||||||
Value=Value
|
Value=Value
|
||||||
Type=Type
|
Type=Type
|
||||||
Note=Note
|
Note=Note
|
||||||
|
Description=Description
|
||||||
Action=Action
|
Action=Action
|
||||||
About=About
|
About=About
|
||||||
WelcomeString=<font class="body">We are </font>%s<font class="body">, and you are connected with name</font> %s
|
WelcomeString=<font class="body">We are </font>%s<font class="body">, and you are connected with name</font> %s
|
||||||
@@ -59,3 +62,5 @@ Total=Total
|
|||||||
TotalHT=Total HT
|
TotalHT=Total HT
|
||||||
TotalTTC=Total TTC
|
TotalTTC=Total TTC
|
||||||
Delta=Delta
|
Delta=Delta
|
||||||
|
Module=Module
|
||||||
|
Option=Option
|
||||||
@@ -1,2 +1,3 @@
|
|||||||
# Dolibarr language file - en_US - other
|
# Dolibarr language file - en_US - other
|
||||||
Calendar=Calendar
|
Calendar=Calendar
|
||||||
|
LoginWebcal=Login for Webcalendar
|
||||||
11
htdocs/langs/en_US/users.lang
Executable file
11
htdocs/langs/en_US/users.lang
Executable file
@@ -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
|
||||||
@@ -1,7 +1,9 @@
|
|||||||
# Dolibarr language file - fr_FR - main
|
# Dolibarr language file - fr_FR - main
|
||||||
charset="iso-8859-1"
|
charset="iso-8859-1"
|
||||||
yes=oui
|
yes=oui
|
||||||
|
Yes=Oui
|
||||||
no=non
|
no=non
|
||||||
|
No=Non
|
||||||
Home=Accueil
|
Home=Accueil
|
||||||
Help=Aide
|
Help=Aide
|
||||||
Activate=Activer
|
Activate=Activer
|
||||||
@@ -31,6 +33,7 @@ Parameters=Param
|
|||||||
Value=Valeur
|
Value=Valeur
|
||||||
Type=Type
|
Type=Type
|
||||||
Note=Note
|
Note=Note
|
||||||
|
Description=Description
|
||||||
Action=Action
|
Action=Action
|
||||||
About=A propos
|
About=A propos
|
||||||
WelcomeString=<font class="body">Nous sommes le</font> %s<font class="body">, et vous <20>tes connect<63>s sous le user</font> %s
|
WelcomeString=<font class="body">Nous sommes le</font> %s<font class="body">, et vous <20>tes connect<63>s sous le user</font> %s
|
||||||
@@ -58,4 +61,6 @@ Amount=Amount
|
|||||||
Total=Total
|
Total=Total
|
||||||
TotalHT=Total HT
|
TotalHT=Total HT
|
||||||
TotalTTC=Total TTC
|
TotalTTC=Total TTC
|
||||||
Delta=Ecart
|
Delta=Ecart
|
||||||
|
Module=Module
|
||||||
|
Option=Option
|
||||||
@@ -1,2 +1,3 @@
|
|||||||
# Dolibarr language file - fr_FR - other
|
# Dolibarr language file - fr_FR - other
|
||||||
Calendar=Calendrier
|
Calendar=Calendrier
|
||||||
|
LoginWebcal=Login Webcalendar
|
||||||
11
htdocs/langs/fr_FR/users.lang
Executable file
11
htdocs/langs/fr_FR/users.lang
Executable file
@@ -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<43>er l'utilisateur
|
||||||
|
LoginAlreadyExists=Ce login existe d<>j<EFBFBD>
|
||||||
@@ -33,8 +33,6 @@
|
|||||||
Ensemble de fonctions de base de dolibarr sous forme d'include
|
Ensemble de fonctions de base de dolibarr sous forme d'include
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$yn[0] = "non";
|
|
||||||
$yn[1] = "oui";
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief envoi des messages dolibarr dans syslog
|
\brief envoi des messages dolibarr dans syslog
|
||||||
@@ -297,7 +295,7 @@ function img_edit_add($alt = "default")
|
|||||||
/*!
|
/*!
|
||||||
\brief Affiche logo -
|
\brief Affiche logo -
|
||||||
*/
|
*/
|
||||||
function img_edit_removed($alt = "default")
|
function img_edit_remove($alt = "default")
|
||||||
{
|
{
|
||||||
if ($alt="default") {
|
if ($alt="default") {
|
||||||
global $langs;
|
global $langs;
|
||||||
@@ -527,7 +525,8 @@ function accessforbidden()
|
|||||||
|
|
||||||
function dolibarr_print_error($db='',$msg='')
|
function dolibarr_print_error($db='',$msg='')
|
||||||
{
|
{
|
||||||
print "Dolibarr a d<>tect<63>e une erreur technique.<br>\n";
|
global $langs;
|
||||||
|
print "Dolibarr a d<>tect<63> une erreur technique.<br>\n";
|
||||||
print "Voici les informations qui pourront aider au diagnostique:<br><br>\n";
|
print "Voici les informations qui pourront aider au diagnostique:<br><br>\n";
|
||||||
|
|
||||||
print "<b>Serveur:</b>".$_SERVER["SERVER_SOFTWARE"]."<br>\n";;
|
print "<b>Serveur:</b>".$_SERVER["SERVER_SOFTWARE"]."<br>\n";;
|
||||||
@@ -1236,12 +1235,25 @@ function tva($euros, $taux=19.6)
|
|||||||
\param euros somme en euro
|
\param euros somme en euro
|
||||||
\param taux taux de tva
|
\param taux taux de tva
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function inctva($euros, $taux=1.196)
|
function inctva($euros, $taux=1.196)
|
||||||
{
|
{
|
||||||
return sprintf("%01.2f",($euros * $taux));
|
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
|
\brief fonction qui affiche des statistiques
|
||||||
\param basename
|
\param basename
|
||||||
@@ -1250,8 +1262,6 @@ function inctva($euros, $taux=1.196)
|
|||||||
\param ftc
|
\param ftc
|
||||||
\param jour
|
\param jour
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
function stat_print($basename,$bc1,$bc2,$ftc, $jour) {
|
function stat_print($basename,$bc1,$bc2,$ftc, $jour) {
|
||||||
|
|
||||||
$db = pg_Connect("","","","","$basename");
|
$db = pg_Connect("","","","","$basename");
|
||||||
|
|||||||
@@ -23,6 +23,9 @@
|
|||||||
|
|
||||||
require("./pre.inc.php");
|
require("./pre.inc.php");
|
||||||
|
|
||||||
|
$langs->load("users");
|
||||||
|
|
||||||
|
|
||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
|
|
||||||
$action=isset($_GET["action"])?$_GET["action"]:$_POST["action"];
|
$action=isset($_GET["action"])?$_GET["action"]:$_POST["action"];
|
||||||
@@ -64,13 +67,19 @@ if ($_POST["action"] == 'add' && $user->admin)
|
|||||||
|
|
||||||
$id = $edituser->create();
|
$id = $edituser->create();
|
||||||
|
|
||||||
if (isset($_POST['password']) && $_POST['password']!='' )
|
if ($id) {
|
||||||
{
|
if (isset($_POST['password']) && $_POST['password']!='' )
|
||||||
$edituser->password($_POST['password'],$conf->password_encrypted);
|
{
|
||||||
|
$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)
|
if ($_POST["action"] == 'update' && $user->admin)
|
||||||
@@ -120,26 +129,28 @@ llxHeader();
|
|||||||
if ($action == 'create')
|
if ($action == 'create')
|
||||||
{
|
{
|
||||||
|
|
||||||
print_titre('Nouvel utilisateur');
|
print_titre($langs->trans("NewUser"));
|
||||||
|
|
||||||
|
if ($message) { print $message."<br>"; }
|
||||||
|
|
||||||
print '<form action="fiche.php" method="post">';
|
print '<form action="fiche.php" method="post">';
|
||||||
print '<input type="hidden" name="action" value="add">';
|
print '<input type="hidden" name="action" value="add">';
|
||||||
|
|
||||||
print '<table class="border" width="100%" cellpadding="3" cellspacing="0">';
|
print '<table class="border" width="100%" cellpadding="3" cellspacing="0">';
|
||||||
|
|
||||||
print '<tr><td valign="top" width="20%">Pr<EFBFBD>nom</td>';
|
print '<tr><td valign="top" width="20%">'.$langs->trans("FirstName").'</td>';
|
||||||
print '<td class="valeur"><input size="30" type="text" name="prenom" value=""></td></tr>';
|
print '<td class="valeur"><input size="30" type="text" name="prenom" value=""></td></tr>';
|
||||||
|
|
||||||
print "<tr>".'<td valign="top">Nom</td>';
|
print "<tr>".'<td valign="top">'.$langs->trans("LastName").'</td>';
|
||||||
print '<td class="valeur"><input size="30" type="text" name="nom" value=""></td></tr>';
|
print '<td class="valeur"><input size="30" type="text" name="nom" value=""></td></tr>';
|
||||||
|
|
||||||
print "<tr>".'<td valign="top">Login</td>';
|
print "<tr>".'<td valign="top">'.$langs->trans("Login").'</td>';
|
||||||
print '<td class="valeur"><input size="20" type="text" name="login" value=""></td></tr>';
|
print '<td class="valeur"><input size="20" type="text" name="login" value=""></td></tr>';
|
||||||
|
|
||||||
print "<tr>".'<td valign="top">Password</td>';
|
print "<tr>".'<td valign="top">'.$langs->trans("Password").'</td>';
|
||||||
print '<td class="valeur"><input size="30" type="text" name="password" value=""></td></tr>';
|
print '<td class="valeur"><input size="30" type="text" name="password" value=""></td></tr>';
|
||||||
|
|
||||||
print "<tr>".'<td valign="top">Email</td>';
|
print "<tr>".'<td valign="top">'.$langs->trans("EMail").'</td>';
|
||||||
print '<td class="valeur"><input size="40" type="text" name="email" value=""></td></tr>';
|
print '<td class="valeur"><input size="40" type="text" name="email" value=""></td></tr>';
|
||||||
|
|
||||||
print "<tr>".'<td valign="top">Admin</td>';
|
print "<tr>".'<td valign="top">Admin</td>';
|
||||||
@@ -147,20 +158,23 @@ if ($action == 'create')
|
|||||||
$form->selectyesnonum('admin',0);
|
$form->selectyesnonum('admin',0);
|
||||||
print "</td></tr>\n";
|
print "</td></tr>\n";
|
||||||
|
|
||||||
if (defined("MAIN_MODULE_WEBCALENDAR"))
|
print "<tr>".'<td valign="top">'.$langs->trans("Note").'</td><td>';
|
||||||
{
|
|
||||||
print "<tr>".'<td valign="top">Login Webcal</td>';
|
|
||||||
print '<td class="valeur"><input size="30" type="text" name="webcal_login" value=""></td></tr>';
|
|
||||||
}
|
|
||||||
|
|
||||||
print "<tr>".'<td valign="top">Note</td><td>';
|
|
||||||
print "<textarea name=\"note\" rows=\"12\" cols=\"40\">";
|
print "<textarea name=\"note\" rows=\"12\" cols=\"40\">";
|
||||||
print "</textarea></td></tr>\n";
|
print "</textarea></td></tr>\n";
|
||||||
|
|
||||||
print "<tr>".'<td align="center" colspan="2"><input value="Enregistrer" type="submit"></td></tr>';
|
// Autres caract<63>ristiques issus des autres modules
|
||||||
|
if ($conf->webcal->enabled)
|
||||||
|
{
|
||||||
|
print "<tr>".'<td valign="top">'.$langs->trans("LoginWebcal").'</td>';
|
||||||
|
print '<td class="valeur"><input size="30" type="text" name="webcal_login" value=""></td></tr>';
|
||||||
|
}
|
||||||
|
|
||||||
|
print "<tr>".'<td align="center" colspan="2"><input value="'.$langs->trans("CreateUser").'" type="submit"></td></tr>';
|
||||||
print "</form>";
|
print "</form>";
|
||||||
print "</table>\n";
|
print "</table>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
/* */
|
/* */
|
||||||
/* Visu et edition */
|
/* Visu et edition */
|
||||||
@@ -173,38 +187,56 @@ else
|
|||||||
$fuser = new User($db, $_GET["id"]);
|
$fuser = new User($db, $_GET["id"]);
|
||||||
$fuser->fetch();
|
$fuser->fetch();
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Affichage onglets
|
||||||
|
*/
|
||||||
|
|
||||||
|
$h = 0;
|
||||||
|
|
||||||
|
$head[$h][0] = DOL_URL_ROOT.'/user/fiche.php?id='.$fuser->id;
|
||||||
|
$head[$h][1] = $langs->trans("UserCard");
|
||||||
|
if ($_GET["action"] != 'perms') { $hselected=$h; }
|
||||||
|
$h++;
|
||||||
|
|
||||||
|
if ($user->admin)
|
||||||
|
{
|
||||||
|
$head[$h][0] = DOL_URL_ROOT.'/user/fiche.php?action=perms&id='.$fuser->id;
|
||||||
|
$head[$h][1] = $langs->trans("Permissions");
|
||||||
|
if ($_GET["action"] == 'perms') { $hselected=$h; }
|
||||||
|
$h++;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
dolibarr_fiche_head($head, $hselected, $fuser->nom." ".$fuser->prenom);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Confirmation suppression
|
* Confirmation suppression
|
||||||
*/
|
*/
|
||||||
if ($action == 'delete')
|
if ($action == 'delete')
|
||||||
{
|
{
|
||||||
print_fiche_titre("Suppression fiche utilisateur",$message);
|
|
||||||
print '<br>';
|
|
||||||
|
|
||||||
$html = new Form($db);
|
$html = new Form($db);
|
||||||
$html->form_confirm("fiche.php?id=$fuser->id","D<EFBFBD>sactiver cet utilisateur","Etes-vous s<>r de vouloir d<>sactiver cet utilisateur ?","confirm_delete");
|
$html->form_confirm("fiche.php?id=$fuser->id","D<EFBFBD>sactiver cet utilisateur","Etes-vous s<>r de vouloir d<>sactiver cet utilisateur ?","confirm_delete");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if ($_GET["action"] == 'perms')
|
if ($_GET["action"] == 'perms')
|
||||||
{
|
{
|
||||||
print_fiche_titre("Permissions utilisateur",$message);
|
if ($message) { print "$message<br>"; }
|
||||||
print '<br>';
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Ecran ajout/suppression permission
|
* Ecran ajout/suppression permission
|
||||||
*/
|
*/
|
||||||
|
|
||||||
print '<table class="border" width="100%" border="0" cellpadding="3" cellspacing="0">';
|
print '<table class="noborder" width="100%" border="0" cellpadding="3" cellspacing="0">';
|
||||||
|
|
||||||
print '<tr><td width="25%" valign="top">Nom</td>';
|
|
||||||
print '<td width="25%" class="valeur">'.$fuser->nom.'</td>';
|
|
||||||
print '<td width="25%" valign="top">Pr<50>nom</td>';
|
|
||||||
print '<td width="25%" class="valeur">'.$fuser->prenom.'</td></tr>';
|
|
||||||
|
|
||||||
// Droits existant
|
// Droits existant
|
||||||
print "<tr>".'<td valign="top" colspan="2">';
|
print "<tr>".'<td valign="top" colspan="2">';
|
||||||
print '<table width="100%" class="noborder" cellpadding="2" cellspacing="0">';
|
print '<table width="100%" class="noborder" cellpadding="2" cellspacing="0">';
|
||||||
$sql = "SELECT r.id, r.libelle, r.module FROM ".MAIN_DB_PREFIX."rights_def as r ORDER BY r.id ASC";
|
print '<tr class="liste_titre"><td>'.$langs->trans("AvailableRights").'</td><td>'.$langs->trans("Module").'</td><td> </td></tr>';
|
||||||
|
$sql = "SELECT r.id, r.libelle, r.module FROM ".MAIN_DB_PREFIX."rights_def as r ORDER BY r.module, r.id ASC";
|
||||||
|
|
||||||
if ($db->query($sql))
|
if ($db->query($sql))
|
||||||
{
|
{
|
||||||
@@ -219,8 +251,10 @@ else
|
|||||||
$oldmod = $obj->module;
|
$oldmod = $obj->module;
|
||||||
$var = !$var;
|
$var = !$var;
|
||||||
}
|
}
|
||||||
print '<tr '. $bc[$var].'><td><a href="fiche.php?id='.$fuser->id.'&action=perms&subaction=addrights&rights='.$obj->id.'">'.$langs->trans("Add").'</a></td>';
|
print '<tr '. $bc[$var].'>';
|
||||||
print '<td>'.$obj->libelle . '</td><td>'.$obj->module . '</td></tr>';
|
print '<td>'.$obj->libelle . '</td><td>'.$obj->module . '</td>';
|
||||||
|
print '<td><a href="fiche.php?id='.$fuser->id.'&action=perms&subaction=addrights&rights='.$obj->id.'">'.img_edit_add().'</a></td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
@@ -231,8 +265,9 @@ else
|
|||||||
|
|
||||||
// Droits poss<73>d<EFBFBD>s
|
// Droits poss<73>d<EFBFBD>s
|
||||||
print '<table class="noborder" width="100%" cellpadding="2" cellspacing="0">';
|
print '<table class="noborder" width="100%" cellpadding="2" cellspacing="0">';
|
||||||
|
print '<tr class="liste_titre"><td> </td><td>'.$langs->trans("OwnedRights").'</td><td>'.$langs->trans("Module").'</td></tr>';
|
||||||
$sql = "SELECT r.id, r.libelle, r.module FROM ".MAIN_DB_PREFIX."rights_def as r, ".MAIN_DB_PREFIX."user_rights as ur";
|
$sql = "SELECT r.id, r.libelle, r.module FROM ".MAIN_DB_PREFIX."rights_def as r, ".MAIN_DB_PREFIX."user_rights as ur";
|
||||||
$sql .= " WHERE ur.fk_id = r.id AND ur.fk_user = ".$fuser->id. " ORDER BY r.id ASC";
|
$sql .= " WHERE ur.fk_id = r.id AND ur.fk_user = ".$fuser->id. " ORDER BY r.module, r.id ASC";
|
||||||
$var = True;
|
$var = True;
|
||||||
if ($db->query($sql))
|
if ($db->query($sql))
|
||||||
{
|
{
|
||||||
@@ -247,55 +282,47 @@ else
|
|||||||
$var = !$var;
|
$var = !$var;
|
||||||
}
|
}
|
||||||
|
|
||||||
print "<tr $bc[$var]><td>".$obj->libelle . '</td><td>'.$obj->module . '</td>';
|
print "<tr $bc[$var]>";
|
||||||
print '<td align="right"><a href="fiche.php?id='.$fuser->id.'&action=perms&subaction=delrights&rights='.$obj->id.'">'.img_delete().'</a></td></tr>';
|
print '<td align="right"><a href="fiche.php?id='.$fuser->id.'&action=perms&subaction=delrights&rights='.$obj->id.'">'.img_edit_remove().'</a></td>';
|
||||||
|
print "<td>".$obj->libelle . '</td><td>'.$obj->module . '</td>';
|
||||||
|
print '</tr>';
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
print '</table>';
|
print '</table>';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
print "<tr>".'<td align="center" colspan="4"><a href="fiche.php?id='.$id.'">ok</a></td></tr></table>';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if ($_GET["action"] != 'perms' && $_GET["action"] != 'edit')
|
if ($_GET["action"] != 'perms' && $_GET["action"] != 'edit')
|
||||||
{
|
{
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Affichage onglet
|
* Fiche en mode visu
|
||||||
*/
|
*/
|
||||||
$h = 0;
|
|
||||||
|
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/user/fiche.php?id='.$fuser->id;
|
|
||||||
$head[$h][1] = "Fiche utilisateur";
|
|
||||||
$h++;
|
|
||||||
|
|
||||||
dolibarr_fiche_head($head, $hselected);
|
|
||||||
|
|
||||||
|
|
||||||
print '<table class="border" width="100%" cellpadding="3" cellspacing="0">';
|
print '<table class="border" width="100%" cellpadding="3" cellspacing="0">';
|
||||||
|
|
||||||
print "<tr>".'<td width="25%" valign="top">Nom</td>';
|
print "<tr>".'<td width="25%" valign="top">'.$langs->trans("LastName").'</td>';
|
||||||
print '<td width="25%" class="valeur">'.$fuser->nom.'</td>';
|
print '<td width="25%" class="valeur">'.$fuser->nom.'</td>';
|
||||||
print '<td width="25%" valign="top">Pr<EFBFBD>nom</td>';
|
print '<td width="25%" valign="top">'.$langs->trans("FirstName").'</td>';
|
||||||
print '<td width="25%" class="valeur">'.$fuser->prenom.'</td>';
|
print '<td width="25%" class="valeur">'.$fuser->prenom.'</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
print "<tr>".'<td width="25%" valign="top">Login</td>';
|
print "<tr>".'<td width="25%" valign="top">'.$langs->trans("Login").'</td>';
|
||||||
print '<td width="25%" class="valeur">'.$fuser->login.'</td>';
|
print '<td width="25%" class="valeur">'.$fuser->login.'</td>';
|
||||||
print '<td width="25%" valign="top">Email</td>';
|
print '<td width="25%" valign="top">'.$langs->trans("EMail").'</td>';
|
||||||
print '<td width="25%" class="valeur"><a href="mailto:'.$fuser->email.'">'.$fuser->email.'</a></td>';
|
print '<td width="25%" class="valeur"><a href="mailto:'.$fuser->email.'">'.$fuser->email.'</a></td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
print "<tr>".'<td width="25%" valign="top">Administrateur</td>';
|
print "<tr>".'<td width="25%" valign="top">Administrateur</td>';
|
||||||
print '<td colspan="3" class="valeur">'.$yn[$fuser->admin].'</td>';
|
print '<td colspan="3" class="valeur">'.yn($fuser->admin).'</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
if ($fuser->societe_id > 0)
|
if ($fuser->societe_id > 0)
|
||||||
{
|
{
|
||||||
$societe = new Societe($db);
|
$societe = new Societe($db);
|
||||||
$societe->fetch($fuser->societe_id);
|
$societe->fetch($fuser->societe_id);
|
||||||
print "<tr>".'<td width="25%" valign="top">Soci<EFBFBD>t<EFBFBD></td>';
|
print "<tr>".'<td width="25%" valign="top">'.$langs->trans("Company").'</td>';
|
||||||
print '<td colspan="3">'.$societe->nom.' </td>';
|
print '<td colspan="3">'.$societe->nom.' </td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
}
|
}
|
||||||
@@ -313,12 +340,12 @@ else
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
print "<tr>".'<td width="25%" valign="top">Note</td>';
|
print "<tr>".'<td width="25%" valign="top">'.$langs->trans("Note").'</td>';
|
||||||
print '<td colspan="3" class="valeur">'.nl2br($fuser->note).' </td>';
|
print '<td colspan="3" class="valeur">'.nl2br($fuser->note).' </td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
// Autres caract<63>ristiques issus des autres modules
|
// Autres caract<63>ristiques issus des autres modules
|
||||||
if (defined("MAIN_MODULE_WEBCALENDAR"))
|
if ($conf->webcal->enabled)
|
||||||
{
|
{
|
||||||
print "<tr>".'<td width="25%" valign="top">Webcal Login</td>';
|
print "<tr>".'<td width="25%" valign="top">Webcal Login</td>';
|
||||||
print '<td colspan="3">'.$fuser->webcal_login.' </td>';
|
print '<td colspan="3">'.$fuser->webcal_login.' </td>';
|
||||||
@@ -330,13 +357,39 @@ else
|
|||||||
|
|
||||||
print "</div>\n";
|
print "</div>\n";
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Barre d'actions
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
print '<div class="tabsAction">';
|
||||||
|
|
||||||
|
if ($user->admin)
|
||||||
|
{
|
||||||
|
print '<a class="tabAction" href="fiche.php?id='.$fuser->id.'&action=edit">'.$langs->trans("Edit").'</a>';
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($user->id == $id or $user->admin)
|
||||||
|
{
|
||||||
|
print '<a class="tabAction" href="fiche.php?id='.$fuser->id.'&action=password">'.$langs->trans("SendNewPassword").'</a>';
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($user->admin && $user->id <> $id)
|
||||||
|
{
|
||||||
|
print '<a class="tabAction" href="fiche.php?action=delete&id='.$fuser->id.'">'.$langs->trans("DisableUser").'</a>';
|
||||||
|
}
|
||||||
|
|
||||||
|
print "</div>\n";
|
||||||
|
print "<br>\n";
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Droits
|
* Droits
|
||||||
*/
|
*/
|
||||||
print '<table width="100%" class="noborder" cellpadding="0" cellspacing="0">';
|
print '<table width="100%" class="noborder" cellpadding="0" cellspacing="0">';
|
||||||
print '<tr class="liste_titre"><td>Droits</td><td>Module</td></tr>';
|
print '<tr class="liste_titre"><td>'.$langs->trans("Permissions").'</td><td>'.$langs->trans("Module").'</td></tr>';
|
||||||
$sql = "SELECT r.libelle, r.module FROM ".MAIN_DB_PREFIX."rights_def as r, ".MAIN_DB_PREFIX."user_rights as ur";
|
$sql = "SELECT r.libelle, r.module FROM ".MAIN_DB_PREFIX."rights_def as r, ".MAIN_DB_PREFIX."user_rights as ur";
|
||||||
$sql .= " WHERE ur.fk_id = r.id AND ur.fk_user = ".$fuser->id. " ORDER BY r.id ASC";
|
$sql .= " WHERE ur.fk_id = r.id AND ur.fk_user = ".$fuser->id. " ORDER BY r.module, r.id ASC";
|
||||||
$var = True;
|
$var = True;
|
||||||
if ($db->query($sql))
|
if ($db->query($sql))
|
||||||
{
|
{
|
||||||
@@ -358,35 +411,6 @@ else
|
|||||||
print "</table>\n";
|
print "</table>\n";
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
|
|
||||||
/*
|
|
||||||
* Barre d'actions
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
print '<div class="tabsAction">';
|
|
||||||
|
|
||||||
if ($user->admin)
|
|
||||||
{
|
|
||||||
print '<a class="tabAction" href="fiche.php?id='.$fuser->id.'&action=edit">'.$langs->trans("Edit").'</a>';
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($user->id == $id or $user->admin)
|
|
||||||
{
|
|
||||||
print '<a class="tabAction" href="fiche.php?id='.$fuser->id.'&action=password">Envoyer nouveau mot de passe</a>';
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($user->admin)
|
|
||||||
{
|
|
||||||
print '<a class="tabAction" href="fiche.php?action=perms&id='.$fuser->id.'">Permissions</a>';
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($user->admin && $user->id <> $id)
|
|
||||||
{
|
|
||||||
print '<a class="tabAction" href="fiche.php?action=delete&id='.$fuser->id.'">D<>sactiver utilisateur</a>';
|
|
||||||
}
|
|
||||||
|
|
||||||
print "</div>\n";
|
|
||||||
print "<br>\n";
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
@@ -396,49 +420,49 @@ else
|
|||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
if ($_GET["action"] == 'edit' && $user->admin)
|
if ($_GET["action"] == 'edit' && $user->admin)
|
||||||
{
|
{
|
||||||
print_fiche_titre("Edition fiche utilisateur",$message);
|
|
||||||
print '<br>';
|
|
||||||
|
|
||||||
print '<form action="fiche.php?id='.$fuser->id.'" method="post">';
|
print '<form action="fiche.php?id='.$fuser->id.'" method="post">';
|
||||||
print '<input type="hidden" name="action" value="update">';
|
print '<input type="hidden" name="action" value="update">';
|
||||||
print '<table class="border" border="1" cellpadding="3" cellspacing="0">';
|
print '<table wdith="100%" class="border" border="1" cellpadding="3" cellspacing="0">';
|
||||||
|
|
||||||
print "<tr>".'<td valign="top">Nom</td>';
|
print "<tr>".'<td valign="top">'.$langs->trans("LastName").'</td>';
|
||||||
print '<td><input size="30" type="text" name="nom" value="'.$fuser->nom.'"></td></tr>';
|
print '<td><input size="30" type="text" name="nom" value="'.$fuser->nom.'"></td></tr>';
|
||||||
|
|
||||||
print "<tr>".'<td valign="top">Pr<EFBFBD>nom</td>';
|
print "<tr>".'<td valign="top">'.$langs->trans("FirstName").'</td>';
|
||||||
print '<td><input size="20" type="text" name="prenom" value="'.$fuser->prenom.'"></td></tr>';
|
print '<td><input size="20" type="text" name="prenom" value="'.$fuser->prenom.'"></td></tr>';
|
||||||
|
|
||||||
print "<tr>".'<td valign="top">Login</td>';
|
print "<tr>".'<td valign="top">'.$langs->trans("Login").'</td>';
|
||||||
print '<td><input size="10" maxlength="8" type="text" name="login" value="'.$fuser->login.'"></td></tr>';
|
print '<td><input size="10" maxlength="8" type="text" name="login" value="'.$fuser->login.'"></td></tr>';
|
||||||
|
|
||||||
print "<tr>".'<td valign="top">Email</td>';
|
print "<tr>".'<td valign="top">'.$langs->trans("EMail").'</td>';
|
||||||
print '<td><input size="30" type="text" name="email" value="'.$fuser->email.'"></td></tr>';
|
print '<td><input size="30" type="text" name="email" value="'.$fuser->email.'"></td></tr>';
|
||||||
print "<tr>".'<td valign="top">Admin ?</td>';
|
|
||||||
if ($fuser->societe_id > 0)
|
|
||||||
{
|
|
||||||
print '<td class="valeur">';
|
|
||||||
print '<input type="hidden" name="admin" value="0">non';
|
|
||||||
print '</td></tr>';
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
print '<td class="valeur">';
|
|
||||||
$form->selectyesnonum('admin',$fuser->admin);
|
|
||||||
print '</td></tr>';
|
|
||||||
}
|
|
||||||
|
|
||||||
print "<tr>".'<td valign="top">Login Webcal</td>';
|
print "<tr>".'<td valign="top">'.$langs->trans("Admin").'</td>';
|
||||||
print '<td class="valeur"><input size="30" type="text" name="webcal_login" value="'.$fuser->webcal_login.'"></td></tr>';
|
if ($fuser->societe_id > 0)
|
||||||
|
{
|
||||||
|
print '<td class="valeur">';
|
||||||
|
print '<input type="hidden" name="admin" value="0">'.$langs->trans("No");
|
||||||
|
print '</td></tr>';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<td class="valeur">';
|
||||||
|
$form->selectyesnonum('admin',$fuser->admin);
|
||||||
|
print '</td></tr>';
|
||||||
|
}
|
||||||
|
|
||||||
print "<tr>".'<td valign="top">Note</td><td>';
|
print "<tr>".'<td valign="top">'.$langs->trans("Note").'</td><td>';
|
||||||
print "<textarea name=\"note\" rows=\"12\" cols=\"40\">";
|
print "<textarea name=\"note\" rows=\"10\" cols=\"40\">";
|
||||||
print $fuser->note;
|
print $fuser->note;
|
||||||
print "</textarea></td></tr>";
|
print "</textarea></td></tr>";
|
||||||
|
|
||||||
print "<tr>".'<td align="center" colspan="3"><input value="Enregistrer" type="submit"></td></tr>';
|
// Autres caract<63>ristiques issus des autres modules
|
||||||
print '</form>';
|
print "<tr>".'<td valign="top">'.$langs->trans("LoginWebcal").'</td>';
|
||||||
|
print '<td class="valeur"><input size="30" type="text" name="webcal_login" value="'.$fuser->webcal_login.'"></td></tr>';
|
||||||
|
|
||||||
|
print "<tr>".'<td align="center" colspan="2"><input value="Enregistrer" type="submit"></td></tr>';
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
print '</form>';
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user