Debug BOM

This commit is contained in:
Laurent Destailleur 2019-11-09 20:12:27 +01:00
parent b1394463db
commit 96314c9c26
3 changed files with 62 additions and 39 deletions

View File

@ -584,13 +584,19 @@ 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->bom->write && $object->status == $object::STATUS_VALIDATED) // Back to draft
if ($object->status == $object::STATUS_VALIDATED)
{
if ($permissiontoadd)
{ {
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=setdraft">'.$langs->trans("SetToDraft").'</a>'; print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=setdraft">'.$langs->trans("SetToDraft").'</a>';
} }
}
// Modify // Modify
if ($permissiontoadd && $object->status == $object::STATUS_DRAFT) if ($object->status == $object::STATUS_DRAFT)
{
if ($permissiontoadd)
{ {
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=edit">'.$langs->trans("Modify").'</a>'."\n"; print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=edit">'.$langs->trans("Modify").'</a>'."\n";
} }
@ -598,9 +604,12 @@ 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"; print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans('Modify').'</a>'."\n";
} }
}
// Validate // Validate
if ($permissiontoadd && $object->status == $object::STATUS_DRAFT) if ($object->status == $object::STATUS_DRAFT)
{
if ($permissiontoadd)
{ {
if (is_array($object->lines) && count($object->lines) > 0) if (is_array($object->lines) && count($object->lines) > 0)
{ {
@ -611,6 +620,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print '<a class="butActionRefused" href="" title="'.$langs->trans("AddAtLeastOneLineFirst").'">' . $langs->trans("Validate") . '</a>'; print '<a class="butActionRefused" href="" title="'.$langs->trans("AddAtLeastOneLineFirst").'">' . $langs->trans("Validate") . '</a>';
} }
} }
}
// Close / Cancel // Close / Cancel
if ($permissiontoadd && $object->status == $object::STATUS_VALIDATED) if ($permissiontoadd && $object->status == $object::STATUS_VALIDATED)

View File

@ -454,10 +454,13 @@ 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"; print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=presend&mode=init#formmailbeforetitle">' . $langs->trans('SendMail') . '</a>'."\n";
// Back to draft // Back to draft
if (! empty($user->rights->mymodule->myobject->write) && $object->status == $object::STATUS_VALIDATED) if ($object->status == $object::STATUS_VALIDATED)
{
if ($permissiontoadd)
{ {
print '<a class="butAction" href="' . $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=setdraft">' . $langs->trans("SetToDraft") . '</a>'; print '<a class="butAction" href="' . $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=setdraft">' . $langs->trans("SetToDraft") . '</a>';
} }
}
// Modify // Modify
if ($permissiontoadd) if ($permissiontoadd)
@ -470,7 +473,9 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
} }
// Validate // Validate
if ($permissiontoadd && $object->status == $object::STATUS_DRAFT) if ($object->status == $object::STATUS_DRAFT)
{
if ($permissiontoadd)
{ {
if (is_array($object->lines) && count($object->lines) > 0) if (is_array($object->lines) && count($object->lines) > 0)
{ {
@ -481,6 +486,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print '<a class="butActionRefused" href="" title="'.$langs->trans("AddAtLeastOneLineFirst").'">'.$langs->trans("Validate").'</a>'; print '<a class="butActionRefused" href="" title="'.$langs->trans("AddAtLeastOneLineFirst").'">'.$langs->trans("Validate").'</a>';
} }
} }
}
// Clone // Clone
if ($permissiontoadd) if ($permissiontoadd)

View File

@ -494,10 +494,14 @@ 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 ($permissiontoadd && $object->status == $object::STATUS_VALIDATED) // Back to draft
if ($object->status == $object::STATUS_VALIDATED)
{
if ($permissiontoadd)
{ {
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=setdraft">'.$langs->trans("SetToDraft").'</a>'; print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=setdraft">'.$langs->trans("SetToDraft").'</a>';
} }
}
// Modify // Modify
if ($permissiontoadd) if ($permissiontoadd)
@ -510,7 +514,9 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
} }
// Validate // Validate
if ($permissiontoadd && $object->status == $object::STATUS_DRAFT) if ($object->status == $object::STATUS_DRAFT)
{
if ($permissiontoadd)
{ {
if (is_array($object->lines) && count($object->lines) > 0) if (is_array($object->lines) && count($object->lines) > 0)
{ {
@ -521,6 +527,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print '<a class="butActionRefused" href="" title="'.$langs->trans("AddAtLeastOneLineFirst").'">'.$langs->trans("Validate").'</a>'; print '<a class="butActionRefused" href="" title="'.$langs->trans("AddAtLeastOneLineFirst").'">'.$langs->trans("Validate").'</a>';
} }
} }
}
// Clone // Clone
if ($permissiontoadd) if ($permissiontoadd)