X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=DataObjects%2FEvents.php;h=9960ed56de906a953cb40da44d6598869e41172a;hb=06522ff7f753be959bc74195bde37370ca07e770;hp=ff8ac4a740bf7be2e330a26fd9909fc6a22adc62;hpb=4387b91fb9b86c48608fcc468d8e3cb5a7a7bd43;p=Pman.Core diff --git a/DataObjects/Events.php b/DataObjects/Events.php index ff8ac4a7..9960ed56 100644 --- a/DataObjects/Events.php +++ b/DataObjects/Events.php @@ -217,13 +217,14 @@ class Pman_Core_DataObjects_Events extends DB_DataObject if (!$obj) { $roo->jerr("ontable is invalid"); } - /* + if (!method_exists($obj,'relatedWhere')) { $roo->jerr( $q['_related_on_table'] . " Does not have method relatedWhere :" . implode(',', get_class_methods($obj))); } if ($obj && method_exists($obj,'relatedWhere')) { $ar = $obj->relatedWhere(); + $tn = $this->tableName(); $w = array(); @@ -241,17 +242,12 @@ class Pman_Core_DataObjects_Events extends DB_DataObject } $this->whereAdd(implode(' OR ' , $w)); - }*/ - if ($obj && method_exists($obj,'relatedEventsWhere')) { - $a = $obj->relatedEventsWhere($q,$roo); - if($a){ - $this->whereAdd($a); - } } + } // since roo does not support autojoin yet.. if (!isset($q['_distinct'])) { @@ -333,21 +329,7 @@ class Pman_Core_DataObjects_Events extends DB_DataObject $cols = $this->tableColumns(); $col = isset($cols[$col]) ? $col : 'person_id'; // for BC.... - revert to using person_id $this->{$col} = $au->pid(); - //$this->person_id = $au ? (!empty($au->id) ? $au->id : $au->pid()) : -1; - - $this->who = $au->name; - - if($au->tableName() == "modx_users"){ - $e = PDO_DataObject::factory('ext_data'); - $e->setFrom(array( - 'userdata_id' => $au->pid(), - )); - print_r($e); - exit; - if($e->find(true)){ - $this->who = $e->getUserName(); - } - } + //$this->person_id = $au ? (!empty($au->id) ? $au->id : $au->pid()) : -1; } $this->person_table = $au ? $au->tableName() : ''; $this->ipaddr = isset($_SERVER["REMOTE_ADDR"]) ? $_SERVER["REMOTE_ADDR"] : 'cli'; @@ -444,7 +426,7 @@ class Pman_Core_DataObjects_Events extends DB_DataObject if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { $this->ipaddr = $_SERVER['HTTP_X_FORWARDED_FOR']; } - } + } } function beforeUpdate($old, $request,$roo)