phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] property/inc class.soadmin_location.inc.php, 1.6 clas


From: sigurdne
Subject: [Phpgroupware-cvs] property/inc class.soadmin_location.inc.php, 1.6 class.solocation.inc.php, 1.7
Date: Wed, 4 May 2005 11:41:00 +0200

Update of property/inc

Modified Files:
     Branch: MAIN
            class.soadmin_location.inc.php lines: +2 -3
            class.solocation.inc.php lines: +60 -2

Log Message:
no message

====================================================
Index: property/inc/class.soadmin_location.inc.php
diff -u property/inc/class.soadmin_location.inc.php:1.5 
property/inc/class.soadmin_location.inc.php:1.6
--- property/inc/class.soadmin_location.inc.php:1.5     Mon May  2 08:42:06 2005
+++ property/inc/class.soadmin_location.inc.php Wed May  4 09:41:38 2005
@@ -642,7 +642,7 @@
                        $attrib['statustext'] = 
$this->db->db_addslashes($attrib['statustext']);
                        $attrib['default'] = 
$this->db->db_addslashes($attrib['default']);

-                       $this->db->query("SELECT column_name FROM 
fm_location_attrib WHERE id='" . $attrib['id']. "'",__LINE__,__FILE__);
+                       $this->db->query("SELECT column_name FROM 
fm_location_attrib WHERE type_id = " . $attrib['type_id'] ." AND id=" . 
$attrib['id'],__LINE__,__FILE__);
                        $this->db->next_record();
                        $OldColumnName          = $this->db->f('column_name');

@@ -660,7 +660,6 @@

                        $this->db->query("UPDATE fm_location_attrib set 
$value_set WHERE type_id = " . $attrib['type_id'] ." AND id=" . 
$attrib['id'],__LINE__,__FILE__);

-
                        if($OldColumnName !=$attrib['column_name'])
                        {
                                $value_set=array(

====================================================
Index: property/inc/class.solocation.inc.php
diff -u property/inc/class.solocation.inc.php:1.6 
property/inc/class.solocation.inc.php:1.7
--- property/inc/class.solocation.inc.php:1.6   Mon May  2 08:42:06 2005
+++ property/inc/class.solocation.inc.php       Wed May  4 09:41:38 2005
@@ -363,6 +363,7 @@
                                $fm_location_cols = 
$this->soadmin_location->read_attrib(array('type_id'=>$type_id,'lookup_type'=>$type_id));

 //_debug_array($fm_location_cols);
+                               $k      = count($uicols);
                                $location_cols_count    = 
count($fm_location_cols);

                                for ($i=0;$i<$location_cols_count;$i++)
@@ -376,6 +377,14 @@
                                                $uicols['descr'][]              
        = $fm_location_cols[$i]['input_text'];
                                                $uicols['statustext'][]         
= $fm_location_cols[$i]['statustext'];

+                                               
$uicols['cols_return_extra'][$k]= array(
+                                                       'id'    => $k,
+                                                       'name'  => 
$fm_location_cols[$i]['column_name'],
+                                                       'datatype'      => 
$fm_location_cols[$i]['datatype'],
+                                                       'attrib_id'     => 
$fm_location_cols[$i]['id']
+                                               );
+                                               $k++;
+
                                                
if($fm_location_cols[$i]['lookup_form']==1)
                                                {
                                                        $uicols['exchange'][]   
        = True;
@@ -509,6 +518,56 @@
                                for ($i=0;$i<$cols_return_count;$i++)
                                {
                                        $location_list[$j][$cols_return[$i]] = 
$this->db->f($cols_return[$i]);
+
+                                       $value = $this->db->f($cols_return[$i]);
+                                       if($uicols['cols_return_extra'][$i])
+                                       {
+                                               
if(($uicols['cols_return_extra'][$i]['datatype']=='R' || 
$uicols['cols_return_extra'][$i]['datatype']=='LB') && $value):
+                                               {
+                                                       $sql="SELECT value FROM 
fm_location_choice where type_id=$type_id AND attrib_id=" 
.$uicols['cols_return_extra'][$i]['attrib_id']. "  AND id=" . $value;
+                                                       $this->db2->query($sql);
+                                                       
$this->db2->next_record();
+                                                       
$location_list[$j][$cols_return[$i]] = $this->db2->f('value');
+                                               }
+                                               
elseif($uicols['cols_return_extra'][$i]['datatype']=='AB' && $value):
+                                               {
+                                                       $contact_data   = 
$contacts->read_single_entry($value,array('n_given'=>'n_given','n_family'=>'n_family','email'=>'email'));
+                                                       
$location_list[$j][$cols_return[$i]]    = $contact_data[0]['n_family'] . ', ' . 
$contact_data[0]['n_given'];
+                                               }
+                                               
elseif($uicols['cols_return_extra'][$i]['datatype']=='VENDOR' && $value):
+                                               {
+                                                       $sql="SELECT org_name 
FROM fm_vendor where id=$value";
+                                                       $this->db2->query($sql);
+                                                       
$this->db2->next_record();
+                                                       
$location_list[$j][$cols_return[$i]] = $this->db2->f('org_name');
+                                               }
+                                               
elseif($uicols['cols_return_extra'][$i]['datatype']=='CH' && $value):
+                                               {
+                                                       $ch= 
unserialize($value);
+
+                                                       if (isset($ch) AND 
is_array($ch))
+                                                       {
+                                                               for 
($k=0;$k<count($ch);$k++)
+                                                               {
+                                                                       
$sql="SELECT value FROM fm_location_choice where type_id=$type_id AND 
attrib_id=" .$uicols['cols_return_extra'][$i]['attrib_id']. "  AND id=" . 
$ch[$k];
+                                                                       
$this->db2->query($sql);
+                                                                       while 
($this->db2->next_record())
+                                                                       {
+                                                                               
$ch_value[]=$this->db2->f('value');
+                                                                       }
+                                                               }
+                                                               
$location_list[$j][$cols_return[$i]] = @implode(",", $ch_value);
+                                                               
unset($ch_value);
+                                                       }
+                                               }
+                                               
elseif($uicols['cols_return_extra'][$i]['datatype']=='D' && $value):
+                                               {
+                                                       
$location_list[$j][$cols_return[$i]]=date($GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'],strtotime($value));
+                                               }
+                                               endif;
+
+                                       }
+                                       unset($value);
                                }

                                $location_code= $this->db->f('location_code');
@@ -522,7 +581,6 @@
                                $j++;
                        }

-//_debug_array($location_list);
                        return $location_list;
                }







reply via email to

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