Ajout permissions

This commit is contained in:
Rodolphe Quiedeville 2003-10-14 11:02:31 +00:00
parent 95a389a4ad
commit 91acd2d1f1
3 changed files with 17 additions and 5 deletions

View File

@ -23,6 +23,11 @@ require("./pre.inc.php");
$user->getrights('propale');
if ($user->societe_id > 0)
{
$socidp = $user->societe_id;
}
llxHeader();
function valeur($sql)
@ -105,6 +110,10 @@ if ( $db->query($sql) )
$sql = "SELECT p.rowid, p.ref";
$sql .= " FROM llx_propal as p";
$sql .= " WHERE p.fk_statut = 1";
if ($socidp)
{
$sql .= " AND p.fk_soc = $socidp";
}
if ( $db->query($sql) )
{
@ -205,8 +214,7 @@ else
*/
$sql = "SELECT s.nom, s.idp, p.rowid as propalid, p.price, p.ref,".$db->pdate("p.datep")." as dp, c.label as statut, c.id as statutid";
$sql .= " FROM llx_societe as s, llx_propal as p, c_propalst as c WHERE p.fk_soc = s.idp AND p.fk_statut = c.id AND p.fk_statut > 0";
$sql .= " FROM llx_societe as s, llx_propal as p, c_propalst as c WHERE p.fk_soc = s.idp AND p.fk_statut = c.id AND p.fk_statut > 1";
if ($socidp)
{
$sql .= " AND s.idp = $socidp";

View File

@ -682,7 +682,7 @@ else
print "</table><br>";
if ($fac->brouillon == 1)
if ($fac->brouillon == 1 && $user->rights->facture->creer)
{
print '<form action="facture.php?facid='.$facid.'" method="post">';
print '<input type="hidden" name="action" value="setremise">';
@ -743,7 +743,7 @@ else
print '<td>&nbsp;</td>';
}
print '<TD align="right">'.price($objp->subprice)."</td>\n";
if ($fac->statut == 0)
if ($fac->statut == 0 && $user->rights->facture->creer)
{
print '<td align="right"><a href="'.$PHPSELF.'?facid='.$facid.'&action=deleteline&rowid='.$objp->rowid.'">del</a></td>';
print '<td align="right"><a href="'.$PHPSELF.'?facid='.$facid.'&action=editline&rowid='.$objp->rowid.'">edit</a></td>';
@ -785,7 +785,7 @@ else
* Ajouter une ligne
*
*/
if ($fac->statut == 0)
if ($fac->statut == 0 && $user->rights->facture->creer)
{
print "<form action=\"$PHP_SELF?facid=$facid\" method=\"post\">";
// echo '<TABLE border="1" width="100%" cellspacing="0" cellpadding="1">';

View File

@ -27,6 +27,10 @@ $info_box_contents = array();
$sql = "SELECT s.nom,s.idp";
$sql .= " FROM llx_societe as s WHERE s.client = 1";
if ($user->societe_id > 0)
{
$sql .= " AND s.idp = $user->societe_id";
}
$sql .= " ORDER BY s.datec DESC ";
$sql .= $db->plimit(5, 0);