From cb6dbd0c8d83b6689612ca19fa7d80c3bbd007c4 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Wed, 5 Apr 2017 21:59:45 +0200 Subject: [PATCH] call hook 'approveDocument' after document has been approved or rejected --- op/op.ApproveDocument.php | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/op/op.ApproveDocument.php b/op/op.ApproveDocument.php index d99e52ba3..366140526 100644 --- a/op/op.ApproveDocument.php +++ b/op/op.ApproveDocument.php @@ -194,8 +194,13 @@ if ($_POST["approvalStatus"]==-1){ } } - // TODO: if user os not owner send notification to owner - + if(isset($GLOBALS['SEEDDMS_HOOKS']['approveDocument'])) { + foreach($GLOBALS['SEEDDMS_HOOKS']['approveDocument'] as $hookObj) { + if (method_exists($hookObj, 'postApproveDocument')) { + $hookObj->postApproveDocument(null, $content, S_REJECTED); + } + } + } } }else{ @@ -241,7 +246,13 @@ if ($_POST["approvalStatus"]==-1){ } } - // TODO: if user os not owner send notification to owner + if(isset($GLOBALS['SEEDDMS_HOOKS']['approveDocument'])) { + foreach($GLOBALS['SEEDDMS_HOOKS']['approveDocument'] as $hookObj) { + if (method_exists($hookObj, 'postApproveDocument')) { + $hookObj->postApproveDocument(null, $content, S_RELEASED); + } + } + } } } }