Fix #5702 - Supplier contact details - extra fields
authorEdward <edward@roojs.com>
Tue, 19 Feb 2019 05:51:53 +0000 (13:51 +0800)
committerEdward <edward@roojs.com>
Tue, 19 Feb 2019 05:51:53 +0000 (13:51 +0800)
DataObjects/Core_company.php
DataObjects/I18n.php

index abc1506..cb0af57 100644 (file)
@@ -12,7 +12,7 @@ class Pman_Core_DataObjects_Core_Company extends DB_DataObject
     public $__table = 'core_company';                       // table name
     public $code;                            // string(32)  not_null
     public $name;                            // string(128)  
-    public $remarks;                         // blob(65535)  blob
+    public $remarks;                         // blob(65535)  blobeforeDeleteb
     public $owner_id;                        // int(11)  not_null
     public $address;                         // blob(65535)  blob
     public $tel;                             // string(32)  
@@ -328,7 +328,7 @@ class Pman_Core_DataObjects_Core_Company extends DB_DataObject
         $img->onid = $this->id;
         $img->find();
         while ($img->fetch()) {
-            $img->beforeDelete();
+            $img->beforeDelete(array(), $roo);
             $img->delete();
         }
         return true;
index c7ea606..3661433 100644 (file)
@@ -149,6 +149,29 @@ class Pman_Core_DataObjects_I18n extends DB_DataObject
             }
             
         }
+        
+        if(!empty($q['_with_geoip_count'])) {
+            
+            $this->selectAdd("
+                (
+                    SELECT
+                            COUNT(geoip_division.id)
+                    FROM
+                            geoip_division
+                    WHERE
+                            geoip_division.country = i18n.lkey
+                ) AS no_of_division,
+                (
+                    SELECT
+                            COUNT(geoip_city.id)
+                    FROM
+                            geoip_city
+                    WHERE
+                            geoip_city.country = i18n.lkey
+                ) AS no_of_city
+            ");
+            
+        }
     }
     
     function lookupCode($inlang,$ltype,$name)