FIX Missing validate button if permission are not valid.
This commit is contained in:
parent
f1ab0d36c5
commit
a70e73a963
@ -2164,18 +2164,20 @@ if ($action == 'create')
|
||||
if ($action != 'statut' && $action != 'editline')
|
||||
{
|
||||
// Validate
|
||||
if ($object->statut == Propal::STATUS_DRAFT && $object->total_ttc >= 0 && count($object->lines) > 0 &&
|
||||
((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->propal->creer))
|
||||
if ($object->statut == Propal::STATUS_DRAFT && $object->total_ttc >= 0 && count($object->lines) > 0)
|
||||
{
|
||||
if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->propal->creer))
|
||||
|| (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->propal->propal_advance->validate)))
|
||||
) {
|
||||
if (count($object->lines) > 0)
|
||||
{
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=validate">' . $langs->trans('Validate') . '</a></div>';
|
||||
// else print '<a class="butActionRefused" href="#">'.$langs->trans('Validate').'</a>';
|
||||
}
|
||||
else
|
||||
print '<div class="inline-block divButAction"><a class="butActionRefused" href="#">' . $langs->trans('Validate') . '</a></div>';
|
||||
}
|
||||
// Create event
|
||||
if ($conf->agenda->enabled && ! empty($conf->global->MAIN_ADD_EVENT_ON_ELEMENT_CARD)) // Add hidden condition because this is not a "workflow" action so should appears somewhere else on page.
|
||||
{
|
||||
print '<a class="butAction" href="' . DOL_URL_ROOT . '/comm/action/card.php?action=create&origin=' . $object->element . '&originid=' . $object->id . '&socid=' . $object->socid . '">' . $langs->trans("AddAction") . '</a>';
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="' . DOL_URL_ROOT . '/comm/action/card.php?action=create&origin=' . $object->element . '&originid=' . $object->id . '&socid=' . $object->socid . '">' . $langs->trans("AddAction") . '</a></div>';
|
||||
}
|
||||
// Edit
|
||||
if ($object->statut == Propal::STATUS_VALIDATED && $user->rights->propal->creer) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user