fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [6949] property:more on related


From: Sigurd Nes
Subject: [Fmsystem-commits] [6949] property:more on related
Date: Mon, 07 Feb 2011 10:11:17 +0000

Revision: 6949
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=6949
Author:   sigurdne
Date:     2011-02-07 10:11:16 +0000 (Mon, 07 Feb 2011)
Log Message:
-----------
property:more on related

Modified Paths:
--------------
    trunk/property/inc/class.solocation.inc.php
    trunk/property/inc/class.sos_agreement.inc.php

Modified: trunk/property/inc/class.solocation.inc.php
===================================================================
--- trunk/property/inc/class.solocation.inc.php 2011-02-07 08:06:45 UTC (rev 
6948)
+++ trunk/property/inc/class.solocation.inc.php 2011-02-07 10:11:16 UTC (rev 
6949)
@@ -171,6 +171,22 @@
                                        );
                        }
 
+
+                       $sql = "SELECT count(*) as hits FROM fm_s_agreement 
{$this->join} fm_s_agreement_detail ON fm_s_agreement.id = 
fm_s_agreement_detail.agreement_id WHERE location_code {$this->like} 
'$location_code%'";
+                       $this->db->query($sql,__LINE__,__FILE__);
+                       $this->db->next_record();
+                       if($this->db->f('hits'))
+                       {
+                               $hits = $this->db->f('hits');
+                               $entity['related'][] = array
+                                       (
+                                               'entity_link'   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction' => 
'property.uis_agreement.index',
+                                                                               
                                                'query'=> $location_code)),
+                                               'name'                  => 
lang('service agreement') . " [{$hits}]",
+                                               'descr'                 => 
lang('service agreement')
+                                       );
+                       }
+
                        return $entity;
                }
 

Modified: trunk/property/inc/class.sos_agreement.inc.php
===================================================================
--- trunk/property/inc/class.sos_agreement.inc.php      2011-02-07 08:06:45 UTC 
(rev 6948)
+++ trunk/property/inc/class.sos_agreement.inc.php      2011-02-07 10:11:16 UTC 
(rev 6949)
@@ -375,6 +375,8 @@
                                                }
                                        }
 
+                                       $query_arr[]= "location_code 
{$this->like} '$query%'";
+
                                        if (isset($query_arr[0]))
                                        {
                                                $querymethod = " $where (" . 
implode (' OR ',$query_arr) . ')';




reply via email to

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