if ($whereAdd !== false) {
$w->whereAdd($whereAdd );
}
+ $w->ontable = $ontable;
//$w->selectAdd();
//$w->selectAdd('distinct(person_id) as person_id');
$nn->person_id = $w->person_id;
$nf = clone($nn);
- $nf->whereAdd('sent < act_when');
+ $nf->whereAdd("sent < '2000-01-01'");
if ($nf->count()) {
// we have a item in the queue for that waiting to be sent..
continue;
}
$nn->act_start( date("Y-m-d H:i:s", $when !== false ? strtotime($when) : time()) );
$nn->insert();
- }
+ }
+
}
// static really...
/**
function notifyEvent($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... -
$w->whereAdd('person_id != '. (int) $event->person_id);
-
-
+
$watches = $w->fetchAll();
- print_R($watches);exit;
+ //print_R($watches);exit;
$nn = DB_DataObject::Factory('core_notify');
$nn->ontable = $event->on_table;
foreach($watches as $watch) {
if (!$watch->person_id) { // no people??? bugs in watch table
- $dom = explode(':',$watch->event);
+ $dom = explode(':',$watch->medium);
if (count($dom) != 2) {
continue;
}
// does this watch already have a flag...
$nf = clone($n);
- $nf->whereAdd('sent < act_when');
+ $nf->whereAdd("sent ><'2000-01-01'");
+ //$nf->whereAdd('sent < act_when');
if ($nf->count()) {
// we have a item in the queue for that waiting to be sent..
continue;