Modif permissions

This commit is contained in:
Rodolphe Quiedeville 2005-09-07 08:22:36 +00:00
parent 832091fc8d
commit e2233fb0f0
2 changed files with 46 additions and 26 deletions

View File

@ -199,6 +199,7 @@ if ($_GET["id"])
print '<tr class="liste_titre"><td>Service</td>'; print '<tr class="liste_titre"><td>Service</td>';
print '<td align="right">Montant Facturé</td>'; print '<td align="right">Montant Facturé</td>';
print '<td align="right">Montant du service</td>'; print '<td align="right">Montant du service</td>';
if ($user->rights->telephonie->ligne->creer)
print "<td>&nbsp;</td>\n"; print "<td>&nbsp;</td>\n";
print '<td align="center">Ajouté par</td>'; print '<td align="center">Ajouté par</td>';
print '<td align="center">Ajouté le</td></tr>'; print '<td align="center">Ajouté le</td></tr>';
@ -218,9 +219,12 @@ if ($_GET["id"])
print '<td align="right">'.price($obj->montant_fac)." euros HT</td>\n"; print '<td align="right">'.price($obj->montant_fac)." euros HT</td>\n";
print '<td align="right">'.price($obj->montant)." euros HT</td>\n"; print '<td align="right">'.price($obj->montant)." euros HT</td>\n";
if ($user->rights->telephonie->ligne->creer)
{
print '<td align="center"><a href="services.php?id='.$contrat->id.'&amp;action=rmservice&amp;service_id='.$obj->serid.'">'; print '<td align="center"><a href="services.php?id='.$contrat->id.'&amp;action=rmservice&amp;service_id='.$obj->serid.'">';
print img_delete(); print img_delete();
print "</a></td>"; print "</a></td>";
}
print '<td align="center">'.$obj->firstname.' '.$obj->name.'</td>'; print '<td align="center">'.$obj->firstname.' '.$obj->name.'</td>';
print '<td align="center">'.strftime("%d/%m/%y",$obj->date_creat).'</td>'; print '<td align="center">'.strftime("%d/%m/%y",$obj->date_creat).'</td>';
print "</tr>\n"; print "</tr>\n";

View File

@ -43,7 +43,20 @@ if ($_GET["id"] or $_GET["numero"])
} }
} }
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)
{ {
$h=0; $h=0;
@ -56,9 +69,11 @@ if ($_GET["id"] or $_GET["numero"])
$hselected = $h; $hselected = $h;
$h++; $h++;
/*
$head[$h][0] = DOL_URL_ROOT."/telephonie/ligne/facturesdet.php?id=".$ligne->id; $head[$h][0] = DOL_URL_ROOT."/telephonie/ligne/facturesdet.php?id=".$ligne->id;
$head[$h][1] = $langs->trans('Factures détaillées'); $head[$h][1] = $langs->trans('Factures détaillées');
$h++; $h++;
*/
$head[$h][0] = DOL_URL_ROOT."/telephonie/ligne/infoc.php?id=".$ligne->id; $head[$h][0] = DOL_URL_ROOT."/telephonie/ligne/infoc.php?id=".$ligne->id;
$head[$h][1] = $langs->trans('Infos'); $head[$h][1] = $langs->trans('Infos');
@ -161,7 +176,7 @@ if ($_GET["id"] or $_GET["numero"])
print '<tr><td>Facture</td><td colspan="3"><a href="'.DOL_URL_ROOT.'/telephonie/client/facture.php?facid='.$fac->id.'">'.$fac->ref.'</a></td></tr>'; print '<tr><td>Facture</td><td colspan="3"><a href="'.DOL_URL_ROOT.'/telephonie/client/facture.php?facid='.$fac->id.'">'.$fac->ref.'</a></td></tr>';
print "</table>\n"; print "</table>\n";
}
/* /*
* *
* *
@ -173,7 +188,7 @@ if ($_GET["id"] or $_GET["numero"])
if (file_exists($file_img)) if (file_exists($file_img))
{ {
print '<br><img src="../showfacture.php?facref='.$fac->ref.'"></img>'; print '<br><img src="../showfacture.php?uid='.$user->id.'&amp;facref='.$fac->id.'"></img>';
} }
else else
{ {
@ -183,7 +198,7 @@ if ($_GET["id"] or $_GET["numero"])
if (file_exists($file_img)) if (file_exists($file_img))
{ {
print '<br><img src="../showfacture.php?facref='.$fac->ref.'"></img>'; print '<br><img src="../showfacture.php?uid='.$user->id.'&amp;facref='.$fac->id.'"></img>';
} }
else else
{ {
@ -191,6 +206,7 @@ if ($_GET["id"] or $_GET["numero"])
} }
} }
} }
}
} }
else else
{ {