phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] hrm/inc class.bocommon.inc.php class.uiuser.inc...


From: Sigurd Nes
Subject: [Phpgroupware-cvs] hrm/inc class.bocommon.inc.php class.uiuser.inc...
Date: Mon, 20 Mar 2006 10:13:25 +0000

CVSROOT:        /sources/phpgroupware
Module name:    hrm
Branch:         
Changes by:     Sigurd Nes <address@hidden>     06/03/20 10:13:25

Modified files:
        inc            : class.bocommon.inc.php class.uiuser.inc.php 

Log message:
        fix for calendar

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/hrm/inc/class.bocommon.inc.php.diff?tr1=1.8&tr2=1.9&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/hrm/inc/class.uiuser.inc.php.diff?tr1=1.11&tr2=1.12&r1=text&r2=text

Patches:
Index: hrm/inc/class.bocommon.inc.php
diff -u hrm/inc/class.bocommon.inc.php:1.8 hrm/inc/class.bocommon.inc.php:1.9
--- hrm/inc/class.bocommon.inc.php:1.8  Fri Jan 27 17:02:29 2006
+++ hrm/inc/class.bocommon.inc.php      Mon Mar 20 10:13:24 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package hrm
        * @subpackage core
-       * @version $Id: class.bocommon.inc.php,v 1.8 2006/01/27 17:02:29 
sigurdne Exp $
+       * @version $Id: class.bocommon.inc.php,v 1.9 2006/03/20 10:13:24 
sigurdne Exp $
        */
 
        /**
@@ -82,39 +82,38 @@
                                case 'pgsql':
                                        $this->dateformat               = 
"Y-m-d";
                                        $this->datetimeformat   = "Y-m-d G:i:s";
-//                                     $this->dateformat               = "F j, 
Y";
-//                                     $this->datetimeformat   = "F j, Y g:iA";
                                        break;
                        }
 
-       /*              if 
($GLOBALS['phpgw_info']['server']['db_type']=='mssql')
-                       {
-                               $this->dateformat               = "M d Y";
-                               $this->datetimeformat   = "M d Y g:iA";
-                       }
-                       else
-                       {
-                               $this->dateformat               = "Y-m-d";
-                               $this->datetimeformat   = "Y-m-d G:i:s";
-                       }
+               }
 
 
-                       if(!$GLOBALS['phpgw_info']['flags']['css'])
-                       {
-                               $GLOBALS['phpgw_info']['flags']['css'] .= 
"-->\n</style>\n"
-                                       . '<link rel="stylesheet" 
type="text/css" media="all" href="'
-                                       . 
$GLOBALS['phpgw_info']['server']['webserver_url'].'/' . $this->currentapp . 
'/templates/'
-                                       . 
$GLOBALS['phpgw_info']['server']['template_set']
-                                       . 
'/css/'.$GLOBALS['phpgw_info']['server']['template_set'].'.css" 
title="'.$GLOBALS['phpgw_info']['server']['template_set'].'" />'
-                                       . "\n<style type=\"text/css\">\n<!--\n";
-                       }
-*/
+
+               function jscalendar()
+               {
+                       $phpgw_js_url = 
$GLOBALS['phpgw_info']['server']['webserver_url'].'/phpgwapi/js';
+                       $img = 
$GLOBALS['phpgw']->common->image('phpgwapi','cal');
+
+                       $dateformat = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
+                       $jsDateFormat = str_replace(array('d', 'm', 'M', 'Y'), 
array('%d', '%m', '%b', '%Y'), $dateformat);
+
+                       $GLOBALS['phpgw_info']['flags']['java_script'] 
.='</script>
+                       <link rel="stylesheet" type="text/css" media="all" 
href="'.$phpgw_js_url.'/jscalendar/calendar-win2k-cold-1.css" 
title="win2k-cold-1" >
+                       <script type="text/javascript" 
src="'.$phpgw_js_url.'/jscalendar/calendar.js"></script>
+                       <script type="text/javascript" 
src="'.$phpgw_js_url.'/jscalendar/calendar-setup.js"></script>
+                       <script type="text/javascript" 
src="'.$phpgw_js_url.'/jscalendar/lang/calendar-'.substr($GLOBALS['phpgw_info']['user']['preferences']['common']['lang'],0,2)
 .'.js"></script>
+                       ';
+
+                       $cal_info=array(
+                               'jsDateFormat'                                  
=> $jsDateFormat,
+                               'img'                                           
        => $img,
+                               );
+                       return $cal_info;
                }
 
 
                function check_perms($rights, $required)
                {
-       //              return (!!($rights & $required) == True);
                        return ($rights & $required);
                }
 
Index: hrm/inc/class.uiuser.inc.php
diff -u hrm/inc/class.uiuser.inc.php:1.11 hrm/inc/class.uiuser.inc.php:1.12
--- hrm/inc/class.uiuser.inc.php:1.11   Fri Dec  2 17:12:35 2005
+++ hrm/inc/class.uiuser.inc.php        Mon Mar 20 10:13:24 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package hrm
        * @subpackage user
-       * @version $Id: class.uiuser.inc.php,v 1.11 2005/12/02 17:12:35 
sigurdne Exp $
+       * @version $Id: class.uiuser.inc.php,v 1.12 2006/03/20 10:13:24 
sigurdne Exp $
        */
 
        /**
@@ -543,7 +543,11 @@
                        );
 //_debug_array($link_data);
 
-                       $jscal = CreateObject('phpgwapi.jscalendar');   // 
before phpgw_header() !!!
+//                     $jscal = CreateObject('phpgwapi.jscalendar');   // 
before phpgw_header() !!!
+
+                       $cal_info       = $this->bocommon->jscalendar();
+                       $jsDateFormat=$cal_info['jsDateFormat'];
+
 
                        $msgbox_data = $this->bocommon->msgbox_data($receipt);
 
@@ -581,8 +585,11 @@
                                'lang_end_date_title'                   => 
lang('select end date'),
                                'lang_start_date_status_text'           => 
lang('Select the start date for your training'),
                                'lang_end_date_status_text'             => 
lang('Select the end date for your training'),
-                               'calendar_setup_start'                  => 
"Calendar.setup({inputField  : 'values[start_date]',button : 
'values[start_date]-trigger'});",
-                               'calendar_setup_end'                    => 
"Calendar.setup({inputField  : 'values[end_date]',button : 
'values[end_date]-trigger'});",
+
+                               'calendar_setup_start'                  => 
"Calendar.setup({inputField  : 'values[start_date]',ifFormat  : '" . 
$jsDateFormat . "',button : 'values[start_date]-trigger'});",
+                               'calendar_setup_end'                    => 
"Calendar.setup({inputField  : 'values[end_date]',ifFormat  : '" . 
$jsDateFormat . "',button : 'values[end_date]-trigger'});",
+
+
                                'lang_reference'                        => 
lang('reference'),
 
                                'lang_entry_date'                       => 
lang('Entry date'),




reply via email to

[Prev in Thread] Current Thread [Next in Thread]