phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] addressbook/inc class.uifields.inc.php, 1.3.2.3.2.5,


From: Jonathan Rivera <address@hidden>
Subject: [Phpgroupware-cvs] addressbook/inc class.uifields.inc.php, 1.3.2.3.2.5, 1.3.2.3.2.6
Date: Thu, 27 Nov 2003 17:24:22 +0000

Update of /cvsroot/phpgroupware/addressbook/inc
In directory subversions:/tmp/cvs-serv31137/addressbook/inc

Modified Files:
      Tag: Version-0_9_16-branch
        class.uifields.inc.php 
Log Message:
Bugfix, save correctly the custom fields


Index: class.uifields.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/addressbook/inc/class.uifields.inc.php,v
retrieving revision 1.3.2.3.2.5
retrieving revision 1.3.2.3.2.6
diff -C2 -d -r1.3.2.3.2.5 -r1.3.2.3.2.6
*** class.uifields.inc.php      12 Nov 2003 18:42:04 -0000      1.3.2.3.2.5
--- class.uifields.inc.php      27 Nov 2003 17:24:19 -0000      1.3.2.3.2.6
***************
*** 399,408 ****
                        {
                                $this->per_custom_fields = 
$this->config->config_data['custom_fields'];
-                               $this->org_custom_fields = array();
                                $all_custom_fields = 
$this->config->config_data['custom_fields'];
                        }
                        elseif($apply=='org')
                        {
-                               $this->per_custom_fields = array();
                                $this->org_custom_fields = 
$this->config->config_data['custom_org_fields'];
                                $all_custom_fields = 
$this->config->config_data['custom_org_fields'];
--- 399,406 ----
***************
*** 412,418 ****
                                $this->per_custom_fields = 
$this->config->config_data['custom_fields'];
                                $this->org_custom_fields = 
$this->config->config_data['custom_org_fields'];
-                               $all_custom_fields = 
array_merge($this->per_custom_fields,$this->org_custom_fields);
-                       }
  
                        //while(list($name,$descr) = 
@each($this->config->config_data['custom_fields']))
                        while(list($name,$descr) = @each($all_custom_fields))
--- 410,428 ----
                                $this->per_custom_fields = 
$this->config->config_data['custom_fields'];
                                $this->org_custom_fields = 
$this->config->config_data['custom_org_fields'];
  
+                               if($this->per_custom_fields!='' && 
$this->org_custom_fields!='')
+                               {
+                                       $all_custom_fields = 
array_merge($this->per_custom_fields,$this->org_custom_fields);
+                               }
+                               elseif($this->per_custom_fields!='')
+                               {
+                                       $all_custom_fields = 
$this->per_custom_fields;
+                               }
+                               elseif($this->org_custom_fields!='')
+                               {
+                                       $all_custom_fields = 
$this->org_custom_fields;
+                               }
+                       }
+                       
                        //while(list($name,$descr) = 
@each($this->config->config_data['custom_fields']))
                        while(list($name,$descr) = @each($all_custom_fields))
***************
*** 449,453 ****
                        }
                        @reset($fields);
- //                    var_dump($fields);
                        return $fields;
                }
--- 459,462 ----
***************
*** 455,467 ****
                function get_apply($key)
                {
!                       if(array_key_exists($key, $this->per_custom_fields) && 
array_key_exists($key, $this->org_custom_fields))
                        {
                                return 'both';
                        }
!                       elseif(array_key_exists($key, $this->per_custom_fields))
                        {
                                return 'person';
                        }
!                       elseif(array_key_exists($key, $this->org_custom_fields))
                        {
                                return 'org';
--- 464,477 ----
                function get_apply($key)
                {
!                       if((is_array($this->per_custom_fields) && 
is_array($this->org_custom_fields)) && 
!                          array_key_exists($key, $this->per_custom_fields) && 
array_key_exists($key, $this->org_custom_fields))
                        {
                                return 'both';
                        }
!                       elseif(is_array($this->per_custom_fields) && 
array_key_exists($key, $this->per_custom_fields))
                        {
                                return 'person';
                        }
!                       elseif(is_array($this->org_custom_fields) && 
array_key_exists($key, $this->org_custom_fields))
                        {
                                return 'org';
***************
*** 540,543 ****
--- 550,564 ----
                                break;
                        }
+ 
+                       if(count($this->config->config_data['custom_fields']) 
== 0)
+                       {
+                               $this->config->config_data['custom_fields'] = 
'';
+                       }
+ 
+                       
if(count($this->config->config_data['custom_org_fields']) == 0)
+                       {
+                               $this->config->config_data['custom_org_fields'] 
= '';
+                       }
+                       
                        $this->config->save_repository();
                }





reply via email to

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