X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=DataObjects%2FCore_watch.php;h=bc106e3ec3f0ff15e861ba759457c46c6d135112;hb=23d39850c0b2d28bcebb9cffda0b4307d9847de2;hp=4f5c6737d0811aab142f463c274d8a29f97f4d01;hpb=f84c18cd7c9ffe45bfe638db628c6c9d70c6f6bf;p=Pman.Core diff --git a/DataObjects/Core_watch.php b/DataObjects/Core_watch.php index 4f5c6737..bc106e3e 100644 --- a/DataObjects/Core_watch.php +++ b/DataObjects/Core_watch.php @@ -1,3 +1,4 @@ + listActions($roo,$q); + } + + + } + function listActions($roo, $q) { + + $d = DB_DataObject::Factory($q['on_table']); + $ret = array(); + foreach(get_class_methods($d) as $m) { + if (!preg_match('/^notify/', $m)) { + continue; + } + $ret[] = array( + 'display_name' => preg_replace('/^notify/', '' , $m), + 'name' => $q['on_table'] .':'. $m + ); + } + $roo->jdata($ret); + } + /** * * Create a watch... * */ + + + function ensureNotify( $ontable, $onid, $person_id, $whereAdd) { //DB_DAtaObject::debugLevel(1); @@ -150,7 +179,8 @@ class Pman_Core_DataObjects_Core_watch extends DB_DataObject function notifyEvent($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... - @@ -172,7 +202,7 @@ class Pman_Core_DataObjects_Core_watch extends DB_DataObject $watches = $w->fetchAll(); - //print_R($watches);exit; + //print_R($watches); //exit; $nn = DB_DataObject::Factory('core_notify'); $nn->ontable = $event->on_table; @@ -190,7 +220,7 @@ class Pman_Core_DataObjects_Core_watch extends DB_DataObject // in which case we set the set $nn->evtype = medium.. // in that case - just let the called method generate the notify.. - + //print_R($dom); $do = DB_DataObject::factory($dom[0]); if (!method_exists($do,$dom[1])) { continue; @@ -221,10 +251,8 @@ class Pman_Core_DataObjects_Core_watch extends DB_DataObject continue; } //echo "inserting notify?"; - $n->act_start( date("Y-m-d H:i:s") ); + $n->act_start( empty($n->act_start) ? date("Y-m-d H:i:s") : $n->act_start ); $n->insert(); - - }