DataObjects/Companies.php
authorChris <chris@roojs.com>
Fri, 10 Jan 2014 09:57:44 +0000 (17:57 +0800)
committerChris <chris@roojs.com>
Fri, 10 Jan 2014 09:57:44 +0000 (17:57 +0800)
DataObjects/Companies.php

index ca34b09..2b2d279 100644 (file)
@@ -243,7 +243,11 @@ class Pman_Core_DataObjects_Companies extends DB_DataObject
     function beforeDelete()
     {
         // should check for members....
-        
+        if(!empty($this->is_system) && 
+            ($old->code != $this->code || $old->name != $this->name)
+        ){
+            $roo->jerr('This company is not allow to delete');
+        }
         $img = DB_DataObject::factory('Images');
         $img->ontable = 'Companies';
         $img->onid = $this->id;