phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] property/inc class.soentity.inc.php


From: Sigurd Nes
Subject: [Phpgroupware-cvs] property/inc class.soentity.inc.php
Date: Wed, 01 Feb 2006 13:39:10 +0000

CVSROOT:        /sources/phpgroupware
Module name:    property
Branch:         
Changes by:     Sigurd Nes <address@hidden>     06/02/01 13:39:10

Modified files:
        inc            : class.soentity.inc.php 

Log message:
        

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.soentity.inc.php.diff?tr1=1.12&tr2=1.13&r1=text&r2=text

Patches:
Index: property/inc/class.soentity.inc.php
diff -u property/inc/class.soentity.inc.php:1.12 
property/inc/class.soentity.inc.php:1.13
--- property/inc/class.soentity.inc.php:1.12    Mon Jan 30 22:14:19 2006
+++ property/inc/class.soentity.inc.php Wed Feb  1 13:39:10 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage entity
-       * @version $Id: class.soentity.inc.php,v 1.12 2006/01/30 22:14:19 
sigurdne Exp $
+       * @version $Id: class.soentity.inc.php,v 1.13 2006/02/01 13:39:10 
sigurdne Exp $
        */
 
        /**
@@ -247,32 +247,39 @@
 
                        if($query)
                        {
-                               $query = ereg_replace("'",'',$query);
-                               $query = ereg_replace('"','',$query);
-
-                               $filtermethod .= " $where ( 
$entity_table.location_code $this->like '%$query%' OR $entity_table.num 
$this->like '%$query%'  OR loc1_name $this->like '%$query%' OR address 
$this->like '%$query%')";
-                               $where= 'OR';
+                               $query = str_replace(",",'.',$query);
+                               if(stristr($query, '.'))
+                               {
+                                       $query=explode(".",$query);
+                                       $querymethod = " $where 
($entity_table.location_code $this->like '" . $query[0] . "%' AND 
$entity_table.location_code $this->like '%" . $query[1] . "')";
+                               }
+                               else
+                               {
+                                       $query = ereg_replace("'",'',$query);
+                                       $query = ereg_replace('"','',$query);
+                                       $filtermethod .= " $where ( 
$entity_table.location_code $this->like '%$query%' OR $entity_table.num 
$this->like '%$query%'  OR loc1_name $this->like '%$query%' OR address 
$this->like '%$query%')";
+                                       $where= 'OR';
 
-                               $this->db->query("SELECT * FROM 
fm_entity_attribute where search='1' AND entity_id= $entity_id AND cat_id = 
$cat_id");
+                                       $this->db->query("SELECT * FROM 
fm_entity_attribute where search='1' AND entity_id= $entity_id AND cat_id = 
$cat_id");
 
-                               while ($this->db->next_record())
-                               {
-                                       if($this->db->f('datatype')=='V' || 
$this->db->f('datatype')=='email' || $this->db->f('datatype')=='CH')
+                                       while ($this->db->next_record())
                                        {
-                                               $querymethod[]= 
"$entity_table." . $this->db->f('column_name') . " $this->like '%$query%'";
+                                               
if($this->db->f('datatype')=='V' || $this->db->f('datatype')=='email' || 
$this->db->f('datatype')=='CH')
+                                               {
+                                                       $querymethod[]= 
"$entity_table." . $this->db->f('column_name') . " $this->like '%$query%'";
+                                               }
+                                               else
+                                               {
+                                                       $querymethod[]= 
"$entity_table." . $this->db->f('column_name') . " = '$query'";
+                                               }
                                        }
-                                       else
+
+                                       if (isset($querymethod) AND 
is_array($querymethod))
                                        {
-                                               $querymethod[]= 
"$entity_table." . $this->db->f('column_name') . " = '$query'";
+                                               $querymethod = " $where (" . 
implode (' OR ',$querymethod) . ')';
+                                               $where = 'AND';
                                        }
                                }
-
-                               if (isset($querymethod) AND 
is_array($querymethod))
-                               {
-                                       $querymethod = " $where (" . implode (' 
OR ',$querymethod) . ')';
-                                       $where = 'AND';
-                               }
-
                        }
 
                        $sql .= " $filtermethod $querymethod";




reply via email to

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