diff --git a/htdocs/telephonie/contrat/services.php b/htdocs/telephonie/contrat/services.php
index dcf26fbfd52..dbf11e80a8c 100644
--- a/htdocs/telephonie/contrat/services.php
+++ b/htdocs/telephonie/contrat/services.php
@@ -199,7 +199,8 @@ if ($_GET["id"])
print '
| Service | ';
print 'Montant Facturé | ';
print 'Montant du service | ';
- print " | \n";
+ if ($user->rights->telephonie->ligne->creer)
+ print " | \n";
print 'Ajouté par | ';
print 'Ajouté le |
';
@@ -218,9 +219,12 @@ if ($_GET["id"])
print ''.price($obj->montant_fac)." euros HT | \n";
print ''.price($obj->montant)." euros HT | \n";
+ if ($user->rights->telephonie->ligne->creer)
+ {
print '';
print img_delete();
print " | ";
+ }
print ''.$obj->firstname.' '.$obj->name.' | ';
print ''.strftime("%d/%m/%y",$obj->date_creat).' | ';
print "\n";
diff --git a/htdocs/telephonie/ligne/factures.php b/htdocs/telephonie/ligne/factures.php
index fcab1723e5e..933a51dde04 100644
--- a/htdocs/telephonie/ligne/factures.php
+++ b/htdocs/telephonie/ligne/factures.php
@@ -42,8 +42,21 @@ if ($_GET["id"] or $_GET["numero"])
$result = $ligne->fetch($_GET["numero"]);
}
}
+
+
+ if ($result == 1)
+ {
+ $client_comm = new Societe($db);
+ $client_comm->fetch($ligne->client_comm_id, $user);
+ }
- if ( $result )
+ if (!$client_comm->perm_read)
+ {
+ print "Lecture non authorisée";
+ }
+
+
+ if ($result == 1 && $client_comm->perm_read)
{
$h=0;
@@ -56,9 +69,11 @@ if ($_GET["id"] or $_GET["numero"])
$hselected = $h;
$h++;
+ /*
$head[$h][0] = DOL_URL_ROOT."/telephonie/ligne/facturesdet.php?id=".$ligne->id;
$head[$h][1] = $langs->trans('Factures détaillées');
$h++;
+ */
$head[$h][0] = DOL_URL_ROOT."/telephonie/ligne/infoc.php?id=".$ligne->id;
$head[$h][1] = $langs->trans('Infos');
@@ -161,33 +176,34 @@ if ($_GET["id"] or $_GET["numero"])
print '| Facture | '.$fac->ref.' |
';
print "\n";
- }
- /*
- *
- *
- *
- */
- $file = DOL_DATA_ROOT."/facture/".$fac->ref."/".$fac->ref.".pdf";
- $file_img = DOL_DATA_ROOT."/facture/".$fac->ref."/".$fac->ref.".pdf.png";
-
- if (file_exists($file_img))
- {
- print '
';
- }
- else
- {
- if (file_exists("/usr/bin/convert"))
+ /*
+ *
+ *
+ *
+ */
+
+ $file = DOL_DATA_ROOT."/facture/".$fac->ref."/".$fac->ref.".pdf";
+ $file_img = DOL_DATA_ROOT."/facture/".$fac->ref."/".$fac->ref.".pdf.png";
+
+ if (file_exists($file_img))
{
- exec("/usr/bin/convert $file $file_img");
-
- if (file_exists($file_img))
+ print '
';
+ }
+ else
+ {
+ if (file_exists("/usr/bin/convert"))
{
- print '
';
- }
- else
- {
- print "Erreur ";
+ exec("/usr/bin/convert $file $file_img");
+
+ if (file_exists($file_img))
+ {
+ print '
';
+ }
+ else
+ {
+ print "Erreur ";
+ }
}
}
}