From 94f678548b1b4514a25037e34e3f9948a63044f6 Mon Sep 17 00:00:00 2001 From: nathangray Date: Wed, 25 Jan 2017 10:52:47 -0700 Subject: [PATCH] Add config option to show age for birthdays --- calendar/inc/class.calendar_bo.inc.php | 4 +++- calendar/templates/default/config.xet | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/calendar/inc/class.calendar_bo.inc.php b/calendar/inc/class.calendar_bo.inc.php index b6d7d7945f..1862793fd0 100644 --- a/calendar/inc/class.calendar_bo.inc.php +++ b/calendar/inc/class.calendar_bo.inc.php @@ -1923,7 +1923,9 @@ class calendar_bo 'month' => $m, 'occurence' => 0, 'name' => lang('Birthday').' '.($pers['n_given'] ? $pers['n_given'] : $pers['n_prefix']).' '.$pers['n_middle'].' '. - $pers['n_family'].($y && !$GLOBALS['egw_info']['server']['hide_birthdays'] ? ' ('.$y.')' : ''), + $pers['n_family']. + ($GLOBALS['egw_info']['server']['hide_birthdays'] == 'age' ? ' '.($year - $y): ''). + ($y && in_array($GLOBALS['egw_info']['server']['hide_birthdays'], array('','age')) ? ' ('.$y.')' : ''), 'birthyear' => $y, // this can be used to identify birthdays from holidays ); } diff --git a/calendar/templates/default/config.xet b/calendar/templates/default/config.xet index e9a6492020..825fa7f17b 100644 --- a/calendar/templates/default/config.xet +++ b/calendar/templates/default/config.xet @@ -91,6 +91,7 @@