Modif permissions

This commit is contained in:
Rodolphe Quiedeville 2005-09-02 10:16:26 +00:00
parent 65874a977e
commit 88aa5514dd
2 changed files with 19 additions and 13 deletions

View File

@ -519,7 +519,6 @@ else
if (!$client_comm->perm_read) if (!$client_comm->perm_read)
{ {
print decoct($client_comm->id);
print "Lecture non authorisée"; print "Lecture non authorisée";
} }
@ -537,9 +536,12 @@ else
if ($ligne->statut == -1) if ($ligne->statut == -1)
{ {
$head[$h][0] = DOL_URL_ROOT."/telephonie/ligne/commande.php?id=".$ligne->id; if ($user->rights->telephonie->ligne->creer)
$head[$h][1] = $langs->trans('Commande'); {
$h++; $head[$h][0] = DOL_URL_ROOT."/telephonie/ligne/commande.php?id=".$ligne->id;
$head[$h][1] = $langs->trans('Commande');
$h++;
}
} }
else else
{ {

View File

@ -37,17 +37,25 @@ if ($cancel == $langs->trans("Cancel"))
if ($_GET["id"]) if ($_GET["id"])
{ {
$ligne = new LigneTel($db);
$ligne = new LigneTel($db);
$result = $ligne->fetch_by_id($_GET["id"]); $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') if ($_GET["action"] <> 'edit' && $_GET["action"] <> 're-edit')
{ {
$h=0; $h=0;
$head[$h][0] = DOL_URL_ROOT."/telephonie/ligne/fiche.php?id=".$ligne->id; $head[$h][0] = DOL_URL_ROOT."/telephonie/ligne/fiche.php?id=".$ligne->id;
$head[$h][1] = $langs->trans("Ligne"); $head[$h][1] = $langs->trans("Ligne");
@ -58,7 +66,6 @@ if ( $result )
$hselected=$h; $hselected=$h;
$h++; $h++;
dolibarr_fiche_head($head, $hselected, 'Ligne : '.$ligne->numero); dolibarr_fiche_head($head, $hselected, 'Ligne : '.$ligne->numero);
print_fiche_titre('Fiche Ligne', $mesg); print_fiche_titre('Fiche Ligne', $mesg);
@ -70,9 +77,6 @@ if ( $result )
$client = new Societe($db, $ligne->client_id); $client = new Societe($db, $ligne->client_id);
$client->fetch($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 '<tr><td width="20%">Client</td><td colspan="2">'; print '<tr><td width="20%">Client</td><td colspan="2">';
print '<a href="'.DOL_URL_ROOT.'/telephonie/client/fiche.php?id='.$client_comm->id.'">'; print '<a href="'.DOL_URL_ROOT.'/telephonie/client/fiche.php?id='.$client_comm->id.'">';
print $client_comm->nom.'</a></td></tr>'; print $client_comm->nom.'</a></td></tr>';