mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-16 14:41:39 +00:00
add onPostRemoveAttribute callback
This commit is contained in:
parent
8052b76165
commit
2d6c1d635b
|
@ -298,6 +298,7 @@ class SeedDMS_Core_Object { /* {{{ */
|
||||||
$this->getAttributes();
|
$this->getAttributes();
|
||||||
}
|
}
|
||||||
if(isset($this->_attributes[$attrdef->getId()])) {
|
if(isset($this->_attributes[$attrdef->getId()])) {
|
||||||
|
$oldvalue = $this->_attributes[$attrdef->getId()]->getValue();
|
||||||
switch(get_class($this)) {
|
switch(get_class($this)) {
|
||||||
case $this->_dms->getClassname('document'):
|
case $this->_dms->getClassname('document'):
|
||||||
$queryStr = "DELETE FROM `tblDocumentAttributes` WHERE `document`=".$this->_id." AND `attrdef`=".$attrdef->getId();
|
$queryStr = "DELETE FROM `tblDocumentAttributes` WHERE `document`=".$this->_id." AND `attrdef`=".$attrdef->getId();
|
||||||
|
@ -315,6 +316,14 @@ class SeedDMS_Core_Object { /* {{{ */
|
||||||
if (!$res)
|
if (!$res)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
/* Check if 'onPostRemoveAttribute' callback is set */
|
||||||
|
if(isset($this->_dms->callbacks['onPostRemoveAttribute'])) {
|
||||||
|
foreach($this->_dms->callbacks['onPostRemoveAttribute'] as $callback) {
|
||||||
|
if(!call_user_func($callback[0], $callback[1], $this, $attrdef, $oldvalue)) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
unset($this->_attributes[$attrdef->getId()]);
|
unset($this->_attributes[$attrdef->getId()]);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
- getLastWorkflowLog() returns a workflow entry even if the workflow has ended
|
- getLastWorkflowLog() returns a workflow entry even if the workflow has ended
|
||||||
- backport setFileType() from 6.0.x
|
- backport setFileType() from 6.0.x
|
||||||
- add SeedDMS_Core_File::fileExtension()
|
- add SeedDMS_Core_File::fileExtension()
|
||||||
- add callbacks on onPostUpdateAttribute and onPostAddAttribute
|
- add callbacks on onPostUpdateAttribute, onPostRemoveAttribute, onPostAddAttribute
|
||||||
</notes>
|
</notes>
|
||||||
<contents>
|
<contents>
|
||||||
<dir baseinstalldir="SeedDMS" name="/">
|
<dir baseinstalldir="SeedDMS" name="/">
|
||||||
|
|
Loading…
Reference in New Issue
Block a user