X-Git-Url: http://git.roojs.org/?p=Pman.Core;a=blobdiff_plain;f=RooPostTrait.php;h=456aa7aa74fde6a79c2611ea8e8561f75ab5d5a8;hp=f48c96dddffec3f6302b43e063e564ede2a9a5f6;hb=443623f47935eb52acd65a3ff0d84eab1fd5a98b;hpb=d1d70ae95da7f336cc84ab1264003996dcfcbf86 diff --git a/RooPostTrait.php b/RooPostTrait.php index f48c96dd..456aa7aa 100644 --- a/RooPostTrait.php +++ b/RooPostTrait.php @@ -170,7 +170,8 @@ trait Pman_Core_RooPostTrait { $affects = array(); - $all_links = $GLOBALS['_DB_DATAOBJECT']['LINKS'][$x->_database]; + $all_links = $x->databaseLinks(); + foreach($all_links as $tbl => $links) { foreach($links as $col => $totbl_col) { $to = explode(':', $totbl_col); @@ -282,7 +283,7 @@ trait Pman_Core_RooPostTrait { } - $this->addDeleteEvent($x); + $this->logDeleteEvent($x); $xx->delete(); @@ -299,7 +300,7 @@ trait Pman_Core_RooPostTrait { } - function addDeleteEvent($object) + function logDeleteEvent($object) { DB_DataObject::Factory('Events')->logDeletedRecord($object); @@ -395,7 +396,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) { @@ -434,7 +435,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; @@ -449,7 +450,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));