phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] CVS: property/inc class.bocommon.inc.php,1.41,1.42 cl


From: Sigurd Nes <address@hidden>
Subject: [Phpgroupware-cvs] CVS: property/inc class.bocommon.inc.php,1.41,1.42 class.bostandard_entity.inc.php,1.6,1.7 class.soXport.inc.php,1.21,1.22 class.uiequipment.inc.php,1.17,1.18
Date: Sat, 10 May 2003 12:34:24 -0400

Update of /cvsroot/phpgroupware/property/inc
In directory subversions:/tmp/cvs-serv19253/inc

Modified Files:
        class.bocommon.inc.php class.bostandard_entity.inc.php 
        class.soXport.inc.php class.uiequipment.inc.php 
Log Message:
no message

Index: class.bocommon.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.bocommon.inc.php,v
retrieving revision 1.41
retrieving revision 1.42
diff -C2 -r1.41 -r1.42
*** class.bocommon.inc.php      3 May 2003 17:27:16 -0000       1.41
--- class.bocommon.inc.php      10 May 2003 16:34:22 -0000      1.42
***************
*** 409,414 ****
--- 409,429 ----
                        $attributes_values      = 
$this->socommon->read_attibutes($data);
  
+                       $dateformat = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
+                       $sep = '/';
+                       $dlarr[strpos($dateformat,'Y')] = 'Y';
+                       $dlarr[strpos($dateformat,'m')] = 'm';
+                       $dlarr[strpos($dateformat,'d')] = 'd';
+                       ksort($dlarr);
+ 
+                       $dateformat= (implode($sep,$dlarr));
+ 
                        for ($i=0;$i<count($attributes_values);$i++)
                        {
+                               if($attributes_values[$i]['datatype']=='D')
+                               {
+                                       $timestamp_date= 
mktime(0,0,0,date(m,strtotime($attributes_values[$i]['value'])),date(d,strtotime($attributes_values[$i]['value'])),date(y,strtotime($attributes_values[$i]['value'])));
+                                       $attributes_values[$i]['value'] = 
$GLOBALS['phpgw']->common->show_date($timestamp_date,$dateformat);
+                               }
+ 
                                
$attributes_values[$i]['lang_attribute_statustext'] = lang('Enter the attribute 
value for this entity');
                                $attributes_values[$i]['datatype_text'] = 
$this->translate_datatype_attributes($attributes_values[$i]['datatype']);
***************
*** 424,430 ****
                        $datatype_text = array(
                                'I' => 'Integer',
!                               'C' => 'Text',
                                'N' => 'Float',
!                               'T' => 'Datetime'
                        );
  
--- 439,445 ----
                        $datatype_text = array(
                                'I' => 'Integer',
!                               'C' => 'char',
                                'N' => 'Float',
!                               'D' => 'Date'
                        );
  
***************
*** 436,439 ****
--- 451,475 ----
                function save_attributes($values_attribute,$type)
                {
+ 
+                       for ($i=0;$i<count($values_attribute);$i++)
+                       {
+                               if($values_attribute[$i]['datatype']=='D')
+                               {
+                                       $dateformat= 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
+                                       $dateformat = 
str_replace(".","",$dateformat);
+                                       $dateformat = 
str_replace("-","",$dateformat);
+                                       $dateformat = 
str_replace("/","",$dateformat);
+                                       $y=strpos($dateformat,'Y');
+                                       $d=strpos($dateformat,'d');
+                                       $m=strpos($dateformat,'m');
+ 
+                                       $dateparts = explode('/', 
$values_attribute[$i]['value']);
+                                       $day            = $dateparts[$d];
+                                       $month          = $dateparts[$m];
+                                       $year           = $dateparts[$y];
+                                       $values_attribute[$i]['value'] = 
date($this->dateformat,mktime(2,0,0,$month,$day,$year));
+                               }
+                       }
+ 
                        
$this->socommon->save_attributes($values_attribute,$type);
                }

Index: class.bostandard_entity.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.bostandard_entity.inc.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** class.bostandard_entity.inc.php     18 Feb 2003 09:13:57 -0000      1.6
--- class.bostandard_entity.inc.php     10 May 2003 16:34:22 -0000      1.7
***************
*** 206,211 ****
                        $datatypes[2]['id']= 'N';
                        $datatypes[2]['name']= lang('Decimal');
!                       $datatypes[3]['id']= 'T';
!                       $datatypes[3]['name']= lang('Datetime');
  
                        while (is_array($datatypes) && list(,$type) = 
each($datatypes))
--- 206,213 ----
                        $datatypes[2]['id']= 'N';
                        $datatypes[2]['name']= lang('Decimal');
!                       $datatypes[3]['id']= 'D';
!                       $datatypes[3]['name']= lang('Date');
!                       $datatypes[4]['id']= 'T';
!                       $datatypes[4]['name']= lang('Text');
  
                        while (is_array($datatypes) && list(,$type) = 
each($datatypes))

Index: class.soXport.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.soXport.inc.php,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -r1.21 -r1.22
*** class.soXport.inc.php       9 May 2003 09:12:02 -0000       1.21
--- class.soXport.inc.php       10 May 2003 16:34:22 -0000      1.22
***************
*** 46,51 ****
                function soXport($useacl=True)
                {
!                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
!                       $this->bocommon         = 
CreateObject($this->currentapp.'.bocommon');
  
                        $this->db = $GLOBALS['phpgw']->db;
--- 46,52 ----
                function soXport($useacl=True)
                {
!                       $this->currentapp               = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
!                       $this->bocommon                 = 
CreateObject($this->currentapp.'.bocommon');
!                       $this->datetimeformat   = 
$this->bocommon->datetimeformat;
  
                        $this->db = $GLOBALS['phpgw']->db;
***************
*** 789,793 ****
                function log_start($batchid)
                {
!                       $tid=date($this->bocommon->datetimeformat);
                $sql= "insert fm_ecologg (batchid,melding,tid) values 
('$batchid','Start transfer','$tid')";
                        $this->db->query($sql,__LINE__,__FILE__);
--- 790,794 ----
                function log_start($batchid)
                {
!                       $tid=date($this->datetimeformat);
                $sql= "insert fm_ecologg (batchid,melding,tid) values 
('$batchid','Start transfer','$tid')";
                        $this->db->query($sql,__LINE__,__FILE__);
***************
*** 795,799 ****
                function log_end($batchid)
                {
!                       $tid=date($this->bocommon->datetimeformat);
                $sql= "insert fm_ecologg (batchid,melding,tid) values 
('$batchid','End transfer','$tid')";
                        $this->db->query($sql,__LINE__,__FILE__);
--- 796,800 ----
                function log_end($batchid)
                {
!                       $tid=date($this->datetimeformat);
                $sql= "insert fm_ecologg (batchid,melding,tid) values 
('$batchid','End transfer','$tid')";
                        $this->db->query($sql,__LINE__,__FILE__);
***************
*** 802,806 ****
                function log_error($batchid,$error_desr)
                {
!                       $tid=date($this->bocommon->datetimeformat);
                $sql= "insert fm_ecologg 
(batchid,ecobilagid,status,melding,tid) values 
('$batchid',NULL,0,'$error_desr','$tid')";
                        $this->db->query($sql,__LINE__,__FILE__);
--- 803,807 ----
                function log_error($batchid,$error_desr)
                {
!                       $tid=date($this->datetimeformat);
                $sql= "insert fm_ecologg 
(batchid,ecobilagid,status,melding,tid) values 
('$batchid',NULL,0,'$error_desr','$tid')";
                        $this->db->query($sql,__LINE__,__FILE__);
***************
*** 811,815 ****
                {
                        $message=lang('Invoice tranferred');
!                       $tid=date($this->bocommon->datetimeformat);
                        $sql= "insert fm_ecologg 
(batchid,ecobilagid,melding,tid) values ('$batchid','$bilagid' 
,'$message','$tid')";
                        $this->db->query($sql,__LINE__,__FILE__);
--- 812,816 ----
                {
                        $message=lang('Invoice tranferred');
!                       $tid=date($this->datetimeformat);
                        $sql= "insert fm_ecologg 
(batchid,ecobilagid,melding,tid) values ('$batchid','$bilagid' 
,'$message','$tid')";
                        $this->db->query($sql,__LINE__,__FILE__);

Index: class.uiequipment.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.uiequipment.inc.php,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -r1.17 -r1.18
*** class.uiequipment.inc.php   29 Apr 2003 12:41:31 -0000      1.17
--- class.uiequipment.inc.php   10 May 2003 16:34:22 -0000      1.18
***************
*** 365,371 ****
--- 365,391 ----
                        $dateformat= (implode($sep,$dlarr));
  
+                       switch(substr($dateformat,0,1))
+                       {
+                               case 'M':
+                                       $dateformat_validate= 
"javascript:vDateType='1'";
+                                       $dateformat_input= 
"DateFormat(this,this.value,event,false,'1')";
+                                       break;
+                               case 'y':
+                                       
$dateformat_validate="javascript:vDateType='2'";
+                                       $dateformat_input= 
"DateFormat(this,this.value,event,false,'2')";
+                                       break;
+                               case 'D':
+                                       
$dateformat_validate="javascript:vDateType='3'";
+                                       $dateformat_input= 
"DateFormat(this,this.value,event,false,'3')";
+                                       break;
+                       }
+ 
+ 
                        $data = array
                        (
+                               'lang_dateformat'                               
=> lang(strtolower($dateformat)),
                                'lang_attributes'                               
=> lang('Attributes'),
+                               'dateformat_validate'                   => 
$dateformat_validate,
+                               'dateformat_input'                              
=> $dateformat_input,
                                'attributes_header'                             
=> $attributes_header,
                                'attributes_values'                             
=> $attributes_values,
***************
*** 374,377 ****
--- 394,398 ----
                                'calendar_gif'                                  
=> './'.$this->currentapp.'/templates/default/images/calendar.gif',
                                'calendar_source'                               
=> './'.$this->currentapp.'/inc/calendar.js',
+                               'dateformat_source'                             
=> './'.$this->currentapp.'/inc/dateformat.js',
                                'dateformat'                                    
=> $dateformat,
                                'lang_popup_calendar'                   => 
lang('Popup Calendar'),





reply via email to

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