projects
/
Pman.Core
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
99405f6
)
NotifyAction.php
author
Alan Knowles
<alan@roojs.com>
Thu, 6 Oct 2011 04:46:00 +0000
(12:46 +0800)
committer
Alan Knowles
<alan@roojs.com>
Thu, 6 Oct 2011 04:46:00 +0000
(12:46 +0800)
NotifyAction.php
patch
|
blob
|
history
diff --git
a/NotifyAction.php
b/NotifyAction.php
index
2e5b468
..
09d9a04
100644
(file)
--- a/
NotifyAction.php
+++ b/
NotifyAction.php
@@
-63,15
+63,20
@@
class Pman_Core_NotifyAction extends Pman
$n->autoJoin();
$ar = $n->fetchAll();
$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);
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");
}
$this->jok("updated");