From 0163159c84cdcf3a2db3bda4b7b0ba669289bc78 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Sat, 2 Oct 2021 07:29:15 +0200 Subject: [PATCH] new method setMimeType() --- SeedDMS_Core/Core/inc.ClassDocument.php | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/SeedDMS_Core/Core/inc.ClassDocument.php b/SeedDMS_Core/Core/inc.ClassDocument.php index 47d2abe96..20885b04d 100644 --- a/SeedDMS_Core/Core/inc.ClassDocument.php +++ b/SeedDMS_Core/Core/inc.ClassDocument.php @@ -3163,10 +3163,27 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */ return true; } /* }}} */ + function setMimeType($newMimetype) { /* {{{ */ + $db = $this->_document->getDMS()->getDB(); + + $newMimetype = trim($newMimetype); + + if(!$newMimetype) + return false; + + $queryStr = "UPDATE `tblDocumentContent` SET `mimeType` = ".$db->qstr($newMimetype)." WHERE `document` = " . $this->_document->getID() . " AND `version` = " . $this->_version; + if (!$db->getResult($queryStr)) + return false; + + $this->_mimeType = $newMimetype; + + return true; + } /* }}} */ + function setComment($newComment) { /* {{{ */ $db = $this->_document->getDMS()->getDB(); - $queryStr = "UPDATE `tblDocumentContent` SET `comment` = ".$db->qstr($newComment)." WHERE `document` = " . $this->_document->getID() . " AND `version` = " . $this->_version; + $queryStr = "UPDATE `tblDocumentContent` SET `comment` = ".$db->qstr($newComment)." WHERE `document` = " . $this->_document->getID() . " AND `version` = " . $this->_version; if (!$db->getResult($queryStr)) return false;