X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=DataObjects%2FCore_watch.php;h=4a30b810c938cbf203e7d0f4823a44898a4021b1;hb=f61e0023b975638a8a1c239decbdcc45e87f192d;hp=2239ca738b5976ed3ca4b3715d4efe6e8974840e;hpb=459d7a9bc5c13801a5b1a3a7cfe9310ada7409a4;p=Pman.Core diff --git a/DataObjects/Core_watch.php b/DataObjects/Core_watch.php index 2239ca73..4a30b810 100644 --- a/DataObjects/Core_watch.php +++ b/DataObjects/Core_watch.php @@ -26,7 +26,7 @@ * * */ -require_once 'DB/DataObject.php'; +class_exists('DB_DataObject') ? '' : require_once 'DB/DataObject.php'; class Pman_Core_DataObjects_Core_watch extends DB_DataObject { @@ -217,8 +217,8 @@ class Pman_Core_DataObjects_Core_watch extends DB_DataObject function notifyEvent($event) { - print_r($event); - //DB_DataObject::DebugLevel(1); + //print_r($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... - @@ -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... - it breaks on the reader article -> + 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;