FIX addMoreActionsButtons hook must be inside the div class=tabaction.
This commit is contained in:
parent
92f9919f97
commit
f901453a6b
@ -961,82 +961,84 @@ if ($id > 0)
|
|||||||
* Barre d'actions
|
* Barre d'actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
print '<div class="tabsAction">';
|
||||||
|
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been
|
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been
|
||||||
|
|
||||||
|
if (empty($reshook))
|
||||||
print '<div class="tabsAction">';
|
{
|
||||||
|
if (! empty($conf->propal->enabled) && $user->rights->propal->creer && $object->status==1)
|
||||||
if (! empty($conf->propal->enabled) && $user->rights->propal->creer && $object->status==1)
|
{
|
||||||
{
|
$langs->load("propal");
|
||||||
$langs->load("propal");
|
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/comm/propal/card.php?socid='.$object->id.'&action=create">'.$langs->trans("AddProp").'</a></div>';
|
||||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/comm/propal/card.php?socid='.$object->id.'&action=create">'.$langs->trans("AddProp").'</a></div>';
|
}
|
||||||
}
|
|
||||||
|
if (! empty($conf->commande->enabled) && $user->rights->commande->creer && $object->status==1)
|
||||||
if (! empty($conf->commande->enabled) && $user->rights->commande->creer && $object->status==1)
|
{
|
||||||
{
|
$langs->load("orders");
|
||||||
$langs->load("orders");
|
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/commande/card.php?socid='.$object->id.'&action=create">'.$langs->trans("AddOrder").'</a></div>';
|
||||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/commande/card.php?socid='.$object->id.'&action=create">'.$langs->trans("AddOrder").'</a></div>';
|
}
|
||||||
}
|
|
||||||
|
if ($user->rights->contrat->creer && $object->status==1)
|
||||||
if ($user->rights->contrat->creer && $object->status==1)
|
{
|
||||||
{
|
$langs->load("contracts");
|
||||||
$langs->load("contracts");
|
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/contrat/card.php?socid='.$object->id.'&action=create">'.$langs->trans("AddContract").'</a></div>';
|
||||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/contrat/card.php?socid='.$object->id.'&action=create">'.$langs->trans("AddContract").'</a></div>';
|
}
|
||||||
}
|
|
||||||
|
if (! empty($conf->ficheinter->enabled) && $user->rights->ficheinter->creer && $object->status==1)
|
||||||
if (! empty($conf->ficheinter->enabled) && $user->rights->ficheinter->creer && $object->status==1)
|
{
|
||||||
{
|
$langs->load("fichinter");
|
||||||
$langs->load("fichinter");
|
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/fichinter/card.php?socid='.$object->id.'&action=create">'.$langs->trans("AddIntervention").'</a></div>';
|
||||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/fichinter/card.php?socid='.$object->id.'&action=create">'.$langs->trans("AddIntervention").'</a></div>';
|
}
|
||||||
}
|
|
||||||
|
// Add invoice
|
||||||
// Add invoice
|
if ($user->societe_id == 0)
|
||||||
if ($user->societe_id == 0)
|
{
|
||||||
{
|
if (! empty($conf->deplacement->enabled) && $object->status==1)
|
||||||
if (! empty($conf->deplacement->enabled) && $object->status==1)
|
{
|
||||||
{
|
$langs->load("trips");
|
||||||
$langs->load("trips");
|
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/compta/deplacement/card.php?socid='.$object->id.'&action=create">'.$langs->trans("AddTrip").'</a></div>';
|
||||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/compta/deplacement/card.php?socid='.$object->id.'&action=create">'.$langs->trans("AddTrip").'</a></div>';
|
}
|
||||||
}
|
|
||||||
|
if (! empty($conf->facture->enabled))
|
||||||
if (! empty($conf->facture->enabled))
|
{
|
||||||
{
|
if ($user->rights->facture->creer && $object->status==1)
|
||||||
if ($user->rights->facture->creer && $object->status==1)
|
{
|
||||||
{
|
$langs->load("bills");
|
||||||
$langs->load("bills");
|
$langs->load("orders");
|
||||||
$langs->load("orders");
|
|
||||||
|
if (! empty($conf->commande->enabled))
|
||||||
if (! empty($conf->commande->enabled))
|
{
|
||||||
{
|
if (! empty($orders2invoice) && $orders2invoice > 0) print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/commande/orderstoinvoice.php?socid='.$object->id.'">'.$langs->trans("CreateInvoiceForThisCustomer").'</a></div>';
|
||||||
if (! empty($orders2invoice) && $orders2invoice > 0) print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/commande/orderstoinvoice.php?socid='.$object->id.'">'.$langs->trans("CreateInvoiceForThisCustomer").'</a></div>';
|
else print '<div class="inline-block divButAction"><a class="butActionRefused" title="'.dol_escape_js($langs->trans("NoOrdersToInvoice")).'" href="#">'.$langs->trans("CreateInvoiceForThisCustomer").'</a></div>';
|
||||||
else print '<div class="inline-block divButAction"><a class="butActionRefused" title="'.dol_escape_js($langs->trans("NoOrdersToInvoice")).'" href="#">'.$langs->trans("CreateInvoiceForThisCustomer").'</a></div>';
|
}
|
||||||
}
|
|
||||||
|
if ($object->client != 0) print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/compta/facture.php?action=create&socid='.$object->id.'">'.$langs->trans("AddBill").'</a></div>';
|
||||||
if ($object->client != 0) print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/compta/facture.php?action=create&socid='.$object->id.'">'.$langs->trans("AddBill").'</a></div>';
|
else print '<div class="inline-block divButAction"><a class="butActionRefused" title="'.dol_escape_js($langs->trans("ThirdPartyMustBeEditAsCustomer")).'" href="#">'.$langs->trans("AddBill").'</a></div>';
|
||||||
else print '<div class="inline-block divButAction"><a class="butActionRefused" title="'.dol_escape_js($langs->trans("ThirdPartyMustBeEditAsCustomer")).'" href="#">'.$langs->trans("AddBill").'</a></div>';
|
|
||||||
|
}
|
||||||
}
|
else
|
||||||
else
|
{
|
||||||
{
|
print '<div class="inline-block divButAction"><a class="butActionRefused" title="'.dol_escape_js($langs->trans("NotAllowed")).'" href="#">'.$langs->trans("AddBill").'</a></div>';
|
||||||
print '<div class="inline-block divButAction"><a class="butActionRefused" title="'.dol_escape_js($langs->trans("NotAllowed")).'" href="#">'.$langs->trans("AddBill").'</a></div>';
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
// Add action
|
||||||
// Add action
|
if (! empty($conf->agenda->enabled) && ! empty($conf->global->MAIN_REPEATTASKONEACHTAB))
|
||||||
if (! empty($conf->agenda->enabled) && ! empty($conf->global->MAIN_REPEATTASKONEACHTAB))
|
{
|
||||||
{
|
if ($user->rights->agenda->myactions->create)
|
||||||
if ($user->rights->agenda->myactions->create)
|
{
|
||||||
{
|
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create&socid='.$object->id.'">'.$langs->trans("AddAction").'</a></div>';
|
||||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create&socid='.$object->id.'">'.$langs->trans("AddAction").'</a></div>';
|
}
|
||||||
}
|
else
|
||||||
else
|
{
|
||||||
{
|
print '<div class="inline-block divButAction"><a class="butAction" title="'.dol_escape_js($langs->trans("NotAllowed")).'" href="#">'.$langs->trans("AddAction").'</a></div>';
|
||||||
print '<div class="inline-block divButAction"><a class="butAction" title="'.dol_escape_js($langs->trans("NotAllowed")).'" href="#">'.$langs->trans("AddAction").'</a></div>';
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
if (! empty($conf->global->MAIN_REPEATCONTACTONEACHTAB))
|
if (! empty($conf->global->MAIN_REPEATCONTACTONEACHTAB))
|
||||||
|
|||||||
@ -518,15 +518,14 @@ if ($object->id > 0)
|
|||||||
/*
|
/*
|
||||||
* Barre d'actions
|
* Barre d'actions
|
||||||
*/
|
*/
|
||||||
|
print '<div class="tabsAction">';
|
||||||
|
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been
|
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been
|
||||||
// modified by hook
|
// modified by hook
|
||||||
if (empty($reshook))
|
if (empty($reshook))
|
||||||
{
|
{
|
||||||
|
if ($user->rights->fournisseur->commande->creer)
|
||||||
print '<div class="tabsAction">';
|
|
||||||
|
|
||||||
if ($user->rights->fournisseur->commande->creer)
|
|
||||||
{
|
{
|
||||||
$langs->load("orders");
|
$langs->load("orders");
|
||||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/fourn/commande/card.php?action=create&socid='.$object->id.'">'.$langs->trans("AddOrder").'</a>';
|
print '<a class="butAction" href="'.DOL_URL_ROOT.'/fourn/commande/card.php?action=create&socid='.$object->id.'">'.$langs->trans("AddOrder").'</a>';
|
||||||
@ -562,9 +561,11 @@ if ($object->id > 0)
|
|||||||
print '<a class="butAction" title="'.dol_escape_js($langs->trans("NotAllowed")).'" href="#">'.$langs->trans("AddAction").'</a>';
|
print '<a class="butAction" title="'.dol_escape_js($langs->trans("NotAllowed")).'" href="#">'.$langs->trans("AddAction").'</a>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
print '</div>';
|
|
||||||
print '<br>';
|
print '</div>';
|
||||||
|
|
||||||
|
print '<br>';
|
||||||
|
|
||||||
if (! empty($conf->global->MAIN_REPEATCONTACTONEACHTAB))
|
if (! empty($conf->global->MAIN_REPEATCONTACTONEACHTAB))
|
||||||
{
|
{
|
||||||
@ -589,7 +590,6 @@ if ($object->id > 0)
|
|||||||
// List of done actions
|
// List of done actions
|
||||||
show_actions_done($conf,$langs,$db,$object);
|
show_actions_done($conf,$langs,$db,$object);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2784,15 +2784,17 @@ elseif (! empty($object->id))
|
|||||||
/**
|
/**
|
||||||
* Boutons actions
|
* Boutons actions
|
||||||
*/
|
*/
|
||||||
$parameters = array();
|
|
||||||
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been
|
if ($user->societe_id == 0 && $action != 'editline' && $action != 'delete')
|
||||||
// modified by hook
|
|
||||||
if (empty($reshook))
|
|
||||||
{
|
{
|
||||||
if ($user->societe_id == 0 && $action != 'editline' && $action != 'delete')
|
print '<div class="tabsAction">';
|
||||||
{
|
|
||||||
print '<div class="tabsAction">';
|
|
||||||
|
|
||||||
|
$parameters = array();
|
||||||
|
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been
|
||||||
|
// modified by hook
|
||||||
|
if (empty($reshook))
|
||||||
|
{
|
||||||
|
|
||||||
// Validate
|
// Validate
|
||||||
if ($object->statut == 0 && $num > 0)
|
if ($object->statut == 0 && $num > 0)
|
||||||
{
|
{
|
||||||
@ -2974,9 +2976,11 @@ elseif (! empty($object->id))
|
|||||||
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete">'.$langs->trans("Delete").'</a>';
|
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete">'.$langs->trans("Delete").'</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
print "</div>";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
print "</div>";
|
||||||
}
|
}
|
||||||
|
|
||||||
print "<br>";
|
print "<br>";
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -487,16 +487,17 @@ if ($id > 0 || ! empty($ref))
|
|||||||
|
|
||||||
if ($action != 'edit')
|
if ($action != 'edit')
|
||||||
{
|
{
|
||||||
$parameters = array();
|
/*
|
||||||
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been
|
* Actions
|
||||||
// modified by hook
|
*/
|
||||||
if (empty($reshook))
|
|
||||||
{
|
print '<div class="tabsAction">';
|
||||||
/*
|
|
||||||
* Actions
|
$parameters = array();
|
||||||
*/
|
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been
|
||||||
print '<div class="tabsAction">';
|
// modified by hook
|
||||||
|
if (empty($reshook))
|
||||||
|
{
|
||||||
// Modify
|
// Modify
|
||||||
if ($user->rights->projet->creer)
|
if ($user->rights->projet->creer)
|
||||||
{
|
{
|
||||||
@ -518,27 +519,25 @@ if ($id > 0 || ! empty($ref))
|
|||||||
}
|
}
|
||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
}
|
||||||
print '<table width="100%"><tr><td width="50%" valign="top">';
|
|
||||||
print '<a name="builddoc"></a>'; // ancre
|
print '<table width="100%"><tr><td width="50%" valign="top">';
|
||||||
|
print '<a name="builddoc"></a>'; // ancre
|
||||||
/*
|
|
||||||
* Documents generes
|
/*
|
||||||
*/
|
* Documents generes
|
||||||
$filename=dol_sanitizeFileName($projectstatic->ref). "/". dol_sanitizeFileName($object->ref);
|
*/
|
||||||
$filedir=$conf->projet->dir_output . "/" . dol_sanitizeFileName($projectstatic->ref). "/" .dol_sanitizeFileName($object->ref);
|
$filename=dol_sanitizeFileName($projectstatic->ref). "/". dol_sanitizeFileName($object->ref);
|
||||||
$urlsource=$_SERVER["PHP_SELF"]."?id=".$object->id;
|
$filedir=$conf->projet->dir_output . "/" . dol_sanitizeFileName($projectstatic->ref). "/" .dol_sanitizeFileName($object->ref);
|
||||||
$genallowed=($user->rights->projet->lire);
|
$urlsource=$_SERVER["PHP_SELF"]."?id=".$object->id;
|
||||||
$delallowed=($user->rights->projet->creer);
|
$genallowed=($user->rights->projet->lire);
|
||||||
|
$delallowed=($user->rights->projet->creer);
|
||||||
$var=true;
|
|
||||||
|
$var=true;
|
||||||
$somethingshown=$formfile->show_documents('project_task',$filename,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf);
|
|
||||||
|
$somethingshown=$formfile->show_documents('project_task',$filename,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf);
|
||||||
|
|
||||||
|
print '</td></tr></table>';
|
||||||
print '</td></tr></table>';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user