From 977d2d3463b4f27c69c75cdccca5909f3aa5769d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 21 Jul 2015 12:19:21 +0200 Subject: [PATCH] Fix: The hook addCalendarChoice was only visible into tabs index.php --- htdocs/comm/action/listactions.php | 18 ++++++++++++++++-- htdocs/comm/action/peruser.php | 17 +++++++++++++++-- 2 files changed, 31 insertions(+), 4 deletions(-) diff --git a/htdocs/comm/action/listactions.php b/htdocs/comm/action/listactions.php index ee16bdd0711..509a9c90d77 100644 --- a/htdocs/comm/action/listactions.php +++ b/htdocs/comm/action/listactions.php @@ -254,8 +254,22 @@ if ($resql) } */ - print_barre_liste($newtitle, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $link, $num, 0, '', 0, $nav); - //print '
'; + $s=$newtitle; + + // Calendars from hooks + $parameters=array(); $object=null; + $reshook=$hookmanager->executeHooks('addCalendarChoice',$parameters,$object,$action); + if (empty($reshook)) + { + $s.= $hookmanager->resPrint; + } + elseif ($reshook > 1) + { + $s = $hookmanager->resPrint; + } + + print_barre_liste($s, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $link, $num, 0, '', 0, $nav); + print '
'."\n"; diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index 1563174c3a2..89aff9b966b 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -317,14 +317,27 @@ if ($conf->use_javascript_ajax) $s.='
' . $val ['name'] . '  
'; } } + + //$s.='
'.$langs->trans("AgendaShowBirthdayEvents").'  
'; + + // Calendars from hooks + $parameters=array(); $object=null; + $reshook=$hookmanager->executeHooks('addCalendarChoice',$parameters,$object,$action); + if (empty($reshook)) + { + $s.= $hookmanager->resPrint; + } + elseif ($reshook > 1) + { + $s = $hookmanager->resPrint; + } } - //$s.='
'.$langs->trans("AgendaShowBirthdayEvents").'  
'; } $link=''; -print_fiche_titre($s,$link.'     '.$nav, ''); +print_fiche_titre($s, $link.'     '.$nav, ''); // Get event in an array