fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [15752]


From: nelson . guerra
Subject: [Fmsystem-commits] [15752]
Date: Thu, 29 Sep 2016 01:32:42 +0000 (UTC)

Revision: 15752
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=15752
Author:   nelson224
Date:     2016-09-29 01:32:42 +0000 (Thu, 29 Sep 2016)
Log Message:
-----------


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

Modified: 
branches/dev-syncromind-2/property/inc/import/class.import_components.inc.php
===================================================================
--- 
branches/dev-syncromind-2/property/inc/import/class.import_components.inc.php   
    2016-09-29 01:32:30 UTC (rev 15751)
+++ 
branches/dev-syncromind-2/property/inc/import/class.import_components.inc.php   
    2016-09-29 01:32:42 UTC (rev 15752)
@@ -74,14 +74,17 @@
                        return $components;
                }
                
-               private function _get_component( $query, 
$attrib_name_componentID)
+               private function _get_component( $query, 
$attrib_name_componentID, $location_code)
                {
+                       $location_code_values = explode('-', $location_code);
+                       $loc1 =  $location_code_values[0];
+                       
                        if ($query)
                        {
                                $query = $this->db->db_addslashes($query);
                        }
 
-                       $sql = "SELECT * FROM fm_bim_item WHERE 
json_representation->>'{$attrib_name_componentID}' = '{$query}'";
+                       $sql = "SELECT * FROM fm_bim_item WHERE loc1 = 
'{$loc1}' AND json_representation->>'{$attrib_name_componentID}' = '{$query}'";
 
                        $this->db->query($sql, __LINE__, __FILE__);
 
@@ -125,7 +128,7 @@
                                                $attributes_values = 
$this->_set_attributes_values($values, $attributes);
                                                $values_insert = 
$this->_populate(array('location_code'=>$location_code, 'location'=>$location), 
$attributes_values);
 
-                                               $component = 
$this->_get_component($values_insert[$attrib_name_componentID], 
$attrib_name_componentID);
+                                               $component = 
$this->_get_component($values_insert[$attrib_name_componentID], 
$attrib_name_componentID, $location_code);
                                                if ($component['id'])
                                                {
                                                        $receipt = 
$this->_edit_eav($values_insert, $entity['entity_id'], $entity['cat_id'], 
$component['id']);




reply via email to

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