From: Alan Knowles Date: Thu, 6 Oct 2011 04:46:00 +0000 (+0800) Subject: NotifyAction.php X-Git-Url: http://git.roojs.org/?p=Pman.Core;a=commitdiff_plain;h=0a17b9efe7fadffb5d9ae601744a84f06fa622fc NotifyAction.php --- diff --git a/NotifyAction.php b/NotifyAction.php index 2e5b4689..09d9a04f 100644 --- a/NotifyAction.php +++ b/NotifyAction.php @@ -63,15 +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????? - yeap... - $this->addEventOnce($_POST['action'],$n->object()); - - + // 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");