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 "
";
diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php
index 1a3b1921713..a65ca9a8f0d 100644
--- a/htdocs/projet/tasks/task.php
+++ b/htdocs/projet/tasks/task.php
@@ -487,52 +487,58 @@ if ($id > 0 || ! empty($ref))
if ($action != 'edit')
{
- /*
- * Actions
- */
- print '';
-
- // Modify
- if ($user->rights->projet->creer)
+ $parameters = array();
+ $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been
+ // modified by hook
+ if (empty($reshook))
{
- print '
'.$langs->trans('Modify').'';
+ /*
+ * Actions
+ */
+ 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 ' |
';
}
- else
- {
- print '
'.$langs->trans('Modify').'';
- }
-
- // Delete
- if ($user->rights->projet->supprimer && ! $object->hasChildren())
- {
- print '
'.$langs->trans('Delete').'';
- }
- else
- {
- print '
'.$langs->trans('Delete').'';
- }
-
- print '
';
-
- print '