diff --git a/SeedDMS_Core/Core/inc.ClassAttribute.php b/SeedDMS_Core/Core/inc.ClassAttribute.php index a51d6c81f..fff7423a3 100644 --- a/SeedDMS_Core/Core/inc.ClassAttribute.php +++ b/SeedDMS_Core/Core/inc.ClassAttribute.php @@ -259,6 +259,14 @@ class SeedDMS_Core_Attribute { /* {{{ */ $this->_value = $value; + /* Check if 'onPostUpdateAttribute' callback is set */ + if(isset($this->_dms->callbacks['onPostUpdateAttribute'])) { + foreach($this->_dms->callbacks['onPostUpdateAttribute'] as $callback) { + if(!call_user_func($callback[0], $callback[1], $this->_obj, $this->_attrdef, $value)) { + } + } + } + return true; } /* }}} */ diff --git a/SeedDMS_Core/Core/inc.ClassObject.php b/SeedDMS_Core/Core/inc.ClassObject.php index bc02592fa..0f7b90eb8 100644 --- a/SeedDMS_Core/Core/inc.ClassObject.php +++ b/SeedDMS_Core/Core/inc.ClassObject.php @@ -269,6 +269,15 @@ class SeedDMS_Core_Object { /* {{{ */ $attr = new SeedDMS_Core_Attribute($db->getInsertID($tablename), $this, $attrdef, $value); $attr->setDMS($this->_dms); $this->_attributes[$attrdef->getId()] = $attr; + + /* Check if 'onPostAddAttribute' callback is set */ + if(isset($this->_dms->callbacks['onPostAddAttribute'])) { + foreach($this->_dms->callbacks['onPostAddAttribute'] as $callback) { + if(!call_user_func($callback[0], $callback[1], $this, $attrdef, $value)) { + } + } + } + return true; } diff --git a/SeedDMS_Core/package.xml b/SeedDMS_Core/package.xml index 16fc74a1c..c6a2273ee 100644 --- a/SeedDMS_Core/package.xml +++ b/SeedDMS_Core/package.xml @@ -28,6 +28,7 @@ - getLastWorkflowLog() returns a workflow entry even if the workflow has ended - backport setFileType() from 6.0.x - add SeedDMS_Core_File::fileExtension() +- add callbacks on onPostUpdateAttribute and onPostAddAttribute