if ($whereAdd !== false) {
$w->whereAdd($whereAdd );
}
- $w->selectAdd();
- $w->selectAdd('distinct(person_id) as person_id');
+ //$w->selectAdd();
+ //$w->selectAdd('distinct(person_id) as person_id');
foreach($w->fetchAll() as $w) {
if (!$w->person_id) { // no people??? bugs in watch table
continue;
}
+
+
$nn = DB_DataObject::Factory('core_notify');
$nn->ontable = $ontable;
$nn->onid = $onid;
$nn->evtype = $w->medium;
- $nn->person_id = $p;
+ $nn->person_id = $w->person_id;
$nf = clone($nn);
$nf->whereAdd('sent < act_when');
$nn->act_start( date("Y-m-d H:i:s", $when !== false ? strtotime($when) : time()) );
$n->insert();
- }
-
+ }
}
// static really...
function notifyEvent($event)