From 4b67a050747549a07d61ecc9af195fa0472073f9 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Fri, 4 Jun 2010 09:01:15 +0000 Subject: [PATCH] - setting again date format and language from current user, was lost in r27581 - using current date in users timezone, instead of server timezone - loading javascript for jscalendar::flat only if not yet loaded --- phpgwapi/inc/class.jscalendar.inc.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/phpgwapi/inc/class.jscalendar.inc.php b/phpgwapi/inc/class.jscalendar.inc.php index 35479ad7b4..45bb220bb1 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$ */ /** @@ -64,10 +64,11 @@ class jscalendar */ function get_javascript() { + $args = array_intersect_key($GLOBALS['egw_info']['user']['preferences']['common'],array('lang'=>1,'dateformat'=>1)); return ' - + '; } @@ -161,7 +162,10 @@ Calendar.setup( */ function flat($url,$date=null,$weekUrl='',$weekTTip='',$monthUrl='',$monthTTip='',$id='calendar-container') { - $javascript = $this->get_javascript(); + if (strpos($GLOBALS['egw_info']['flags']['java_script'],'jscalendar') === false) + { + $javascript = $this->get_javascript(); + } if ($date) // string if format YYYYmmdd or timestamp { $date = is_int($date) ? adodb_date('m/d/Y',$date) : @@ -192,7 +196,7 @@ function todayClicked(calendar) { { var split = parts[i].split("="); if (split[0] && split[0] == "date") { - split[1] = "'.date('Ymd').'"; + split[1] = "'.egw_time::to('now','Ymd').'"; hasdate = true; } @@ -211,7 +215,7 @@ function todayClicked(calendar) { newsearch = "?"; else newsearch += "&"; - newsearch += "date='.date('Ymd').'"; + newsearch += "date='.egw_time::to('now','Ymd').'"; } window.location.search = newsearch;