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)