Disabled action are hidden with reason

This commit is contained in:
Laurent Destailleur 2018-10-16 20:27:33 +02:00
parent d43e1fcef6
commit 57bb8bcfcd
2 changed files with 35 additions and 12 deletions

View File

@ -766,17 +766,37 @@ if (empty($reshook))
{
print "<div class=\"tabsAction\">\n";
if (! $variants) {
if ($user->rights->stock->mouvement->creer) {
if ($user->rights->stock->mouvement->creer)
{
if (! $variants) {
print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&amp;action=correction">' . $langs->trans("CorrectStock") . '</a>';
}
//if (($user->rights->stock->mouvement->creer) && ! $object->hasbatch())
if ($user->rights->stock->mouvement->creer) {
print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&amp;action=transfert">' . $langs->trans("TransferStock") . '</a>';
else
{
print '<a class="butActionRefused" href="#" title="'.$langs->trans("ActionAvailableOnVariantProductOnly").'">' . $langs->trans("CorrectStock") . '</a>';
}
}
else
{
print '<a class="butActionRefused" href="#" title="'.$langs->trans("NotEnoughPermissions").'">' . $langs->trans("CorrectStock") . '</a>';
}
//if (($user->rights->stock->mouvement->creer) && ! $object->hasbatch())
if ($user->rights->stock->mouvement->creer)
{
if (! $variants) {
print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&amp;action=transfert">' . $langs->trans("TransferStock") . '</a>';
}
else
{
print '<a class="butActionRefused" href="#" title="'.$langs->trans("ActionAvailableOnVariantProductOnly").'">' . $langs->trans("TransferStock") . '</a>';
}
}
else
{
print '<a class="butActionRefused" href="#" title="'.$langs->trans("NotEnoughPermissions").'">' . $langs->trans("CorrectStock") . '</a>';
}
print '</div>';
}

View File

@ -326,7 +326,7 @@ if (! empty($id) || ! empty($ref))
if ($action == 'add') {
$title = $langs->trans('NewProductCombination');
print dol_fiche_head();
//print dol_fiche_head();
$features = $_SESSION['addvariant_'.$object->id];
//First, sanitize
print '<div id="parttoaddvariant">';
@ -347,7 +347,8 @@ if (! empty($id) || ! empty($ref))
}
}
print '</div>';
print dol_fiche_end();
print '<br><br>';
//print dol_fiche_end();
} else {
$title = $langs->trans('EditProductCombination');
}
@ -633,12 +634,14 @@ if (! empty($id) || ! empty($ref))
print '<div class="tabsAction">';
print ' <div class="inline-block divButAction">';
if ($productCombinations) {
print '<a href="combinations.php?id='.$object->id.'&action=copy" class="butAction">'.$langs->trans('PropagateVariant').'</a>';
}
print '<a href="combinations.php?id='.$object->id.'&action=add" class="butAction">'.$langs->trans('NewProductCombination').'</a>'; // NewVariant
if ($productCombinations)
{
print '<a href="combinations.php?id='.$object->id.'&action=copy" class="butAction">'.$langs->trans('PropagateVariant').'</a>';
}
// Too much bugged page.
/*
print '<a href="generator.php?id='.$object->id.'" class="butAction">'.$langs->trans('ProductCombinationGenerator').'</a>';