X-Git-Url: http://git.roojs.org/?p=Pman.Core;a=blobdiff_plain;f=NotifyAction.php;h=e3b9af5cd3d43c80988a61dcc8ad9f8aa89aa4a8;hp=8b692e3f116e69ce8dfa5999e7dd7c75869cf9f2;hb=a1a3ecba68d2fedabc8203e88b40759401d7472d;hpb=e3a00108f28df0a56637c734cc143a66af3f41d9 diff --git a/NotifyAction.php b/NotifyAction.php index 8b692e3f..e3b9af5c 100644 --- a/NotifyAction.php +++ b/NotifyAction.php @@ -31,12 +31,12 @@ class Pman_Core_NotifyAction extends Pman } - function get() + function get($v, $opts=array()) { $this->jerr("invalid request"); } - function post() + function post($v) { // needs: (Array of...) // on_table, @@ -63,12 +63,20 @@ class Pman_Core_NotifyAction extends Pman $n->autoJoin(); $ar = $n->fetchAll(); + $done = array(); + foreach($ar as $n) { $nc = clone($n); $nc->sent = date('Y-m-d H:i:s'); $nc->update($n); - // add an event????? + // add an event????? - yeap... only once per object + $key = implode(':', array($nc->ontable,$nc->onid)); + if (!isset($done[$key])) { + + $e = $this->addEvent($_POST['action'],$n->object()); + } + $done[$key] = true; } $this->jok("updated");