diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index 17098310769..38447c17c5e 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -961,82 +961,84 @@ if ($id > 0) * Barre d'actions */ + print '
'; + $parameters = array(); $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been - - print '
'; - - if (! empty($conf->propal->enabled) && $user->rights->propal->creer && $object->status==1) - { - $langs->load("propal"); - print ''; - } - - if (! empty($conf->commande->enabled) && $user->rights->commande->creer && $object->status==1) - { - $langs->load("orders"); - print ''; - } - - if ($user->rights->contrat->creer && $object->status==1) - { - $langs->load("contracts"); - print ''; - } - - if (! empty($conf->ficheinter->enabled) && $user->rights->ficheinter->creer && $object->status==1) - { - $langs->load("fichinter"); - print ''; - } - - // Add invoice - if ($user->societe_id == 0) - { - if (! empty($conf->deplacement->enabled) && $object->status==1) - { - $langs->load("trips"); - print ''; - } - - if (! empty($conf->facture->enabled)) - { - if ($user->rights->facture->creer && $object->status==1) - { - $langs->load("bills"); - $langs->load("orders"); - - if (! empty($conf->commande->enabled)) - { - if (! empty($orders2invoice) && $orders2invoice > 0) print ''; - else print ''; - } - - if ($object->client != 0) print ''; - else print ''; - - } - else - { - print ''; - } - } - } - - // Add action - if (! empty($conf->agenda->enabled) && ! empty($conf->global->MAIN_REPEATTASKONEACHTAB)) - { - if ($user->rights->agenda->myactions->create) - { - print ''; - } - else - { - print ''; - } - } - + if (empty($reshook)) + { + if (! empty($conf->propal->enabled) && $user->rights->propal->creer && $object->status==1) + { + $langs->load("propal"); + print ''; + } + + if (! empty($conf->commande->enabled) && $user->rights->commande->creer && $object->status==1) + { + $langs->load("orders"); + print ''; + } + + if ($user->rights->contrat->creer && $object->status==1) + { + $langs->load("contracts"); + print ''; + } + + if (! empty($conf->ficheinter->enabled) && $user->rights->ficheinter->creer && $object->status==1) + { + $langs->load("fichinter"); + print ''; + } + + // Add invoice + if ($user->societe_id == 0) + { + if (! empty($conf->deplacement->enabled) && $object->status==1) + { + $langs->load("trips"); + print ''; + } + + if (! empty($conf->facture->enabled)) + { + if ($user->rights->facture->creer && $object->status==1) + { + $langs->load("bills"); + $langs->load("orders"); + + if (! empty($conf->commande->enabled)) + { + if (! empty($orders2invoice) && $orders2invoice > 0) print ''; + else print ''; + } + + if ($object->client != 0) print ''; + else print ''; + + } + else + { + print ''; + } + } + } + + // Add action + if (! empty($conf->agenda->enabled) && ! empty($conf->global->MAIN_REPEATTASKONEACHTAB)) + { + if ($user->rights->agenda->myactions->create) + { + print ''; + } + else + { + print ''; + } + } + } + print '
'; if (! empty($conf->global->MAIN_REPEATCONTACTONEACHTAB)) diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php index 255d7f2cda0..b64a8ee77e4 100644 --- a/htdocs/fourn/card.php +++ b/htdocs/fourn/card.php @@ -518,15 +518,14 @@ if ($object->id > 0) /* * Barre d'actions */ + print '
'; + $parameters = array(); $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been // modified by hook if (empty($reshook)) { - - print '
'; - - if ($user->rights->fournisseur->commande->creer) + if ($user->rights->fournisseur->commande->creer) { $langs->load("orders"); print ''.$langs->trans("AddOrder").''; @@ -562,9 +561,11 @@ if ($object->id > 0) print ''.$langs->trans("AddAction").''; } } - - print '
'; - print '
'; + } + + print '
'; + + print '
'; if (! empty($conf->global->MAIN_REPEATCONTACTONEACHTAB)) { @@ -589,7 +590,6 @@ if ($object->id > 0) // List of done actions show_actions_done($conf,$langs,$db,$object); } - } } else { diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 4454c0ac28c..8d18914d62c 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -2784,15 +2784,17 @@ elseif (! empty($object->id)) /** * Boutons actions */ - $parameters = array(); - $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been - // modified by hook - if (empty($reshook)) + + if ($user->societe_id == 0 && $action != 'editline' && $action != 'delete') { - if ($user->societe_id == 0 && $action != 'editline' && $action != 'delete') - { - print '
'; + print '
'; + $parameters = array(); + $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been + // modified by hook + if (empty($reshook)) + { + // Validate if ($object->statut == 0 && $num > 0) { @@ -2974,9 +2976,11 @@ elseif (! empty($object->id)) print ''.$langs->trans("Delete").''; } - print "
"; } + + print "
"; } + print "
"; diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php index a65ca9a8f0d..8c1d1fc40cb 100644 --- a/htdocs/projet/tasks/task.php +++ b/htdocs/projet/tasks/task.php @@ -487,16 +487,17 @@ if ($id > 0 || ! empty($ref)) if ($action != 'edit') { - $parameters = array(); - $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been - // modified by hook - if (empty($reshook)) - { - /* - * Actions - */ - print '
'; - + /* + * Actions + */ + + print '
'; + + $parameters = array(); + $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been + // modified by hook + if (empty($reshook)) + { // Modify if ($user->rights->projet->creer) { @@ -518,27 +519,25 @@ if ($id > 0 || ! empty($ref)) } print '
'; - - print '
'; - print ''; // ancre - - /* - * Documents generes - */ - $filename=dol_sanitizeFileName($projectstatic->ref). "/". dol_sanitizeFileName($object->ref); - $filedir=$conf->projet->dir_output . "/" . dol_sanitizeFileName($projectstatic->ref). "/" .dol_sanitizeFileName($object->ref); - $urlsource=$_SERVER["PHP_SELF"]."?id=".$object->id; - $genallowed=($user->rights->projet->lire); - $delallowed=($user->rights->projet->creer); - - $var=true; - - $somethingshown=$formfile->show_documents('project_task',$filename,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf); - - - - print '
'; - } + } + + print '
'; + print ''; // ancre + + /* + * Documents generes + */ + $filename=dol_sanitizeFileName($projectstatic->ref). "/". dol_sanitizeFileName($object->ref); + $filedir=$conf->projet->dir_output . "/" . dol_sanitizeFileName($projectstatic->ref). "/" .dol_sanitizeFileName($object->ref); + $urlsource=$_SERVER["PHP_SELF"]."?id=".$object->id; + $genallowed=($user->rights->projet->lire); + $delallowed=($user->rights->projet->creer); + + $var=true; + + $somethingshown=$formfile->show_documents('project_task',$filename,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf); + + print '
'; } } }