projects
/
Pman.Core
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
11e2653
)
NotifyAction.php
author
Alan Knowles
<alan@roojs.com>
Thu, 29 Sep 2011 14:22:54 +0000
(22:22 +0800)
committer
Alan Knowles
<alan@roojs.com>
Thu, 29 Sep 2011 14:22:54 +0000
(22:22 +0800)
NotifyAction.php
patch
|
blob
|
history
diff --git
a/NotifyAction.php
b/NotifyAction.php
index
8f880ae
..
7dbb966
100644
(file)
--- a/
NotifyAction.php
+++ b/
NotifyAction.php
@@
-38,19
+38,36
@@
class Pman_Core_NotifyAction extends Pman
function post()
{
// needs: (Array of...)
function post()
{
// needs: (Array of...)
- // ontable, action(eg. APPROVAL)
- // onid (comma delimited.)
+ // on
_
table, action(eg. APPROVAL)
+ // on
_
id (comma delimited.)
$n = DB_DataObject::factory('core_notify');
$n = DB_DataObject::factory('core_notify');
+ $n->person_id = $this->authUser->id;
// in theory in workflow, this could trigger another action...
// if watch is on it..
foreach(array('on_table','on_id','action') as $k) {
if (empty($_POST[$k])) {
$this->jerr("missing argument $k");
}
// in theory in workflow, this could trigger another action...
// if watch is on it..
foreach(array('on_table','on_id','action') as $k) {
if (empty($_POST[$k])) {
$this->jerr("missing argument $k");
}
+ if ($k == 'on_id') {
+ continue;
+ }
$n->$k = $v;
}
$n->$k = $v;
}
+ $ids = explode(',', $_POST['on_id']);
+ $n->whereAdd('sent < act_when'); // not issued yet..
+ $n->whereAdd("join_watch_id_id.medium = '". $n->escape($k) ."'");
+ $n->whereAddIn('core_notify.id', $ids, 'int' );
+ $n->autoJoin();
+ $ar = $n->fetchAll();
-
+ foreach($ar as $n) {
+ $nc = clone($n);
+ $nc->sent = date('Y-m-d H:i:s');
+ $nc->update($n);
+ // add an event?????
+
+ }
+