La modif des carac de sociétés (conditions réglement, mode réglement par défaut) est conditionné sur droit modif plutot que sur utilisateur externe/interne
This commit is contained in:
parent
cb61b09da8
commit
9afc0b39f1
@ -81,7 +81,7 @@ if ($_GET["action"] == 'attribute_prefix')
|
|||||||
$societe->attribute_prefix($db, $_GET["socid"]);
|
$societe->attribute_prefix($db, $_GET["socid"]);
|
||||||
}
|
}
|
||||||
// conditions de règlement
|
// conditions de règlement
|
||||||
if ($_POST["action"] == 'setconditions' && (!$user->societe_id > 0))
|
if ($_POST["action"] == 'setconditions' && $user->rights->societe->creer)
|
||||||
{
|
{
|
||||||
|
|
||||||
$societe = new Societe($db, $_GET["socid"]);
|
$societe = new Societe($db, $_GET["socid"]);
|
||||||
@ -92,7 +92,7 @@ if ($_POST["action"] == 'setconditions' && (!$user->societe_id > 0))
|
|||||||
if (! $result) dolibarr_print_error($result);
|
if (! $result) dolibarr_print_error($result);
|
||||||
}
|
}
|
||||||
// mode de règlement
|
// mode de règlement
|
||||||
if ($_POST["action"] == 'setmode' && (!$user->societe_id > 0))
|
if ($_POST["action"] == 'setmode' && $user->rights->societe->creer)
|
||||||
{
|
{
|
||||||
$societe = new Societe($db, $_GET["socid"]);
|
$societe = new Societe($db, $_GET["socid"]);
|
||||||
$societe->mode_reglement=$_POST['mode_reglement_id'];
|
$societe->mode_reglement=$_POST['mode_reglement_id'];
|
||||||
@ -102,7 +102,7 @@ if ($_POST["action"] == 'setmode' && (!$user->societe_id > 0))
|
|||||||
if (! $result) dolibarr_print_error($result);
|
if (! $result) dolibarr_print_error($result);
|
||||||
}
|
}
|
||||||
// assujétissement à la TVA
|
// assujétissement à la TVA
|
||||||
if ($_POST["action"] == 'setassujtva' && (!$user->societe_id > 0))
|
if ($_POST["action"] == 'setassujtva' && $user->rights->societe->creer)
|
||||||
{
|
{
|
||||||
$societe = new Societe($db, $_GET["socid"]);
|
$societe = new Societe($db, $_GET["socid"]);
|
||||||
$societe->tva_assuj=$_POST['assujtva_value'];
|
$societe->tva_assuj=$_POST['assujtva_value'];
|
||||||
@ -247,7 +247,7 @@ if ($socidp > 0)
|
|||||||
print '<table width="100%" class="nobordernopadding"><tr><td nowrap>';
|
print '<table width="100%" class="nobordernopadding"><tr><td nowrap>';
|
||||||
print $langs->trans('PaymentConditions');
|
print $langs->trans('PaymentConditions');
|
||||||
print '<td>';
|
print '<td>';
|
||||||
if (($_GET['action'] != 'editconditions') && (!$user->societe_id > 0)) print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editconditions&socid='.$objsoc->id.'">'.img_edit($langs->trans('SetConditions'),1).'</a></td>';
|
if (($_GET['action'] != 'editconditions') && $user->rights->societe->creer) print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editconditions&socid='.$objsoc->id.'">'.img_edit($langs->trans('SetConditions'),1).'</a></td>';
|
||||||
print '</tr></table>';
|
print '</tr></table>';
|
||||||
print '</td><td colspan="3">';
|
print '</td><td colspan="3">';
|
||||||
if ($_GET['action'] == 'editconditions')
|
if ($_GET['action'] == 'editconditions')
|
||||||
@ -266,7 +266,7 @@ if ($socidp > 0)
|
|||||||
print '<table width="100%" class="nobordernopadding"><tr><td nowrap>';
|
print '<table width="100%" class="nobordernopadding"><tr><td nowrap>';
|
||||||
print $langs->trans('PaymentMode');
|
print $langs->trans('PaymentMode');
|
||||||
print '<td>';
|
print '<td>';
|
||||||
if (($_GET['action'] != 'editmode') && (!$user->societe_id > 0)) print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editmode&socid='.$objsoc->id.'">'.img_edit($langs->trans('SetMode'),1).'</a></td>';
|
if (($_GET['action'] != 'editmode') && $user->rights->societe->creer) print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editmode&socid='.$objsoc->id.'">'.img_edit($langs->trans('SetMode'),1).'</a></td>';
|
||||||
print '</tr></table>';
|
print '</tr></table>';
|
||||||
print '</td><td colspan="3">';
|
print '</td><td colspan="3">';
|
||||||
if ($_GET['action'] == 'editmode')
|
if ($_GET['action'] == 'editmode')
|
||||||
@ -285,7 +285,7 @@ if ($socidp > 0)
|
|||||||
print '<table width="100%" class="nobordernopadding"><tr><td nowrap>';
|
print '<table width="100%" class="nobordernopadding"><tr><td nowrap>';
|
||||||
print $langs->trans("CustomerRelativeDiscountShort");
|
print $langs->trans("CustomerRelativeDiscountShort");
|
||||||
print '<td><td align="right">';
|
print '<td><td align="right">';
|
||||||
if (!$user->societe_id > 0)
|
if ($user->rights->societe->creer)
|
||||||
{
|
{
|
||||||
print '<a href="'.DOL_URL_ROOT.'/comm/remise.php?id='.$objsoc->id.'">'.img_edit($langs->trans("Modify")).'</a>';
|
print '<a href="'.DOL_URL_ROOT.'/comm/remise.php?id='.$objsoc->id.'">'.img_edit($langs->trans("Modify")).'</a>';
|
||||||
}
|
}
|
||||||
@ -299,7 +299,7 @@ if ($socidp > 0)
|
|||||||
print '<tr><td nowrap>';
|
print '<tr><td nowrap>';
|
||||||
print $langs->trans("CustomerAbsoluteDiscountShort");
|
print $langs->trans("CustomerAbsoluteDiscountShort");
|
||||||
print '<td><td align="right">';
|
print '<td><td align="right">';
|
||||||
if (!$user->societe_id > 0)
|
if ($user->rights->societe->creer)
|
||||||
{
|
{
|
||||||
print '<a href="'.DOL_URL_ROOT.'/comm/remx.php?id='.$objsoc->id.'">'.img_edit($langs->trans("Modify")).'</a>';
|
print '<a href="'.DOL_URL_ROOT.'/comm/remx.php?id='.$objsoc->id.'">'.img_edit($langs->trans("Modify")).'</a>';
|
||||||
}
|
}
|
||||||
@ -320,7 +320,7 @@ if ($socidp > 0)
|
|||||||
print '<table width="100%" class="nobordernopadding"><tr><td nowrap>';
|
print '<table width="100%" class="nobordernopadding"><tr><td nowrap>';
|
||||||
print $langs->trans("PriceLevel");
|
print $langs->trans("PriceLevel");
|
||||||
print '<td><td align="right">';
|
print '<td><td align="right">';
|
||||||
if (!$user->societe_id > 0)
|
if ($user->rights->societe->creer)
|
||||||
{
|
{
|
||||||
print '<a href="'.DOL_URL_ROOT.'/comm/multiprix.php?id='.$objsoc->id.'">'.img_edit($langs->trans("Modify")).'</a>';
|
print '<a href="'.DOL_URL_ROOT.'/comm/multiprix.php?id='.$objsoc->id.'">'.img_edit($langs->trans("Modify")).'</a>';
|
||||||
}
|
}
|
||||||
@ -336,7 +336,7 @@ if ($socidp > 0)
|
|||||||
print '<table width="100%" class="nobordernopadding"><tr><td nowrap>';
|
print '<table width="100%" class="nobordernopadding"><tr><td nowrap>';
|
||||||
print $langs->trans("DeliveriesAddress");
|
print $langs->trans("DeliveriesAddress");
|
||||||
print '<td><td align="right">';
|
print '<td><td align="right">';
|
||||||
if (!$user->societe_id > 0)
|
if ($user->rights->societe->creer)
|
||||||
{
|
{
|
||||||
print '<a href="'.DOL_URL_ROOT.'/comm/adresse_livraison.php?socid='.$objsoc->id.'">'.img_edit($langs->trans("Modify")).'</a>';
|
print '<a href="'.DOL_URL_ROOT.'/comm/adresse_livraison.php?socid='.$objsoc->id.'">'.img_edit($langs->trans("Modify")).'</a>';
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user