From 75323859e4c0e1ed90eb96bd4407335ccef15b39 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 Jan 2021 13:58:16 +0100 Subject: [PATCH] Add some hooks to add new buttons (compensation of removal of tabs). --- htdocs/comm/action/index.php | 9 +++++++++ htdocs/comm/action/list.php | 15 +++++++++++---- htdocs/comm/action/pertype.php | 9 +++++++++ htdocs/comm/action/peruser.php | 9 +++++++++ 4 files changed, 38 insertions(+), 4 deletions(-) diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index dc0ada64eb3..016201be0f3 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -454,6 +454,15 @@ $viewmode .= ''; +// Add more views from hooks +$parameters = array(); $object = null; +$reshook = $hookmanager->executeHooks('addCalendarView', $parameters, $object, $action); +if (empty($reshook)) { + $viewmode .= $hookmanager->resPrint; +} elseif ($reshook > 1) { + $viewmode = $hookmanager->resPrint; +} + $newcardbutton = ''; if ($user->rights->agenda->myactions->create || $user->rights->agenda->allactions->create) diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php index 2fe47ab39f1..f5a0a6783da 100644 --- a/htdocs/comm/action/list.php +++ b/htdocs/comm/action/list.php @@ -472,11 +472,9 @@ if ($resql) // Calendars from hooks $parameters = array(); $object = null; $reshook = $hookmanager->executeHooks('addCalendarChoice', $parameters, $object, $action); - if (empty($reshook)) - { + if (empty($reshook)) { $s .= $hookmanager->resPrint; - } elseif ($reshook > 1) - { + } elseif ($reshook > 1) { $s = $hookmanager->resPrint; } @@ -513,6 +511,15 @@ if ($resql) $viewmode .= ''; + // Add more views from hooks + $parameters = array(); $object = null; + $reshook = $hookmanager->executeHooks('addCalendarView', $parameters, $object, $action); + if (empty($reshook)) { + $viewmode .= $hookmanager->resPrint; + } elseif ($reshook > 1) { + $viewmode = $hookmanager->resPrint; + } + $tmpforcreatebutton = dol_getdate(dol_now(), true); $newparam .= '&month='.str_pad($month, 2, "0", STR_PAD_LEFT).'&year='.$tmpforcreatebutton['year']; diff --git a/htdocs/comm/action/pertype.php b/htdocs/comm/action/pertype.php index 29b86b96868..f956b5ae5f7 100644 --- a/htdocs/comm/action/pertype.php +++ b/htdocs/comm/action/pertype.php @@ -384,6 +384,15 @@ $viewmode .= ''; +// Add more views from hooks +$parameters = array(); $object = null; +$reshook = $hookmanager->executeHooks('addCalendarView', $parameters, $object, $action); +if (empty($reshook)) { + $viewmode .= $hookmanager->resPrint; +} elseif ($reshook > 1) { + $viewmode = $hookmanager->resPrint; +} + $newcardbutton = ''; if ($user->rights->agenda->myactions->create || $user->rights->agenda->allactions->create) diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index 55e6725ba8d..2dc62a52e91 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -389,6 +389,15 @@ $viewmode .= ''; +// Add more views from hooks +$parameters = array(); $object = null; +$reshook = $hookmanager->executeHooks('addCalendarView', $parameters, $object, $action); +if (empty($reshook)) { + $viewmode .= $hookmanager->resPrint; +} elseif ($reshook > 1) { + $viewmode = $hookmanager->resPrint; +} + $newcardbutton = ''; if ($user->rights->agenda->myactions->create || $user->rights->agenda->allactions->create)