fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [15302]


From: nelson . guerra
Subject: [Fmsystem-commits] [15302]
Date: Sat, 18 Jun 2016 01:04:59 +0000 (UTC)

Revision: 15302
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=15302
Author:   nelson224
Date:     2016-06-18 01:04:59 +0000 (Sat, 18 Jun 2016)
Log Message:
-----------


Modified Paths:
--------------
    branches/dev-syncromind-2/property/inc/import/import_update_components.php

Modified: 
branches/dev-syncromind-2/property/inc/import/import_update_components.php
===================================================================
--- branches/dev-syncromind-2/property/inc/import/import_update_components.php  
2016-06-17 13:33:46 UTC (rev 15301)
+++ branches/dev-syncromind-2/property/inc/import/import_update_components.php  
2016-06-18 01:04:59 UTC (rev 15302)
@@ -11,6 +11,7 @@
                        $this->db = & $GLOBALS['phpgw']->db;
                        $this->join = $this->db->join;
                        $this->bo = CreateObject('property.boadmin_entity', 
true);
+                       $this->bo_entity = CreateObject('property.boentity', 
true);
                }
 
                public function get_entity_categories ($data = array())
@@ -44,20 +45,51 @@
                
                public function add_entity_categories ($buildingpart_out_table)
                {
+                       $buildingparts = array();
+                       
                        foreach ($buildingpart_out_table as $k => $v)
-                       {
+                       {       
                                if ($v['parent'])
                                {
+                                       $values = array();
                                        $childs = 
$this->get_entity_categories(array('parent_id' => $v['parent']['id']));
                                        if (count($childs))
                                        {
-                                               $category = 
array_values($childs)[0];
-                                               $attrib_list = 
$this->bo->read_attrib(array('entity_id' => $category['entity_id'], 'cat_id' => 
$category['id'], 'allrows' => true));
+                                               $child = 
array_values($childs)[0];
+                                               $attrib_list = 
$this->bo->read_attrib(array('entity_id' => $child['entity_id'], 'cat_id' => 
$child['id'], 'allrows' => true));
+                                               
+                                               foreach ($attrib_list as 
$attrib) 
+                                               {
+                                                       
$values['template_attrib'][] = $attrib['id'];
+                                               }
+                                               $values['category_template'] = 
$child['entity_id'].'_'.$child['id'];
                                        }
+                                       $values['parent_id'] = 
$v['parent']['id'];
+                                       $values['name'] = $k;
+                                       $values['descr'] = $k;
+                                       $values['entity_id'] = 3;
+                                       $values['fileupload'] = 1;
+                                       $values['loc_link'] = 1;
+                                       $values['is_eav'] = 1;
+                                       
+                                       $receipt = 
$this->bo->save_category($values);
+                                       
+                                       if ($receipt['id'])
+                                       {
+                                               $buildingparts['added'][$k] = 
$k;
+                                       }
+                                       else {
+                                               $buildingparts['not_added'][$k] 
= $k;
+                                       }
                                }
                        }
                        
-                       return $attrib_list;
+                       return $buildingparts;
                }
                
+               public function add_bim_item($data)
+               {
+                       return;
+               }
+               
        }
\ No newline at end of file




reply via email to

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