From 11e2653d626225d89e337f3d0efa37139bed22b0 Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Thu, 29 Sep 2011 22:15:27 +0800 Subject: [PATCH] NotifyAction.php --- NotifyAction.php | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/NotifyAction.php b/NotifyAction.php index ad845f34..8f880aea 100644 --- a/NotifyAction.php +++ b/NotifyAction.php @@ -11,5 +11,50 @@ class Pman_Core_NotifyAction extends Pman { + function getAuth() + { + $au = $this->getAuthUser(); + if (!$au) { + $this->jerr("Not authenticated", array('authFailure' => true)); + } + // workflow only applicable to owner company.. + if ($au->company()->comptype != 'OWNER') { + $this->jerr("Core:NotifyAction: invalid user - not owner company."); + + } + + $this->authUser = $au; + // check that it's a supplier!!!! + + return true; + } + + + function get() + { + $this->jerr("invalid request"); + + } + function post() + { + // needs: (Array of...) + // ontable, action(eg. APPROVAL) + // onid (comma delimited.) + $n = DB_DataObject::factory('core_notify'); + // 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"); + } + $n->$k = $v; + } + + + + + + + } } \ No newline at end of file -- 2.39.2