DataObjects/Core_notify_recur.php
[Pman.Core] / DataObjects / Companies.php
index a15063b..0c3e3f0 100644 (file)
@@ -11,7 +11,7 @@ class Pman_Core_DataObjects_Companies extends DB_DataObject
 
     public $__table = 'Companies';                       // table name
     public $code;                            // string(32)  not_null
-    public $name;                            // string(128)  multiple_key
+    public $name;                            // string(128)  
     public $remarks;                         // blob(65535)  blob
     public $owner_id;                        // int(11)  not_null
     public $address;                         // blob(65535)  blob
@@ -23,7 +23,6 @@ class Pman_Core_DataObjects_Companies extends DB_DataObject
     public $logo_id;                         // int(11)  not_null
     public $background_color;                // string(8)  not_null
     public $comptype;                        // string(8)  not_null
-    public $ava_craft;                       // string(254)  
     public $url;                             // string(254)  not_null
     public $main_office_id;                  // int(11)  not_null
     public $created_by;                      // int(11)  not_null
@@ -31,6 +30,9 @@ class Pman_Core_DataObjects_Companies extends DB_DataObject
     public $updated_by;                      // int(11)  not_null
     public $updated_dt;                      // datetime(19)  not_null binary
     public $passwd;                          // string(64)  not_null
+    public $dispatch_port;                   // string(255)  not_null
+    public $province;                        // string(255)  not_null
+    public $country;                         // string(4)  not_null
 
     
     /* the code above is auto generated do not remove the tag below */
@@ -39,7 +41,7 @@ class Pman_Core_DataObjects_Companies extends DB_DataObject
     function applyFilters($q, $au)
     {
         
-        DB_DataObject::debugLevel(1);
+        //DB_DataObject::debugLevel(1);
         $x = DB_DataObject::factory('Companies');
         $x->comptype= 'OWNER';
         $x->find(true);
@@ -254,7 +256,19 @@ class Pman_Core_DataObjects_Companies extends DB_DataObject
             return $this->id == $au->company_id;
         }
         
-        return $au->hasPerm("Core.".$this->tableName(), $lvl);    
-    } 
+        return $au->hasPerm("Core.Companies", $lvl);    
+    }
+    
+    function logoImageToHTML($size)
+    {
+        $i = DB_DataObject::factory('Images');
+        if (!$this->logo_id || !$i->get($this->logo_id)) {
+            return '';
+        }
+        return $i->toHTML($size);
+        
+    }
+    
+    
     
 }