DataObjects/Core_person_signup.php
[Pman.Core] / DataObjects / Companies.php
index f981f31..4c2b443 100644 (file)
@@ -40,6 +40,9 @@ class Pman_Core_DataObjects_Companies extends DB_DataObject
     
     function applyFilters($q, $au)
     {
+       
+        $this->selectAdd("i18n_translate('c' , Companies.country, 'en') as country_display_name ");
+      
         $tn = $this->tableName();
         //DB_DataObject::debugLevel(1);
         $x = DB_DataObject::factory('Companies');
@@ -105,7 +108,12 @@ class Pman_Core_DataObjects_Companies extends DB_DataObject
                 {$tn}.name LIKE '%$s%'
             ");
         }
-         
+          if(!empty($q['search']['name_starts'])){
+            $s = $this->escape($q['search']['name_starts']);
+            $this->whereAdd("
+                {$tn}.name LIKE '$s%'
+            ");
+        }
     }
     
     function toEventString() {
@@ -240,7 +248,7 @@ class Pman_Core_DataObjects_Companies extends DB_DataObject
     function beforeUpdate($old, $q,$roo)
     {
         if(!empty($this->is_system) && 
-            ($old->code != $this->code || $old->name != $this->name)
+            ($old->code != $this->code  ) // used to be not allowed to change name..
         ){
             $roo->jerr('This company is not allow to editing Ref. or Company Name...');
         }