X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=DataObjects%2FCore_watch.php;h=bc106e3ec3f0ff15e861ba759457c46c6d135112;hb=23d39850c0b2d28bcebb9cffda0b4307d9847de2;hp=eeb61a7b953d9b7012e2e48a0f0af18744375d47;hpb=f4cd417211fc2b954dcb54adeb885f638c5fe6e9;p=Pman.Core diff --git a/DataObjects/Core_watch.php b/DataObjects/Core_watch.php index eeb61a7b..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); @@ -151,7 +180,7 @@ class Pman_Core_DataObjects_Core_watch extends DB_DataObject function notifyEvent($event) { //print_r($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... - @@ -173,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; @@ -191,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; @@ -222,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(); - - }