Merge branch 'seeddms-5.1.x' into seeddms-6.0.x

This commit is contained in:
Uwe Steinmann 2022-02-26 14:16:53 +01:00
commit 0652faf7c3
3 changed files with 16 additions and 4 deletions

View File

@ -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;

View File

@ -24,9 +24,11 @@
</stability> </stability>
<license uri="http://opensource.org/licenses/gpl-license">GPL License</license> <license uri="http://opensource.org/licenses/gpl-license">GPL License</license>
<notes> <notes>
- all changes from 5.1.25 - rename getLastWorkflowTransition() to getLastWorkflowLog()
- replace all checks on isset(_workflow) by checking for null - getLastWorkflowLog() returns a workflow entry even if the workflow has ended
- SeedDMS_Core_Document::getWorkflowLog() returns all log entries if the document is currently not in a workflow. Previously a transition had to be passed as well. - backport setFileType() from 6.0.x
- add SeedDMS_Core_File::fileExtension()
- add callbacks on onPostUpdateAttribute, onPostRemoveAttribute, onPostAddAttribute
</notes> </notes>
<contents> <contents>
<dir baseinstalldir="SeedDMS" name="/"> <dir baseinstalldir="SeedDMS" name="/">
@ -1970,7 +1972,7 @@ add method SeedDMS_Core_DatabaseAccess::setLogFp()
- 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>
</release> </release>
<release> <release>

View File

@ -50,6 +50,7 @@ class SeedDMS_Controller_Download extends SeedDMS_Controller_Common {
header("Content-Disposition: attachment; filename=\"" . $efilename . "\"; filename*=UTF-8''".$efilename); header("Content-Disposition: attachment; filename=\"" . $efilename . "\"; filename*=UTF-8''".$efilename);
header("Content-Type: " . $content->getMimeType()); header("Content-Type: " . $content->getMimeType());
header("Cache-Control: must-revalidate"); header("Cache-Control: must-revalidate");
header("ETag: ".$content->getChecksum());
sendFile($dms->contentDir . $content->getPath()); sendFile($dms->contentDir . $content->getPath());
} }