X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=NotifyAction.php;h=968eace383b3c76fa12053984f3831482502f19d;hb=refs%2Fheads%2Fmaster;hp=2e5b46899be7c89c3986a1a915501ba47ea32b2b;hpb=f4deea590eb9a6a528c38257fdfa76824031d8d6;p=Pman.Core diff --git a/NotifyAction.php b/NotifyAction.php index 2e5b4689..968eace3 100644 --- a/NotifyAction.php +++ b/NotifyAction.php @@ -16,7 +16,7 @@ class Pman_Core_NotifyAction extends Pman { $au = $this->getAuthUser(); if (!$au) { - $this->jerr("Not authenticated", array('authFailure' => true)); + $this->jerror("LOGIN-NOAUTH", "Not authenticated", array('authFailure' => true)); } // workflow only applicable to owner company.. if ($au->company()->comptype != 'OWNER') { @@ -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,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");