From 8f378da6c936a8ecfb3dea8fa6b9de4f2604d34c Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Fri, 31 Jul 2009 12:56:39 +0000 Subject: [PATCH] fix for jscalendar in sitemgr (was not displayed) provided by H.J.Tappe --- phpgwapi/inc/class.jscalendar.inc.php | 20 ++++++++++++++------ phpgwapi/inc/jscalendar-setup.php | 14 ++++++++++++-- 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/phpgwapi/inc/class.jscalendar.inc.php b/phpgwapi/inc/class.jscalendar.inc.php index c522d0052f..3d31542c19 100644 --- a/phpgwapi/inc/class.jscalendar.inc.php +++ b/phpgwapi/inc/class.jscalendar.inc.php @@ -5,9 +5,9 @@ * @link http://www.egroupware.org * @author Ralf Becker * @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License + * @version $Id$ * @package api * @subpackage html - * @version $Id$ */ /** @@ -42,6 +42,15 @@ class jscalendar $this->jscalendar_url = $GLOBALS['egw_info']['server']['webserver_url'].'/phpgwapi/js/'.$path; $this->dateformat = $GLOBALS['egw_info']['user']['preferences']['common']['dateformat']; + $args = array_intersect_key($GLOBALS['egw_info']['user']['preferences']['common'],array('lang'=>1,'dateformat'=>1)); + if (isset($GLOBALS['egw_info']['flags']['currentapp'])) + { + $args['app'] = $GLOBALS['egw_info']['flags']['currentapp']; + } + else + { + $args['app'] = 'home'; // home can be granted to anyone. + } if ($do_header && (strpos($GLOBALS['egw_info']['flags']['java_script'],'jscalendar')===false)) { $GLOBALS['egw_info']['flags']['java_script'] .= $this->get_javascript(); @@ -58,8 +67,7 @@ class jscalendar return ' - + '; } @@ -114,16 +122,16 @@ class jscalendar if ($jsreturn) { $return_array = array( - 'html' => '', + 'html' => '', 'js' => 'Calendar.setup({inputField : "'.$name.'",button: "'.$name.'-trigger" });' - ); + ); return $return_array; } return '