$nw->insert();
}
-
+ /**
+ * Generate a notify event based on watches (matching whereAdd)
+ *
+ */
function notify($ontable , $onid, $whereAdd)
{
$w = DB_DataObject::factory('core_watch');
// 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... -
$w = DB_DataObject::factory('core_watch');
$w->ontable = $event->on_table;
$w->whereAdd('onid = 0 OR onid='. ((int) $event->on_id));
+
$w->event = $event->action;
+ $w->active = 1;
+
+
$w->whereAdd('person_id != '. (int) $event->person_id);
}
$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...