From 520facd55e6cae0fba91af3dfdc468f5f0b4aecc Mon Sep 17 00:00:00 2001 From: BENKE Charlie Date: Wed, 27 Apr 2016 22:17:45 +0200 Subject: [PATCH] Missing addMoreActionsButtons hook --- htdocs/projet/card.php | 275 +++++++++++++++++++++-------------------- 1 file changed, 140 insertions(+), 135 deletions(-) diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 5ef9b0e1ce4..c489910064d 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -852,142 +852,147 @@ else * Boutons actions */ print '
'; - - 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)) { - // Modify - if ($object->statut != 2 && $user->rights->projet->creer) - { - if ($userWrite > 0) - { - print ''; - } - else - { - print ''; - } - } - - // Validate - if ($object->statut == 0 && $user->rights->projet->creer) - { - if ($userWrite > 0) - { - print ''; - } - else - { - print ''; - } - } - - // Close - if (($object->statut == 0 || $object->statut == 1) && $user->rights->projet->creer) - { - if ($userWrite > 0) - { - print ''; - } - else - { - print ''; - } - } - - // Reopen - if ($object->statut == 2 && $user->rights->projet->creer) - { - if ($userWrite > 0) - { - print ''; - } - else - { - print ''; - } - } - - // Add button to create objects from project - if (! empty($conf->global->PROJECT_SHOW_CREATE_OBJECT_BUTTON)) - { - if (! empty($conf->propal->enabled) && $user->rights->propal->creer) - { - $langs->load("propal"); - print ''; - } - if (! empty($conf->commande->enabled) && $user->rights->commande->creer) - { - $langs->load("orders"); - print ''; - } - if (! empty($conf->facture->enabled) && $user->rights->facture->creer) - { - $langs->load("bills"); - print ''; - } - if (! empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposal->creer) - { - $langs->load("supplier_proposal"); - print ''; - } - if (! empty($conf->supplier_order->enabled) && $user->rights->fournisseur->commande->creer) - { - $langs->load("suppliers"); - print ''; - } - if (! empty($conf->supplier_invoice->enabled) && $user->rights->fournisseur->facture->creer) - { - $langs->load("suppliers"); - print ''; - } - if (! empty($conf->ficheinter->enabled) && $user->rights->ficheinter->creer) - { - $langs->load("interventions"); - print ''; - } - if (! empty($conf->contrat->enabled) && $user->rights->contrat->creer) - { - $langs->load("contracts"); - print ''; - } - if (! empty($conf->expensereport->enabled) && $user->rights->expensereport->creer) - { - $langs->load("expensereports"); - $langs->load("trips"); - print ''; - } - if (! empty($conf->don->enabled) && $user->rights->don->creer) - { - $langs->load("donations"); - print ''; - } - } - - // Clone - if ($user->rights->projet->creer) - { - if ($userWrite > 0) - { - print ''; - } - else - { - print ''; - } - } - - // Delete - if ($user->rights->projet->supprimer) - { - if ($userDelete > 0) - { - print ''; - } - else - { - print ''; - } - } + if ($action != "edit" ) + { + // Modify + if ($object->statut != 2 && $user->rights->projet->creer) + { + if ($userWrite > 0) + { + print ''; + } + else + { + print ''; + } + } + + // Validate + if ($object->statut == 0 && $user->rights->projet->creer) + { + if ($userWrite > 0) + { + print ''; + } + else + { + print ''; + } + } + + // Close + if (($object->statut == 0 || $object->statut == 1) && $user->rights->projet->creer) + { + if ($userWrite > 0) + { + print ''; + } + else + { + print ''; + } + } + + // Reopen + if ($object->statut == 2 && $user->rights->projet->creer) + { + if ($userWrite > 0) + { + print ''; + } + else + { + print ''; + } + } + + // Add button to create objects from project + if (! empty($conf->global->PROJECT_SHOW_CREATE_OBJECT_BUTTON)) + { + if (! empty($conf->propal->enabled) && $user->rights->propal->creer) + { + $langs->load("propal"); + print ''; + } + if (! empty($conf->commande->enabled) && $user->rights->commande->creer) + { + $langs->load("orders"); + print ''; + } + if (! empty($conf->facture->enabled) && $user->rights->facture->creer) + { + $langs->load("bills"); + print ''; + } + if (! empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposal->creer) + { + $langs->load("supplier_proposal"); + print ''; + } + if (! empty($conf->supplier_order->enabled) && $user->rights->fournisseur->commande->creer) + { + $langs->load("suppliers"); + print ''; + } + if (! empty($conf->supplier_invoice->enabled) && $user->rights->fournisseur->facture->creer) + { + $langs->load("suppliers"); + print ''; + } + if (! empty($conf->ficheinter->enabled) && $user->rights->ficheinter->creer) + { + $langs->load("interventions"); + print ''; + } + if (! empty($conf->contrat->enabled) && $user->rights->contrat->creer) + { + $langs->load("contracts"); + print ''; + } + if (! empty($conf->expensereport->enabled) && $user->rights->expensereport->creer) + { + $langs->load("expensereports"); + $langs->load("trips"); + print ''; + } + if (! empty($conf->don->enabled) && $user->rights->don->creer) + { + $langs->load("donations"); + print ''; + } + } + + // Clone + if ($user->rights->projet->creer) + { + if ($userWrite > 0) + { + print ''; + } + else + { + print ''; + } + } + + // Delete + if ($user->rights->projet->supprimer) + { + if ($userDelete > 0) + { + print ''; + } + else + { + print ''; + } + } + } } print "
";