DataObjects/Events.php
authorAlan Knowles <alan@roojs.com>
Sat, 8 Oct 2011 03:39:45 +0000 (11:39 +0800)
committerAlan Knowles <alan@roojs.com>
Sat, 8 Oct 2011 03:39:45 +0000 (11:39 +0800)
DataObjects/Events.php

index e998007..3c69a92 100644 (file)
@@ -96,8 +96,16 @@ class Pman_Core_DataObjects_Events extends DB_DataObject
     
     function init($act, $obj, $remarks)
     {
-        $pg = HTML_FlexyFramework::get()->page;
+        $ff = HTML_FlexyFramework::get();
+        $pg = $ff->page;
         $au = $pg->getAuthUser();
+        
+        if ($ff->cli && empty($au) && isset($obj->person_id)) {
+            $au = DB_DataObject::Factory('Person'); // not always a person..
+            $au->get($obj->person_id);
+        } 
+         
+         
          
         $this->person_name = $au && !empty($au->name) ? $au->name : '';
         $this->person_id = $au ? $au->id : '';