Update card.php
This commit is contained in:
parent
a7f82af352
commit
64f2f324de
@ -75,6 +75,16 @@ $extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
|||||||
// Load object
|
// Load object
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals
|
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals
|
||||||
|
|
||||||
|
if (empty($conf->global->MAIN_USE_ADVANCED_PERMS))
|
||||||
|
{
|
||||||
|
$permissiontoadd = $user->rights->stock->write;
|
||||||
|
$permissiontodelete = $user->rights->stock->write;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$permissiontoadd = $user->rights->stock->advance_inventory->create;
|
||||||
|
$permissiontodelete = $user->rights->stock->advance_inventory->write;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -89,16 +99,6 @@ if (empty($reshook))
|
|||||||
{
|
{
|
||||||
$error=0;
|
$error=0;
|
||||||
|
|
||||||
if (empty($conf->global->MAIN_USE_ADVANCED_PERMS))
|
|
||||||
{
|
|
||||||
$permissiontoadd = $user->rights->stock->write;
|
|
||||||
$permissiontodelete = $user->rights->stock->write;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$permissiontoadd = $user->rights->stock->advance_inventory->create;
|
|
||||||
$permissiontodelete = $user->rights->stock->advance_inventory->write;
|
|
||||||
}
|
|
||||||
$backurlforlist = DOL_URL_ROOT.'/product/inventory/list.php';
|
$backurlforlist = DOL_URL_ROOT.'/product/inventory/list.php';
|
||||||
|
|
||||||
// Actions cancel, add, update or delete
|
// Actions cancel, add, update or delete
|
||||||
@ -344,7 +344,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
// Send
|
// Send
|
||||||
print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=presend&mode=init#formmailbeforetitle">' . $langs->trans('SendMail') . '</a>'."\n";
|
print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=presend&mode=init#formmailbeforetitle">' . $langs->trans('SendMail') . '</a>'."\n";
|
||||||
|
|
||||||
if ($user->rights->stock->advance_inventory->write)
|
if ($permissiontoadd)
|
||||||
{
|
{
|
||||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit">'.$langs->trans("Modify").'</a>'."\n";
|
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit">'.$langs->trans("Modify").'</a>'."\n";
|
||||||
}
|
}
|
||||||
@ -353,7 +353,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans('Modify').'</a>'."\n";
|
print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans('Modify').'</a>'."\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($user->rights->stock->advance_inventory->write)
|
if ($permissiontodelete)
|
||||||
{
|
{
|
||||||
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete">'.$langs->trans('Delete').'</a>'."\n";
|
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete">'.$langs->trans('Delete').'</a>'."\n";
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user