diff --git a/htdocs/telephonie/client/ca.php b/htdocs/telephonie/client/ca.php
index b09a63b0b8f..0a9f9669130 100644
--- a/htdocs/telephonie/client/ca.php
+++ b/htdocs/telephonie/client/ca.php
@@ -108,7 +108,7 @@ if ($_GET["id"])
print '
';
$file = $img_root.$soc->id."/graphgain.png";
- if (file_exists($file))
+ if (file_exists($file) && $user->rights->telephonie->ligne->gain)
{
print ' ';
}
diff --git a/htdocs/telephonie/client/liste.php b/htdocs/telephonie/client/liste.php
index dabb5119b17..8b04716aecf 100644
--- a/htdocs/telephonie/client/liste.php
+++ b/htdocs/telephonie/client/liste.php
@@ -1,5 +1,5 @@
+/* Copyright (C) 2004-2005 Rodolphe Quiedeville
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -65,12 +65,17 @@ $pagenext = $page + 1;
$sql = "SELECT s.idp as socidp, s.nom, count(l.ligne) as ligne, cs.ca";
-$sql .= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."telephonie_societe_ligne as l";
+$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
+$sql .= ",".MAIN_DB_PREFIX."telephonie_societe_ligne as l";
+$sql .= ",".MAIN_DB_PREFIX."societe_perms as sp";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."telephonie_client_stats as cs ON s.idp=cs.fk_client_comm";
$sql .= " WHERE l.fk_client_comm = s.idp ";
+$sql .= " AND s.idp = sp.fk_soc";
+$sql .= " AND sp.fk_user = ".$user->id." AND sp.pread = 1";
+
if ($_GET["search_client"])
{
$sel = urldecode($_GET["search_client"]);
diff --git a/htdocs/telephonie/client/pre.inc.php b/htdocs/telephonie/client/pre.inc.php
index 9628496691d..50c23356fcd 100644
--- a/htdocs/telephonie/client/pre.inc.php
+++ b/htdocs/telephonie/client/pre.inc.php
@@ -53,7 +53,8 @@ function llxHeader($head = "", $title="") {
$menu->add(DOL_URL_ROOT."/telephonie/ligne/index.php", "Lignes");
- $menu->add(DOL_URL_ROOT."/telephonie/ligne/commande/", "Commandes");
+ if ($user->rights->telephonie->ligne_commander)
+ $menu->add(DOL_URL_ROOT."/telephonie/ligne/commande/", "Commandes");
if ($user->rights->telephonie->stats->lire)
$menu->add(DOL_URL_ROOT."/telephonie/stats/", "Statistiques");
|