diff --git a/htdocs/telephonie/ligne/fiche.php b/htdocs/telephonie/ligne/fiche.php index fc1a6724ee7..dffeafe9aec 100644 --- a/htdocs/telephonie/ligne/fiche.php +++ b/htdocs/telephonie/ligne/fiche.php @@ -519,7 +519,6 @@ else if (!$client_comm->perm_read) { - print decoct($client_comm->id); print "Lecture non authorisée"; } @@ -537,9 +536,12 @@ else if ($ligne->statut == -1) { - $head[$h][0] = DOL_URL_ROOT."/telephonie/ligne/commande.php?id=".$ligne->id; - $head[$h][1] = $langs->trans('Commande'); - $h++; + if ($user->rights->telephonie->ligne->creer) + { + $head[$h][0] = DOL_URL_ROOT."/telephonie/ligne/commande.php?id=".$ligne->id; + $head[$h][1] = $langs->trans('Commande'); + $h++; + } } else { diff --git a/htdocs/telephonie/ligne/remises.php b/htdocs/telephonie/ligne/remises.php index e2281e2ff3c..c3503b6b08e 100644 --- a/htdocs/telephonie/ligne/remises.php +++ b/htdocs/telephonie/ligne/remises.php @@ -37,17 +37,25 @@ if ($cancel == $langs->trans("Cancel")) if ($_GET["id"]) { - - $ligne = new LigneTel($db); - + $ligne = new LigneTel($db); $result = $ligne->fetch_by_id($_GET["id"]); } -if ( $result ) +if ($result == 1) +{ + $client_comm = new Societe($db); + $client_comm->fetch($ligne->client_comm_id, $user); +} + +if (!$client_comm->perm_read) +{ + print "Lecture non authorisée"; +} + +if ($result == 1 && $client_comm->perm_read) { if ($_GET["action"] <> 'edit' && $_GET["action"] <> 're-edit') { - $h=0; $head[$h][0] = DOL_URL_ROOT."/telephonie/ligne/fiche.php?id=".$ligne->id; $head[$h][1] = $langs->trans("Ligne"); @@ -58,7 +66,6 @@ if ( $result ) $hselected=$h; $h++; - dolibarr_fiche_head($head, $hselected, 'Ligne : '.$ligne->numero); print_fiche_titre('Fiche Ligne', $mesg); @@ -70,9 +77,6 @@ if ( $result ) $client = new Societe($db, $ligne->client_id); $client->fetch($ligne->client_id); - $client_comm = new Societe($db, $ligne->client_comm_id); - $client_comm->fetch($ligne->client_comm_id); - print '