fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [10497] property: name tables when not eav


From: Sigurd Nes
Subject: [Fmsystem-commits] [10497] property: name tables when not eav
Date: Fri, 09 Nov 2012 10:33:26 +0000

Revision: 10497
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=10497
Author:   sigurdne
Date:     2012-11-09 10:33:26 +0000 (Fri, 09 Nov 2012)
Log Message:
-----------
property: name tables when not eav

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

Modified: trunk/phpgwapi/inc/class.custom_fields.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.custom_fields.inc.php      2012-11-09 09:51:44 UTC 
(rev 10496)
+++ trunk/phpgwapi/inc/class.custom_fields.inc.php      2012-11-09 10:33:26 UTC 
(rev 10497)
@@ -582,7 +582,10 @@
 
                        $column_name = $this->_db->f('column_name');
 
-                       $this->_oProc->DropColumn($table, false, $column_name);
+                       if($table)
+                       {
+                               $this->_oProc->DropColumn($table, false, 
$column_name);
+                       }
 
                        if(!$doubled) // else: wait for it - another one is 
coming
                        {

Modified: trunk/property/inc/class.boadmin_entity.inc.php
===================================================================
--- trunk/property/inc/class.boadmin_entity.inc.php     2012-11-09 09:51:44 UTC 
(rev 10496)
+++ trunk/property/inc/class.boadmin_entity.inc.php     2012-11-09 10:33:26 UTC 
(rev 10497)
@@ -475,6 +475,7 @@
                        $receipt = array();
                        $attrib['appname']       = $this->type_app[$this->type];
                        $attrib['location']      = 
".{$this->type}.{$attrib['entity_id']}.{$attrib['cat_id']}";
+                       $attrib_table = 
$GLOBALS['phpgw']->locations->get_attrib_table($attrib['appname'], 
$attrib['location']);
                        if ( $action == 'edit' && $attrib['id'] )
                        {
                                if ( $this->custom->edit( $attrib ) )
@@ -488,7 +489,7 @@
                        }
                        else
                        {
-                               $id = $this->custom->add( $attrib );
+                               $id = $this->custom->add( $attrib, 
$attrib_table);
                                if ( $id <= 0 )
                                {
                                        $receipt['error'][] = array('msg' => 
lang( 'Unable to add field' ));

Modified: trunk/property/inc/class.soadmin_entity.inc.php
===================================================================
--- trunk/property/inc/class.soadmin_entity.inc.php     2012-11-09 09:51:44 UTC 
(rev 10496)
+++ trunk/property/inc/class.soadmin_entity.inc.php     2012-11-09 10:33:26 UTC 
(rev 10497)
@@ -540,7 +540,10 @@
                        $values['descr'] = 
$this->db->db_addslashes($values['descr']);
 
                        $values['id'] = $this->bocommon->next_id($table, 
array('entity_id'=>$values['entity_id']));
-                       $location_id = 
$GLOBALS['phpgw']->locations->add(".{$this->type}.{$values['entity_id']}.{$values['id']}",
 $values['name'],  $this->type_app[$this->type], true);
+                       
+                       $custom_tbl = !$values['is_eav'] ? 
"fm_{$this->type}_{$values['entity_id']}_{$values['id']}" : null;
+                       
+                       $location_id = 
$GLOBALS['phpgw']->locations->add(".{$this->type}.{$values['entity_id']}.{$values['id']}",
 $values['name'],  $this->type_app[$this->type], true, $custom_tbl, $c_function 
= true);
 
                        if($values['parent_id'])
                        {




reply via email to

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