Skip to content
Snippets Groups Projects
Commit ab06dd95 authored by Rodolphe Quiedeville's avatar Rodolphe Quiedeville
Browse files

Modif permissions

parent a09228e7
Branches
Tags
No related merge requests found
...@@ -36,9 +36,14 @@ if ($cancel == $langs->trans("Cancel")) ...@@ -36,9 +36,14 @@ if ($cancel == $langs->trans("Cancel"))
if ($_GET["id"]) if ($_GET["id"])
{ {
$soc = new Societe($db); $soc = new Societe($db);
$result = $soc->fetch($_GET["id"]); $result = $soc->fetch($_GET["id"], $user);
if ( $result == 1 ) if (!$soc->perm_read)
{
print "Lecture non authorise";
}
if ( $result == 1 && $soc->perm_read)
{ {
if ($_GET["action"] <> 'edit' && $_GET["action"] <> 're-edit') if ($_GET["action"] <> 'edit' && $_GET["action"] <> 're-edit')
{ {
......
...@@ -38,9 +38,14 @@ if ($cancel == $langs->trans("Cancel")) ...@@ -38,9 +38,14 @@ if ($cancel == $langs->trans("Cancel"))
if ($_GET["id"]) if ($_GET["id"])
{ {
$soc = new Societe($db); $soc = new Societe($db);
$result = $soc->fetch($_GET["id"]); $result = $soc->fetch($_GET["id"], $user);
if ( $result == 1 ) if (!$soc->perm_read)
{
print "Lecture non authorise";
}
if ( $result == 1 && $soc->perm_read)
{ {
if ($_GET["action"] <> 'edit' && $_GET["action"] <> 're-edit') if ($_GET["action"] <> 'edit' && $_GET["action"] <> 're-edit')
{ {
...@@ -66,6 +71,13 @@ if ($_GET["id"]) ...@@ -66,6 +71,13 @@ if ($_GET["id"])
$head[$h][1] = $langs->trans("Tarifs"); $head[$h][1] = $langs->trans("Tarifs");
$h++; $h++;
if ($soc->perm_perms)
{
$head[$h][0] = DOL_URL_ROOT."/telephonie/client/permissions.php?id=".$soc->id;
$head[$h][1] = $langs->trans("Permissions");
$h++;
}
dolibarr_fiche_head($head, $hselected, 'Client : '.$soc->nom); dolibarr_fiche_head($head, $hselected, 'Client : '.$soc->nom);
print '<table class="border" cellpadding="3" cellspacing="0" width="100%">'; print '<table class="border" cellpadding="3" cellspacing="0" width="100%">';
......
...@@ -38,9 +38,14 @@ if ($cancel == $langs->trans("Cancel")) ...@@ -38,9 +38,14 @@ if ($cancel == $langs->trans("Cancel"))
if ($_GET["id"]) if ($_GET["id"])
{ {
$soc = new Societe($db); $soc = new Societe($db);
$result = $soc->fetch($_GET["id"]); $result = $soc->fetch($_GET["id"], $user);
if ( $result == 1 ) if (!$soc->perm_read)
{
print "Lecture non authorise";
}
if ( $result == 1 && $soc->perm_read)
{ {
if ($_GET["action"] <> 'edit' && $_GET["action"] <> 're-edit') if ($_GET["action"] <> 'edit' && $_GET["action"] <> 're-edit')
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment