From 330a147533c45cc20959f88f230a3b0816358ec6 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Mon, 9 Jan 2023 17:45:20 +0100 Subject: [PATCH 1/6] update release date and notes --- SeedDMS_Lucene/package.xml | 3 ++- SeedDMS_Preview/package.xml | 2 +- SeedDMS_SQLiteFTS/package.xml | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/SeedDMS_Lucene/package.xml b/SeedDMS_Lucene/package.xml index 6b901160b..3ccc53ec9 100644 --- a/SeedDMS_Lucene/package.xml +++ b/SeedDMS_Lucene/package.xml @@ -11,7 +11,7 @@ uwe@steinmann.cx yes - 2023-01-03 + 2023-01-09 1.1.18 @@ -24,6 +24,7 @@ GPL License - IndexedDocument() accepts a callable for conversion to text +- SeedDMS_Lucene_Search::open and create return itself but Zend_Search_Lucene diff --git a/SeedDMS_Preview/package.xml b/SeedDMS_Preview/package.xml index 4e385c123..cddd83d25 100644 --- a/SeedDMS_Preview/package.xml +++ b/SeedDMS_Preview/package.xml @@ -11,7 +11,7 @@ uwe@steinmann.cx yes - 2023-01-02 + 2023-01-09 1.5.0 diff --git a/SeedDMS_SQLiteFTS/package.xml b/SeedDMS_SQLiteFTS/package.xml index 047d9cae1..3813a6252 100644 --- a/SeedDMS_SQLiteFTS/package.xml +++ b/SeedDMS_SQLiteFTS/package.xml @@ -11,7 +11,7 @@ uwe@steinmann.cx yes - 2023-01-03 + 2023-01-09 1.0.18 From 1d217251c193832868fb567cd1d2785ab6d9327b Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Tue, 10 Jan 2023 08:10:33 +0100 Subject: [PATCH 2/6] add method SeedDMS_Core_KeywordCategory::countKeywordLists() --- SeedDMS_Core/Core/inc.ClassKeywords.php | 158 +++++++++++++----------- 1 file changed, 86 insertions(+), 72 deletions(-) diff --git a/SeedDMS_Core/Core/inc.ClassKeywords.php b/SeedDMS_Core/Core/inc.ClassKeywords.php index aa11c9dc3..16afc994f 100644 --- a/SeedDMS_Core/Core/inc.ClassKeywords.php +++ b/SeedDMS_Core/Core/inc.ClassKeywords.php @@ -8,7 +8,7 @@ * @version @version@ * @author Uwe Steinmann * @copyright Copyright (C) 2002-2005 Markus Westphal, 2006-2008 Malcolm Cowe, - * 2010 Uwe Steinmann + * 2010-2023 Uwe Steinmann * @version Release: @package_version@ */ @@ -19,7 +19,7 @@ * @package SeedDMS_Core * @author Markus Westphal, Malcolm Cowe, Uwe Steinmann * @copyright Copyright (C) 2002-2005 Markus Westphal, 2006-2008 Malcolm Cowe, - * 2010 Uwe Steinmann + * 2010-2023 Uwe Steinmann * @version Release: @package_version@ */ class SeedDMS_Core_KeywordCategory { @@ -47,53 +47,53 @@ class SeedDMS_Core_KeywordCategory { */ protected $_dms; - /** - * SeedDMS_Core_KeywordCategory constructor. - * @param $id - * @param $ownerID - * @param $name - */ - function __construct($id, $ownerID, $name) { + /** + * SeedDMS_Core_KeywordCategory constructor. + * @param $id + * @param $ownerID + * @param $name + */ + function __construct($id, $ownerID, $name) { /* {{{ */ $this->_id = $id; $this->_name = $name; $this->_ownerID = $ownerID; $this->_dms = null; - } + } /* }}} */ - /** - * @param SeedDMS_Core_DMS $dms - */ - function setDMS($dms) { + /** + * @param SeedDMS_Core_DMS $dms + */ + function setDMS($dms) { /* {{{ */ $this->_dms = $dms; - } + } /* }}} */ - /** - * @return int - */ + /** + * @return int + */ function getID() { return $this->_id; } - /** - * @return string - */ + /** + * @return string + */ function getName() { return $this->_name; } - /** - * @return bool|SeedDMS_Core_User - */ - function getOwner() { + /** + * @return bool|SeedDMS_Core_User + */ + function getOwner() { /* {{{ */ if (!isset($this->_owner)) $this->_owner = $this->_dms->getUser($this->_ownerID); return $this->_owner; - } + } /* }}} */ - /** - * @param $newName - * @return bool - */ - function setName($newName) { - $newName = trim($newName); - if(!$newName) - return false; + /** + * @param $newName + * @return bool + */ + function setName($newName) { /* {{{ */ + $newName = trim($newName); + if(!$newName) + return false; $db = $this->_dms->getDB(); @@ -103,75 +103,89 @@ class SeedDMS_Core_KeywordCategory { $this->_name = $newName; return true; - } + } /* }}} */ - /** - * @param SeedDMS_Core_User $user - * @return bool - */ - function setOwner($user) { - if(!$user || !$user->isType('user')) - return false; + /** + * @param SeedDMS_Core_User $user + * @return bool + */ + function setOwner($user) { /* {{{ */ + if(!$user || !$user->isType('user')) + return false; $db = $this->_dms->getDB(); - $queryStr = "UPDATE `tblKeywordCategories` SET `owner` = " . $user->getID() . " WHERE `id` = " . $this->_id; + $queryStr = "UPDATE `tblKeywordCategories` SET `owner` = " . $user->getID() . " WHERE `id` = " . $this->_id; if (!$db->getResult($queryStr)) return false; $this->_ownerID = $user->getID(); $this->_owner = $user; return true; - } + } /* }}} */ - /** - * @return array - */ - function getKeywordLists() { + /** + * @return array keywords in this list + */ + function getKeywordLists() { /* {{{ */ $db = $this->_dms->getDB(); $queryStr = "SELECT * FROM `tblKeywords` WHERE `category` = " . $this->_id . " order by `keywords`"; return $db->getResultArray($queryStr); } - /** - * @param $listID - * @param $keywords - * @return bool - */ - function editKeywordList($listID, $keywords) { + /** + * @return integer number of keywords in this list + */ + function countKeywordLists() { /* {{{ */ + $db = $this->_dms->getDB(); + + $queryStr = "SELECT COUNT(*) as `c` FROM `tblKeywords` where `category`=".$this->_id; + $resArr = $db->getResultArray($queryStr); + if (is_bool($resArr) && !$resArr) + return false; + + return $resArr[0]['c']; + } /* }}} */ + + /** + * @param $listID + * @param $keywords + * @return bool + */ + function editKeywordList($listID, $keywords) { /* {{{ */ $db = $this->_dms->getDB(); $queryStr = "UPDATE `tblKeywords` SET `keywords` = ".$db->qstr($keywords)." WHERE `id` = $listID"; return $db->getResult($queryStr); - } + } /* }}} */ - /** - * @param $keywords - * @return bool - */ - function addKeywordList($keywords) { + /** + * @param $keywords + * @return bool + */ + function addKeywordList($keywords) { /* {{{ */ $db = $this->_dms->getDB(); $queryStr = "INSERT INTO `tblKeywords` (`category`, `keywords`) VALUES (" . $this->_id . ", ".$db->qstr($keywords).")"; return $db->getResult($queryStr); - } + } /* }}} */ - /** - * @param $listID - * @return bool - */ - function removeKeywordList($listID) { + /** + * @param $listID + * @return bool + */ + function removeKeywordList($listID) { /* {{{ */ $db = $this->_dms->getDB(); $queryStr = "DELETE FROM `tblKeywords` WHERE `id` = $listID"; return $db->getResult($queryStr); - } + } /* }}} */ - /** - * @return bool - */ - function remove() { + /** + * @return bool + */ + function remove() { /* {{{ */ $db = $this->_dms->getDB(); $db->startTransaction(); @@ -189,5 +203,5 @@ class SeedDMS_Core_KeywordCategory { $db->commitTransaction(); return true; - } + } /* }}} */ } From da4aafff8697dd2fad4739f2dade4e14639b5fb6 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Tue, 10 Jan 2023 08:10:51 +0100 Subject: [PATCH 3/6] add more notes for 5.1.29 --- SeedDMS_Core/package.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SeedDMS_Core/package.xml b/SeedDMS_Core/package.xml index 6cfa5d734..046973024 100644 --- a/SeedDMS_Core/package.xml +++ b/SeedDMS_Core/package.xml @@ -26,8 +26,8 @@ - SeedDMS_Core_Folder::addDocument() does rollback transaction propperly when setting document categories fail - add $skiproot and $sep parameter to SeedDMS_Core_Folder::getFolderPathPlain() -- turn off auto commit for mysql - add class name for 'documentfile' +- add method SeedDMS_Core_KeywordCategory::countKeywordLists() From 913baaa7ce649c4caf3a2a2c75f0eaa4cb22b627 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Tue, 10 Jan 2023 08:11:24 +0100 Subject: [PATCH 4/6] show number of documents per category in select menu --- views/bootstrap/class.Categories.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/views/bootstrap/class.Categories.php b/views/bootstrap/class.Categories.php index 639e73125..35f775cca 100644 --- a/views/bootstrap/class.Categories.php +++ b/views/bootstrap/class.Categories.php @@ -155,7 +155,7 @@ $(document).ready( function() { $options[] = array("-1", getMLText("choose_category")); $options[] = array("0", getMLText("new_document_category")); foreach ($categories as $category) { - $options[] = array($category->getID(), htmlspecialchars($category->getName()), $selcat && $category->getID()==$selcat->getID()); + $options[] = array($category->getID(), htmlspecialchars($category->getName()), $selcat && $category->getID()==$selcat->getID(), array(array('data-subtitle', $category->countDocumentsByCategory().' '.getMLText('documents')))); } $this->formField( null, //getMLText("selection"), From cc144f6c0f6a3d5a6748ead1c1c6bd46043cff4b Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Tue, 10 Jan 2023 08:11:52 +0100 Subject: [PATCH 5/6] show number of keywords per category in select menu --- views/bootstrap/class.DefaultKeywords.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/views/bootstrap/class.DefaultKeywords.php b/views/bootstrap/class.DefaultKeywords.php index f21846d08..1fdfd3313 100644 --- a/views/bootstrap/class.DefaultKeywords.php +++ b/views/bootstrap/class.DefaultKeywords.php @@ -221,7 +221,7 @@ $(document).ready( function() { foreach ($categories as $category) { $owner = $category->getOwner(); if ($user->isAdmin() || ($owner->getID() == $user->getID())) - $options[] = array($category->getID(), htmlspecialchars($category->getName()), $selcategory && $category->getID()==$selcategory->getID()); + $options[] = array($category->getID(), htmlspecialchars($category->getName()), $selcategory && $category->getID()==$selcategory->getID(), array(array('data-subtitle', $category->countKeywordLists().' '.getMLText('keywords')))); } $this->formField( null, //getMLText("selection"), From acd96034d84cc83c49cd3755076437a0569a9fdd Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Tue, 10 Jan 2023 08:12:06 +0100 Subject: [PATCH 6/6] add changes of 5.1.29 --- CHANGELOG | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 2d6d1645d..8c795065d 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -7,6 +7,9 @@ - introduce authentication service - new hook in restapi to add middleware - previews for png, txt, pdf in different directories +- various improvements of fulltext service +- show number of documents per category in category manager +- show number of keywords per category in keyword manager -------------------------------------------------------------------------------- Changes in version 5.1.28