From beeaf215219d85df9249275c4e5a385b50cc54a8 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Wed, 2 Sep 2015 12:46:46 +0000 Subject: [PATCH] Update timezones always reports nothing to update, as automatic called init_static() already done the update --- calendar/inc/class.calendar_timezones.inc.php | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/calendar/inc/class.calendar_timezones.inc.php b/calendar/inc/class.calendar_timezones.inc.php index dea4693e9b..b60309762d 100644 --- a/calendar/inc/class.calendar_timezones.inc.php +++ b/calendar/inc/class.calendar_timezones.inc.php @@ -7,7 +7,7 @@ * @link http://www.egroupware.org * @package calendar * @author Ralf Becker - * @copyright (c) 2009-11 by RalfBecker-At-outdoor-training.de + * @copyright (c) 2009-15 by RalfBecker-At-outdoor-training.de * @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License * @version $Id$ */ @@ -154,6 +154,13 @@ class calendar_timezones return !$data ? $data : ($what ? $data[$what] : $data); } + /** + * Import messages from init_static, if import happend in that request + * + * @var string + */ + protected static $import_msg; + /** * Init static variables for session and check for updated timezone information * @@ -184,6 +191,8 @@ class calendar_timezones $alias_msg = self::import_tz_aliases($updated); if ($updated) error_log($alias_msg); // log that timezone aliases have been updated + self::$import_msg = $msg.'
'.$alias_msg; + egw_cache::setSession(__CLASS__, 'tzs_checked', true); } } @@ -323,10 +332,12 @@ class calendar_timezones { throw new egw_exception_no_permission_admin(); } - $output = '

'.self::import_zones()."

\n"; - $output .= '

'.self::import_tz_aliases()."

\n"; - - $GLOBALS['egw']->framework->render($output, lang('Update timezones'), true); + if (empty(self::$import_msg)) + { + self::$import_msg = self::import_zones(); + self::$import_msg .= '
'.self::import_tz_aliases(); + } + $GLOBALS['egw']->framework->render('

'.self::$import_msg.'

', lang('Update timezones'), false); } /**