Fix: check perms by type of product
This commit is contained in:
parent
71c968b0b1
commit
01b3b8e09e
@ -1588,15 +1588,16 @@ else
|
|||||||
print '<div class="underbanner clearboth"></div>';
|
print '<div class="underbanner clearboth"></div>';
|
||||||
print '<table class="border tableforfield" width="100%">';
|
print '<table class="border tableforfield" width="100%">';
|
||||||
|
|
||||||
// Type
|
// Type
|
||||||
if (! empty($conf->produit->enabled) && ! empty($conf->service->enabled))
|
if (! empty($conf->produit->enabled) && ! empty($conf->service->enabled))
|
||||||
{
|
{
|
||||||
// TODO change for compatibility with edit in place
|
// TODO change for compatibility with edit in place
|
||||||
$typeformat='select;0:'.$langs->trans("Product").',1:'.$langs->trans("Service");
|
$typeformat='select;0:'.$langs->trans("Product").',1:'.$langs->trans("Service");
|
||||||
print '<tr><td class="titlefield">'.$form->editfieldkey("Type",'fk_product_type',$object->type,$object,$user->rights->produit->creer||$user->rights->service->creer,$typeformat).'</td><td colspan="2">';
|
$perm = ($object->type==Product::TYPE_PRODUCT && $user->rights->produit->creer) || ($object->type==Product::TYPE_SERVICE && $user->rights->service->creer);
|
||||||
print $form->editfieldval("Type",'fk_product_type',$object->type,$object,$user->rights->produit->creer||$user->rights->service->creer,$typeformat);
|
print '<tr><td class="titlefield">'.$form->editfieldkey("Type", 'fk_product_type', $object->type, $object, $perm, $typeformat).'</td><td colspan="2">';
|
||||||
print '</td></tr>';
|
print $form->editfieldval("Type", 'fk_product_type', $object->type, $object, $perm, $typeformat);
|
||||||
}
|
print '</td></tr>';
|
||||||
|
}
|
||||||
|
|
||||||
if ($showbarcode)
|
if ($showbarcode)
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user