fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [11208] API: prevent alter fieldname for custom field


From: Sigurd Nes
Subject: [Fmsystem-commits] [11208] API: prevent alter fieldname for custom fields at eav-models
Date: Thu, 27 Jun 2013 08:57:47 +0000

Revision: 11208
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=11208
Author:   sigurdne
Date:     2013-06-27 08:56:56 +0000 (Thu, 27 Jun 2013)
Log Message:
-----------
API: prevent alter fieldname for custom fields at eav-models

Modified Paths:
--------------
    trunk/phpgwapi/inc/class.custom_fields.inc.php

Modified: trunk/phpgwapi/inc/class.custom_fields.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.custom_fields.inc.php      2013-06-27 07:41:05 UTC 
(rev 11207)
+++ trunk/phpgwapi/inc/class.custom_fields.inc.php      2013-06-27 08:56:56 UTC 
(rev 11208)
@@ -795,26 +795,25 @@
 
                        }
 
-                       if($attrib_table)
+                       if($attrib_table) // not eav
                        {
                                $table_def = 
$this->get_table_def($attrib_table);       
                                $this->_oProc->m_aTables = $table_def;
 
-                       }
-
-                       if($OldColumnName !=$attrib['column_name'])
-                       {
-                               $value_set=array('column_name'  => 
$attrib['column_name']);
-
-                               if( !$doubled )
+                               if($OldColumnName !=$attrib['column_name'])
                                {
-                                       $value_set      = 
$this->_db->validate_update($value_set);
-                                       $this->_db->query("UPDATE 
phpgw_cust_attribute set $value_set WHERE location_id = {$location_id} AND id=" 
. $attrib_id,__LINE__,__FILE__);
-                               }
+                                       $value_set=array('column_name'  => 
$attrib['column_name']);
 
-                               if($attrib_table)
-                               {
-                                       
$this->_oProc->RenameColumn($attrib_table, $OldColumnName, 
$attrib['column_name']);
+                                       if( !$doubled )
+                                       {
+                                               $value_set      = 
$this->_db->validate_update($value_set);
+                                               $this->_db->query("UPDATE 
phpgw_cust_attribute set $value_set WHERE location_id = {$location_id} AND id=" 
. $attrib_id,__LINE__,__FILE__);
+                                       }
+       
+                                       if($attrib_table)
+                                       {
+                                               
$this->_oProc->RenameColumn($attrib_table, $OldColumnName, 
$attrib['column_name']);
+                                       }
                                }
                        }
 
@@ -853,14 +852,14 @@
                                        
unset($attrib['column_info']['default']);
                                }
 
-                               $value_set=array(
-                                       'column_name'   => 
$attrib['column_name'],
+                               $value_set=array
+                               (
                                        'datatype'              => 
$attrib['column_info']['type'],
                                        'precision_'    => 
$attrib['column_info']['precision'],
                                        'scale'                 => 
$attrib['column_info']['scale'],
                                        'default_value' => 
$attrib['column_info']['default'],
                                        'nullable'              => 
$attrib['column_info']['nullable']
-                                       );
+                               );
 
                                if( !$doubled )
                                {




reply via email to

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