DataObjects/Core_enum.php
[Pman.Core] / RooPostTrait.php
index aae1fa2..a2e1d27 100644 (file)
@@ -282,11 +282,7 @@ trait Pman_Core_RooPostTrait {
           
             }
             
-            $this->addDeleteEvent($x);
-            
-            DB_DataObject::Factory('Events')->logDeletedRecord($x);
-            
-            $this->addEvent("DELETE", $x);
+            $this->logDeleteEvent($x);
             
             $xx->delete();
             
@@ -303,6 +299,17 @@ trait Pman_Core_RooPostTrait {
         
     }
     
+    function logDeleteEvent($object)
+    {
+        
+        DB_DataObject::Factory('Events')->logDeletedRecord($object);
+        
+        $this->addEvent("DELETE", $object);
+          
+        
+    }
+    
+    
     function update($x, $req,  $with_perm_check = true)
     {
         if ( $with_perm_check && !$this->checkPerm($x,'E', $req) )  {
@@ -388,7 +395,7 @@ trait Pman_Core_RooPostTrait {
     {
         $this->permitError = true; // allow it to fail without dieing
         
-        $lock = DB_DataObjecT::factory('Core_locking');
+        $lock = DB_DataObjecT::factory('core_locking');
         $this->permitError = false; 
         if (is_a($lock,'DB_DataObject') && $this->authUser)  {
                  
@@ -427,7 +434,7 @@ trait Pman_Core_RooPostTrait {
             // edit it anyways...
             
             // can we find the user's lock.
-            $lock = DB_DataObjecT::factory('Core_locking');
+            $lock = DB_DataObjecT::factory('core_locking');
             $lock->on_id = $x->{$this->key};
             $lock->on_table= strtolower($x->tableName());
             $lock->person_id = $this->authUser->id;
@@ -442,7 +449,7 @@ trait Pman_Core_RooPostTrait {
                    $x->modified_by != $this->authUser->id      
                 )
             {
-                $p = DB_DataObject::factory('Person');
+                $p = DB_DataObject::factory('core_person');
                 $p->get($x->modified_by);
                 $this->jerr($p->name . " saved the record since you started editing,\nDo you really want to update it?", array('needs_confirm' => true));