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

This commit is contained in:
Uwe Steinmann 2021-06-25 09:35:35 +02:00
commit 39fc81b64b
2 changed files with 21 additions and 0 deletions

View File

@ -456,6 +456,26 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */
return true;
} /* }}} */
/**
* Check if document has a given category
*
* @param SeedDMS_Core_DocumentCategory $cat
* @return bool true if document has category, otherwise false
*/
function hasCategory($cat) { /* {{{ */
$db = $this->_dms->getDB();
if(!$cat)
return false;
$queryStr = "SELECT * FROM `tblDocumentCategory` WHERE `documentID` = ".$this->_id." AND `categoryID`=".$cat->getId();
$resArr = $db->getResultArray($queryStr);
if (!$resArr)
return false;
return true;
} /* }}} */
/**
* Retrieve a list of all categories this document belongs to
*

View File

@ -1906,6 +1906,7 @@ add method SeedDMS_Core_DatabaseAccess::setLogFp()
- add methods SeedDMS_Core_DocumentContent::getApproveLog() and SeedDMS_Core_DocumentContent::getReviewLog()
- better handling of document with an empty workflow state
- fix checking of email addresses by using filter_var instead of regex
- add new method SeedDMS_Core_Document::hasCategory()
</notes>
</release>
<release>