diff --git a/HISTORY.txt b/HISTORY.txt index 41fb1e8..b06949f 100644 --- a/HISTORY.txt +++ b/HISTORY.txt @@ -2,6 +2,19 @@ What's new in this release ========================== +3.0.3 + +Features: + + + +Fixes: + + - KTS-972 Owner, Everyone and Authenticated weren't being respected by browse + and search + - KTS-959 Documents weren't properly purged from the cache on change. + + 3.0.2 ----- diff --git a/lib/foldermanagement/folderutil.inc.php b/lib/foldermanagement/folderutil.inc.php index a9cfe86..84aa77e 100644 --- a/lib/foldermanagement/folderutil.inc.php +++ b/lib/foldermanagement/folderutil.inc.php @@ -72,6 +72,9 @@ class KTFolderUtil { // fire subscription alerts for the new folder $oSubscriptionEvent = new SubscriptionEvent(); $oSubscriptionEvent->AddFolder($oFolder, $oParentFolder); + + KTFolderUtil::updateSearchableText($oFolder); + return $oFolder; } @@ -208,6 +211,8 @@ class KTFolderUtil { $oFolder->setName($sNewName); $res = $oFolder->update(); + KTFolderUtil::updateSearchableText($oFolder); + Document::clearAllCaches(); Folder::clearAllCaches(); @@ -218,6 +223,8 @@ class KTFolderUtil { return Folder::folderExistsName($sName, $oParentFolder->getID()); } + + /* folderUtil::delete * * this function is _much_ more complex than it might seem. @@ -469,6 +476,30 @@ class KTFolderUtil { return true; } + + function updateSearchableText($oFolder) { + // very simple function to rebuild the searchable text for this + // folder. + + // MyISAM table for fulltext index - no transactions. + + // get the folder text + // XXX replace this with a trigger / producer set. + $sSearchableText = $oFolder->getName(); + + // do the update. + $iFolderId = KTUtil::getId($oFolder); + $sTable = KTUtil::getTableName('folder_searchable_text'); + $aDelete = array( + "folder_id" => $iFolderId, + ); + DBUtil::whereDelete($sTable, $aDelete); + $aInsert = array( + "folder_id" => $iFolderId, + "folder_text" => $sSearchableText, + ); + return DBUtil::autoInsert($sTable, $aInsert, array('noid' => true)); + } } ?> diff --git a/search/simpleSearch.php b/search/simpleSearch.php index 2975760..6021b13 100644 --- a/search/simpleSearch.php +++ b/search/simpleSearch.php @@ -150,7 +150,7 @@ class SimpleSearchDispatcher extends KTStandardDispatcher { $t->setSearch($searchable_text); */ $t =& new TitleColumn("Test 1 (title)","title"); - $t->setOptions(array('documenturl' => $GLOBALS['KTRootUrl'] . '/view.php')); + $t->setOptions(array('documenturl' => $GLOBALS['KTRootUrl'] . '/view.php', 'direct_folder' => true)); $collection->addColumn($t); $collection->addColumn(new DownloadColumn('','download')); $collection->addColumn(new DateColumn(_kt("Created"),"created", "getCreatedDateTime"));