DataObjects/Core_watch.php
[Pman.Core] / DataObjects / Core_watch.php
index 2239ca7..5e33ef3 100644 (file)
@@ -218,7 +218,7 @@ class Pman_Core_DataObjects_Core_watch extends DB_DataObject
     function notifyEvent($event)
     {
         print_r($event);
-       //DB_DataObject::DebugLevel(1);
+        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... -
@@ -235,12 +235,14 @@ class Pman_Core_DataObjects_Core_watch extends DB_DataObject
         $w->event  = $event->action;
         $w->active = 1;
         
-        
-        $w->whereAdd('person_id != '. (int) $event->person_id);
+        // not sure why this is here...
+        if ($event->person_id) {
+            $w->whereAdd('person_id != '. (int) $event->person_id);
+        }
  
         $watches = $w->fetchAll();
         
-        //print_R($watches); //exit;
+        print_R($watches); 
         
         $nn = DB_DataObject::Factory('core_notify');
         $nn->ontable    = $event->on_table;