From 8a63298102312df88124431c05f6cd0149b254b1 Mon Sep 17 00:00:00 2001 From: BENKE Charlie Date: Wed, 27 Apr 2016 22:19:38 +0200 Subject: [PATCH] Missing addMoreActionsButtons hook --- htdocs/projet/tasks/task.php | 97 +++++++++++++++++++----------------- 1 file changed, 51 insertions(+), 46 deletions(-) diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php index 1a3b1921713..e1bfbb335da 100644 --- a/htdocs/projet/tasks/task.php +++ b/htdocs/projet/tasks/task.php @@ -484,55 +484,60 @@ if ($id > 0 || ! empty($ref)) dol_fiche_end(); } - - 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 '
'; - - // Modify - if ($user->rights->projet->creer) + if ($action != 'edit') { - print ''.$langs->trans('Modify').''; + /* + * Actions + */ + print '
'; + + // Modify + if ($user->rights->projet->creer) + { + print ''.$langs->trans('Modify').''; + } + else + { + print ''.$langs->trans('Modify').''; + } + + // Delete + if ($user->rights->projet->supprimer && ! $object->hasChildren()) + { + print ''.$langs->trans('Delete').''; + } + else + { + print ''.$langs->trans('Delete').''; + } + + 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 '
'; - 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 '
'; } } }