Add hook for addMorButton into supplier card
This commit is contained in:
parent
4b74b0529f
commit
860253759b
@ -48,6 +48,12 @@ $result = restrictedArea($user, 'societe&fournisseur', $id, '&societe');
|
|||||||
|
|
||||||
$object = new Fournisseur($db);
|
$object = new Fournisseur($db);
|
||||||
|
|
||||||
|
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||||
|
$hookmanager->initHooks(array('suppliercard'));
|
||||||
|
|
||||||
|
$parameters = array('id' => $id);
|
||||||
|
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Action
|
* Action
|
||||||
*/
|
*/
|
||||||
@ -435,34 +441,41 @@ if ($object->fetch($id))
|
|||||||
* Barre d'actions
|
* Barre d'actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
print '<div class="tabsAction">';
|
print '<div class="tabsAction">';
|
||||||
|
|
||||||
if ($user->rights->fournisseur->commande->creer)
|
$parameters = array();
|
||||||
{
|
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been
|
||||||
$langs->load("orders");
|
// modified by hook
|
||||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/fourn/commande/fiche.php?action=create&socid='.$object->id.'">'.$langs->trans("AddOrder").'</a>';
|
if (empty($reshook)) {
|
||||||
|
|
||||||
|
if ($user->rights->fournisseur->commande->creer)
|
||||||
|
{
|
||||||
|
$langs->load("orders");
|
||||||
|
print '<a class="butAction" href="'.DOL_URL_ROOT.'/fourn/commande/fiche.php?action=create&socid='.$object->id.'">'.$langs->trans("AddOrder").'</a>';
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($user->rights->fournisseur->facture->creer)
|
||||||
|
{
|
||||||
|
$langs->load("bills");
|
||||||
|
print '<a class="butAction" href="'.DOL_URL_ROOT.'/fourn/facture/fiche.php?action=create&socid='.$object->id.'">'.$langs->trans("AddBill").'</a>';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add action
|
||||||
|
if (! empty($conf->agenda->enabled) && ! empty($conf->global->MAIN_REPEATTASKONEACHTAB))
|
||||||
|
{
|
||||||
|
if ($user->rights->agenda->myactions->create)
|
||||||
|
{
|
||||||
|
print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/fiche.php?action=create&socid='.$object->id.'">'.$langs->trans("AddAction").'</a>';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<a class="butAction" title="'.dol_escape_js($langs->trans("NotAllowed")).'" href="#">'.$langs->trans("AddAction").'</a>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
print '</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($user->rights->fournisseur->facture->creer)
|
|
||||||
{
|
|
||||||
$langs->load("bills");
|
|
||||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/fourn/facture/fiche.php?action=create&socid='.$object->id.'">'.$langs->trans("AddBill").'</a>';
|
|
||||||
}
|
|
||||||
|
|
||||||
// Add action
|
|
||||||
if (! empty($conf->agenda->enabled) && ! empty($conf->global->MAIN_REPEATTASKONEACHTAB))
|
|
||||||
{
|
|
||||||
if ($user->rights->agenda->myactions->create)
|
|
||||||
{
|
|
||||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/fiche.php?action=create&socid='.$object->id.'">'.$langs->trans("AddAction").'</a>';
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
print '<a class="butAction" title="'.dol_escape_js($langs->trans("NotAllowed")).'" href="#">'.$langs->trans("AddAction").'</a>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
print '</div>';
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
if (! empty($conf->global->MAIN_REPEATCONTACTONEACHTAB))
|
if (! empty($conf->global->MAIN_REPEATCONTACTONEACHTAB))
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user