From 68d18162513203896abb2880664170dd28f26759 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Fri, 19 Jun 2015 15:24:19 +0200 Subject: [PATCH] add optional parameter cleasAccessList() will turn off removal of notification --- SeedDMS_Core/Core/inc.ClassDocument.php | 7 ++++++- SeedDMS_Core/Core/inc.ClassFolder.php | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/SeedDMS_Core/Core/inc.ClassDocument.php b/SeedDMS_Core/Core/inc.ClassDocument.php index 756b1fc6e..63bda72de 100644 --- a/SeedDMS_Core/Core/inc.ClassDocument.php +++ b/SeedDMS_Core/Core/inc.ClassDocument.php @@ -592,9 +592,10 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */ /** * Delete all entries for this document from the access control list * + * @param boolean $noclean set to true if notifier list shall not be clean up * @return boolean true if operation was successful otherwise false */ - function clearAccessList() { /* {{{ */ + function clearAccessList($noclean=false) { /* {{{ */ $db = $this->_dms->getDB(); $queryStr = "DELETE FROM tblACLs WHERE targetType = " . T_DOCUMENT . " AND target = " . $this->_id; @@ -602,6 +603,10 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */ return false; unset($this->_accessList); + + if(!$noclean) + self::cleanNotifyList(); + return true; } /* }}} */ diff --git a/SeedDMS_Core/Core/inc.ClassFolder.php b/SeedDMS_Core/Core/inc.ClassFolder.php index 2c052d0d8..8d2b434b2 100644 --- a/SeedDMS_Core/Core/inc.ClassFolder.php +++ b/SeedDMS_Core/Core/inc.ClassFolder.php @@ -882,9 +882,10 @@ class SeedDMS_Core_Folder extends SeedDMS_Core_Object { /** * Delete all entries for this folder from the access control list * + * @param boolean $noclean set to true if notifier list shall not be clean up * @return boolean true if operation was successful otherwise false */ - function clearAccessList() { /* {{{ */ + function clearAccessList($noclean=false) { /* {{{ */ $db = $this->_dms->getDB(); $queryStr = "DELETE FROM tblACLs WHERE targetType = " . T_FOLDER . " AND target = " . $this->_id; @@ -892,6 +893,10 @@ class SeedDMS_Core_Folder extends SeedDMS_Core_Object { return false; unset($this->_accessList); + + if(!$noclean) + self::cleanNotifyList(); + return true; } /* }}} */