fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [9536] property: read_single_eav


From: Sigurd Nes
Subject: [Fmsystem-commits] [9536] property: read_single_eav
Date: Fri, 08 Jun 2012 11:19:33 +0000

Revision: 9536
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=9536
Author:   sigurdne
Date:     2012-06-08 11:19:33 +0000 (Fri, 08 Jun 2012)
Log Message:
-----------
property: read_single_eav

Modified Paths:
--------------
    trunk/property/inc/class.soentity.inc.php

Modified: trunk/property/inc/class.soentity.inc.php
===================================================================
--- trunk/property/inc/class.soentity.inc.php   2012-06-08 10:34:39 UTC (rev 
9535)
+++ trunk/property/inc/class.soentity.inc.php   2012-06-08 11:19:33 UTC (rev 
9536)
@@ -1530,9 +1530,19 @@
 
                function read_single_eav($data, $values = array())
                {
-                       $id                     = (int)$data['id'];
-                       $this->db->query("SELECT * FROM fm_bim_item WHERE id = 
{$id}");
+                       if(isset($data['guid']) && $data['guid'])
+                       {
+                               $sql = "SELECT * FROM fm_bim_item WHERE guid = 
'{$data['guid']}'";
+                       }
+                       else
+                       {
+                               $id                     = (int)$data['id'];
+                               $location_id = 
$GLOBALS['phpgw']->locations->get_id($this->type_app[$this->type], 
".{$this->type}.{$data['entity_id']}.{$data['cat_id']}");
+                               $sql = "SELECT fm_bim_item.* FROM fm_bim_item 
{$this->join} fm_bim_type ON fm_bim_type.id = fm_bim_item.type WHERE 
fm_bim_item.id = {$id} AND location_id = $location_id";
+                       }
 
+                       $this->db->query($sql,__LINE__,__FILE__);
+
                        if($this->db->next_record())
                        {
                                $values['id']                           = $id;




reply via email to

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