Debug mrp
This commit is contained in:
parent
59d83fce59
commit
b1394463db
@ -584,13 +584,13 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
// Send
|
||||
//print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=presend&mode=init#formmailbeforetitle">' . $langs->trans('SendMail') . '</a>'."\n";
|
||||
|
||||
if ($user->rights->bom->write && $object->status == BOM::STATUS_VALIDATED)
|
||||
if ($user->rights->bom->write && $object->status == $object::STATUS_VALIDATED)
|
||||
{
|
||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=setdraft">'.$langs->trans("SetToDraft").'</a>';
|
||||
}
|
||||
|
||||
// Modify
|
||||
if ($permissiontoadd)
|
||||
if ($permissiontoadd && $object->status == $object::STATUS_DRAFT)
|
||||
{
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit">'.$langs->trans("Modify").'</a>'."\n";
|
||||
}
|
||||
@ -600,7 +600,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
}
|
||||
|
||||
// Validate
|
||||
if ($user->rights->bom->write && $object->status == BOM::STATUS_DRAFT)
|
||||
if ($permissiontoadd && $object->status == $object::STATUS_DRAFT)
|
||||
{
|
||||
if (is_array($object->lines) && count($object->lines) > 0)
|
||||
{
|
||||
@ -613,13 +613,13 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
}
|
||||
|
||||
// Close / Cancel
|
||||
if ($user->rights->bom->write && $object->status == BOM::STATUS_VALIDATED)
|
||||
if ($permissiontoadd && $object->status == $object::STATUS_VALIDATED)
|
||||
{
|
||||
print '<a class="butAction" href="' . $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=close">' . $langs->trans("Disable") . '</a>';
|
||||
}
|
||||
|
||||
// Re-open
|
||||
if ($user->rights->bom->write && $object->status == BOM::STATUS_CANCELED)
|
||||
if ($permissiontoadd && $object->status == $object::STATUS_CANCELED)
|
||||
{
|
||||
print '<a class="butAction" href="' . $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=reopen">' . $langs->trans("ReOpen") . '</a>';
|
||||
}
|
||||
|
||||
@ -454,7 +454,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=presend&mode=init#formmailbeforetitle">' . $langs->trans('SendMail') . '</a>'."\n";
|
||||
|
||||
// Back to draft
|
||||
if (! empty($user->rights->mymodule->myobject->write) && $object->status == BOM::STATUS_VALIDATED)
|
||||
if (! empty($user->rights->mymodule->myobject->write) && $object->status == $object::STATUS_VALIDATED)
|
||||
{
|
||||
print '<a class="butAction" href="' . $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=setdraft">' . $langs->trans("SetToDraft") . '</a>';
|
||||
}
|
||||
@ -469,6 +469,19 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans('Modify').'</a>'."\n";
|
||||
}
|
||||
|
||||
// Validate
|
||||
if ($permissiontoadd && $object->status == $object::STATUS_DRAFT)
|
||||
{
|
||||
if (is_array($object->lines) && count($object->lines) > 0)
|
||||
{
|
||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=validate">'.$langs->trans("Validate").'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a class="butActionRefused" href="" title="'.$langs->trans("AddAtLeastOneLineFirst").'">'.$langs->trans("Validate").'</a>';
|
||||
}
|
||||
}
|
||||
|
||||
// Clone
|
||||
if ($permissiontoadd)
|
||||
{
|
||||
|
||||
@ -323,7 +323,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
}*/
|
||||
|
||||
$formquestion = array();
|
||||
if (!empty($conf->bom->enabled))
|
||||
if (!empty($conf->mrp->enabled))
|
||||
{
|
||||
$langs->load("mrp");
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
|
||||
@ -494,7 +494,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
// Send
|
||||
//print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=presend&mode=init#formmailbeforetitle">' . $langs->trans('SendMail') . '</a>'."\n";
|
||||
|
||||
if ($user->rights->bom->write && $object->status == MO::STATUS_VALIDATED)
|
||||
if ($permissiontoadd && $object->status == $object::STATUS_VALIDATED)
|
||||
{
|
||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=setdraft">'.$langs->trans("SetToDraft").'</a>';
|
||||
}
|
||||
@ -510,7 +510,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
}
|
||||
|
||||
// Validate
|
||||
if ($user->rights->mrp->write && $object->status == MO::STATUS_DRAFT)
|
||||
if ($permissiontoadd && $object->status == $object::STATUS_DRAFT)
|
||||
{
|
||||
if (is_array($object->lines) && count($object->lines) > 0)
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user