DataObjects/core.sql
[Pman.Core] / DataObjects / Core_watch.php
index de56cb7..d370835 100644 (file)
@@ -74,7 +74,10 @@ class Pman_Core_DataObjects_Core_watch extends DB_DataObject
         $nw->insert();
          
     }
-    
+    /**
+     * Generate a notify event based on watches (matching whereAdd)
+     *
+     */
     function notify($ontable , $onid, $whereAdd)
     {
         $w = DB_DataObject::factory('core_watch');
@@ -108,6 +111,7 @@ class Pman_Core_DataObjects_Core_watch extends DB_DataObject
     // static really...
     function notifyEvent($event)
     {
+        //DB_DataObject::DebugLevel(1);
         // see if there are any watches on events..
         // notify everyone flagged except the person doing it...
         // this is very basic logic... -
@@ -140,7 +144,9 @@ class Pman_Core_DataObjects_Core_watch extends DB_DataObject
             }
             
             $n = clone($nn);
-            $n->person_id = $p;
+            $n->trigger_person_id = $event->person_id;
+            $n->trigger_event_id = $event->id;
+            $n->person_id = $watch->person_id;
             $n->watch_id =  $watch->id;
             
             // does this watch already have a flag...